Skip to main content

fidl_fuchsia_component_runtime/
fidl_fuchsia_component_runtime.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_runtime__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct CapabilitiesCapabilityAssociateHandleRequest {
16    pub capability_handle: fidl::EventPair,
17    pub other_handle: fidl::EventPair,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for CapabilitiesCapabilityAssociateHandleRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct CapabilitiesConnectorCreateRequest {
27    pub connector: fidl::EventPair,
28    pub receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32    for CapabilitiesConnectorCreateRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct CapabilitiesConnectorOpenRequest {
38    pub connector: fidl::EventPair,
39    pub channel: fidl::Channel,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43    for CapabilitiesConnectorOpenRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct CapabilitiesConnectorRouterCreateRequest {
49    pub router: fidl::EventPair,
50    pub router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54    for CapabilitiesConnectorRouterCreateRequest
55{
56}
57
58#[derive(Debug, PartialEq)]
59pub struct CapabilitiesConnectorRouterRouteRequest {
60    pub router: fidl::EventPair,
61    pub request: RouteRequest,
62    pub instance_token: fidl::EventPair,
63    pub connector: fidl::EventPair,
64}
65
66impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
67    for CapabilitiesConnectorRouterRouteRequest
68{
69}
70
71#[derive(Debug, PartialEq)]
72pub struct CapabilitiesDataCreateRequest {
73    pub data_handle: fidl::EventPair,
74    pub data: Data,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
78    for CapabilitiesDataCreateRequest
79{
80}
81
82#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct CapabilitiesDataGetRequest {
84    pub data_handle: fidl::EventPair,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
88    for CapabilitiesDataGetRequest
89{
90}
91
92#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct CapabilitiesDataRouterCreateRequest {
94    pub router: fidl::EventPair,
95    pub router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
96}
97
98impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
99    for CapabilitiesDataRouterCreateRequest
100{
101}
102
103#[derive(Debug, PartialEq)]
104pub struct CapabilitiesDataRouterRouteRequest {
105    pub router: fidl::EventPair,
106    pub request: RouteRequest,
107    pub instance_token: fidl::EventPair,
108    pub data: fidl::EventPair,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
112    for CapabilitiesDataRouterRouteRequest
113{
114}
115
116#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct CapabilitiesDictionaryCreateRequest {
118    pub dictionary: fidl::EventPair,
119}
120
121impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
122    for CapabilitiesDictionaryCreateRequest
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct CapabilitiesDictionaryGetRequest {
128    pub dictionary: fidl::EventPair,
129    pub key: String,
130    pub value: fidl::EventPair,
131}
132
133impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
134    for CapabilitiesDictionaryGetRequest
135{
136}
137
138#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct CapabilitiesDictionaryInsertRequest {
140    pub dictionary: fidl::EventPair,
141    pub key: String,
142    pub value: fidl::EventPair,
143}
144
145impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
146    for CapabilitiesDictionaryInsertRequest
147{
148}
149
150#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151pub struct CapabilitiesDictionaryIterateKeysRequest {
152    pub dictionary: fidl::EventPair,
153    pub key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
154}
155
156impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
157    for CapabilitiesDictionaryIterateKeysRequest
158{
159}
160
161#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
162pub struct CapabilitiesDictionaryRouterCreateRequest {
163    pub router: fidl::EventPair,
164    pub router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
165}
166
167impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
168    for CapabilitiesDictionaryRouterCreateRequest
169{
170}
171
172#[derive(Debug, PartialEq)]
173pub struct CapabilitiesDictionaryRouterRouteRequest {
174    pub router: fidl::EventPair,
175    pub request: RouteRequest,
176    pub instance_token: fidl::EventPair,
177    pub dictionary: fidl::EventPair,
178}
179
180impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
181    for CapabilitiesDictionaryRouterRouteRequest
182{
183}
184
185#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct CapabilitiesDirConnectorCreateRequest {
187    pub dir_connector: fidl::EventPair,
188    pub receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
189}
190
191impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
192    for CapabilitiesDirConnectorCreateRequest
193{
194}
195
196#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
197pub struct CapabilitiesDirConnectorRouterCreateRequest {
198    pub router: fidl::EventPair,
199    pub router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
200}
201
202impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
203    for CapabilitiesDirConnectorRouterCreateRequest
204{
205}
206
207#[derive(Debug, PartialEq)]
208pub struct CapabilitiesDirConnectorRouterRouteRequest {
209    pub router: fidl::EventPair,
210    pub request: RouteRequest,
211    pub instance_token: fidl::EventPair,
212    pub dir_connector: fidl::EventPair,
213}
214
215impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
216    for CapabilitiesDirConnectorRouterRouteRequest
217{
218}
219
220#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct CapabilitiesInstanceTokenCreateRequest {
222    pub instance_token: fidl::EventPair,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
226    for CapabilitiesInstanceTokenCreateRequest
227{
228}
229
230#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
231pub struct CapabilitiesDictionaryGetResponse {
232    pub capability_type: CapabilityType,
233}
234
235impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
236    for CapabilitiesDictionaryGetResponse
237{
238}
239
240#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
241pub struct CapabilitiesDictionaryRemoveResponse {
242    pub capability_type: CapabilityType,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
246    for CapabilitiesDictionaryRemoveResponse
247{
248}
249
250#[derive(Debug, PartialEq)]
251pub struct ConnectorRouterRouteRequest {
252    pub request: RouteRequest,
253    pub instance_token: fidl::EventPair,
254    pub handle: fidl::EventPair,
255}
256
257impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
258    for ConnectorRouterRouteRequest
259{
260}
261
262#[derive(Debug, PartialEq)]
263pub struct DataRouterRouteRequest {
264    pub request: RouteRequest,
265    pub instance_token: fidl::EventPair,
266    pub handle: fidl::EventPair,
267}
268
269impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteRequest {}
270
271#[derive(Debug, PartialEq)]
272pub struct DictionaryRouterRouteRequest {
273    pub request: RouteRequest,
274    pub instance_token: fidl::EventPair,
275    pub handle: fidl::EventPair,
276}
277
278impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
279    for DictionaryRouterRouteRequest
280{
281}
282
283#[derive(Debug, PartialEq)]
284pub struct DirConnectorRouterRouteRequest {
285    pub request: RouteRequest,
286    pub instance_token: fidl::EventPair,
287    pub handle: fidl::EventPair,
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
291    for DirConnectorRouterRouteRequest
292{
293}
294
295#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
296pub struct DirReceiverReceiveRequest {
297    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
298    pub path: String,
299    pub rights: fidl_fuchsia_io::Flags,
300}
301
302impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
303
304#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
305pub struct ReceiverReceiveRequest {
306    pub channel: fidl::Channel,
307}
308
309impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ReceiverReceiveRequest {}
310
311#[derive(Debug, Default, PartialEq)]
312pub struct CapabilitiesDictionaryRemoveRequest {
313    pub dictionary: Option<fidl::EventPair>,
314    pub key: Option<String>,
315    pub value: Option<fidl::EventPair>,
316    #[doc(hidden)]
317    pub __source_breaking: fidl::marker::SourceBreaking,
318}
319
320impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
321    for CapabilitiesDictionaryRemoveRequest
322{
323}
324
325#[derive(Debug, Default, PartialEq)]
326pub struct CapabilitiesDirConnectorOpenRequest {
327    pub dir_connector: Option<fidl::EventPair>,
328    pub channel: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
329    pub flags: Option<fidl_fuchsia_io::Flags>,
330    pub path: Option<String>,
331    #[doc(hidden)]
332    pub __source_breaking: fidl::marker::SourceBreaking,
333}
334
335impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
336    for CapabilitiesDirConnectorOpenRequest
337{
338}
339
340/// Contains metadata on how to route a capability, and a token representing the
341/// component that started the route.
342///
343/// `metadata` is a dictionary, which contains data capabilities used by
344/// component manager to track things like the type of the route (e.g. protocol,
345/// storage, runner, ...), the rights on a directory route, and the scope on an
346/// event stream route. Generally an empty dictionary is safe to pass to
347/// component manager.
348///
349/// Either both fields must be set, or neither.
350#[derive(Debug, Default, PartialEq)]
351pub struct RouteRequest {
352    pub metadata: Option<fidl::EventPair>,
353    #[doc(hidden)]
354    pub __source_breaking: fidl::marker::SourceBreaking,
355}
356
357impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
358
359#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
360pub struct CapabilitiesMarker;
361
362impl fidl::endpoints::ProtocolMarker for CapabilitiesMarker {
363    type Proxy = CapabilitiesProxy;
364    type RequestStream = CapabilitiesRequestStream;
365    #[cfg(target_os = "fuchsia")]
366    type SynchronousProxy = CapabilitiesSynchronousProxy;
367
368    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Capabilities";
369}
370impl fidl::endpoints::DiscoverableProtocolMarker for CapabilitiesMarker {}
371pub type CapabilitiesConnectorCreateResult = Result<(), CapabilitiesError>;
372pub type CapabilitiesDirConnectorCreateResult = Result<(), CapabilitiesError>;
373pub type CapabilitiesDictionaryCreateResult = Result<(), CapabilitiesError>;
374pub type CapabilitiesDataCreateResult = Result<(), CapabilitiesError>;
375pub type CapabilitiesConnectorRouterCreateResult = Result<(), CapabilitiesError>;
376pub type CapabilitiesDirConnectorRouterCreateResult = Result<(), CapabilitiesError>;
377pub type CapabilitiesDictionaryRouterCreateResult = Result<(), CapabilitiesError>;
378pub type CapabilitiesDataRouterCreateResult = Result<(), CapabilitiesError>;
379pub type CapabilitiesInstanceTokenCreateResult = Result<(), CapabilitiesError>;
380pub type CapabilitiesConnectorOpenResult = Result<(), CapabilitiesError>;
381pub type CapabilitiesDirConnectorOpenResult = Result<(), CapabilitiesError>;
382pub type CapabilitiesDictionaryInsertResult = Result<(), CapabilitiesError>;
383pub type CapabilitiesDictionaryGetResult = Result<CapabilityType, CapabilitiesError>;
384pub type CapabilitiesDictionaryRemoveResult = Result<CapabilityType, CapabilitiesError>;
385pub type CapabilitiesDictionaryIterateKeysResult = Result<(), CapabilitiesError>;
386pub type CapabilitiesDataGetResult = Result<Data, CapabilitiesError>;
387pub type CapabilitiesConnectorRouterRouteResult = Result<RouterResponse, i32>;
388pub type CapabilitiesDirConnectorRouterRouteResult = Result<RouterResponse, i32>;
389pub type CapabilitiesDictionaryRouterRouteResult = Result<RouterResponse, i32>;
390pub type CapabilitiesDataRouterRouteResult = Result<RouterResponse, i32>;
391pub type CapabilitiesCapabilityAssociateHandleResult = Result<(), CapabilitiesError>;
392
393pub trait CapabilitiesProxyInterface: Send + Sync {
394    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorCreateResult, fidl::Error>>
395        + Send;
396    fn r#connector_create(
397        &self,
398        connector: fidl::EventPair,
399        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
400    ) -> Self::ConnectorCreateResponseFut;
401    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorCreateResult, fidl::Error>>
402        + Send;
403    fn r#dir_connector_create(
404        &self,
405        dir_connector: fidl::EventPair,
406        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
407    ) -> Self::DirConnectorCreateResponseFut;
408    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryCreateResult, fidl::Error>>
409        + Send;
410    fn r#dictionary_create(&self, dictionary: fidl::EventPair)
411    -> Self::DictionaryCreateResponseFut;
412    type DataCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataCreateResult, fidl::Error>>
413        + Send;
414    fn r#data_create(
415        &self,
416        data_handle: fidl::EventPair,
417        data: &Data,
418    ) -> Self::DataCreateResponseFut;
419    type ConnectorRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterCreateResult, fidl::Error>>
420        + Send;
421    fn r#connector_router_create(
422        &self,
423        router: fidl::EventPair,
424        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
425    ) -> Self::ConnectorRouterCreateResponseFut;
426    type DirConnectorRouterCreateResponseFut: std::future::Future<
427            Output = Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error>,
428        > + Send;
429    fn r#dir_connector_router_create(
430        &self,
431        router: fidl::EventPair,
432        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
433    ) -> Self::DirConnectorRouterCreateResponseFut;
434    type DictionaryRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error>>
435        + Send;
436    fn r#dictionary_router_create(
437        &self,
438        router: fidl::EventPair,
439        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
440    ) -> Self::DictionaryRouterCreateResponseFut;
441    type DataRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterCreateResult, fidl::Error>>
442        + Send;
443    fn r#data_router_create(
444        &self,
445        router: fidl::EventPair,
446        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
447    ) -> Self::DataRouterCreateResponseFut;
448    type InstanceTokenCreateResponseFut: std::future::Future<Output = Result<CapabilitiesInstanceTokenCreateResult, fidl::Error>>
449        + Send;
450    fn r#instance_token_create(
451        &self,
452        instance_token: fidl::EventPair,
453    ) -> Self::InstanceTokenCreateResponseFut;
454    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorOpenResult, fidl::Error>>
455        + Send;
456    fn r#connector_open(
457        &self,
458        connector: fidl::EventPair,
459        channel: fidl::Channel,
460    ) -> Self::ConnectorOpenResponseFut;
461    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorOpenResult, fidl::Error>>
462        + Send;
463    fn r#dir_connector_open(
464        &self,
465        payload: CapabilitiesDirConnectorOpenRequest,
466    ) -> Self::DirConnectorOpenResponseFut;
467    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryInsertResult, fidl::Error>>
468        + Send;
469    fn r#dictionary_insert(
470        &self,
471        dictionary: fidl::EventPair,
472        key: &str,
473        value: fidl::EventPair,
474    ) -> Self::DictionaryInsertResponseFut;
475    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryGetResult, fidl::Error>>
476        + Send;
477    fn r#dictionary_get(
478        &self,
479        dictionary: fidl::EventPair,
480        key: &str,
481        value: fidl::EventPair,
482    ) -> Self::DictionaryGetResponseFut;
483    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRemoveResult, fidl::Error>>
484        + Send;
485    fn r#dictionary_remove(
486        &self,
487        payload: CapabilitiesDictionaryRemoveRequest,
488    ) -> Self::DictionaryRemoveResponseFut;
489    type DictionaryIterateKeysResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error>>
490        + Send;
491    fn r#dictionary_iterate_keys(
492        &self,
493        dictionary: fidl::EventPair,
494        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
495    ) -> Self::DictionaryIterateKeysResponseFut;
496    type DataGetResponseFut: std::future::Future<Output = Result<CapabilitiesDataGetResult, fidl::Error>>
497        + Send;
498    fn r#data_get(&self, data_handle: fidl::EventPair) -> Self::DataGetResponseFut;
499    type ConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterRouteResult, fidl::Error>>
500        + Send;
501    fn r#connector_router_route(
502        &self,
503        router: fidl::EventPair,
504        request: RouteRequest,
505        instance_token: fidl::EventPair,
506        connector: fidl::EventPair,
507    ) -> Self::ConnectorRouterRouteResponseFut;
508    type DirConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error>>
509        + Send;
510    fn r#dir_connector_router_route(
511        &self,
512        router: fidl::EventPair,
513        request: RouteRequest,
514        instance_token: fidl::EventPair,
515        dir_connector: fidl::EventPair,
516    ) -> Self::DirConnectorRouterRouteResponseFut;
517    type DictionaryRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error>>
518        + Send;
519    fn r#dictionary_router_route(
520        &self,
521        router: fidl::EventPair,
522        request: RouteRequest,
523        instance_token: fidl::EventPair,
524        dictionary: fidl::EventPair,
525    ) -> Self::DictionaryRouterRouteResponseFut;
526    type DataRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterRouteResult, fidl::Error>>
527        + Send;
528    fn r#data_router_route(
529        &self,
530        router: fidl::EventPair,
531        request: RouteRequest,
532        instance_token: fidl::EventPair,
533        data: fidl::EventPair,
534    ) -> Self::DataRouterRouteResponseFut;
535    type CapabilityAssociateHandleResponseFut: std::future::Future<
536            Output = Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error>,
537        > + Send;
538    fn r#capability_associate_handle(
539        &self,
540        capability_handle: fidl::EventPair,
541        other_handle: fidl::EventPair,
542    ) -> Self::CapabilityAssociateHandleResponseFut;
543}
544#[derive(Debug)]
545#[cfg(target_os = "fuchsia")]
546pub struct CapabilitiesSynchronousProxy {
547    client: fidl::client::sync::Client,
548}
549
550#[cfg(target_os = "fuchsia")]
551impl fidl::endpoints::SynchronousProxy for CapabilitiesSynchronousProxy {
552    type Proxy = CapabilitiesProxy;
553    type Protocol = CapabilitiesMarker;
554
555    fn from_channel(inner: fidl::Channel) -> Self {
556        Self::new(inner)
557    }
558
559    fn into_channel(self) -> fidl::Channel {
560        self.client.into_channel()
561    }
562
563    fn as_channel(&self) -> &fidl::Channel {
564        self.client.as_channel()
565    }
566}
567
568#[cfg(target_os = "fuchsia")]
569impl CapabilitiesSynchronousProxy {
570    pub fn new(channel: fidl::Channel) -> Self {
571        Self { client: fidl::client::sync::Client::new(channel) }
572    }
573
574    pub fn into_channel(self) -> fidl::Channel {
575        self.client.into_channel()
576    }
577
578    /// Waits until an event arrives and returns it. It is safe for other
579    /// threads to make concurrent requests while waiting for an event.
580    pub fn wait_for_event(
581        &self,
582        deadline: zx::MonotonicInstant,
583    ) -> Result<CapabilitiesEvent, fidl::Error> {
584        CapabilitiesEvent::decode(self.client.wait_for_event::<CapabilitiesMarker>(deadline)?)
585    }
586
587    /// Creates a reference to a new connector capability. When the connector is
588    /// opened, the channel given to the open call will be sent over
589    /// `receiver_client_end`.
590    ///
591    /// Make sure this method returns before passing the handle's peer to other
592    /// methods in this API. The creation may not be complete before then.
593    pub fn r#connector_create(
594        &self,
595        mut connector: fidl::EventPair,
596        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
597        ___deadline: zx::MonotonicInstant,
598    ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
599        let _response = self.client.send_query::<
600            CapabilitiesConnectorCreateRequest,
601            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
602            CapabilitiesMarker,
603        >(
604            (connector, receiver_client_end,),
605            0xac2bc2dbd7033d1,
606            fidl::encoding::DynamicFlags::FLEXIBLE,
607            ___deadline,
608        )?
609        .into_result::<CapabilitiesMarker>("connector_create")?;
610        Ok(_response.map(|x| x))
611    }
612
613    /// Creates a reference to a new directory connector capability. When the
614    /// directory connector is opened, the channel given to the open call will
615    /// be sent over `receiver_client_end`.
616    ///
617    /// Make sure this method returns before passing the handle's peer to other
618    /// methods in this API. The creation may not be complete before then.
619    pub fn r#dir_connector_create(
620        &self,
621        mut dir_connector: fidl::EventPair,
622        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
623        ___deadline: zx::MonotonicInstant,
624    ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
625        let _response = self.client.send_query::<
626            CapabilitiesDirConnectorCreateRequest,
627            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
628            CapabilitiesMarker,
629        >(
630            (dir_connector, receiver_client_end,),
631            0x721911e05da2a3bf,
632            fidl::encoding::DynamicFlags::FLEXIBLE,
633            ___deadline,
634        )?
635        .into_result::<CapabilitiesMarker>("dir_connector_create")?;
636        Ok(_response.map(|x| x))
637    }
638
639    /// Creates a reference to a new dictionary capability.
640    ///
641    /// Make sure this method returns before passing the handle's peer to other
642    /// methods in this API. The creation may not be complete before then.
643    pub fn r#dictionary_create(
644        &self,
645        mut dictionary: fidl::EventPair,
646        ___deadline: zx::MonotonicInstant,
647    ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
648        let _response = self.client.send_query::<
649            CapabilitiesDictionaryCreateRequest,
650            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
651            CapabilitiesMarker,
652        >(
653            (dictionary,),
654            0x7f8bd91f0942a36e,
655            fidl::encoding::DynamicFlags::FLEXIBLE,
656            ___deadline,
657        )?
658        .into_result::<CapabilitiesMarker>("dictionary_create")?;
659        Ok(_response.map(|x| x))
660    }
661
662    /// Creates a reference to a new data capability with the given value.
663    ///
664    /// Make sure this method returns before passing the handle's peer to other
665    /// methods in this API. The creation may not be complete before then.
666    pub fn r#data_create(
667        &self,
668        mut data_handle: fidl::EventPair,
669        mut data: &Data,
670        ___deadline: zx::MonotonicInstant,
671    ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
672        let _response = self.client.send_query::<
673            CapabilitiesDataCreateRequest,
674            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
675            CapabilitiesMarker,
676        >(
677            (data_handle, data,),
678            0x40ef43e45372ee6a,
679            fidl::encoding::DynamicFlags::FLEXIBLE,
680            ___deadline,
681        )?
682        .into_result::<CapabilitiesMarker>("data_create")?;
683        Ok(_response.map(|x| x))
684    }
685
686    /// Creates a reference to a new router capability that will return a
687    /// connector capability when used.
688    ///
689    /// Make sure this method returns before passing the handle's peer to other
690    /// methods in this API. The creation may not be complete before then.
691    pub fn r#connector_router_create(
692        &self,
693        mut router: fidl::EventPair,
694        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
695        ___deadline: zx::MonotonicInstant,
696    ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
697        let _response = self.client.send_query::<
698            CapabilitiesConnectorRouterCreateRequest,
699            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
700            CapabilitiesMarker,
701        >(
702            (router, router_client_end,),
703            0x7f7e7fbafcdf1761,
704            fidl::encoding::DynamicFlags::FLEXIBLE,
705            ___deadline,
706        )?
707        .into_result::<CapabilitiesMarker>("connector_router_create")?;
708        Ok(_response.map(|x| x))
709    }
710
711    /// Creates a reference to a new router capability that will return a
712    /// directory connector capability when used.
713    ///
714    /// Make sure this method returns before passing the handle's peer to other
715    /// methods in this API. The creation may not be complete before then.
716    pub fn r#dir_connector_router_create(
717        &self,
718        mut router: fidl::EventPair,
719        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
720        ___deadline: zx::MonotonicInstant,
721    ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
722        let _response = self.client.send_query::<
723            CapabilitiesDirConnectorRouterCreateRequest,
724            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
725            CapabilitiesMarker,
726        >(
727            (router, router_client_end,),
728            0x56520da453fad19f,
729            fidl::encoding::DynamicFlags::FLEXIBLE,
730            ___deadline,
731        )?
732        .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
733        Ok(_response.map(|x| x))
734    }
735
736    /// Creates a reference to a new router capability that will return a
737    /// dictionary capability when used.
738    ///
739    /// Make sure this method returns before passing the handle's peer to other
740    /// methods in this API. The creation may not be complete before then.
741    pub fn r#dictionary_router_create(
742        &self,
743        mut router: fidl::EventPair,
744        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
745        ___deadline: zx::MonotonicInstant,
746    ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
747        let _response = self.client.send_query::<
748            CapabilitiesDictionaryRouterCreateRequest,
749            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
750            CapabilitiesMarker,
751        >(
752            (router, router_client_end,),
753            0x37acef18cd423d42,
754            fidl::encoding::DynamicFlags::FLEXIBLE,
755            ___deadline,
756        )?
757        .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
758        Ok(_response.map(|x| x))
759    }
760
761    /// Creates a reference to a new router capability that will return a data
762    /// value when used.
763    ///
764    /// Make sure this method returns before passing the handle's peer to other
765    /// methods in this API. The creation may not be complete before then.
766    pub fn r#data_router_create(
767        &self,
768        mut router: fidl::EventPair,
769        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
770        ___deadline: zx::MonotonicInstant,
771    ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
772        let _response = self.client.send_query::<
773            CapabilitiesDataRouterCreateRequest,
774            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
775            CapabilitiesMarker,
776        >(
777            (router, router_client_end,),
778            0x24e471395b95088,
779            fidl::encoding::DynamicFlags::FLEXIBLE,
780            ___deadline,
781        )?
782        .into_result::<CapabilitiesMarker>("data_router_create")?;
783        Ok(_response.map(|x| x))
784    }
785
786    /// Creates a new instance token, which is an opaque identifier associated
787    /// with a specific component. This instance token will be associated with
788    /// the component this connection is opened from.
789    ///
790    /// Make sure this method returns before passing the handle's peer to other
791    /// methods in this API. The creation may not be complete before then.
792    pub fn r#instance_token_create(
793        &self,
794        mut instance_token: fidl::EventPair,
795        ___deadline: zx::MonotonicInstant,
796    ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
797        let _response = self.client.send_query::<
798            CapabilitiesInstanceTokenCreateRequest,
799            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
800            CapabilitiesMarker,
801        >(
802            (instance_token,),
803            0x3576e31727c40813,
804            fidl::encoding::DynamicFlags::FLEXIBLE,
805            ___deadline,
806        )?
807        .into_result::<CapabilitiesMarker>("instance_token_create")?;
808        Ok(_response.map(|x| x))
809    }
810
811    /// Uses the provided `connector` to open a new connection by delivering
812    /// this channel to whoever created the connector.
813    ///
814    /// If there is an error, it will be reported as a zx.Status epitaph on
815    /// `channel`.
816    ///
817    /// If the `connector` event pair handle is not correlated with a handle
818    /// given to `ConnectorCreate`, this connection will be closed.
819    pub fn r#connector_open(
820        &self,
821        mut connector: fidl::EventPair,
822        mut channel: fidl::Channel,
823        ___deadline: zx::MonotonicInstant,
824    ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
825        let _response = self.client.send_query::<
826            CapabilitiesConnectorOpenRequest,
827            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
828            CapabilitiesMarker,
829        >(
830            (connector, channel,),
831            0xc0646965f1884eb,
832            fidl::encoding::DynamicFlags::FLEXIBLE,
833            ___deadline,
834        )?
835        .into_result::<CapabilitiesMarker>("connector_open")?;
836        Ok(_response.map(|x| x))
837    }
838
839    /// Uses the provided `dir_connector` to open a new directory connection by
840    /// delivering this channel to whoever created the directory connector.
841    ///
842    /// If there is an error, it will be reported as a zx.Status epitaph on
843    /// `channel`.
844    ///
845    /// If the `dir_connector` event pair handle is not correlated with a handle
846    /// given to `DirConnectorCreate`, this connection will be closed.
847    ///
848    /// `dir_connector` and `channel` are both required. `flags` and `path`
849    /// may be omitted.
850    pub fn r#dir_connector_open(
851        &self,
852        mut payload: CapabilitiesDirConnectorOpenRequest,
853        ___deadline: zx::MonotonicInstant,
854    ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
855        let _response = self.client.send_query::<
856            CapabilitiesDirConnectorOpenRequest,
857            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
858            CapabilitiesMarker,
859        >(
860            &mut payload,
861            0x1332bbf5debd6c20,
862            fidl::encoding::DynamicFlags::FLEXIBLE,
863            ___deadline,
864        )?
865        .into_result::<CapabilitiesMarker>("dir_connector_open")?;
866        Ok(_response.map(|x| x))
867    }
868
869    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
870    /// Overwrites any existing entry.
871    pub fn r#dictionary_insert(
872        &self,
873        mut dictionary: fidl::EventPair,
874        mut key: &str,
875        mut value: fidl::EventPair,
876        ___deadline: zx::MonotonicInstant,
877    ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
878        let _response = self.client.send_query::<
879            CapabilitiesDictionaryInsertRequest,
880            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
881            CapabilitiesMarker,
882        >(
883            (dictionary, key, value,),
884            0x5972e3061a760e7a,
885            fidl::encoding::DynamicFlags::FLEXIBLE,
886            ___deadline,
887        )?
888        .into_result::<CapabilitiesMarker>("dictionary_insert")?;
889        Ok(_response.map(|x| x))
890    }
891
892    /// Creates a new reference to the `capability` named `key` in this
893    /// dictionary, if that capability exists. That capability will remain in
894    /// the dictionary. To take a capability out of the dictionary, use
895    /// `DictionaryRemove`.
896    ///
897    /// If `key` does not exist, `value` will not reference any capability and
898    /// the `NO_SUCH_CAPABILITY` error value will be returned.
899    ///
900    /// Make sure this method returns before passing the handle's peer to other
901    /// methods in this API. The creation may not be complete before then.
902    pub fn r#dictionary_get(
903        &self,
904        mut dictionary: fidl::EventPair,
905        mut key: &str,
906        mut value: fidl::EventPair,
907        ___deadline: zx::MonotonicInstant,
908    ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
909        let _response = self
910            .client
911            .send_query::<CapabilitiesDictionaryGetRequest, fidl::encoding::FlexibleResultType<
912                CapabilitiesDictionaryGetResponse,
913                CapabilitiesError,
914            >, CapabilitiesMarker>(
915                (dictionary, key, value),
916                0x31fafe2280a283d5,
917                fidl::encoding::DynamicFlags::FLEXIBLE,
918                ___deadline,
919            )?
920            .into_result::<CapabilitiesMarker>("dictionary_get")?;
921        Ok(_response.map(|x| x.capability_type))
922    }
923
924    /// Removes the `capability` named `key` from this dictionary and returns a
925    /// reference to it, if that capability exists.
926    ///
927    /// `dictionary` and `key` are required. `capability` is optional, and when
928    /// set will become associated with the capability that was removed from the
929    /// dictionary.
930    ///
931    /// If `key` does not exist, `value` will not reference any capability and
932    /// the `NO_SUCH_CAPABILITY` error value will be returned.
933    ///
934    /// Make sure this method returns before passing the peer of `capability` to
935    /// other methods in this API. The creation may not be complete before then.
936    pub fn r#dictionary_remove(
937        &self,
938        mut payload: CapabilitiesDictionaryRemoveRequest,
939        ___deadline: zx::MonotonicInstant,
940    ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
941        let _response = self
942            .client
943            .send_query::<CapabilitiesDictionaryRemoveRequest, fidl::encoding::FlexibleResultType<
944                CapabilitiesDictionaryRemoveResponse,
945                CapabilitiesError,
946            >, CapabilitiesMarker>(
947                &mut payload,
948                0x6827c83106ac5a2c,
949                fidl::encoding::DynamicFlags::FLEXIBLE,
950                ___deadline,
951            )?
952            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
953        Ok(_response.map(|x| x.capability_type))
954    }
955
956    /// Opens an iterator which can be used to iterate over the keys of this
957    /// dictionary.
958    pub fn r#dictionary_iterate_keys(
959        &self,
960        mut dictionary: fidl::EventPair,
961        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
962        ___deadline: zx::MonotonicInstant,
963    ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
964        let _response = self.client.send_query::<
965            CapabilitiesDictionaryIterateKeysRequest,
966            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
967            CapabilitiesMarker,
968        >(
969            (dictionary, key_iterator,),
970            0x3d4ea59c80df9bb8,
971            fidl::encoding::DynamicFlags::FLEXIBLE,
972            ___deadline,
973        )?
974        .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
975        Ok(_response.map(|x| x))
976    }
977
978    /// Returns the `Data` value that was provided to the `DataCreate` call used
979    /// with `data_handle`.
980    pub fn r#data_get(
981        &self,
982        mut data_handle: fidl::EventPair,
983        ___deadline: zx::MonotonicInstant,
984    ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
985        let _response = self.client.send_query::<
986            CapabilitiesDataGetRequest,
987            fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
988            CapabilitiesMarker,
989        >(
990            (data_handle,),
991            0x65ae25b59f9e0daf,
992            fidl::encoding::DynamicFlags::FLEXIBLE,
993            ___deadline,
994        )?
995        .into_result::<CapabilitiesMarker>("data_get")?;
996        Ok(_response.map(|x| x))
997    }
998
999    /// Attempts to produce a `Connector` capability from this
1000    /// `ConnectorRouter`.
1001    ///
1002    /// `request` contains context for this route, and `instance_token`
1003    /// references the component that the routing operation is being performed
1004    /// for.
1005    ///
1006    /// This will return:
1007    ///
1008    /// - `SUCCESS` if `connector` has been associated with a connector.
1009    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1010    ///   `connector` will be closed.
1011    /// - An error, if the operation failed.
1012    pub fn r#connector_router_route(
1013        &self,
1014        mut router: fidl::EventPair,
1015        mut request: RouteRequest,
1016        mut instance_token: fidl::EventPair,
1017        mut connector: fidl::EventPair,
1018        ___deadline: zx::MonotonicInstant,
1019    ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
1020        let _response = self.client.send_query::<
1021            CapabilitiesConnectorRouterRouteRequest,
1022            fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
1023            CapabilitiesMarker,
1024        >(
1025            (router, &mut request, instance_token, connector,),
1026            0x1bd9c6e7e3dd487e,
1027            fidl::encoding::DynamicFlags::FLEXIBLE,
1028            ___deadline,
1029        )?
1030        .into_result::<CapabilitiesMarker>("connector_router_route")?;
1031        Ok(_response.map(|x| x.response))
1032    }
1033
1034    /// Attempts to produce a `DirConnector` capability from this
1035    /// `DirConnectorRouter`.
1036    ///
1037    /// `request` contains context for this route, and `instance_token`
1038    /// references the component that the routing operation is being performed
1039    /// for.
1040    ///
1041    /// This will return:
1042    ///
1043    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1044    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1045    ///   `dir_connector` will be closed.
1046    /// - An error, if the operation failed.
1047    pub fn r#dir_connector_router_route(
1048        &self,
1049        mut router: fidl::EventPair,
1050        mut request: RouteRequest,
1051        mut instance_token: fidl::EventPair,
1052        mut dir_connector: fidl::EventPair,
1053        ___deadline: zx::MonotonicInstant,
1054    ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
1055        let _response = self.client.send_query::<
1056            CapabilitiesDirConnectorRouterRouteRequest,
1057            fidl::encoding::FlexibleResultType<CapabilitiesDirConnectorRouterRouteResponse, i32>,
1058            CapabilitiesMarker,
1059        >(
1060            (router, &mut request, instance_token, dir_connector,),
1061            0x3afdcc1b79e0799d,
1062            fidl::encoding::DynamicFlags::FLEXIBLE,
1063            ___deadline,
1064        )?
1065        .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
1066        Ok(_response.map(|x| x.response))
1067    }
1068
1069    /// Attempts to produce a `Dictionary` capability from this
1070    /// `DictionaryRouter`.
1071    ///
1072    /// `request` contains context for this route, and `instance_token`
1073    /// references the component that the routing operation is being performed
1074    /// for.
1075    ///
1076    /// This will return:
1077    ///
1078    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1079    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1080    ///   `dictionary` will be closed.
1081    /// - An error, if the operation failed.
1082    pub fn r#dictionary_router_route(
1083        &self,
1084        mut router: fidl::EventPair,
1085        mut request: RouteRequest,
1086        mut instance_token: fidl::EventPair,
1087        mut dictionary: fidl::EventPair,
1088        ___deadline: zx::MonotonicInstant,
1089    ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
1090        let _response = self.client.send_query::<
1091            CapabilitiesDictionaryRouterRouteRequest,
1092            fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
1093            CapabilitiesMarker,
1094        >(
1095            (router, &mut request, instance_token, dictionary,),
1096            0xcf72de10714a708,
1097            fidl::encoding::DynamicFlags::FLEXIBLE,
1098            ___deadline,
1099        )?
1100        .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
1101        Ok(_response.map(|x| x.response))
1102    }
1103
1104    /// Attempts to produce a `Data` capability from this `DataRouter`.
1105    ///
1106    /// `request` contains context for this route, and `instance_token`
1107    /// references the component that the routing operation is being performed
1108    /// for.
1109    ///
1110    /// This will return:
1111    ///
1112    /// - `SUCCESS` if `data` has been associated with a connector.
1113    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1114    ///   will be closed.
1115    /// - An error, if the operation failed.
1116    pub fn r#data_router_route(
1117        &self,
1118        mut router: fidl::EventPair,
1119        mut request: RouteRequest,
1120        mut instance_token: fidl::EventPair,
1121        mut data: fidl::EventPair,
1122        ___deadline: zx::MonotonicInstant,
1123    ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
1124        let _response = self.client.send_query::<
1125            CapabilitiesDataRouterRouteRequest,
1126            fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
1127            CapabilitiesMarker,
1128        >(
1129            (router, &mut request, instance_token, data,),
1130            0x61ab188455ed0643,
1131            fidl::encoding::DynamicFlags::FLEXIBLE,
1132            ___deadline,
1133        )?
1134        .into_result::<CapabilitiesMarker>("data_router_route")?;
1135        Ok(_response.map(|x| x.response))
1136    }
1137
1138    /// Associates `other_handle` with the same capability referenced by
1139    /// `capability_handle`.
1140    ///
1141    /// Typically if one already has `capability_handle` the handle can be
1142    /// duplicated to make a new handle that references the same object, but
1143    /// this doesn't work when someone else has provided a handle that should be
1144    /// associated with an existing object.
1145    pub fn r#capability_associate_handle(
1146        &self,
1147        mut capability_handle: fidl::EventPair,
1148        mut other_handle: fidl::EventPair,
1149        ___deadline: zx::MonotonicInstant,
1150    ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
1151        let _response = self.client.send_query::<
1152            CapabilitiesCapabilityAssociateHandleRequest,
1153            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1154            CapabilitiesMarker,
1155        >(
1156            (capability_handle, other_handle,),
1157            0x1d69bb61953d8e7,
1158            fidl::encoding::DynamicFlags::FLEXIBLE,
1159            ___deadline,
1160        )?
1161        .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
1162        Ok(_response.map(|x| x))
1163    }
1164}
1165
1166#[cfg(target_os = "fuchsia")]
1167impl From<CapabilitiesSynchronousProxy> for zx::NullableHandle {
1168    fn from(value: CapabilitiesSynchronousProxy) -> Self {
1169        value.into_channel().into()
1170    }
1171}
1172
1173#[cfg(target_os = "fuchsia")]
1174impl From<fidl::Channel> for CapabilitiesSynchronousProxy {
1175    fn from(value: fidl::Channel) -> Self {
1176        Self::new(value)
1177    }
1178}
1179
1180#[cfg(target_os = "fuchsia")]
1181impl fidl::endpoints::FromClient for CapabilitiesSynchronousProxy {
1182    type Protocol = CapabilitiesMarker;
1183
1184    fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesMarker>) -> Self {
1185        Self::new(value.into_channel())
1186    }
1187}
1188
1189#[derive(Debug, Clone)]
1190pub struct CapabilitiesProxy {
1191    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1192}
1193
1194impl fidl::endpoints::Proxy for CapabilitiesProxy {
1195    type Protocol = CapabilitiesMarker;
1196
1197    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1198        Self::new(inner)
1199    }
1200
1201    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1202        self.client.into_channel().map_err(|client| Self { client })
1203    }
1204
1205    fn as_channel(&self) -> &::fidl::AsyncChannel {
1206        self.client.as_channel()
1207    }
1208}
1209
1210impl CapabilitiesProxy {
1211    /// Create a new Proxy for fuchsia.component.runtime/Capabilities.
1212    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1213        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1214        Self { client: fidl::client::Client::new(channel, protocol_name) }
1215    }
1216
1217    /// Get a Stream of events from the remote end of the protocol.
1218    ///
1219    /// # Panics
1220    ///
1221    /// Panics if the event stream was already taken.
1222    pub fn take_event_stream(&self) -> CapabilitiesEventStream {
1223        CapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
1224    }
1225
1226    /// Creates a reference to a new connector capability. When the connector is
1227    /// opened, the channel given to the open call will be sent over
1228    /// `receiver_client_end`.
1229    ///
1230    /// Make sure this method returns before passing the handle's peer to other
1231    /// methods in this API. The creation may not be complete before then.
1232    pub fn r#connector_create(
1233        &self,
1234        mut connector: fidl::EventPair,
1235        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1236    ) -> fidl::client::QueryResponseFut<
1237        CapabilitiesConnectorCreateResult,
1238        fidl::encoding::DefaultFuchsiaResourceDialect,
1239    > {
1240        CapabilitiesProxyInterface::r#connector_create(self, connector, receiver_client_end)
1241    }
1242
1243    /// Creates a reference to a new directory connector capability. When the
1244    /// directory connector is opened, the channel given to the open call will
1245    /// be sent over `receiver_client_end`.
1246    ///
1247    /// Make sure this method returns before passing the handle's peer to other
1248    /// methods in this API. The creation may not be complete before then.
1249    pub fn r#dir_connector_create(
1250        &self,
1251        mut dir_connector: fidl::EventPair,
1252        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1253    ) -> fidl::client::QueryResponseFut<
1254        CapabilitiesDirConnectorCreateResult,
1255        fidl::encoding::DefaultFuchsiaResourceDialect,
1256    > {
1257        CapabilitiesProxyInterface::r#dir_connector_create(self, dir_connector, receiver_client_end)
1258    }
1259
1260    /// Creates a reference to a new dictionary capability.
1261    ///
1262    /// Make sure this method returns before passing the handle's peer to other
1263    /// methods in this API. The creation may not be complete before then.
1264    pub fn r#dictionary_create(
1265        &self,
1266        mut dictionary: fidl::EventPair,
1267    ) -> fidl::client::QueryResponseFut<
1268        CapabilitiesDictionaryCreateResult,
1269        fidl::encoding::DefaultFuchsiaResourceDialect,
1270    > {
1271        CapabilitiesProxyInterface::r#dictionary_create(self, dictionary)
1272    }
1273
1274    /// Creates a reference to a new data capability with the given value.
1275    ///
1276    /// Make sure this method returns before passing the handle's peer to other
1277    /// methods in this API. The creation may not be complete before then.
1278    pub fn r#data_create(
1279        &self,
1280        mut data_handle: fidl::EventPair,
1281        mut data: &Data,
1282    ) -> fidl::client::QueryResponseFut<
1283        CapabilitiesDataCreateResult,
1284        fidl::encoding::DefaultFuchsiaResourceDialect,
1285    > {
1286        CapabilitiesProxyInterface::r#data_create(self, data_handle, data)
1287    }
1288
1289    /// Creates a reference to a new router capability that will return a
1290    /// connector capability when used.
1291    ///
1292    /// Make sure this method returns before passing the handle's peer to other
1293    /// methods in this API. The creation may not be complete before then.
1294    pub fn r#connector_router_create(
1295        &self,
1296        mut router: fidl::EventPair,
1297        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1298    ) -> fidl::client::QueryResponseFut<
1299        CapabilitiesConnectorRouterCreateResult,
1300        fidl::encoding::DefaultFuchsiaResourceDialect,
1301    > {
1302        CapabilitiesProxyInterface::r#connector_router_create(self, router, router_client_end)
1303    }
1304
1305    /// Creates a reference to a new router capability that will return a
1306    /// directory connector capability when used.
1307    ///
1308    /// Make sure this method returns before passing the handle's peer to other
1309    /// methods in this API. The creation may not be complete before then.
1310    pub fn r#dir_connector_router_create(
1311        &self,
1312        mut router: fidl::EventPair,
1313        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1314    ) -> fidl::client::QueryResponseFut<
1315        CapabilitiesDirConnectorRouterCreateResult,
1316        fidl::encoding::DefaultFuchsiaResourceDialect,
1317    > {
1318        CapabilitiesProxyInterface::r#dir_connector_router_create(self, router, router_client_end)
1319    }
1320
1321    /// Creates a reference to a new router capability that will return a
1322    /// dictionary capability when used.
1323    ///
1324    /// Make sure this method returns before passing the handle's peer to other
1325    /// methods in this API. The creation may not be complete before then.
1326    pub fn r#dictionary_router_create(
1327        &self,
1328        mut router: fidl::EventPair,
1329        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1330    ) -> fidl::client::QueryResponseFut<
1331        CapabilitiesDictionaryRouterCreateResult,
1332        fidl::encoding::DefaultFuchsiaResourceDialect,
1333    > {
1334        CapabilitiesProxyInterface::r#dictionary_router_create(self, router, router_client_end)
1335    }
1336
1337    /// Creates a reference to a new router capability that will return a data
1338    /// value when used.
1339    ///
1340    /// Make sure this method returns before passing the handle's peer to other
1341    /// methods in this API. The creation may not be complete before then.
1342    pub fn r#data_router_create(
1343        &self,
1344        mut router: fidl::EventPair,
1345        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1346    ) -> fidl::client::QueryResponseFut<
1347        CapabilitiesDataRouterCreateResult,
1348        fidl::encoding::DefaultFuchsiaResourceDialect,
1349    > {
1350        CapabilitiesProxyInterface::r#data_router_create(self, router, router_client_end)
1351    }
1352
1353    /// Creates a new instance token, which is an opaque identifier associated
1354    /// with a specific component. This instance token will be associated with
1355    /// the component this connection is opened from.
1356    ///
1357    /// Make sure this method returns before passing the handle's peer to other
1358    /// methods in this API. The creation may not be complete before then.
1359    pub fn r#instance_token_create(
1360        &self,
1361        mut instance_token: fidl::EventPair,
1362    ) -> fidl::client::QueryResponseFut<
1363        CapabilitiesInstanceTokenCreateResult,
1364        fidl::encoding::DefaultFuchsiaResourceDialect,
1365    > {
1366        CapabilitiesProxyInterface::r#instance_token_create(self, instance_token)
1367    }
1368
1369    /// Uses the provided `connector` to open a new connection by delivering
1370    /// this channel to whoever created the connector.
1371    ///
1372    /// If there is an error, it will be reported as a zx.Status epitaph on
1373    /// `channel`.
1374    ///
1375    /// If the `connector` event pair handle is not correlated with a handle
1376    /// given to `ConnectorCreate`, this connection will be closed.
1377    pub fn r#connector_open(
1378        &self,
1379        mut connector: fidl::EventPair,
1380        mut channel: fidl::Channel,
1381    ) -> fidl::client::QueryResponseFut<
1382        CapabilitiesConnectorOpenResult,
1383        fidl::encoding::DefaultFuchsiaResourceDialect,
1384    > {
1385        CapabilitiesProxyInterface::r#connector_open(self, connector, channel)
1386    }
1387
1388    /// Uses the provided `dir_connector` to open a new directory connection by
1389    /// delivering this channel to whoever created the directory connector.
1390    ///
1391    /// If there is an error, it will be reported as a zx.Status epitaph on
1392    /// `channel`.
1393    ///
1394    /// If the `dir_connector` event pair handle is not correlated with a handle
1395    /// given to `DirConnectorCreate`, this connection will be closed.
1396    ///
1397    /// `dir_connector` and `channel` are both required. `flags` and `path`
1398    /// may be omitted.
1399    pub fn r#dir_connector_open(
1400        &self,
1401        mut payload: CapabilitiesDirConnectorOpenRequest,
1402    ) -> fidl::client::QueryResponseFut<
1403        CapabilitiesDirConnectorOpenResult,
1404        fidl::encoding::DefaultFuchsiaResourceDialect,
1405    > {
1406        CapabilitiesProxyInterface::r#dir_connector_open(self, payload)
1407    }
1408
1409    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
1410    /// Overwrites any existing entry.
1411    pub fn r#dictionary_insert(
1412        &self,
1413        mut dictionary: fidl::EventPair,
1414        mut key: &str,
1415        mut value: fidl::EventPair,
1416    ) -> fidl::client::QueryResponseFut<
1417        CapabilitiesDictionaryInsertResult,
1418        fidl::encoding::DefaultFuchsiaResourceDialect,
1419    > {
1420        CapabilitiesProxyInterface::r#dictionary_insert(self, dictionary, key, value)
1421    }
1422
1423    /// Creates a new reference to the `capability` named `key` in this
1424    /// dictionary, if that capability exists. That capability will remain in
1425    /// the dictionary. To take a capability out of the dictionary, use
1426    /// `DictionaryRemove`.
1427    ///
1428    /// If `key` does not exist, `value` will not reference any capability and
1429    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1430    ///
1431    /// Make sure this method returns before passing the handle's peer to other
1432    /// methods in this API. The creation may not be complete before then.
1433    pub fn r#dictionary_get(
1434        &self,
1435        mut dictionary: fidl::EventPair,
1436        mut key: &str,
1437        mut value: fidl::EventPair,
1438    ) -> fidl::client::QueryResponseFut<
1439        CapabilitiesDictionaryGetResult,
1440        fidl::encoding::DefaultFuchsiaResourceDialect,
1441    > {
1442        CapabilitiesProxyInterface::r#dictionary_get(self, dictionary, key, value)
1443    }
1444
1445    /// Removes the `capability` named `key` from this dictionary and returns a
1446    /// reference to it, if that capability exists.
1447    ///
1448    /// `dictionary` and `key` are required. `capability` is optional, and when
1449    /// set will become associated with the capability that was removed from the
1450    /// dictionary.
1451    ///
1452    /// If `key` does not exist, `value` will not reference any capability and
1453    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1454    ///
1455    /// Make sure this method returns before passing the peer of `capability` to
1456    /// other methods in this API. The creation may not be complete before then.
1457    pub fn r#dictionary_remove(
1458        &self,
1459        mut payload: CapabilitiesDictionaryRemoveRequest,
1460    ) -> fidl::client::QueryResponseFut<
1461        CapabilitiesDictionaryRemoveResult,
1462        fidl::encoding::DefaultFuchsiaResourceDialect,
1463    > {
1464        CapabilitiesProxyInterface::r#dictionary_remove(self, payload)
1465    }
1466
1467    /// Opens an iterator which can be used to iterate over the keys of this
1468    /// dictionary.
1469    pub fn r#dictionary_iterate_keys(
1470        &self,
1471        mut dictionary: fidl::EventPair,
1472        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
1473    ) -> fidl::client::QueryResponseFut<
1474        CapabilitiesDictionaryIterateKeysResult,
1475        fidl::encoding::DefaultFuchsiaResourceDialect,
1476    > {
1477        CapabilitiesProxyInterface::r#dictionary_iterate_keys(self, dictionary, key_iterator)
1478    }
1479
1480    /// Returns the `Data` value that was provided to the `DataCreate` call used
1481    /// with `data_handle`.
1482    pub fn r#data_get(
1483        &self,
1484        mut data_handle: fidl::EventPair,
1485    ) -> fidl::client::QueryResponseFut<
1486        CapabilitiesDataGetResult,
1487        fidl::encoding::DefaultFuchsiaResourceDialect,
1488    > {
1489        CapabilitiesProxyInterface::r#data_get(self, data_handle)
1490    }
1491
1492    /// Attempts to produce a `Connector` capability from this
1493    /// `ConnectorRouter`.
1494    ///
1495    /// `request` contains context for this route, and `instance_token`
1496    /// references the component that the routing operation is being performed
1497    /// for.
1498    ///
1499    /// This will return:
1500    ///
1501    /// - `SUCCESS` if `connector` has been associated with a connector.
1502    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1503    ///   `connector` will be closed.
1504    /// - An error, if the operation failed.
1505    pub fn r#connector_router_route(
1506        &self,
1507        mut router: fidl::EventPair,
1508        mut request: RouteRequest,
1509        mut instance_token: fidl::EventPair,
1510        mut connector: fidl::EventPair,
1511    ) -> fidl::client::QueryResponseFut<
1512        CapabilitiesConnectorRouterRouteResult,
1513        fidl::encoding::DefaultFuchsiaResourceDialect,
1514    > {
1515        CapabilitiesProxyInterface::r#connector_router_route(
1516            self,
1517            router,
1518            request,
1519            instance_token,
1520            connector,
1521        )
1522    }
1523
1524    /// Attempts to produce a `DirConnector` capability from this
1525    /// `DirConnectorRouter`.
1526    ///
1527    /// `request` contains context for this route, and `instance_token`
1528    /// references the component that the routing operation is being performed
1529    /// for.
1530    ///
1531    /// This will return:
1532    ///
1533    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1534    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1535    ///   `dir_connector` will be closed.
1536    /// - An error, if the operation failed.
1537    pub fn r#dir_connector_router_route(
1538        &self,
1539        mut router: fidl::EventPair,
1540        mut request: RouteRequest,
1541        mut instance_token: fidl::EventPair,
1542        mut dir_connector: fidl::EventPair,
1543    ) -> fidl::client::QueryResponseFut<
1544        CapabilitiesDirConnectorRouterRouteResult,
1545        fidl::encoding::DefaultFuchsiaResourceDialect,
1546    > {
1547        CapabilitiesProxyInterface::r#dir_connector_router_route(
1548            self,
1549            router,
1550            request,
1551            instance_token,
1552            dir_connector,
1553        )
1554    }
1555
1556    /// Attempts to produce a `Dictionary` capability from this
1557    /// `DictionaryRouter`.
1558    ///
1559    /// `request` contains context for this route, and `instance_token`
1560    /// references the component that the routing operation is being performed
1561    /// for.
1562    ///
1563    /// This will return:
1564    ///
1565    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1566    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1567    ///   `dictionary` will be closed.
1568    /// - An error, if the operation failed.
1569    pub fn r#dictionary_router_route(
1570        &self,
1571        mut router: fidl::EventPair,
1572        mut request: RouteRequest,
1573        mut instance_token: fidl::EventPair,
1574        mut dictionary: fidl::EventPair,
1575    ) -> fidl::client::QueryResponseFut<
1576        CapabilitiesDictionaryRouterRouteResult,
1577        fidl::encoding::DefaultFuchsiaResourceDialect,
1578    > {
1579        CapabilitiesProxyInterface::r#dictionary_router_route(
1580            self,
1581            router,
1582            request,
1583            instance_token,
1584            dictionary,
1585        )
1586    }
1587
1588    /// Attempts to produce a `Data` capability from this `DataRouter`.
1589    ///
1590    /// `request` contains context for this route, and `instance_token`
1591    /// references the component that the routing operation is being performed
1592    /// for.
1593    ///
1594    /// This will return:
1595    ///
1596    /// - `SUCCESS` if `data` has been associated with a connector.
1597    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1598    ///   will be closed.
1599    /// - An error, if the operation failed.
1600    pub fn r#data_router_route(
1601        &self,
1602        mut router: fidl::EventPair,
1603        mut request: RouteRequest,
1604        mut instance_token: fidl::EventPair,
1605        mut data: fidl::EventPair,
1606    ) -> fidl::client::QueryResponseFut<
1607        CapabilitiesDataRouterRouteResult,
1608        fidl::encoding::DefaultFuchsiaResourceDialect,
1609    > {
1610        CapabilitiesProxyInterface::r#data_router_route(self, router, request, instance_token, data)
1611    }
1612
1613    /// Associates `other_handle` with the same capability referenced by
1614    /// `capability_handle`.
1615    ///
1616    /// Typically if one already has `capability_handle` the handle can be
1617    /// duplicated to make a new handle that references the same object, but
1618    /// this doesn't work when someone else has provided a handle that should be
1619    /// associated with an existing object.
1620    pub fn r#capability_associate_handle(
1621        &self,
1622        mut capability_handle: fidl::EventPair,
1623        mut other_handle: fidl::EventPair,
1624    ) -> fidl::client::QueryResponseFut<
1625        CapabilitiesCapabilityAssociateHandleResult,
1626        fidl::encoding::DefaultFuchsiaResourceDialect,
1627    > {
1628        CapabilitiesProxyInterface::r#capability_associate_handle(
1629            self,
1630            capability_handle,
1631            other_handle,
1632        )
1633    }
1634}
1635
1636impl CapabilitiesProxyInterface for CapabilitiesProxy {
1637    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1638        CapabilitiesConnectorCreateResult,
1639        fidl::encoding::DefaultFuchsiaResourceDialect,
1640    >;
1641    fn r#connector_create(
1642        &self,
1643        mut connector: fidl::EventPair,
1644        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1645    ) -> Self::ConnectorCreateResponseFut {
1646        fn _decode(
1647            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1648        ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
1649            let _response = fidl::client::decode_transaction_body::<
1650                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1651                fidl::encoding::DefaultFuchsiaResourceDialect,
1652                0xac2bc2dbd7033d1,
1653            >(_buf?)?
1654            .into_result::<CapabilitiesMarker>("connector_create")?;
1655            Ok(_response.map(|x| x))
1656        }
1657        self.client.send_query_and_decode::<
1658            CapabilitiesConnectorCreateRequest,
1659            CapabilitiesConnectorCreateResult,
1660        >(
1661            (connector, receiver_client_end,),
1662            0xac2bc2dbd7033d1,
1663            fidl::encoding::DynamicFlags::FLEXIBLE,
1664            _decode,
1665        )
1666    }
1667
1668    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1669        CapabilitiesDirConnectorCreateResult,
1670        fidl::encoding::DefaultFuchsiaResourceDialect,
1671    >;
1672    fn r#dir_connector_create(
1673        &self,
1674        mut dir_connector: fidl::EventPair,
1675        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1676    ) -> Self::DirConnectorCreateResponseFut {
1677        fn _decode(
1678            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1679        ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
1680            let _response = fidl::client::decode_transaction_body::<
1681                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1682                fidl::encoding::DefaultFuchsiaResourceDialect,
1683                0x721911e05da2a3bf,
1684            >(_buf?)?
1685            .into_result::<CapabilitiesMarker>("dir_connector_create")?;
1686            Ok(_response.map(|x| x))
1687        }
1688        self.client.send_query_and_decode::<
1689            CapabilitiesDirConnectorCreateRequest,
1690            CapabilitiesDirConnectorCreateResult,
1691        >(
1692            (dir_connector, receiver_client_end,),
1693            0x721911e05da2a3bf,
1694            fidl::encoding::DynamicFlags::FLEXIBLE,
1695            _decode,
1696        )
1697    }
1698
1699    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1700        CapabilitiesDictionaryCreateResult,
1701        fidl::encoding::DefaultFuchsiaResourceDialect,
1702    >;
1703    fn r#dictionary_create(
1704        &self,
1705        mut dictionary: fidl::EventPair,
1706    ) -> Self::DictionaryCreateResponseFut {
1707        fn _decode(
1708            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1709        ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
1710            let _response = fidl::client::decode_transaction_body::<
1711                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1712                fidl::encoding::DefaultFuchsiaResourceDialect,
1713                0x7f8bd91f0942a36e,
1714            >(_buf?)?
1715            .into_result::<CapabilitiesMarker>("dictionary_create")?;
1716            Ok(_response.map(|x| x))
1717        }
1718        self.client.send_query_and_decode::<
1719            CapabilitiesDictionaryCreateRequest,
1720            CapabilitiesDictionaryCreateResult,
1721        >(
1722            (dictionary,),
1723            0x7f8bd91f0942a36e,
1724            fidl::encoding::DynamicFlags::FLEXIBLE,
1725            _decode,
1726        )
1727    }
1728
1729    type DataCreateResponseFut = fidl::client::QueryResponseFut<
1730        CapabilitiesDataCreateResult,
1731        fidl::encoding::DefaultFuchsiaResourceDialect,
1732    >;
1733    fn r#data_create(
1734        &self,
1735        mut data_handle: fidl::EventPair,
1736        mut data: &Data,
1737    ) -> Self::DataCreateResponseFut {
1738        fn _decode(
1739            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1740        ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
1741            let _response = fidl::client::decode_transaction_body::<
1742                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1743                fidl::encoding::DefaultFuchsiaResourceDialect,
1744                0x40ef43e45372ee6a,
1745            >(_buf?)?
1746            .into_result::<CapabilitiesMarker>("data_create")?;
1747            Ok(_response.map(|x| x))
1748        }
1749        self.client
1750            .send_query_and_decode::<CapabilitiesDataCreateRequest, CapabilitiesDataCreateResult>(
1751                (data_handle, data),
1752                0x40ef43e45372ee6a,
1753                fidl::encoding::DynamicFlags::FLEXIBLE,
1754                _decode,
1755            )
1756    }
1757
1758    type ConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1759        CapabilitiesConnectorRouterCreateResult,
1760        fidl::encoding::DefaultFuchsiaResourceDialect,
1761    >;
1762    fn r#connector_router_create(
1763        &self,
1764        mut router: fidl::EventPair,
1765        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1766    ) -> Self::ConnectorRouterCreateResponseFut {
1767        fn _decode(
1768            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1769        ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
1770            let _response = fidl::client::decode_transaction_body::<
1771                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1772                fidl::encoding::DefaultFuchsiaResourceDialect,
1773                0x7f7e7fbafcdf1761,
1774            >(_buf?)?
1775            .into_result::<CapabilitiesMarker>("connector_router_create")?;
1776            Ok(_response.map(|x| x))
1777        }
1778        self.client.send_query_and_decode::<
1779            CapabilitiesConnectorRouterCreateRequest,
1780            CapabilitiesConnectorRouterCreateResult,
1781        >(
1782            (router, router_client_end,),
1783            0x7f7e7fbafcdf1761,
1784            fidl::encoding::DynamicFlags::FLEXIBLE,
1785            _decode,
1786        )
1787    }
1788
1789    type DirConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1790        CapabilitiesDirConnectorRouterCreateResult,
1791        fidl::encoding::DefaultFuchsiaResourceDialect,
1792    >;
1793    fn r#dir_connector_router_create(
1794        &self,
1795        mut router: fidl::EventPair,
1796        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1797    ) -> Self::DirConnectorRouterCreateResponseFut {
1798        fn _decode(
1799            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1800        ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
1801            let _response = fidl::client::decode_transaction_body::<
1802                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1803                fidl::encoding::DefaultFuchsiaResourceDialect,
1804                0x56520da453fad19f,
1805            >(_buf?)?
1806            .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
1807            Ok(_response.map(|x| x))
1808        }
1809        self.client.send_query_and_decode::<
1810            CapabilitiesDirConnectorRouterCreateRequest,
1811            CapabilitiesDirConnectorRouterCreateResult,
1812        >(
1813            (router, router_client_end,),
1814            0x56520da453fad19f,
1815            fidl::encoding::DynamicFlags::FLEXIBLE,
1816            _decode,
1817        )
1818    }
1819
1820    type DictionaryRouterCreateResponseFut = fidl::client::QueryResponseFut<
1821        CapabilitiesDictionaryRouterCreateResult,
1822        fidl::encoding::DefaultFuchsiaResourceDialect,
1823    >;
1824    fn r#dictionary_router_create(
1825        &self,
1826        mut router: fidl::EventPair,
1827        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1828    ) -> Self::DictionaryRouterCreateResponseFut {
1829        fn _decode(
1830            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1831        ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
1832            let _response = fidl::client::decode_transaction_body::<
1833                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1834                fidl::encoding::DefaultFuchsiaResourceDialect,
1835                0x37acef18cd423d42,
1836            >(_buf?)?
1837            .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
1838            Ok(_response.map(|x| x))
1839        }
1840        self.client.send_query_and_decode::<
1841            CapabilitiesDictionaryRouterCreateRequest,
1842            CapabilitiesDictionaryRouterCreateResult,
1843        >(
1844            (router, router_client_end,),
1845            0x37acef18cd423d42,
1846            fidl::encoding::DynamicFlags::FLEXIBLE,
1847            _decode,
1848        )
1849    }
1850
1851    type DataRouterCreateResponseFut = fidl::client::QueryResponseFut<
1852        CapabilitiesDataRouterCreateResult,
1853        fidl::encoding::DefaultFuchsiaResourceDialect,
1854    >;
1855    fn r#data_router_create(
1856        &self,
1857        mut router: fidl::EventPair,
1858        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1859    ) -> Self::DataRouterCreateResponseFut {
1860        fn _decode(
1861            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1862        ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
1863            let _response = fidl::client::decode_transaction_body::<
1864                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1865                fidl::encoding::DefaultFuchsiaResourceDialect,
1866                0x24e471395b95088,
1867            >(_buf?)?
1868            .into_result::<CapabilitiesMarker>("data_router_create")?;
1869            Ok(_response.map(|x| x))
1870        }
1871        self.client.send_query_and_decode::<
1872            CapabilitiesDataRouterCreateRequest,
1873            CapabilitiesDataRouterCreateResult,
1874        >(
1875            (router, router_client_end,),
1876            0x24e471395b95088,
1877            fidl::encoding::DynamicFlags::FLEXIBLE,
1878            _decode,
1879        )
1880    }
1881
1882    type InstanceTokenCreateResponseFut = fidl::client::QueryResponseFut<
1883        CapabilitiesInstanceTokenCreateResult,
1884        fidl::encoding::DefaultFuchsiaResourceDialect,
1885    >;
1886    fn r#instance_token_create(
1887        &self,
1888        mut instance_token: fidl::EventPair,
1889    ) -> Self::InstanceTokenCreateResponseFut {
1890        fn _decode(
1891            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1892        ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
1893            let _response = fidl::client::decode_transaction_body::<
1894                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1895                fidl::encoding::DefaultFuchsiaResourceDialect,
1896                0x3576e31727c40813,
1897            >(_buf?)?
1898            .into_result::<CapabilitiesMarker>("instance_token_create")?;
1899            Ok(_response.map(|x| x))
1900        }
1901        self.client.send_query_and_decode::<
1902            CapabilitiesInstanceTokenCreateRequest,
1903            CapabilitiesInstanceTokenCreateResult,
1904        >(
1905            (instance_token,),
1906            0x3576e31727c40813,
1907            fidl::encoding::DynamicFlags::FLEXIBLE,
1908            _decode,
1909        )
1910    }
1911
1912    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1913        CapabilitiesConnectorOpenResult,
1914        fidl::encoding::DefaultFuchsiaResourceDialect,
1915    >;
1916    fn r#connector_open(
1917        &self,
1918        mut connector: fidl::EventPair,
1919        mut channel: fidl::Channel,
1920    ) -> Self::ConnectorOpenResponseFut {
1921        fn _decode(
1922            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1923        ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
1924            let _response = fidl::client::decode_transaction_body::<
1925                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1926                fidl::encoding::DefaultFuchsiaResourceDialect,
1927                0xc0646965f1884eb,
1928            >(_buf?)?
1929            .into_result::<CapabilitiesMarker>("connector_open")?;
1930            Ok(_response.map(|x| x))
1931        }
1932        self.client.send_query_and_decode::<
1933            CapabilitiesConnectorOpenRequest,
1934            CapabilitiesConnectorOpenResult,
1935        >(
1936            (connector, channel,),
1937            0xc0646965f1884eb,
1938            fidl::encoding::DynamicFlags::FLEXIBLE,
1939            _decode,
1940        )
1941    }
1942
1943    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1944        CapabilitiesDirConnectorOpenResult,
1945        fidl::encoding::DefaultFuchsiaResourceDialect,
1946    >;
1947    fn r#dir_connector_open(
1948        &self,
1949        mut payload: CapabilitiesDirConnectorOpenRequest,
1950    ) -> Self::DirConnectorOpenResponseFut {
1951        fn _decode(
1952            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1953        ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
1954            let _response = fidl::client::decode_transaction_body::<
1955                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1956                fidl::encoding::DefaultFuchsiaResourceDialect,
1957                0x1332bbf5debd6c20,
1958            >(_buf?)?
1959            .into_result::<CapabilitiesMarker>("dir_connector_open")?;
1960            Ok(_response.map(|x| x))
1961        }
1962        self.client.send_query_and_decode::<
1963            CapabilitiesDirConnectorOpenRequest,
1964            CapabilitiesDirConnectorOpenResult,
1965        >(
1966            &mut payload,
1967            0x1332bbf5debd6c20,
1968            fidl::encoding::DynamicFlags::FLEXIBLE,
1969            _decode,
1970        )
1971    }
1972
1973    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1974        CapabilitiesDictionaryInsertResult,
1975        fidl::encoding::DefaultFuchsiaResourceDialect,
1976    >;
1977    fn r#dictionary_insert(
1978        &self,
1979        mut dictionary: fidl::EventPair,
1980        mut key: &str,
1981        mut value: fidl::EventPair,
1982    ) -> Self::DictionaryInsertResponseFut {
1983        fn _decode(
1984            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1985        ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
1986            let _response = fidl::client::decode_transaction_body::<
1987                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1988                fidl::encoding::DefaultFuchsiaResourceDialect,
1989                0x5972e3061a760e7a,
1990            >(_buf?)?
1991            .into_result::<CapabilitiesMarker>("dictionary_insert")?;
1992            Ok(_response.map(|x| x))
1993        }
1994        self.client.send_query_and_decode::<
1995            CapabilitiesDictionaryInsertRequest,
1996            CapabilitiesDictionaryInsertResult,
1997        >(
1998            (dictionary, key, value,),
1999            0x5972e3061a760e7a,
2000            fidl::encoding::DynamicFlags::FLEXIBLE,
2001            _decode,
2002        )
2003    }
2004
2005    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
2006        CapabilitiesDictionaryGetResult,
2007        fidl::encoding::DefaultFuchsiaResourceDialect,
2008    >;
2009    fn r#dictionary_get(
2010        &self,
2011        mut dictionary: fidl::EventPair,
2012        mut key: &str,
2013        mut value: fidl::EventPair,
2014    ) -> Self::DictionaryGetResponseFut {
2015        fn _decode(
2016            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2017        ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
2018            let _response = fidl::client::decode_transaction_body::<
2019                fidl::encoding::FlexibleResultType<
2020                    CapabilitiesDictionaryGetResponse,
2021                    CapabilitiesError,
2022                >,
2023                fidl::encoding::DefaultFuchsiaResourceDialect,
2024                0x31fafe2280a283d5,
2025            >(_buf?)?
2026            .into_result::<CapabilitiesMarker>("dictionary_get")?;
2027            Ok(_response.map(|x| x.capability_type))
2028        }
2029        self.client.send_query_and_decode::<
2030            CapabilitiesDictionaryGetRequest,
2031            CapabilitiesDictionaryGetResult,
2032        >(
2033            (dictionary, key, value,),
2034            0x31fafe2280a283d5,
2035            fidl::encoding::DynamicFlags::FLEXIBLE,
2036            _decode,
2037        )
2038    }
2039
2040    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
2041        CapabilitiesDictionaryRemoveResult,
2042        fidl::encoding::DefaultFuchsiaResourceDialect,
2043    >;
2044    fn r#dictionary_remove(
2045        &self,
2046        mut payload: CapabilitiesDictionaryRemoveRequest,
2047    ) -> Self::DictionaryRemoveResponseFut {
2048        fn _decode(
2049            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2050        ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
2051            let _response = fidl::client::decode_transaction_body::<
2052                fidl::encoding::FlexibleResultType<
2053                    CapabilitiesDictionaryRemoveResponse,
2054                    CapabilitiesError,
2055                >,
2056                fidl::encoding::DefaultFuchsiaResourceDialect,
2057                0x6827c83106ac5a2c,
2058            >(_buf?)?
2059            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
2060            Ok(_response.map(|x| x.capability_type))
2061        }
2062        self.client.send_query_and_decode::<
2063            CapabilitiesDictionaryRemoveRequest,
2064            CapabilitiesDictionaryRemoveResult,
2065        >(
2066            &mut payload,
2067            0x6827c83106ac5a2c,
2068            fidl::encoding::DynamicFlags::FLEXIBLE,
2069            _decode,
2070        )
2071    }
2072
2073    type DictionaryIterateKeysResponseFut = fidl::client::QueryResponseFut<
2074        CapabilitiesDictionaryIterateKeysResult,
2075        fidl::encoding::DefaultFuchsiaResourceDialect,
2076    >;
2077    fn r#dictionary_iterate_keys(
2078        &self,
2079        mut dictionary: fidl::EventPair,
2080        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
2081    ) -> Self::DictionaryIterateKeysResponseFut {
2082        fn _decode(
2083            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2084        ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
2085            let _response = fidl::client::decode_transaction_body::<
2086                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2087                fidl::encoding::DefaultFuchsiaResourceDialect,
2088                0x3d4ea59c80df9bb8,
2089            >(_buf?)?
2090            .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
2091            Ok(_response.map(|x| x))
2092        }
2093        self.client.send_query_and_decode::<
2094            CapabilitiesDictionaryIterateKeysRequest,
2095            CapabilitiesDictionaryIterateKeysResult,
2096        >(
2097            (dictionary, key_iterator,),
2098            0x3d4ea59c80df9bb8,
2099            fidl::encoding::DynamicFlags::FLEXIBLE,
2100            _decode,
2101        )
2102    }
2103
2104    type DataGetResponseFut = fidl::client::QueryResponseFut<
2105        CapabilitiesDataGetResult,
2106        fidl::encoding::DefaultFuchsiaResourceDialect,
2107    >;
2108    fn r#data_get(&self, mut data_handle: fidl::EventPair) -> Self::DataGetResponseFut {
2109        fn _decode(
2110            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2111        ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
2112            let _response = fidl::client::decode_transaction_body::<
2113                fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
2114                fidl::encoding::DefaultFuchsiaResourceDialect,
2115                0x65ae25b59f9e0daf,
2116            >(_buf?)?
2117            .into_result::<CapabilitiesMarker>("data_get")?;
2118            Ok(_response.map(|x| x))
2119        }
2120        self.client.send_query_and_decode::<CapabilitiesDataGetRequest, CapabilitiesDataGetResult>(
2121            (data_handle,),
2122            0x65ae25b59f9e0daf,
2123            fidl::encoding::DynamicFlags::FLEXIBLE,
2124            _decode,
2125        )
2126    }
2127
2128    type ConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2129        CapabilitiesConnectorRouterRouteResult,
2130        fidl::encoding::DefaultFuchsiaResourceDialect,
2131    >;
2132    fn r#connector_router_route(
2133        &self,
2134        mut router: fidl::EventPair,
2135        mut request: RouteRequest,
2136        mut instance_token: fidl::EventPair,
2137        mut connector: fidl::EventPair,
2138    ) -> Self::ConnectorRouterRouteResponseFut {
2139        fn _decode(
2140            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2141        ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
2142            let _response = fidl::client::decode_transaction_body::<
2143                fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
2144                fidl::encoding::DefaultFuchsiaResourceDialect,
2145                0x1bd9c6e7e3dd487e,
2146            >(_buf?)?
2147            .into_result::<CapabilitiesMarker>("connector_router_route")?;
2148            Ok(_response.map(|x| x.response))
2149        }
2150        self.client.send_query_and_decode::<
2151            CapabilitiesConnectorRouterRouteRequest,
2152            CapabilitiesConnectorRouterRouteResult,
2153        >(
2154            (router, &mut request, instance_token, connector,),
2155            0x1bd9c6e7e3dd487e,
2156            fidl::encoding::DynamicFlags::FLEXIBLE,
2157            _decode,
2158        )
2159    }
2160
2161    type DirConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2162        CapabilitiesDirConnectorRouterRouteResult,
2163        fidl::encoding::DefaultFuchsiaResourceDialect,
2164    >;
2165    fn r#dir_connector_router_route(
2166        &self,
2167        mut router: fidl::EventPair,
2168        mut request: RouteRequest,
2169        mut instance_token: fidl::EventPair,
2170        mut dir_connector: fidl::EventPair,
2171    ) -> Self::DirConnectorRouterRouteResponseFut {
2172        fn _decode(
2173            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2174        ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
2175            let _response = fidl::client::decode_transaction_body::<
2176                fidl::encoding::FlexibleResultType<
2177                    CapabilitiesDirConnectorRouterRouteResponse,
2178                    i32,
2179                >,
2180                fidl::encoding::DefaultFuchsiaResourceDialect,
2181                0x3afdcc1b79e0799d,
2182            >(_buf?)?
2183            .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
2184            Ok(_response.map(|x| x.response))
2185        }
2186        self.client.send_query_and_decode::<
2187            CapabilitiesDirConnectorRouterRouteRequest,
2188            CapabilitiesDirConnectorRouterRouteResult,
2189        >(
2190            (router, &mut request, instance_token, dir_connector,),
2191            0x3afdcc1b79e0799d,
2192            fidl::encoding::DynamicFlags::FLEXIBLE,
2193            _decode,
2194        )
2195    }
2196
2197    type DictionaryRouterRouteResponseFut = fidl::client::QueryResponseFut<
2198        CapabilitiesDictionaryRouterRouteResult,
2199        fidl::encoding::DefaultFuchsiaResourceDialect,
2200    >;
2201    fn r#dictionary_router_route(
2202        &self,
2203        mut router: fidl::EventPair,
2204        mut request: RouteRequest,
2205        mut instance_token: fidl::EventPair,
2206        mut dictionary: fidl::EventPair,
2207    ) -> Self::DictionaryRouterRouteResponseFut {
2208        fn _decode(
2209            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2210        ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
2211            let _response = fidl::client::decode_transaction_body::<
2212                fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
2213                fidl::encoding::DefaultFuchsiaResourceDialect,
2214                0xcf72de10714a708,
2215            >(_buf?)?
2216            .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
2217            Ok(_response.map(|x| x.response))
2218        }
2219        self.client.send_query_and_decode::<
2220            CapabilitiesDictionaryRouterRouteRequest,
2221            CapabilitiesDictionaryRouterRouteResult,
2222        >(
2223            (router, &mut request, instance_token, dictionary,),
2224            0xcf72de10714a708,
2225            fidl::encoding::DynamicFlags::FLEXIBLE,
2226            _decode,
2227        )
2228    }
2229
2230    type DataRouterRouteResponseFut = fidl::client::QueryResponseFut<
2231        CapabilitiesDataRouterRouteResult,
2232        fidl::encoding::DefaultFuchsiaResourceDialect,
2233    >;
2234    fn r#data_router_route(
2235        &self,
2236        mut router: fidl::EventPair,
2237        mut request: RouteRequest,
2238        mut instance_token: fidl::EventPair,
2239        mut data: fidl::EventPair,
2240    ) -> Self::DataRouterRouteResponseFut {
2241        fn _decode(
2242            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2243        ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
2244            let _response = fidl::client::decode_transaction_body::<
2245                fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
2246                fidl::encoding::DefaultFuchsiaResourceDialect,
2247                0x61ab188455ed0643,
2248            >(_buf?)?
2249            .into_result::<CapabilitiesMarker>("data_router_route")?;
2250            Ok(_response.map(|x| x.response))
2251        }
2252        self.client.send_query_and_decode::<
2253            CapabilitiesDataRouterRouteRequest,
2254            CapabilitiesDataRouterRouteResult,
2255        >(
2256            (router, &mut request, instance_token, data,),
2257            0x61ab188455ed0643,
2258            fidl::encoding::DynamicFlags::FLEXIBLE,
2259            _decode,
2260        )
2261    }
2262
2263    type CapabilityAssociateHandleResponseFut = fidl::client::QueryResponseFut<
2264        CapabilitiesCapabilityAssociateHandleResult,
2265        fidl::encoding::DefaultFuchsiaResourceDialect,
2266    >;
2267    fn r#capability_associate_handle(
2268        &self,
2269        mut capability_handle: fidl::EventPair,
2270        mut other_handle: fidl::EventPair,
2271    ) -> Self::CapabilityAssociateHandleResponseFut {
2272        fn _decode(
2273            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2274        ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
2275            let _response = fidl::client::decode_transaction_body::<
2276                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2277                fidl::encoding::DefaultFuchsiaResourceDialect,
2278                0x1d69bb61953d8e7,
2279            >(_buf?)?
2280            .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
2281            Ok(_response.map(|x| x))
2282        }
2283        self.client.send_query_and_decode::<
2284            CapabilitiesCapabilityAssociateHandleRequest,
2285            CapabilitiesCapabilityAssociateHandleResult,
2286        >(
2287            (capability_handle, other_handle,),
2288            0x1d69bb61953d8e7,
2289            fidl::encoding::DynamicFlags::FLEXIBLE,
2290            _decode,
2291        )
2292    }
2293}
2294
2295pub struct CapabilitiesEventStream {
2296    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2297}
2298
2299impl std::marker::Unpin for CapabilitiesEventStream {}
2300
2301impl futures::stream::FusedStream for CapabilitiesEventStream {
2302    fn is_terminated(&self) -> bool {
2303        self.event_receiver.is_terminated()
2304    }
2305}
2306
2307impl futures::Stream for CapabilitiesEventStream {
2308    type Item = Result<CapabilitiesEvent, fidl::Error>;
2309
2310    fn poll_next(
2311        mut self: std::pin::Pin<&mut Self>,
2312        cx: &mut std::task::Context<'_>,
2313    ) -> std::task::Poll<Option<Self::Item>> {
2314        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2315            &mut self.event_receiver,
2316            cx
2317        )?) {
2318            Some(buf) => std::task::Poll::Ready(Some(CapabilitiesEvent::decode(buf))),
2319            None => std::task::Poll::Ready(None),
2320        }
2321    }
2322}
2323
2324#[derive(Debug)]
2325pub enum CapabilitiesEvent {
2326    #[non_exhaustive]
2327    _UnknownEvent {
2328        /// Ordinal of the event that was sent.
2329        ordinal: u64,
2330    },
2331}
2332
2333impl CapabilitiesEvent {
2334    /// Decodes a message buffer as a [`CapabilitiesEvent`].
2335    fn decode(
2336        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2337    ) -> Result<CapabilitiesEvent, fidl::Error> {
2338        let (bytes, _handles) = buf.split_mut();
2339        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2340        debug_assert_eq!(tx_header.tx_id, 0);
2341        match tx_header.ordinal {
2342            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2343                Ok(CapabilitiesEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2344            }
2345            _ => Err(fidl::Error::UnknownOrdinal {
2346                ordinal: tx_header.ordinal,
2347                protocol_name: <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2348            }),
2349        }
2350    }
2351}
2352
2353/// A Stream of incoming requests for fuchsia.component.runtime/Capabilities.
2354pub struct CapabilitiesRequestStream {
2355    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2356    is_terminated: bool,
2357}
2358
2359impl std::marker::Unpin for CapabilitiesRequestStream {}
2360
2361impl futures::stream::FusedStream for CapabilitiesRequestStream {
2362    fn is_terminated(&self) -> bool {
2363        self.is_terminated
2364    }
2365}
2366
2367impl fidl::endpoints::RequestStream for CapabilitiesRequestStream {
2368    type Protocol = CapabilitiesMarker;
2369    type ControlHandle = CapabilitiesControlHandle;
2370
2371    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2372        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2373    }
2374
2375    fn control_handle(&self) -> Self::ControlHandle {
2376        CapabilitiesControlHandle { inner: self.inner.clone() }
2377    }
2378
2379    fn into_inner(
2380        self,
2381    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2382    {
2383        (self.inner, self.is_terminated)
2384    }
2385
2386    fn from_inner(
2387        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2388        is_terminated: bool,
2389    ) -> Self {
2390        Self { inner, is_terminated }
2391    }
2392}
2393
2394impl futures::Stream for CapabilitiesRequestStream {
2395    type Item = Result<CapabilitiesRequest, fidl::Error>;
2396
2397    fn poll_next(
2398        mut self: std::pin::Pin<&mut Self>,
2399        cx: &mut std::task::Context<'_>,
2400    ) -> std::task::Poll<Option<Self::Item>> {
2401        let this = &mut *self;
2402        if this.inner.check_shutdown(cx) {
2403            this.is_terminated = true;
2404            return std::task::Poll::Ready(None);
2405        }
2406        if this.is_terminated {
2407            panic!("polled CapabilitiesRequestStream after completion");
2408        }
2409        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2410            |bytes, handles| {
2411                match this.inner.channel().read_etc(cx, bytes, handles) {
2412                    std::task::Poll::Ready(Ok(())) => {}
2413                    std::task::Poll::Pending => return std::task::Poll::Pending,
2414                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2415                        this.is_terminated = true;
2416                        return std::task::Poll::Ready(None);
2417                    }
2418                    std::task::Poll::Ready(Err(e)) => {
2419                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2420                            e.into(),
2421                        ))));
2422                    }
2423                }
2424
2425                // A message has been received from the channel
2426                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2427
2428                std::task::Poll::Ready(Some(match header.ordinal {
2429                    0xac2bc2dbd7033d1 => {
2430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2431                        let mut req = fidl::new_empty!(
2432                            CapabilitiesConnectorCreateRequest,
2433                            fidl::encoding::DefaultFuchsiaResourceDialect
2434                        );
2435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2436                        let control_handle =
2437                            CapabilitiesControlHandle { inner: this.inner.clone() };
2438                        Ok(CapabilitiesRequest::ConnectorCreate {
2439                            connector: req.connector,
2440                            receiver_client_end: req.receiver_client_end,
2441
2442                            responder: CapabilitiesConnectorCreateResponder {
2443                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2444                                tx_id: header.tx_id,
2445                            },
2446                        })
2447                    }
2448                    0x721911e05da2a3bf => {
2449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2450                        let mut req = fidl::new_empty!(
2451                            CapabilitiesDirConnectorCreateRequest,
2452                            fidl::encoding::DefaultFuchsiaResourceDialect
2453                        );
2454                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2455                        let control_handle =
2456                            CapabilitiesControlHandle { inner: this.inner.clone() };
2457                        Ok(CapabilitiesRequest::DirConnectorCreate {
2458                            dir_connector: req.dir_connector,
2459                            receiver_client_end: req.receiver_client_end,
2460
2461                            responder: CapabilitiesDirConnectorCreateResponder {
2462                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2463                                tx_id: header.tx_id,
2464                            },
2465                        })
2466                    }
2467                    0x7f8bd91f0942a36e => {
2468                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2469                        let mut req = fidl::new_empty!(
2470                            CapabilitiesDictionaryCreateRequest,
2471                            fidl::encoding::DefaultFuchsiaResourceDialect
2472                        );
2473                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2474                        let control_handle =
2475                            CapabilitiesControlHandle { inner: this.inner.clone() };
2476                        Ok(CapabilitiesRequest::DictionaryCreate {
2477                            dictionary: req.dictionary,
2478
2479                            responder: CapabilitiesDictionaryCreateResponder {
2480                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2481                                tx_id: header.tx_id,
2482                            },
2483                        })
2484                    }
2485                    0x40ef43e45372ee6a => {
2486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2487                        let mut req = fidl::new_empty!(
2488                            CapabilitiesDataCreateRequest,
2489                            fidl::encoding::DefaultFuchsiaResourceDialect
2490                        );
2491                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2492                        let control_handle =
2493                            CapabilitiesControlHandle { inner: this.inner.clone() };
2494                        Ok(CapabilitiesRequest::DataCreate {
2495                            data_handle: req.data_handle,
2496                            data: req.data,
2497
2498                            responder: CapabilitiesDataCreateResponder {
2499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2500                                tx_id: header.tx_id,
2501                            },
2502                        })
2503                    }
2504                    0x7f7e7fbafcdf1761 => {
2505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2506                        let mut req = fidl::new_empty!(
2507                            CapabilitiesConnectorRouterCreateRequest,
2508                            fidl::encoding::DefaultFuchsiaResourceDialect
2509                        );
2510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2511                        let control_handle =
2512                            CapabilitiesControlHandle { inner: this.inner.clone() };
2513                        Ok(CapabilitiesRequest::ConnectorRouterCreate {
2514                            router: req.router,
2515                            router_client_end: req.router_client_end,
2516
2517                            responder: CapabilitiesConnectorRouterCreateResponder {
2518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2519                                tx_id: header.tx_id,
2520                            },
2521                        })
2522                    }
2523                    0x56520da453fad19f => {
2524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2525                        let mut req = fidl::new_empty!(
2526                            CapabilitiesDirConnectorRouterCreateRequest,
2527                            fidl::encoding::DefaultFuchsiaResourceDialect
2528                        );
2529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2530                        let control_handle =
2531                            CapabilitiesControlHandle { inner: this.inner.clone() };
2532                        Ok(CapabilitiesRequest::DirConnectorRouterCreate {
2533                            router: req.router,
2534                            router_client_end: req.router_client_end,
2535
2536                            responder: CapabilitiesDirConnectorRouterCreateResponder {
2537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2538                                tx_id: header.tx_id,
2539                            },
2540                        })
2541                    }
2542                    0x37acef18cd423d42 => {
2543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2544                        let mut req = fidl::new_empty!(
2545                            CapabilitiesDictionaryRouterCreateRequest,
2546                            fidl::encoding::DefaultFuchsiaResourceDialect
2547                        );
2548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2549                        let control_handle =
2550                            CapabilitiesControlHandle { inner: this.inner.clone() };
2551                        Ok(CapabilitiesRequest::DictionaryRouterCreate {
2552                            router: req.router,
2553                            router_client_end: req.router_client_end,
2554
2555                            responder: CapabilitiesDictionaryRouterCreateResponder {
2556                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2557                                tx_id: header.tx_id,
2558                            },
2559                        })
2560                    }
2561                    0x24e471395b95088 => {
2562                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2563                        let mut req = fidl::new_empty!(
2564                            CapabilitiesDataRouterCreateRequest,
2565                            fidl::encoding::DefaultFuchsiaResourceDialect
2566                        );
2567                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2568                        let control_handle =
2569                            CapabilitiesControlHandle { inner: this.inner.clone() };
2570                        Ok(CapabilitiesRequest::DataRouterCreate {
2571                            router: req.router,
2572                            router_client_end: req.router_client_end,
2573
2574                            responder: CapabilitiesDataRouterCreateResponder {
2575                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2576                                tx_id: header.tx_id,
2577                            },
2578                        })
2579                    }
2580                    0x3576e31727c40813 => {
2581                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2582                        let mut req = fidl::new_empty!(
2583                            CapabilitiesInstanceTokenCreateRequest,
2584                            fidl::encoding::DefaultFuchsiaResourceDialect
2585                        );
2586                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesInstanceTokenCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2587                        let control_handle =
2588                            CapabilitiesControlHandle { inner: this.inner.clone() };
2589                        Ok(CapabilitiesRequest::InstanceTokenCreate {
2590                            instance_token: req.instance_token,
2591
2592                            responder: CapabilitiesInstanceTokenCreateResponder {
2593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2594                                tx_id: header.tx_id,
2595                            },
2596                        })
2597                    }
2598                    0xc0646965f1884eb => {
2599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2600                        let mut req = fidl::new_empty!(
2601                            CapabilitiesConnectorOpenRequest,
2602                            fidl::encoding::DefaultFuchsiaResourceDialect
2603                        );
2604                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2605                        let control_handle =
2606                            CapabilitiesControlHandle { inner: this.inner.clone() };
2607                        Ok(CapabilitiesRequest::ConnectorOpen {
2608                            connector: req.connector,
2609                            channel: req.channel,
2610
2611                            responder: CapabilitiesConnectorOpenResponder {
2612                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2613                                tx_id: header.tx_id,
2614                            },
2615                        })
2616                    }
2617                    0x1332bbf5debd6c20 => {
2618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2619                        let mut req = fidl::new_empty!(
2620                            CapabilitiesDirConnectorOpenRequest,
2621                            fidl::encoding::DefaultFuchsiaResourceDialect
2622                        );
2623                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2624                        let control_handle =
2625                            CapabilitiesControlHandle { inner: this.inner.clone() };
2626                        Ok(CapabilitiesRequest::DirConnectorOpen {
2627                            payload: req,
2628                            responder: CapabilitiesDirConnectorOpenResponder {
2629                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2630                                tx_id: header.tx_id,
2631                            },
2632                        })
2633                    }
2634                    0x5972e3061a760e7a => {
2635                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2636                        let mut req = fidl::new_empty!(
2637                            CapabilitiesDictionaryInsertRequest,
2638                            fidl::encoding::DefaultFuchsiaResourceDialect
2639                        );
2640                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2641                        let control_handle =
2642                            CapabilitiesControlHandle { inner: this.inner.clone() };
2643                        Ok(CapabilitiesRequest::DictionaryInsert {
2644                            dictionary: req.dictionary,
2645                            key: req.key,
2646                            value: req.value,
2647
2648                            responder: CapabilitiesDictionaryInsertResponder {
2649                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2650                                tx_id: header.tx_id,
2651                            },
2652                        })
2653                    }
2654                    0x31fafe2280a283d5 => {
2655                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2656                        let mut req = fidl::new_empty!(
2657                            CapabilitiesDictionaryGetRequest,
2658                            fidl::encoding::DefaultFuchsiaResourceDialect
2659                        );
2660                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2661                        let control_handle =
2662                            CapabilitiesControlHandle { inner: this.inner.clone() };
2663                        Ok(CapabilitiesRequest::DictionaryGet {
2664                            dictionary: req.dictionary,
2665                            key: req.key,
2666                            value: req.value,
2667
2668                            responder: CapabilitiesDictionaryGetResponder {
2669                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2670                                tx_id: header.tx_id,
2671                            },
2672                        })
2673                    }
2674                    0x6827c83106ac5a2c => {
2675                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2676                        let mut req = fidl::new_empty!(
2677                            CapabilitiesDictionaryRemoveRequest,
2678                            fidl::encoding::DefaultFuchsiaResourceDialect
2679                        );
2680                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2681                        let control_handle =
2682                            CapabilitiesControlHandle { inner: this.inner.clone() };
2683                        Ok(CapabilitiesRequest::DictionaryRemove {
2684                            payload: req,
2685                            responder: CapabilitiesDictionaryRemoveResponder {
2686                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2687                                tx_id: header.tx_id,
2688                            },
2689                        })
2690                    }
2691                    0x3d4ea59c80df9bb8 => {
2692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2693                        let mut req = fidl::new_empty!(
2694                            CapabilitiesDictionaryIterateKeysRequest,
2695                            fidl::encoding::DefaultFuchsiaResourceDialect
2696                        );
2697                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryIterateKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2698                        let control_handle =
2699                            CapabilitiesControlHandle { inner: this.inner.clone() };
2700                        Ok(CapabilitiesRequest::DictionaryIterateKeys {
2701                            dictionary: req.dictionary,
2702                            key_iterator: req.key_iterator,
2703
2704                            responder: CapabilitiesDictionaryIterateKeysResponder {
2705                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2706                                tx_id: header.tx_id,
2707                            },
2708                        })
2709                    }
2710                    0x65ae25b59f9e0daf => {
2711                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2712                        let mut req = fidl::new_empty!(
2713                            CapabilitiesDataGetRequest,
2714                            fidl::encoding::DefaultFuchsiaResourceDialect
2715                        );
2716                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataGetRequest>(&header, _body_bytes, handles, &mut req)?;
2717                        let control_handle =
2718                            CapabilitiesControlHandle { inner: this.inner.clone() };
2719                        Ok(CapabilitiesRequest::DataGet {
2720                            data_handle: req.data_handle,
2721
2722                            responder: CapabilitiesDataGetResponder {
2723                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2724                                tx_id: header.tx_id,
2725                            },
2726                        })
2727                    }
2728                    0x1bd9c6e7e3dd487e => {
2729                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2730                        let mut req = fidl::new_empty!(
2731                            CapabilitiesConnectorRouterRouteRequest,
2732                            fidl::encoding::DefaultFuchsiaResourceDialect
2733                        );
2734                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2735                        let control_handle =
2736                            CapabilitiesControlHandle { inner: this.inner.clone() };
2737                        Ok(CapabilitiesRequest::ConnectorRouterRoute {
2738                            router: req.router,
2739                            request: req.request,
2740                            instance_token: req.instance_token,
2741                            connector: req.connector,
2742
2743                            responder: CapabilitiesConnectorRouterRouteResponder {
2744                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2745                                tx_id: header.tx_id,
2746                            },
2747                        })
2748                    }
2749                    0x3afdcc1b79e0799d => {
2750                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2751                        let mut req = fidl::new_empty!(
2752                            CapabilitiesDirConnectorRouterRouteRequest,
2753                            fidl::encoding::DefaultFuchsiaResourceDialect
2754                        );
2755                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2756                        let control_handle =
2757                            CapabilitiesControlHandle { inner: this.inner.clone() };
2758                        Ok(CapabilitiesRequest::DirConnectorRouterRoute {
2759                            router: req.router,
2760                            request: req.request,
2761                            instance_token: req.instance_token,
2762                            dir_connector: req.dir_connector,
2763
2764                            responder: CapabilitiesDirConnectorRouterRouteResponder {
2765                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2766                                tx_id: header.tx_id,
2767                            },
2768                        })
2769                    }
2770                    0xcf72de10714a708 => {
2771                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2772                        let mut req = fidl::new_empty!(
2773                            CapabilitiesDictionaryRouterRouteRequest,
2774                            fidl::encoding::DefaultFuchsiaResourceDialect
2775                        );
2776                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2777                        let control_handle =
2778                            CapabilitiesControlHandle { inner: this.inner.clone() };
2779                        Ok(CapabilitiesRequest::DictionaryRouterRoute {
2780                            router: req.router,
2781                            request: req.request,
2782                            instance_token: req.instance_token,
2783                            dictionary: req.dictionary,
2784
2785                            responder: CapabilitiesDictionaryRouterRouteResponder {
2786                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2787                                tx_id: header.tx_id,
2788                            },
2789                        })
2790                    }
2791                    0x61ab188455ed0643 => {
2792                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2793                        let mut req = fidl::new_empty!(
2794                            CapabilitiesDataRouterRouteRequest,
2795                            fidl::encoding::DefaultFuchsiaResourceDialect
2796                        );
2797                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2798                        let control_handle =
2799                            CapabilitiesControlHandle { inner: this.inner.clone() };
2800                        Ok(CapabilitiesRequest::DataRouterRoute {
2801                            router: req.router,
2802                            request: req.request,
2803                            instance_token: req.instance_token,
2804                            data: req.data,
2805
2806                            responder: CapabilitiesDataRouterRouteResponder {
2807                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2808                                tx_id: header.tx_id,
2809                            },
2810                        })
2811                    }
2812                    0x1d69bb61953d8e7 => {
2813                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2814                        let mut req = fidl::new_empty!(
2815                            CapabilitiesCapabilityAssociateHandleRequest,
2816                            fidl::encoding::DefaultFuchsiaResourceDialect
2817                        );
2818                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesCapabilityAssociateHandleRequest>(&header, _body_bytes, handles, &mut req)?;
2819                        let control_handle =
2820                            CapabilitiesControlHandle { inner: this.inner.clone() };
2821                        Ok(CapabilitiesRequest::CapabilityAssociateHandle {
2822                            capability_handle: req.capability_handle,
2823                            other_handle: req.other_handle,
2824
2825                            responder: CapabilitiesCapabilityAssociateHandleResponder {
2826                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2827                                tx_id: header.tx_id,
2828                            },
2829                        })
2830                    }
2831                    _ if header.tx_id == 0
2832                        && header
2833                            .dynamic_flags()
2834                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2835                    {
2836                        Ok(CapabilitiesRequest::_UnknownMethod {
2837                            ordinal: header.ordinal,
2838                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2839                            method_type: fidl::MethodType::OneWay,
2840                        })
2841                    }
2842                    _ if header
2843                        .dynamic_flags()
2844                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2845                    {
2846                        this.inner.send_framework_err(
2847                            fidl::encoding::FrameworkErr::UnknownMethod,
2848                            header.tx_id,
2849                            header.ordinal,
2850                            header.dynamic_flags(),
2851                            (bytes, handles),
2852                        )?;
2853                        Ok(CapabilitiesRequest::_UnknownMethod {
2854                            ordinal: header.ordinal,
2855                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2856                            method_type: fidl::MethodType::TwoWay,
2857                        })
2858                    }
2859                    _ => Err(fidl::Error::UnknownOrdinal {
2860                        ordinal: header.ordinal,
2861                        protocol_name:
2862                            <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2863                    }),
2864                }))
2865            },
2866        )
2867    }
2868}
2869
2870/// An API for creating and manipulating references to runtime capabilities in
2871/// the component framework. These capabilities are all reference counted by
2872/// component manager, and when accessed with this protocol the references are
2873/// implemented as event pair handles.
2874#[derive(Debug)]
2875pub enum CapabilitiesRequest {
2876    /// Creates a reference to a new connector capability. When the connector is
2877    /// opened, the channel given to the open call will be sent over
2878    /// `receiver_client_end`.
2879    ///
2880    /// Make sure this method returns before passing the handle's peer to other
2881    /// methods in this API. The creation may not be complete before then.
2882    ConnectorCreate {
2883        connector: fidl::EventPair,
2884        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
2885        responder: CapabilitiesConnectorCreateResponder,
2886    },
2887    /// Creates a reference to a new directory connector capability. When the
2888    /// directory connector is opened, the channel given to the open call will
2889    /// be sent over `receiver_client_end`.
2890    ///
2891    /// Make sure this method returns before passing the handle's peer to other
2892    /// methods in this API. The creation may not be complete before then.
2893    DirConnectorCreate {
2894        dir_connector: fidl::EventPair,
2895        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2896        responder: CapabilitiesDirConnectorCreateResponder,
2897    },
2898    /// Creates a reference to a new dictionary capability.
2899    ///
2900    /// Make sure this method returns before passing the handle's peer to other
2901    /// methods in this API. The creation may not be complete before then.
2902    DictionaryCreate {
2903        dictionary: fidl::EventPair,
2904        responder: CapabilitiesDictionaryCreateResponder,
2905    },
2906    /// Creates a reference to a new data capability with the given value.
2907    ///
2908    /// Make sure this method returns before passing the handle's peer to other
2909    /// methods in this API. The creation may not be complete before then.
2910    DataCreate {
2911        data_handle: fidl::EventPair,
2912        data: Data,
2913        responder: CapabilitiesDataCreateResponder,
2914    },
2915    /// Creates a reference to a new router capability that will return a
2916    /// connector capability when used.
2917    ///
2918    /// Make sure this method returns before passing the handle's peer to other
2919    /// methods in this API. The creation may not be complete before then.
2920    ConnectorRouterCreate {
2921        router: fidl::EventPair,
2922        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
2923        responder: CapabilitiesConnectorRouterCreateResponder,
2924    },
2925    /// Creates a reference to a new router capability that will return a
2926    /// directory connector capability when used.
2927    ///
2928    /// Make sure this method returns before passing the handle's peer to other
2929    /// methods in this API. The creation may not be complete before then.
2930    DirConnectorRouterCreate {
2931        router: fidl::EventPair,
2932        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
2933        responder: CapabilitiesDirConnectorRouterCreateResponder,
2934    },
2935    /// Creates a reference to a new router capability that will return a
2936    /// dictionary capability when used.
2937    ///
2938    /// Make sure this method returns before passing the handle's peer to other
2939    /// methods in this API. The creation may not be complete before then.
2940    DictionaryRouterCreate {
2941        router: fidl::EventPair,
2942        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
2943        responder: CapabilitiesDictionaryRouterCreateResponder,
2944    },
2945    /// Creates a reference to a new router capability that will return a data
2946    /// value when used.
2947    ///
2948    /// Make sure this method returns before passing the handle's peer to other
2949    /// methods in this API. The creation may not be complete before then.
2950    DataRouterCreate {
2951        router: fidl::EventPair,
2952        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
2953        responder: CapabilitiesDataRouterCreateResponder,
2954    },
2955    /// Creates a new instance token, which is an opaque identifier associated
2956    /// with a specific component. This instance token will be associated with
2957    /// the component this connection is opened from.
2958    ///
2959    /// Make sure this method returns before passing the handle's peer to other
2960    /// methods in this API. The creation may not be complete before then.
2961    InstanceTokenCreate {
2962        instance_token: fidl::EventPair,
2963        responder: CapabilitiesInstanceTokenCreateResponder,
2964    },
2965    /// Uses the provided `connector` to open a new connection by delivering
2966    /// this channel to whoever created the connector.
2967    ///
2968    /// If there is an error, it will be reported as a zx.Status epitaph on
2969    /// `channel`.
2970    ///
2971    /// If the `connector` event pair handle is not correlated with a handle
2972    /// given to `ConnectorCreate`, this connection will be closed.
2973    ConnectorOpen {
2974        connector: fidl::EventPair,
2975        channel: fidl::Channel,
2976        responder: CapabilitiesConnectorOpenResponder,
2977    },
2978    /// Uses the provided `dir_connector` to open a new directory connection by
2979    /// delivering this channel to whoever created the directory connector.
2980    ///
2981    /// If there is an error, it will be reported as a zx.Status epitaph on
2982    /// `channel`.
2983    ///
2984    /// If the `dir_connector` event pair handle is not correlated with a handle
2985    /// given to `DirConnectorCreate`, this connection will be closed.
2986    ///
2987    /// `dir_connector` and `channel` are both required. `flags` and `path`
2988    /// may be omitted.
2989    DirConnectorOpen {
2990        payload: CapabilitiesDirConnectorOpenRequest,
2991        responder: CapabilitiesDirConnectorOpenResponder,
2992    },
2993    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
2994    /// Overwrites any existing entry.
2995    DictionaryInsert {
2996        dictionary: fidl::EventPair,
2997        key: String,
2998        value: fidl::EventPair,
2999        responder: CapabilitiesDictionaryInsertResponder,
3000    },
3001    /// Creates a new reference to the `capability` named `key` in this
3002    /// dictionary, if that capability exists. That capability will remain in
3003    /// the dictionary. To take a capability out of the dictionary, use
3004    /// `DictionaryRemove`.
3005    ///
3006    /// If `key` does not exist, `value` will not reference any capability and
3007    /// the `NO_SUCH_CAPABILITY` error value will be returned.
3008    ///
3009    /// Make sure this method returns before passing the handle's peer to other
3010    /// methods in this API. The creation may not be complete before then.
3011    DictionaryGet {
3012        dictionary: fidl::EventPair,
3013        key: String,
3014        value: fidl::EventPair,
3015        responder: CapabilitiesDictionaryGetResponder,
3016    },
3017    /// Removes the `capability` named `key` from this dictionary and returns a
3018    /// reference to it, if that capability exists.
3019    ///
3020    /// `dictionary` and `key` are required. `capability` is optional, and when
3021    /// set will become associated with the capability that was removed from the
3022    /// dictionary.
3023    ///
3024    /// If `key` does not exist, `value` will not reference any capability and
3025    /// the `NO_SUCH_CAPABILITY` error value will be returned.
3026    ///
3027    /// Make sure this method returns before passing the peer of `capability` to
3028    /// other methods in this API. The creation may not be complete before then.
3029    DictionaryRemove {
3030        payload: CapabilitiesDictionaryRemoveRequest,
3031        responder: CapabilitiesDictionaryRemoveResponder,
3032    },
3033    /// Opens an iterator which can be used to iterate over the keys of this
3034    /// dictionary.
3035    DictionaryIterateKeys {
3036        dictionary: fidl::EventPair,
3037        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3038        responder: CapabilitiesDictionaryIterateKeysResponder,
3039    },
3040    /// Returns the `Data` value that was provided to the `DataCreate` call used
3041    /// with `data_handle`.
3042    DataGet { data_handle: fidl::EventPair, responder: CapabilitiesDataGetResponder },
3043    /// Attempts to produce a `Connector` capability from this
3044    /// `ConnectorRouter`.
3045    ///
3046    /// `request` contains context for this route, and `instance_token`
3047    /// references the component that the routing operation is being performed
3048    /// for.
3049    ///
3050    /// This will return:
3051    ///
3052    /// - `SUCCESS` if `connector` has been associated with a connector.
3053    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3054    ///   `connector` will be closed.
3055    /// - An error, if the operation failed.
3056    ConnectorRouterRoute {
3057        router: fidl::EventPair,
3058        request: RouteRequest,
3059        instance_token: fidl::EventPair,
3060        connector: fidl::EventPair,
3061        responder: CapabilitiesConnectorRouterRouteResponder,
3062    },
3063    /// Attempts to produce a `DirConnector` capability from this
3064    /// `DirConnectorRouter`.
3065    ///
3066    /// `request` contains context for this route, and `instance_token`
3067    /// references the component that the routing operation is being performed
3068    /// for.
3069    ///
3070    /// This will return:
3071    ///
3072    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
3073    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3074    ///   `dir_connector` will be closed.
3075    /// - An error, if the operation failed.
3076    DirConnectorRouterRoute {
3077        router: fidl::EventPair,
3078        request: RouteRequest,
3079        instance_token: fidl::EventPair,
3080        dir_connector: fidl::EventPair,
3081        responder: CapabilitiesDirConnectorRouterRouteResponder,
3082    },
3083    /// Attempts to produce a `Dictionary` capability from this
3084    /// `DictionaryRouter`.
3085    ///
3086    /// `request` contains context for this route, and `instance_token`
3087    /// references the component that the routing operation is being performed
3088    /// for.
3089    ///
3090    /// This will return:
3091    ///
3092    /// - `SUCCESS` if `dictionary` has been associated with a connector.
3093    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3094    ///   `dictionary` will be closed.
3095    /// - An error, if the operation failed.
3096    DictionaryRouterRoute {
3097        router: fidl::EventPair,
3098        request: RouteRequest,
3099        instance_token: fidl::EventPair,
3100        dictionary: fidl::EventPair,
3101        responder: CapabilitiesDictionaryRouterRouteResponder,
3102    },
3103    /// Attempts to produce a `Data` capability from this `DataRouter`.
3104    ///
3105    /// `request` contains context for this route, and `instance_token`
3106    /// references the component that the routing operation is being performed
3107    /// for.
3108    ///
3109    /// This will return:
3110    ///
3111    /// - `SUCCESS` if `data` has been associated with a connector.
3112    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
3113    ///   will be closed.
3114    /// - An error, if the operation failed.
3115    DataRouterRoute {
3116        router: fidl::EventPair,
3117        request: RouteRequest,
3118        instance_token: fidl::EventPair,
3119        data: fidl::EventPair,
3120        responder: CapabilitiesDataRouterRouteResponder,
3121    },
3122    /// Associates `other_handle` with the same capability referenced by
3123    /// `capability_handle`.
3124    ///
3125    /// Typically if one already has `capability_handle` the handle can be
3126    /// duplicated to make a new handle that references the same object, but
3127    /// this doesn't work when someone else has provided a handle that should be
3128    /// associated with an existing object.
3129    CapabilityAssociateHandle {
3130        capability_handle: fidl::EventPair,
3131        other_handle: fidl::EventPair,
3132        responder: CapabilitiesCapabilityAssociateHandleResponder,
3133    },
3134    /// An interaction was received which does not match any known method.
3135    #[non_exhaustive]
3136    _UnknownMethod {
3137        /// Ordinal of the method that was called.
3138        ordinal: u64,
3139        control_handle: CapabilitiesControlHandle,
3140        method_type: fidl::MethodType,
3141    },
3142}
3143
3144impl CapabilitiesRequest {
3145    #[allow(irrefutable_let_patterns)]
3146    pub fn into_connector_create(
3147        self,
3148    ) -> Option<(
3149        fidl::EventPair,
3150        fidl::endpoints::ClientEnd<ReceiverMarker>,
3151        CapabilitiesConnectorCreateResponder,
3152    )> {
3153        if let CapabilitiesRequest::ConnectorCreate { connector, receiver_client_end, responder } =
3154            self
3155        {
3156            Some((connector, receiver_client_end, responder))
3157        } else {
3158            None
3159        }
3160    }
3161
3162    #[allow(irrefutable_let_patterns)]
3163    pub fn into_dir_connector_create(
3164        self,
3165    ) -> Option<(
3166        fidl::EventPair,
3167        fidl::endpoints::ClientEnd<DirReceiverMarker>,
3168        CapabilitiesDirConnectorCreateResponder,
3169    )> {
3170        if let CapabilitiesRequest::DirConnectorCreate {
3171            dir_connector,
3172            receiver_client_end,
3173            responder,
3174        } = self
3175        {
3176            Some((dir_connector, receiver_client_end, responder))
3177        } else {
3178            None
3179        }
3180    }
3181
3182    #[allow(irrefutable_let_patterns)]
3183    pub fn into_dictionary_create(
3184        self,
3185    ) -> Option<(fidl::EventPair, CapabilitiesDictionaryCreateResponder)> {
3186        if let CapabilitiesRequest::DictionaryCreate { dictionary, responder } = self {
3187            Some((dictionary, responder))
3188        } else {
3189            None
3190        }
3191    }
3192
3193    #[allow(irrefutable_let_patterns)]
3194    pub fn into_data_create(
3195        self,
3196    ) -> Option<(fidl::EventPair, Data, CapabilitiesDataCreateResponder)> {
3197        if let CapabilitiesRequest::DataCreate { data_handle, data, responder } = self {
3198            Some((data_handle, data, responder))
3199        } else {
3200            None
3201        }
3202    }
3203
3204    #[allow(irrefutable_let_patterns)]
3205    pub fn into_connector_router_create(
3206        self,
3207    ) -> Option<(
3208        fidl::EventPair,
3209        fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
3210        CapabilitiesConnectorRouterCreateResponder,
3211    )> {
3212        if let CapabilitiesRequest::ConnectorRouterCreate { router, router_client_end, responder } =
3213            self
3214        {
3215            Some((router, router_client_end, responder))
3216        } else {
3217            None
3218        }
3219    }
3220
3221    #[allow(irrefutable_let_patterns)]
3222    pub fn into_dir_connector_router_create(
3223        self,
3224    ) -> Option<(
3225        fidl::EventPair,
3226        fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
3227        CapabilitiesDirConnectorRouterCreateResponder,
3228    )> {
3229        if let CapabilitiesRequest::DirConnectorRouterCreate {
3230            router,
3231            router_client_end,
3232            responder,
3233        } = self
3234        {
3235            Some((router, router_client_end, responder))
3236        } else {
3237            None
3238        }
3239    }
3240
3241    #[allow(irrefutable_let_patterns)]
3242    pub fn into_dictionary_router_create(
3243        self,
3244    ) -> Option<(
3245        fidl::EventPair,
3246        fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
3247        CapabilitiesDictionaryRouterCreateResponder,
3248    )> {
3249        if let CapabilitiesRequest::DictionaryRouterCreate {
3250            router,
3251            router_client_end,
3252            responder,
3253        } = self
3254        {
3255            Some((router, router_client_end, responder))
3256        } else {
3257            None
3258        }
3259    }
3260
3261    #[allow(irrefutable_let_patterns)]
3262    pub fn into_data_router_create(
3263        self,
3264    ) -> Option<(
3265        fidl::EventPair,
3266        fidl::endpoints::ClientEnd<DataRouterMarker>,
3267        CapabilitiesDataRouterCreateResponder,
3268    )> {
3269        if let CapabilitiesRequest::DataRouterCreate { router, router_client_end, responder } = self
3270        {
3271            Some((router, router_client_end, responder))
3272        } else {
3273            None
3274        }
3275    }
3276
3277    #[allow(irrefutable_let_patterns)]
3278    pub fn into_instance_token_create(
3279        self,
3280    ) -> Option<(fidl::EventPair, CapabilitiesInstanceTokenCreateResponder)> {
3281        if let CapabilitiesRequest::InstanceTokenCreate { instance_token, responder } = self {
3282            Some((instance_token, responder))
3283        } else {
3284            None
3285        }
3286    }
3287
3288    #[allow(irrefutable_let_patterns)]
3289    pub fn into_connector_open(
3290        self,
3291    ) -> Option<(fidl::EventPair, fidl::Channel, CapabilitiesConnectorOpenResponder)> {
3292        if let CapabilitiesRequest::ConnectorOpen { connector, channel, responder } = self {
3293            Some((connector, channel, responder))
3294        } else {
3295            None
3296        }
3297    }
3298
3299    #[allow(irrefutable_let_patterns)]
3300    pub fn into_dir_connector_open(
3301        self,
3302    ) -> Option<(CapabilitiesDirConnectorOpenRequest, CapabilitiesDirConnectorOpenResponder)> {
3303        if let CapabilitiesRequest::DirConnectorOpen { payload, responder } = self {
3304            Some((payload, responder))
3305        } else {
3306            None
3307        }
3308    }
3309
3310    #[allow(irrefutable_let_patterns)]
3311    pub fn into_dictionary_insert(
3312        self,
3313    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryInsertResponder)>
3314    {
3315        if let CapabilitiesRequest::DictionaryInsert { dictionary, key, value, responder } = self {
3316            Some((dictionary, key, value, responder))
3317        } else {
3318            None
3319        }
3320    }
3321
3322    #[allow(irrefutable_let_patterns)]
3323    pub fn into_dictionary_get(
3324        self,
3325    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryGetResponder)>
3326    {
3327        if let CapabilitiesRequest::DictionaryGet { dictionary, key, value, responder } = self {
3328            Some((dictionary, key, value, responder))
3329        } else {
3330            None
3331        }
3332    }
3333
3334    #[allow(irrefutable_let_patterns)]
3335    pub fn into_dictionary_remove(
3336        self,
3337    ) -> Option<(CapabilitiesDictionaryRemoveRequest, CapabilitiesDictionaryRemoveResponder)> {
3338        if let CapabilitiesRequest::DictionaryRemove { payload, responder } = self {
3339            Some((payload, responder))
3340        } else {
3341            None
3342        }
3343    }
3344
3345    #[allow(irrefutable_let_patterns)]
3346    pub fn into_dictionary_iterate_keys(
3347        self,
3348    ) -> Option<(
3349        fidl::EventPair,
3350        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3351        CapabilitiesDictionaryIterateKeysResponder,
3352    )> {
3353        if let CapabilitiesRequest::DictionaryIterateKeys { dictionary, key_iterator, responder } =
3354            self
3355        {
3356            Some((dictionary, key_iterator, responder))
3357        } else {
3358            None
3359        }
3360    }
3361
3362    #[allow(irrefutable_let_patterns)]
3363    pub fn into_data_get(self) -> Option<(fidl::EventPair, CapabilitiesDataGetResponder)> {
3364        if let CapabilitiesRequest::DataGet { data_handle, responder } = self {
3365            Some((data_handle, responder))
3366        } else {
3367            None
3368        }
3369    }
3370
3371    #[allow(irrefutable_let_patterns)]
3372    pub fn into_connector_router_route(
3373        self,
3374    ) -> Option<(
3375        fidl::EventPair,
3376        RouteRequest,
3377        fidl::EventPair,
3378        fidl::EventPair,
3379        CapabilitiesConnectorRouterRouteResponder,
3380    )> {
3381        if let CapabilitiesRequest::ConnectorRouterRoute {
3382            router,
3383            request,
3384            instance_token,
3385            connector,
3386            responder,
3387        } = self
3388        {
3389            Some((router, request, instance_token, connector, responder))
3390        } else {
3391            None
3392        }
3393    }
3394
3395    #[allow(irrefutable_let_patterns)]
3396    pub fn into_dir_connector_router_route(
3397        self,
3398    ) -> Option<(
3399        fidl::EventPair,
3400        RouteRequest,
3401        fidl::EventPair,
3402        fidl::EventPair,
3403        CapabilitiesDirConnectorRouterRouteResponder,
3404    )> {
3405        if let CapabilitiesRequest::DirConnectorRouterRoute {
3406            router,
3407            request,
3408            instance_token,
3409            dir_connector,
3410            responder,
3411        } = self
3412        {
3413            Some((router, request, instance_token, dir_connector, responder))
3414        } else {
3415            None
3416        }
3417    }
3418
3419    #[allow(irrefutable_let_patterns)]
3420    pub fn into_dictionary_router_route(
3421        self,
3422    ) -> Option<(
3423        fidl::EventPair,
3424        RouteRequest,
3425        fidl::EventPair,
3426        fidl::EventPair,
3427        CapabilitiesDictionaryRouterRouteResponder,
3428    )> {
3429        if let CapabilitiesRequest::DictionaryRouterRoute {
3430            router,
3431            request,
3432            instance_token,
3433            dictionary,
3434            responder,
3435        } = self
3436        {
3437            Some((router, request, instance_token, dictionary, responder))
3438        } else {
3439            None
3440        }
3441    }
3442
3443    #[allow(irrefutable_let_patterns)]
3444    pub fn into_data_router_route(
3445        self,
3446    ) -> Option<(
3447        fidl::EventPair,
3448        RouteRequest,
3449        fidl::EventPair,
3450        fidl::EventPair,
3451        CapabilitiesDataRouterRouteResponder,
3452    )> {
3453        if let CapabilitiesRequest::DataRouterRoute {
3454            router,
3455            request,
3456            instance_token,
3457            data,
3458            responder,
3459        } = self
3460        {
3461            Some((router, request, instance_token, data, responder))
3462        } else {
3463            None
3464        }
3465    }
3466
3467    #[allow(irrefutable_let_patterns)]
3468    pub fn into_capability_associate_handle(
3469        self,
3470    ) -> Option<(fidl::EventPair, fidl::EventPair, CapabilitiesCapabilityAssociateHandleResponder)>
3471    {
3472        if let CapabilitiesRequest::CapabilityAssociateHandle {
3473            capability_handle,
3474            other_handle,
3475            responder,
3476        } = self
3477        {
3478            Some((capability_handle, other_handle, responder))
3479        } else {
3480            None
3481        }
3482    }
3483
3484    /// Name of the method defined in FIDL
3485    pub fn method_name(&self) -> &'static str {
3486        match *self {
3487            CapabilitiesRequest::ConnectorCreate { .. } => "connector_create",
3488            CapabilitiesRequest::DirConnectorCreate { .. } => "dir_connector_create",
3489            CapabilitiesRequest::DictionaryCreate { .. } => "dictionary_create",
3490            CapabilitiesRequest::DataCreate { .. } => "data_create",
3491            CapabilitiesRequest::ConnectorRouterCreate { .. } => "connector_router_create",
3492            CapabilitiesRequest::DirConnectorRouterCreate { .. } => "dir_connector_router_create",
3493            CapabilitiesRequest::DictionaryRouterCreate { .. } => "dictionary_router_create",
3494            CapabilitiesRequest::DataRouterCreate { .. } => "data_router_create",
3495            CapabilitiesRequest::InstanceTokenCreate { .. } => "instance_token_create",
3496            CapabilitiesRequest::ConnectorOpen { .. } => "connector_open",
3497            CapabilitiesRequest::DirConnectorOpen { .. } => "dir_connector_open",
3498            CapabilitiesRequest::DictionaryInsert { .. } => "dictionary_insert",
3499            CapabilitiesRequest::DictionaryGet { .. } => "dictionary_get",
3500            CapabilitiesRequest::DictionaryRemove { .. } => "dictionary_remove",
3501            CapabilitiesRequest::DictionaryIterateKeys { .. } => "dictionary_iterate_keys",
3502            CapabilitiesRequest::DataGet { .. } => "data_get",
3503            CapabilitiesRequest::ConnectorRouterRoute { .. } => "connector_router_route",
3504            CapabilitiesRequest::DirConnectorRouterRoute { .. } => "dir_connector_router_route",
3505            CapabilitiesRequest::DictionaryRouterRoute { .. } => "dictionary_router_route",
3506            CapabilitiesRequest::DataRouterRoute { .. } => "data_router_route",
3507            CapabilitiesRequest::CapabilityAssociateHandle { .. } => "capability_associate_handle",
3508            CapabilitiesRequest::_UnknownMethod {
3509                method_type: fidl::MethodType::OneWay, ..
3510            } => "unknown one-way method",
3511            CapabilitiesRequest::_UnknownMethod {
3512                method_type: fidl::MethodType::TwoWay, ..
3513            } => "unknown two-way method",
3514        }
3515    }
3516}
3517
3518#[derive(Debug, Clone)]
3519pub struct CapabilitiesControlHandle {
3520    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3521}
3522
3523impl fidl::endpoints::ControlHandle for CapabilitiesControlHandle {
3524    fn shutdown(&self) {
3525        self.inner.shutdown()
3526    }
3527
3528    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3529        self.inner.shutdown_with_epitaph(status)
3530    }
3531
3532    fn is_closed(&self) -> bool {
3533        self.inner.channel().is_closed()
3534    }
3535    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3536        self.inner.channel().on_closed()
3537    }
3538
3539    #[cfg(target_os = "fuchsia")]
3540    fn signal_peer(
3541        &self,
3542        clear_mask: zx::Signals,
3543        set_mask: zx::Signals,
3544    ) -> Result<(), zx_status::Status> {
3545        use fidl::Peered;
3546        self.inner.channel().signal_peer(clear_mask, set_mask)
3547    }
3548}
3549
3550impl CapabilitiesControlHandle {}
3551
3552#[must_use = "FIDL methods require a response to be sent"]
3553#[derive(Debug)]
3554pub struct CapabilitiesConnectorCreateResponder {
3555    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3556    tx_id: u32,
3557}
3558
3559/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3560/// if the responder is dropped without sending a response, so that the client
3561/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3562impl std::ops::Drop for CapabilitiesConnectorCreateResponder {
3563    fn drop(&mut self) {
3564        self.control_handle.shutdown();
3565        // Safety: drops once, never accessed again
3566        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3567    }
3568}
3569
3570impl fidl::endpoints::Responder for CapabilitiesConnectorCreateResponder {
3571    type ControlHandle = CapabilitiesControlHandle;
3572
3573    fn control_handle(&self) -> &CapabilitiesControlHandle {
3574        &self.control_handle
3575    }
3576
3577    fn drop_without_shutdown(mut self) {
3578        // Safety: drops once, never accessed again due to mem::forget
3579        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3580        // Prevent Drop from running (which would shut down the channel)
3581        std::mem::forget(self);
3582    }
3583}
3584
3585impl CapabilitiesConnectorCreateResponder {
3586    /// Sends a response to the FIDL transaction.
3587    ///
3588    /// Sets the channel to shutdown if an error occurs.
3589    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3590        let _result = self.send_raw(result);
3591        if _result.is_err() {
3592            self.control_handle.shutdown();
3593        }
3594        self.drop_without_shutdown();
3595        _result
3596    }
3597
3598    /// Similar to "send" but does not shutdown the channel if an error occurs.
3599    pub fn send_no_shutdown_on_err(
3600        self,
3601        mut result: Result<(), CapabilitiesError>,
3602    ) -> Result<(), fidl::Error> {
3603        let _result = self.send_raw(result);
3604        self.drop_without_shutdown();
3605        _result
3606    }
3607
3608    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3609        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3610            fidl::encoding::EmptyStruct,
3611            CapabilitiesError,
3612        >>(
3613            fidl::encoding::FlexibleResult::new(result),
3614            self.tx_id,
3615            0xac2bc2dbd7033d1,
3616            fidl::encoding::DynamicFlags::FLEXIBLE,
3617        )
3618    }
3619}
3620
3621#[must_use = "FIDL methods require a response to be sent"]
3622#[derive(Debug)]
3623pub struct CapabilitiesDirConnectorCreateResponder {
3624    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3625    tx_id: u32,
3626}
3627
3628/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3629/// if the responder is dropped without sending a response, so that the client
3630/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3631impl std::ops::Drop for CapabilitiesDirConnectorCreateResponder {
3632    fn drop(&mut self) {
3633        self.control_handle.shutdown();
3634        // Safety: drops once, never accessed again
3635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3636    }
3637}
3638
3639impl fidl::endpoints::Responder for CapabilitiesDirConnectorCreateResponder {
3640    type ControlHandle = CapabilitiesControlHandle;
3641
3642    fn control_handle(&self) -> &CapabilitiesControlHandle {
3643        &self.control_handle
3644    }
3645
3646    fn drop_without_shutdown(mut self) {
3647        // Safety: drops once, never accessed again due to mem::forget
3648        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3649        // Prevent Drop from running (which would shut down the channel)
3650        std::mem::forget(self);
3651    }
3652}
3653
3654impl CapabilitiesDirConnectorCreateResponder {
3655    /// Sends a response to the FIDL transaction.
3656    ///
3657    /// Sets the channel to shutdown if an error occurs.
3658    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3659        let _result = self.send_raw(result);
3660        if _result.is_err() {
3661            self.control_handle.shutdown();
3662        }
3663        self.drop_without_shutdown();
3664        _result
3665    }
3666
3667    /// Similar to "send" but does not shutdown the channel if an error occurs.
3668    pub fn send_no_shutdown_on_err(
3669        self,
3670        mut result: Result<(), CapabilitiesError>,
3671    ) -> Result<(), fidl::Error> {
3672        let _result = self.send_raw(result);
3673        self.drop_without_shutdown();
3674        _result
3675    }
3676
3677    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3678        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3679            fidl::encoding::EmptyStruct,
3680            CapabilitiesError,
3681        >>(
3682            fidl::encoding::FlexibleResult::new(result),
3683            self.tx_id,
3684            0x721911e05da2a3bf,
3685            fidl::encoding::DynamicFlags::FLEXIBLE,
3686        )
3687    }
3688}
3689
3690#[must_use = "FIDL methods require a response to be sent"]
3691#[derive(Debug)]
3692pub struct CapabilitiesDictionaryCreateResponder {
3693    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3694    tx_id: u32,
3695}
3696
3697/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3698/// if the responder is dropped without sending a response, so that the client
3699/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3700impl std::ops::Drop for CapabilitiesDictionaryCreateResponder {
3701    fn drop(&mut self) {
3702        self.control_handle.shutdown();
3703        // Safety: drops once, never accessed again
3704        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3705    }
3706}
3707
3708impl fidl::endpoints::Responder for CapabilitiesDictionaryCreateResponder {
3709    type ControlHandle = CapabilitiesControlHandle;
3710
3711    fn control_handle(&self) -> &CapabilitiesControlHandle {
3712        &self.control_handle
3713    }
3714
3715    fn drop_without_shutdown(mut self) {
3716        // Safety: drops once, never accessed again due to mem::forget
3717        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3718        // Prevent Drop from running (which would shut down the channel)
3719        std::mem::forget(self);
3720    }
3721}
3722
3723impl CapabilitiesDictionaryCreateResponder {
3724    /// Sends a response to the FIDL transaction.
3725    ///
3726    /// Sets the channel to shutdown if an error occurs.
3727    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3728        let _result = self.send_raw(result);
3729        if _result.is_err() {
3730            self.control_handle.shutdown();
3731        }
3732        self.drop_without_shutdown();
3733        _result
3734    }
3735
3736    /// Similar to "send" but does not shutdown the channel if an error occurs.
3737    pub fn send_no_shutdown_on_err(
3738        self,
3739        mut result: Result<(), CapabilitiesError>,
3740    ) -> Result<(), fidl::Error> {
3741        let _result = self.send_raw(result);
3742        self.drop_without_shutdown();
3743        _result
3744    }
3745
3746    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3747        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3748            fidl::encoding::EmptyStruct,
3749            CapabilitiesError,
3750        >>(
3751            fidl::encoding::FlexibleResult::new(result),
3752            self.tx_id,
3753            0x7f8bd91f0942a36e,
3754            fidl::encoding::DynamicFlags::FLEXIBLE,
3755        )
3756    }
3757}
3758
3759#[must_use = "FIDL methods require a response to be sent"]
3760#[derive(Debug)]
3761pub struct CapabilitiesDataCreateResponder {
3762    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3763    tx_id: u32,
3764}
3765
3766/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3767/// if the responder is dropped without sending a response, so that the client
3768/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3769impl std::ops::Drop for CapabilitiesDataCreateResponder {
3770    fn drop(&mut self) {
3771        self.control_handle.shutdown();
3772        // Safety: drops once, never accessed again
3773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3774    }
3775}
3776
3777impl fidl::endpoints::Responder for CapabilitiesDataCreateResponder {
3778    type ControlHandle = CapabilitiesControlHandle;
3779
3780    fn control_handle(&self) -> &CapabilitiesControlHandle {
3781        &self.control_handle
3782    }
3783
3784    fn drop_without_shutdown(mut self) {
3785        // Safety: drops once, never accessed again due to mem::forget
3786        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3787        // Prevent Drop from running (which would shut down the channel)
3788        std::mem::forget(self);
3789    }
3790}
3791
3792impl CapabilitiesDataCreateResponder {
3793    /// Sends a response to the FIDL transaction.
3794    ///
3795    /// Sets the channel to shutdown if an error occurs.
3796    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3797        let _result = self.send_raw(result);
3798        if _result.is_err() {
3799            self.control_handle.shutdown();
3800        }
3801        self.drop_without_shutdown();
3802        _result
3803    }
3804
3805    /// Similar to "send" but does not shutdown the channel if an error occurs.
3806    pub fn send_no_shutdown_on_err(
3807        self,
3808        mut result: Result<(), CapabilitiesError>,
3809    ) -> Result<(), fidl::Error> {
3810        let _result = self.send_raw(result);
3811        self.drop_without_shutdown();
3812        _result
3813    }
3814
3815    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3816        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3817            fidl::encoding::EmptyStruct,
3818            CapabilitiesError,
3819        >>(
3820            fidl::encoding::FlexibleResult::new(result),
3821            self.tx_id,
3822            0x40ef43e45372ee6a,
3823            fidl::encoding::DynamicFlags::FLEXIBLE,
3824        )
3825    }
3826}
3827
3828#[must_use = "FIDL methods require a response to be sent"]
3829#[derive(Debug)]
3830pub struct CapabilitiesConnectorRouterCreateResponder {
3831    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3832    tx_id: u32,
3833}
3834
3835/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3836/// if the responder is dropped without sending a response, so that the client
3837/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3838impl std::ops::Drop for CapabilitiesConnectorRouterCreateResponder {
3839    fn drop(&mut self) {
3840        self.control_handle.shutdown();
3841        // Safety: drops once, never accessed again
3842        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3843    }
3844}
3845
3846impl fidl::endpoints::Responder for CapabilitiesConnectorRouterCreateResponder {
3847    type ControlHandle = CapabilitiesControlHandle;
3848
3849    fn control_handle(&self) -> &CapabilitiesControlHandle {
3850        &self.control_handle
3851    }
3852
3853    fn drop_without_shutdown(mut self) {
3854        // Safety: drops once, never accessed again due to mem::forget
3855        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3856        // Prevent Drop from running (which would shut down the channel)
3857        std::mem::forget(self);
3858    }
3859}
3860
3861impl CapabilitiesConnectorRouterCreateResponder {
3862    /// Sends a response to the FIDL transaction.
3863    ///
3864    /// Sets the channel to shutdown if an error occurs.
3865    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3866        let _result = self.send_raw(result);
3867        if _result.is_err() {
3868            self.control_handle.shutdown();
3869        }
3870        self.drop_without_shutdown();
3871        _result
3872    }
3873
3874    /// Similar to "send" but does not shutdown the channel if an error occurs.
3875    pub fn send_no_shutdown_on_err(
3876        self,
3877        mut result: Result<(), CapabilitiesError>,
3878    ) -> Result<(), fidl::Error> {
3879        let _result = self.send_raw(result);
3880        self.drop_without_shutdown();
3881        _result
3882    }
3883
3884    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3885        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3886            fidl::encoding::EmptyStruct,
3887            CapabilitiesError,
3888        >>(
3889            fidl::encoding::FlexibleResult::new(result),
3890            self.tx_id,
3891            0x7f7e7fbafcdf1761,
3892            fidl::encoding::DynamicFlags::FLEXIBLE,
3893        )
3894    }
3895}
3896
3897#[must_use = "FIDL methods require a response to be sent"]
3898#[derive(Debug)]
3899pub struct CapabilitiesDirConnectorRouterCreateResponder {
3900    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3901    tx_id: u32,
3902}
3903
3904/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3905/// if the responder is dropped without sending a response, so that the client
3906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3907impl std::ops::Drop for CapabilitiesDirConnectorRouterCreateResponder {
3908    fn drop(&mut self) {
3909        self.control_handle.shutdown();
3910        // Safety: drops once, never accessed again
3911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3912    }
3913}
3914
3915impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterCreateResponder {
3916    type ControlHandle = CapabilitiesControlHandle;
3917
3918    fn control_handle(&self) -> &CapabilitiesControlHandle {
3919        &self.control_handle
3920    }
3921
3922    fn drop_without_shutdown(mut self) {
3923        // Safety: drops once, never accessed again due to mem::forget
3924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3925        // Prevent Drop from running (which would shut down the channel)
3926        std::mem::forget(self);
3927    }
3928}
3929
3930impl CapabilitiesDirConnectorRouterCreateResponder {
3931    /// Sends a response to the FIDL transaction.
3932    ///
3933    /// Sets the channel to shutdown if an error occurs.
3934    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3935        let _result = self.send_raw(result);
3936        if _result.is_err() {
3937            self.control_handle.shutdown();
3938        }
3939        self.drop_without_shutdown();
3940        _result
3941    }
3942
3943    /// Similar to "send" but does not shutdown the channel if an error occurs.
3944    pub fn send_no_shutdown_on_err(
3945        self,
3946        mut result: Result<(), CapabilitiesError>,
3947    ) -> Result<(), fidl::Error> {
3948        let _result = self.send_raw(result);
3949        self.drop_without_shutdown();
3950        _result
3951    }
3952
3953    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3954        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3955            fidl::encoding::EmptyStruct,
3956            CapabilitiesError,
3957        >>(
3958            fidl::encoding::FlexibleResult::new(result),
3959            self.tx_id,
3960            0x56520da453fad19f,
3961            fidl::encoding::DynamicFlags::FLEXIBLE,
3962        )
3963    }
3964}
3965
3966#[must_use = "FIDL methods require a response to be sent"]
3967#[derive(Debug)]
3968pub struct CapabilitiesDictionaryRouterCreateResponder {
3969    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3970    tx_id: u32,
3971}
3972
3973/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3974/// if the responder is dropped without sending a response, so that the client
3975/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3976impl std::ops::Drop for CapabilitiesDictionaryRouterCreateResponder {
3977    fn drop(&mut self) {
3978        self.control_handle.shutdown();
3979        // Safety: drops once, never accessed again
3980        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3981    }
3982}
3983
3984impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterCreateResponder {
3985    type ControlHandle = CapabilitiesControlHandle;
3986
3987    fn control_handle(&self) -> &CapabilitiesControlHandle {
3988        &self.control_handle
3989    }
3990
3991    fn drop_without_shutdown(mut self) {
3992        // Safety: drops once, never accessed again due to mem::forget
3993        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3994        // Prevent Drop from running (which would shut down the channel)
3995        std::mem::forget(self);
3996    }
3997}
3998
3999impl CapabilitiesDictionaryRouterCreateResponder {
4000    /// Sends a response to the FIDL transaction.
4001    ///
4002    /// Sets the channel to shutdown if an error occurs.
4003    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4004        let _result = self.send_raw(result);
4005        if _result.is_err() {
4006            self.control_handle.shutdown();
4007        }
4008        self.drop_without_shutdown();
4009        _result
4010    }
4011
4012    /// Similar to "send" but does not shutdown the channel if an error occurs.
4013    pub fn send_no_shutdown_on_err(
4014        self,
4015        mut result: Result<(), CapabilitiesError>,
4016    ) -> Result<(), fidl::Error> {
4017        let _result = self.send_raw(result);
4018        self.drop_without_shutdown();
4019        _result
4020    }
4021
4022    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4023        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4024            fidl::encoding::EmptyStruct,
4025            CapabilitiesError,
4026        >>(
4027            fidl::encoding::FlexibleResult::new(result),
4028            self.tx_id,
4029            0x37acef18cd423d42,
4030            fidl::encoding::DynamicFlags::FLEXIBLE,
4031        )
4032    }
4033}
4034
4035#[must_use = "FIDL methods require a response to be sent"]
4036#[derive(Debug)]
4037pub struct CapabilitiesDataRouterCreateResponder {
4038    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4039    tx_id: u32,
4040}
4041
4042/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4043/// if the responder is dropped without sending a response, so that the client
4044/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4045impl std::ops::Drop for CapabilitiesDataRouterCreateResponder {
4046    fn drop(&mut self) {
4047        self.control_handle.shutdown();
4048        // Safety: drops once, never accessed again
4049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4050    }
4051}
4052
4053impl fidl::endpoints::Responder for CapabilitiesDataRouterCreateResponder {
4054    type ControlHandle = CapabilitiesControlHandle;
4055
4056    fn control_handle(&self) -> &CapabilitiesControlHandle {
4057        &self.control_handle
4058    }
4059
4060    fn drop_without_shutdown(mut self) {
4061        // Safety: drops once, never accessed again due to mem::forget
4062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4063        // Prevent Drop from running (which would shut down the channel)
4064        std::mem::forget(self);
4065    }
4066}
4067
4068impl CapabilitiesDataRouterCreateResponder {
4069    /// Sends a response to the FIDL transaction.
4070    ///
4071    /// Sets the channel to shutdown if an error occurs.
4072    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4073        let _result = self.send_raw(result);
4074        if _result.is_err() {
4075            self.control_handle.shutdown();
4076        }
4077        self.drop_without_shutdown();
4078        _result
4079    }
4080
4081    /// Similar to "send" but does not shutdown the channel if an error occurs.
4082    pub fn send_no_shutdown_on_err(
4083        self,
4084        mut result: Result<(), CapabilitiesError>,
4085    ) -> Result<(), fidl::Error> {
4086        let _result = self.send_raw(result);
4087        self.drop_without_shutdown();
4088        _result
4089    }
4090
4091    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4092        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4093            fidl::encoding::EmptyStruct,
4094            CapabilitiesError,
4095        >>(
4096            fidl::encoding::FlexibleResult::new(result),
4097            self.tx_id,
4098            0x24e471395b95088,
4099            fidl::encoding::DynamicFlags::FLEXIBLE,
4100        )
4101    }
4102}
4103
4104#[must_use = "FIDL methods require a response to be sent"]
4105#[derive(Debug)]
4106pub struct CapabilitiesInstanceTokenCreateResponder {
4107    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4108    tx_id: u32,
4109}
4110
4111/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4112/// if the responder is dropped without sending a response, so that the client
4113/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4114impl std::ops::Drop for CapabilitiesInstanceTokenCreateResponder {
4115    fn drop(&mut self) {
4116        self.control_handle.shutdown();
4117        // Safety: drops once, never accessed again
4118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4119    }
4120}
4121
4122impl fidl::endpoints::Responder for CapabilitiesInstanceTokenCreateResponder {
4123    type ControlHandle = CapabilitiesControlHandle;
4124
4125    fn control_handle(&self) -> &CapabilitiesControlHandle {
4126        &self.control_handle
4127    }
4128
4129    fn drop_without_shutdown(mut self) {
4130        // Safety: drops once, never accessed again due to mem::forget
4131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4132        // Prevent Drop from running (which would shut down the channel)
4133        std::mem::forget(self);
4134    }
4135}
4136
4137impl CapabilitiesInstanceTokenCreateResponder {
4138    /// Sends a response to the FIDL transaction.
4139    ///
4140    /// Sets the channel to shutdown if an error occurs.
4141    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4142        let _result = self.send_raw(result);
4143        if _result.is_err() {
4144            self.control_handle.shutdown();
4145        }
4146        self.drop_without_shutdown();
4147        _result
4148    }
4149
4150    /// Similar to "send" but does not shutdown the channel if an error occurs.
4151    pub fn send_no_shutdown_on_err(
4152        self,
4153        mut result: Result<(), CapabilitiesError>,
4154    ) -> Result<(), fidl::Error> {
4155        let _result = self.send_raw(result);
4156        self.drop_without_shutdown();
4157        _result
4158    }
4159
4160    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4161        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4162            fidl::encoding::EmptyStruct,
4163            CapabilitiesError,
4164        >>(
4165            fidl::encoding::FlexibleResult::new(result),
4166            self.tx_id,
4167            0x3576e31727c40813,
4168            fidl::encoding::DynamicFlags::FLEXIBLE,
4169        )
4170    }
4171}
4172
4173#[must_use = "FIDL methods require a response to be sent"]
4174#[derive(Debug)]
4175pub struct CapabilitiesConnectorOpenResponder {
4176    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4177    tx_id: u32,
4178}
4179
4180/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4181/// if the responder is dropped without sending a response, so that the client
4182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4183impl std::ops::Drop for CapabilitiesConnectorOpenResponder {
4184    fn drop(&mut self) {
4185        self.control_handle.shutdown();
4186        // Safety: drops once, never accessed again
4187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4188    }
4189}
4190
4191impl fidl::endpoints::Responder for CapabilitiesConnectorOpenResponder {
4192    type ControlHandle = CapabilitiesControlHandle;
4193
4194    fn control_handle(&self) -> &CapabilitiesControlHandle {
4195        &self.control_handle
4196    }
4197
4198    fn drop_without_shutdown(mut self) {
4199        // Safety: drops once, never accessed again due to mem::forget
4200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4201        // Prevent Drop from running (which would shut down the channel)
4202        std::mem::forget(self);
4203    }
4204}
4205
4206impl CapabilitiesConnectorOpenResponder {
4207    /// Sends a response to the FIDL transaction.
4208    ///
4209    /// Sets the channel to shutdown if an error occurs.
4210    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4211        let _result = self.send_raw(result);
4212        if _result.is_err() {
4213            self.control_handle.shutdown();
4214        }
4215        self.drop_without_shutdown();
4216        _result
4217    }
4218
4219    /// Similar to "send" but does not shutdown the channel if an error occurs.
4220    pub fn send_no_shutdown_on_err(
4221        self,
4222        mut result: Result<(), CapabilitiesError>,
4223    ) -> Result<(), fidl::Error> {
4224        let _result = self.send_raw(result);
4225        self.drop_without_shutdown();
4226        _result
4227    }
4228
4229    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4230        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4231            fidl::encoding::EmptyStruct,
4232            CapabilitiesError,
4233        >>(
4234            fidl::encoding::FlexibleResult::new(result),
4235            self.tx_id,
4236            0xc0646965f1884eb,
4237            fidl::encoding::DynamicFlags::FLEXIBLE,
4238        )
4239    }
4240}
4241
4242#[must_use = "FIDL methods require a response to be sent"]
4243#[derive(Debug)]
4244pub struct CapabilitiesDirConnectorOpenResponder {
4245    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4246    tx_id: u32,
4247}
4248
4249/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4250/// if the responder is dropped without sending a response, so that the client
4251/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4252impl std::ops::Drop for CapabilitiesDirConnectorOpenResponder {
4253    fn drop(&mut self) {
4254        self.control_handle.shutdown();
4255        // Safety: drops once, never accessed again
4256        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4257    }
4258}
4259
4260impl fidl::endpoints::Responder for CapabilitiesDirConnectorOpenResponder {
4261    type ControlHandle = CapabilitiesControlHandle;
4262
4263    fn control_handle(&self) -> &CapabilitiesControlHandle {
4264        &self.control_handle
4265    }
4266
4267    fn drop_without_shutdown(mut self) {
4268        // Safety: drops once, never accessed again due to mem::forget
4269        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4270        // Prevent Drop from running (which would shut down the channel)
4271        std::mem::forget(self);
4272    }
4273}
4274
4275impl CapabilitiesDirConnectorOpenResponder {
4276    /// Sends a response to the FIDL transaction.
4277    ///
4278    /// Sets the channel to shutdown if an error occurs.
4279    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4280        let _result = self.send_raw(result);
4281        if _result.is_err() {
4282            self.control_handle.shutdown();
4283        }
4284        self.drop_without_shutdown();
4285        _result
4286    }
4287
4288    /// Similar to "send" but does not shutdown the channel if an error occurs.
4289    pub fn send_no_shutdown_on_err(
4290        self,
4291        mut result: Result<(), CapabilitiesError>,
4292    ) -> Result<(), fidl::Error> {
4293        let _result = self.send_raw(result);
4294        self.drop_without_shutdown();
4295        _result
4296    }
4297
4298    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4299        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4300            fidl::encoding::EmptyStruct,
4301            CapabilitiesError,
4302        >>(
4303            fidl::encoding::FlexibleResult::new(result),
4304            self.tx_id,
4305            0x1332bbf5debd6c20,
4306            fidl::encoding::DynamicFlags::FLEXIBLE,
4307        )
4308    }
4309}
4310
4311#[must_use = "FIDL methods require a response to be sent"]
4312#[derive(Debug)]
4313pub struct CapabilitiesDictionaryInsertResponder {
4314    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4315    tx_id: u32,
4316}
4317
4318/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4319/// if the responder is dropped without sending a response, so that the client
4320/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4321impl std::ops::Drop for CapabilitiesDictionaryInsertResponder {
4322    fn drop(&mut self) {
4323        self.control_handle.shutdown();
4324        // Safety: drops once, never accessed again
4325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4326    }
4327}
4328
4329impl fidl::endpoints::Responder for CapabilitiesDictionaryInsertResponder {
4330    type ControlHandle = CapabilitiesControlHandle;
4331
4332    fn control_handle(&self) -> &CapabilitiesControlHandle {
4333        &self.control_handle
4334    }
4335
4336    fn drop_without_shutdown(mut self) {
4337        // Safety: drops once, never accessed again due to mem::forget
4338        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4339        // Prevent Drop from running (which would shut down the channel)
4340        std::mem::forget(self);
4341    }
4342}
4343
4344impl CapabilitiesDictionaryInsertResponder {
4345    /// Sends a response to the FIDL transaction.
4346    ///
4347    /// Sets the channel to shutdown if an error occurs.
4348    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4349        let _result = self.send_raw(result);
4350        if _result.is_err() {
4351            self.control_handle.shutdown();
4352        }
4353        self.drop_without_shutdown();
4354        _result
4355    }
4356
4357    /// Similar to "send" but does not shutdown the channel if an error occurs.
4358    pub fn send_no_shutdown_on_err(
4359        self,
4360        mut result: Result<(), CapabilitiesError>,
4361    ) -> Result<(), fidl::Error> {
4362        let _result = self.send_raw(result);
4363        self.drop_without_shutdown();
4364        _result
4365    }
4366
4367    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4368        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4369            fidl::encoding::EmptyStruct,
4370            CapabilitiesError,
4371        >>(
4372            fidl::encoding::FlexibleResult::new(result),
4373            self.tx_id,
4374            0x5972e3061a760e7a,
4375            fidl::encoding::DynamicFlags::FLEXIBLE,
4376        )
4377    }
4378}
4379
4380#[must_use = "FIDL methods require a response to be sent"]
4381#[derive(Debug)]
4382pub struct CapabilitiesDictionaryGetResponder {
4383    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4384    tx_id: u32,
4385}
4386
4387/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4388/// if the responder is dropped without sending a response, so that the client
4389/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4390impl std::ops::Drop for CapabilitiesDictionaryGetResponder {
4391    fn drop(&mut self) {
4392        self.control_handle.shutdown();
4393        // Safety: drops once, never accessed again
4394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4395    }
4396}
4397
4398impl fidl::endpoints::Responder for CapabilitiesDictionaryGetResponder {
4399    type ControlHandle = CapabilitiesControlHandle;
4400
4401    fn control_handle(&self) -> &CapabilitiesControlHandle {
4402        &self.control_handle
4403    }
4404
4405    fn drop_without_shutdown(mut self) {
4406        // Safety: drops once, never accessed again due to mem::forget
4407        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4408        // Prevent Drop from running (which would shut down the channel)
4409        std::mem::forget(self);
4410    }
4411}
4412
4413impl CapabilitiesDictionaryGetResponder {
4414    /// Sends a response to the FIDL transaction.
4415    ///
4416    /// Sets the channel to shutdown if an error occurs.
4417    pub fn send(
4418        self,
4419        mut result: Result<CapabilityType, CapabilitiesError>,
4420    ) -> Result<(), fidl::Error> {
4421        let _result = self.send_raw(result);
4422        if _result.is_err() {
4423            self.control_handle.shutdown();
4424        }
4425        self.drop_without_shutdown();
4426        _result
4427    }
4428
4429    /// Similar to "send" but does not shutdown the channel if an error occurs.
4430    pub fn send_no_shutdown_on_err(
4431        self,
4432        mut result: Result<CapabilityType, CapabilitiesError>,
4433    ) -> Result<(), fidl::Error> {
4434        let _result = self.send_raw(result);
4435        self.drop_without_shutdown();
4436        _result
4437    }
4438
4439    fn send_raw(
4440        &self,
4441        mut result: Result<CapabilityType, CapabilitiesError>,
4442    ) -> Result<(), fidl::Error> {
4443        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4444            CapabilitiesDictionaryGetResponse,
4445            CapabilitiesError,
4446        >>(
4447            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4448            self.tx_id,
4449            0x31fafe2280a283d5,
4450            fidl::encoding::DynamicFlags::FLEXIBLE,
4451        )
4452    }
4453}
4454
4455#[must_use = "FIDL methods require a response to be sent"]
4456#[derive(Debug)]
4457pub struct CapabilitiesDictionaryRemoveResponder {
4458    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4459    tx_id: u32,
4460}
4461
4462/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4463/// if the responder is dropped without sending a response, so that the client
4464/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4465impl std::ops::Drop for CapabilitiesDictionaryRemoveResponder {
4466    fn drop(&mut self) {
4467        self.control_handle.shutdown();
4468        // Safety: drops once, never accessed again
4469        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4470    }
4471}
4472
4473impl fidl::endpoints::Responder for CapabilitiesDictionaryRemoveResponder {
4474    type ControlHandle = CapabilitiesControlHandle;
4475
4476    fn control_handle(&self) -> &CapabilitiesControlHandle {
4477        &self.control_handle
4478    }
4479
4480    fn drop_without_shutdown(mut self) {
4481        // Safety: drops once, never accessed again due to mem::forget
4482        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4483        // Prevent Drop from running (which would shut down the channel)
4484        std::mem::forget(self);
4485    }
4486}
4487
4488impl CapabilitiesDictionaryRemoveResponder {
4489    /// Sends a response to the FIDL transaction.
4490    ///
4491    /// Sets the channel to shutdown if an error occurs.
4492    pub fn send(
4493        self,
4494        mut result: Result<CapabilityType, CapabilitiesError>,
4495    ) -> Result<(), fidl::Error> {
4496        let _result = self.send_raw(result);
4497        if _result.is_err() {
4498            self.control_handle.shutdown();
4499        }
4500        self.drop_without_shutdown();
4501        _result
4502    }
4503
4504    /// Similar to "send" but does not shutdown the channel if an error occurs.
4505    pub fn send_no_shutdown_on_err(
4506        self,
4507        mut result: Result<CapabilityType, CapabilitiesError>,
4508    ) -> Result<(), fidl::Error> {
4509        let _result = self.send_raw(result);
4510        self.drop_without_shutdown();
4511        _result
4512    }
4513
4514    fn send_raw(
4515        &self,
4516        mut result: Result<CapabilityType, CapabilitiesError>,
4517    ) -> Result<(), fidl::Error> {
4518        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4519            CapabilitiesDictionaryRemoveResponse,
4520            CapabilitiesError,
4521        >>(
4522            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4523            self.tx_id,
4524            0x6827c83106ac5a2c,
4525            fidl::encoding::DynamicFlags::FLEXIBLE,
4526        )
4527    }
4528}
4529
4530#[must_use = "FIDL methods require a response to be sent"]
4531#[derive(Debug)]
4532pub struct CapabilitiesDictionaryIterateKeysResponder {
4533    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4534    tx_id: u32,
4535}
4536
4537/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4538/// if the responder is dropped without sending a response, so that the client
4539/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4540impl std::ops::Drop for CapabilitiesDictionaryIterateKeysResponder {
4541    fn drop(&mut self) {
4542        self.control_handle.shutdown();
4543        // Safety: drops once, never accessed again
4544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4545    }
4546}
4547
4548impl fidl::endpoints::Responder for CapabilitiesDictionaryIterateKeysResponder {
4549    type ControlHandle = CapabilitiesControlHandle;
4550
4551    fn control_handle(&self) -> &CapabilitiesControlHandle {
4552        &self.control_handle
4553    }
4554
4555    fn drop_without_shutdown(mut self) {
4556        // Safety: drops once, never accessed again due to mem::forget
4557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4558        // Prevent Drop from running (which would shut down the channel)
4559        std::mem::forget(self);
4560    }
4561}
4562
4563impl CapabilitiesDictionaryIterateKeysResponder {
4564    /// Sends a response to the FIDL transaction.
4565    ///
4566    /// Sets the channel to shutdown if an error occurs.
4567    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4568        let _result = self.send_raw(result);
4569        if _result.is_err() {
4570            self.control_handle.shutdown();
4571        }
4572        self.drop_without_shutdown();
4573        _result
4574    }
4575
4576    /// Similar to "send" but does not shutdown the channel if an error occurs.
4577    pub fn send_no_shutdown_on_err(
4578        self,
4579        mut result: Result<(), CapabilitiesError>,
4580    ) -> Result<(), fidl::Error> {
4581        let _result = self.send_raw(result);
4582        self.drop_without_shutdown();
4583        _result
4584    }
4585
4586    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4587        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4588            fidl::encoding::EmptyStruct,
4589            CapabilitiesError,
4590        >>(
4591            fidl::encoding::FlexibleResult::new(result),
4592            self.tx_id,
4593            0x3d4ea59c80df9bb8,
4594            fidl::encoding::DynamicFlags::FLEXIBLE,
4595        )
4596    }
4597}
4598
4599#[must_use = "FIDL methods require a response to be sent"]
4600#[derive(Debug)]
4601pub struct CapabilitiesDataGetResponder {
4602    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4603    tx_id: u32,
4604}
4605
4606/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4607/// if the responder is dropped without sending a response, so that the client
4608/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4609impl std::ops::Drop for CapabilitiesDataGetResponder {
4610    fn drop(&mut self) {
4611        self.control_handle.shutdown();
4612        // Safety: drops once, never accessed again
4613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4614    }
4615}
4616
4617impl fidl::endpoints::Responder for CapabilitiesDataGetResponder {
4618    type ControlHandle = CapabilitiesControlHandle;
4619
4620    fn control_handle(&self) -> &CapabilitiesControlHandle {
4621        &self.control_handle
4622    }
4623
4624    fn drop_without_shutdown(mut self) {
4625        // Safety: drops once, never accessed again due to mem::forget
4626        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4627        // Prevent Drop from running (which would shut down the channel)
4628        std::mem::forget(self);
4629    }
4630}
4631
4632impl CapabilitiesDataGetResponder {
4633    /// Sends a response to the FIDL transaction.
4634    ///
4635    /// Sets the channel to shutdown if an error occurs.
4636    pub fn send(self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4637        let _result = self.send_raw(result);
4638        if _result.is_err() {
4639            self.control_handle.shutdown();
4640        }
4641        self.drop_without_shutdown();
4642        _result
4643    }
4644
4645    /// Similar to "send" but does not shutdown the channel if an error occurs.
4646    pub fn send_no_shutdown_on_err(
4647        self,
4648        mut result: Result<&Data, CapabilitiesError>,
4649    ) -> Result<(), fidl::Error> {
4650        let _result = self.send_raw(result);
4651        self.drop_without_shutdown();
4652        _result
4653    }
4654
4655    fn send_raw(&self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4656        self.control_handle
4657            .inner
4658            .send::<fidl::encoding::FlexibleResultType<Data, CapabilitiesError>>(
4659                fidl::encoding::FlexibleResult::new(result),
4660                self.tx_id,
4661                0x65ae25b59f9e0daf,
4662                fidl::encoding::DynamicFlags::FLEXIBLE,
4663            )
4664    }
4665}
4666
4667#[must_use = "FIDL methods require a response to be sent"]
4668#[derive(Debug)]
4669pub struct CapabilitiesConnectorRouterRouteResponder {
4670    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4671    tx_id: u32,
4672}
4673
4674/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4675/// if the responder is dropped without sending a response, so that the client
4676/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4677impl std::ops::Drop for CapabilitiesConnectorRouterRouteResponder {
4678    fn drop(&mut self) {
4679        self.control_handle.shutdown();
4680        // Safety: drops once, never accessed again
4681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4682    }
4683}
4684
4685impl fidl::endpoints::Responder for CapabilitiesConnectorRouterRouteResponder {
4686    type ControlHandle = CapabilitiesControlHandle;
4687
4688    fn control_handle(&self) -> &CapabilitiesControlHandle {
4689        &self.control_handle
4690    }
4691
4692    fn drop_without_shutdown(mut self) {
4693        // Safety: drops once, never accessed again due to mem::forget
4694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4695        // Prevent Drop from running (which would shut down the channel)
4696        std::mem::forget(self);
4697    }
4698}
4699
4700impl CapabilitiesConnectorRouterRouteResponder {
4701    /// Sends a response to the FIDL transaction.
4702    ///
4703    /// Sets the channel to shutdown if an error occurs.
4704    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4705        let _result = self.send_raw(result);
4706        if _result.is_err() {
4707            self.control_handle.shutdown();
4708        }
4709        self.drop_without_shutdown();
4710        _result
4711    }
4712
4713    /// Similar to "send" but does not shutdown the channel if an error occurs.
4714    pub fn send_no_shutdown_on_err(
4715        self,
4716        mut result: Result<RouterResponse, i32>,
4717    ) -> Result<(), fidl::Error> {
4718        let _result = self.send_raw(result);
4719        self.drop_without_shutdown();
4720        _result
4721    }
4722
4723    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4724        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4725            CapabilitiesConnectorRouterRouteResponse,
4726            i32,
4727        >>(
4728            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4729            self.tx_id,
4730            0x1bd9c6e7e3dd487e,
4731            fidl::encoding::DynamicFlags::FLEXIBLE,
4732        )
4733    }
4734}
4735
4736#[must_use = "FIDL methods require a response to be sent"]
4737#[derive(Debug)]
4738pub struct CapabilitiesDirConnectorRouterRouteResponder {
4739    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4740    tx_id: u32,
4741}
4742
4743/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4744/// if the responder is dropped without sending a response, so that the client
4745/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4746impl std::ops::Drop for CapabilitiesDirConnectorRouterRouteResponder {
4747    fn drop(&mut self) {
4748        self.control_handle.shutdown();
4749        // Safety: drops once, never accessed again
4750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4751    }
4752}
4753
4754impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterRouteResponder {
4755    type ControlHandle = CapabilitiesControlHandle;
4756
4757    fn control_handle(&self) -> &CapabilitiesControlHandle {
4758        &self.control_handle
4759    }
4760
4761    fn drop_without_shutdown(mut self) {
4762        // Safety: drops once, never accessed again due to mem::forget
4763        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4764        // Prevent Drop from running (which would shut down the channel)
4765        std::mem::forget(self);
4766    }
4767}
4768
4769impl CapabilitiesDirConnectorRouterRouteResponder {
4770    /// Sends a response to the FIDL transaction.
4771    ///
4772    /// Sets the channel to shutdown if an error occurs.
4773    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4774        let _result = self.send_raw(result);
4775        if _result.is_err() {
4776            self.control_handle.shutdown();
4777        }
4778        self.drop_without_shutdown();
4779        _result
4780    }
4781
4782    /// Similar to "send" but does not shutdown the channel if an error occurs.
4783    pub fn send_no_shutdown_on_err(
4784        self,
4785        mut result: Result<RouterResponse, i32>,
4786    ) -> Result<(), fidl::Error> {
4787        let _result = self.send_raw(result);
4788        self.drop_without_shutdown();
4789        _result
4790    }
4791
4792    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4793        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4794            CapabilitiesDirConnectorRouterRouteResponse,
4795            i32,
4796        >>(
4797            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4798            self.tx_id,
4799            0x3afdcc1b79e0799d,
4800            fidl::encoding::DynamicFlags::FLEXIBLE,
4801        )
4802    }
4803}
4804
4805#[must_use = "FIDL methods require a response to be sent"]
4806#[derive(Debug)]
4807pub struct CapabilitiesDictionaryRouterRouteResponder {
4808    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4809    tx_id: u32,
4810}
4811
4812/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4813/// if the responder is dropped without sending a response, so that the client
4814/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4815impl std::ops::Drop for CapabilitiesDictionaryRouterRouteResponder {
4816    fn drop(&mut self) {
4817        self.control_handle.shutdown();
4818        // Safety: drops once, never accessed again
4819        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4820    }
4821}
4822
4823impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterRouteResponder {
4824    type ControlHandle = CapabilitiesControlHandle;
4825
4826    fn control_handle(&self) -> &CapabilitiesControlHandle {
4827        &self.control_handle
4828    }
4829
4830    fn drop_without_shutdown(mut self) {
4831        // Safety: drops once, never accessed again due to mem::forget
4832        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4833        // Prevent Drop from running (which would shut down the channel)
4834        std::mem::forget(self);
4835    }
4836}
4837
4838impl CapabilitiesDictionaryRouterRouteResponder {
4839    /// Sends a response to the FIDL transaction.
4840    ///
4841    /// Sets the channel to shutdown if an error occurs.
4842    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4843        let _result = self.send_raw(result);
4844        if _result.is_err() {
4845            self.control_handle.shutdown();
4846        }
4847        self.drop_without_shutdown();
4848        _result
4849    }
4850
4851    /// Similar to "send" but does not shutdown the channel if an error occurs.
4852    pub fn send_no_shutdown_on_err(
4853        self,
4854        mut result: Result<RouterResponse, i32>,
4855    ) -> Result<(), fidl::Error> {
4856        let _result = self.send_raw(result);
4857        self.drop_without_shutdown();
4858        _result
4859    }
4860
4861    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4862        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4863            CapabilitiesDictionaryRouterRouteResponse,
4864            i32,
4865        >>(
4866            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4867            self.tx_id,
4868            0xcf72de10714a708,
4869            fidl::encoding::DynamicFlags::FLEXIBLE,
4870        )
4871    }
4872}
4873
4874#[must_use = "FIDL methods require a response to be sent"]
4875#[derive(Debug)]
4876pub struct CapabilitiesDataRouterRouteResponder {
4877    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4878    tx_id: u32,
4879}
4880
4881/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4882/// if the responder is dropped without sending a response, so that the client
4883/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4884impl std::ops::Drop for CapabilitiesDataRouterRouteResponder {
4885    fn drop(&mut self) {
4886        self.control_handle.shutdown();
4887        // Safety: drops once, never accessed again
4888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4889    }
4890}
4891
4892impl fidl::endpoints::Responder for CapabilitiesDataRouterRouteResponder {
4893    type ControlHandle = CapabilitiesControlHandle;
4894
4895    fn control_handle(&self) -> &CapabilitiesControlHandle {
4896        &self.control_handle
4897    }
4898
4899    fn drop_without_shutdown(mut self) {
4900        // Safety: drops once, never accessed again due to mem::forget
4901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4902        // Prevent Drop from running (which would shut down the channel)
4903        std::mem::forget(self);
4904    }
4905}
4906
4907impl CapabilitiesDataRouterRouteResponder {
4908    /// Sends a response to the FIDL transaction.
4909    ///
4910    /// Sets the channel to shutdown if an error occurs.
4911    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4912        let _result = self.send_raw(result);
4913        if _result.is_err() {
4914            self.control_handle.shutdown();
4915        }
4916        self.drop_without_shutdown();
4917        _result
4918    }
4919
4920    /// Similar to "send" but does not shutdown the channel if an error occurs.
4921    pub fn send_no_shutdown_on_err(
4922        self,
4923        mut result: Result<RouterResponse, i32>,
4924    ) -> Result<(), fidl::Error> {
4925        let _result = self.send_raw(result);
4926        self.drop_without_shutdown();
4927        _result
4928    }
4929
4930    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4931        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4932            CapabilitiesDataRouterRouteResponse,
4933            i32,
4934        >>(
4935            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4936            self.tx_id,
4937            0x61ab188455ed0643,
4938            fidl::encoding::DynamicFlags::FLEXIBLE,
4939        )
4940    }
4941}
4942
4943#[must_use = "FIDL methods require a response to be sent"]
4944#[derive(Debug)]
4945pub struct CapabilitiesCapabilityAssociateHandleResponder {
4946    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4947    tx_id: u32,
4948}
4949
4950/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4951/// if the responder is dropped without sending a response, so that the client
4952/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4953impl std::ops::Drop for CapabilitiesCapabilityAssociateHandleResponder {
4954    fn drop(&mut self) {
4955        self.control_handle.shutdown();
4956        // Safety: drops once, never accessed again
4957        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4958    }
4959}
4960
4961impl fidl::endpoints::Responder for CapabilitiesCapabilityAssociateHandleResponder {
4962    type ControlHandle = CapabilitiesControlHandle;
4963
4964    fn control_handle(&self) -> &CapabilitiesControlHandle {
4965        &self.control_handle
4966    }
4967
4968    fn drop_without_shutdown(mut self) {
4969        // Safety: drops once, never accessed again due to mem::forget
4970        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4971        // Prevent Drop from running (which would shut down the channel)
4972        std::mem::forget(self);
4973    }
4974}
4975
4976impl CapabilitiesCapabilityAssociateHandleResponder {
4977    /// Sends a response to the FIDL transaction.
4978    ///
4979    /// Sets the channel to shutdown if an error occurs.
4980    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4981        let _result = self.send_raw(result);
4982        if _result.is_err() {
4983            self.control_handle.shutdown();
4984        }
4985        self.drop_without_shutdown();
4986        _result
4987    }
4988
4989    /// Similar to "send" but does not shutdown the channel if an error occurs.
4990    pub fn send_no_shutdown_on_err(
4991        self,
4992        mut result: Result<(), CapabilitiesError>,
4993    ) -> Result<(), fidl::Error> {
4994        let _result = self.send_raw(result);
4995        self.drop_without_shutdown();
4996        _result
4997    }
4998
4999    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
5000        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5001            fidl::encoding::EmptyStruct,
5002            CapabilitiesError,
5003        >>(
5004            fidl::encoding::FlexibleResult::new(result),
5005            self.tx_id,
5006            0x1d69bb61953d8e7,
5007            fidl::encoding::DynamicFlags::FLEXIBLE,
5008        )
5009    }
5010}
5011
5012#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5013pub struct ConnectorRouterMarker;
5014
5015impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
5016    type Proxy = ConnectorRouterProxy;
5017    type RequestStream = ConnectorRouterRequestStream;
5018    #[cfg(target_os = "fuchsia")]
5019    type SynchronousProxy = ConnectorRouterSynchronousProxy;
5020
5021    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouter";
5022}
5023pub type ConnectorRouterRouteResult = Result<RouterResponse, i32>;
5024
5025pub trait ConnectorRouterProxyInterface: Send + Sync {
5026    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
5027        + Send;
5028    fn r#route(
5029        &self,
5030        request: RouteRequest,
5031        instance_token: fidl::EventPair,
5032        handle: fidl::EventPair,
5033    ) -> Self::RouteResponseFut;
5034}
5035#[derive(Debug)]
5036#[cfg(target_os = "fuchsia")]
5037pub struct ConnectorRouterSynchronousProxy {
5038    client: fidl::client::sync::Client,
5039}
5040
5041#[cfg(target_os = "fuchsia")]
5042impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
5043    type Proxy = ConnectorRouterProxy;
5044    type Protocol = ConnectorRouterMarker;
5045
5046    fn from_channel(inner: fidl::Channel) -> Self {
5047        Self::new(inner)
5048    }
5049
5050    fn into_channel(self) -> fidl::Channel {
5051        self.client.into_channel()
5052    }
5053
5054    fn as_channel(&self) -> &fidl::Channel {
5055        self.client.as_channel()
5056    }
5057}
5058
5059#[cfg(target_os = "fuchsia")]
5060impl ConnectorRouterSynchronousProxy {
5061    pub fn new(channel: fidl::Channel) -> Self {
5062        Self { client: fidl::client::sync::Client::new(channel) }
5063    }
5064
5065    pub fn into_channel(self) -> fidl::Channel {
5066        self.client.into_channel()
5067    }
5068
5069    /// Waits until an event arrives and returns it. It is safe for other
5070    /// threads to make concurrent requests while waiting for an event.
5071    pub fn wait_for_event(
5072        &self,
5073        deadline: zx::MonotonicInstant,
5074    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5075        ConnectorRouterEvent::decode(self.client.wait_for_event::<ConnectorRouterMarker>(deadline)?)
5076    }
5077
5078    /// Attempts to produce a `Connector` capability from this
5079    /// `ConnectorRouter`.
5080    ///
5081    /// `request` contains context for this route, and `instance_token`
5082    /// references the component that the routing operation is being performed
5083    /// for.
5084    ///
5085    /// This will return:
5086    ///
5087    /// - `SUCCESS` if `handle` has been associated with a connector.
5088    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5089    ///   will be closed.
5090    /// - An error, if the operation failed.
5091    pub fn r#route(
5092        &self,
5093        mut request: RouteRequest,
5094        mut instance_token: fidl::EventPair,
5095        mut handle: fidl::EventPair,
5096        ___deadline: zx::MonotonicInstant,
5097    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5098        let _response = self.client.send_query::<
5099            ConnectorRouterRouteRequest,
5100            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5101            ConnectorRouterMarker,
5102        >(
5103            (&mut request, instance_token, handle,),
5104            0x57a912c92a38f9f8,
5105            fidl::encoding::DynamicFlags::FLEXIBLE,
5106            ___deadline,
5107        )?
5108        .into_result::<ConnectorRouterMarker>("route")?;
5109        Ok(_response.map(|x| x.response))
5110    }
5111}
5112
5113#[cfg(target_os = "fuchsia")]
5114impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
5115    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
5116        value.into_channel().into()
5117    }
5118}
5119
5120#[cfg(target_os = "fuchsia")]
5121impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
5122    fn from(value: fidl::Channel) -> Self {
5123        Self::new(value)
5124    }
5125}
5126
5127#[cfg(target_os = "fuchsia")]
5128impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
5129    type Protocol = ConnectorRouterMarker;
5130
5131    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
5132        Self::new(value.into_channel())
5133    }
5134}
5135
5136#[derive(Debug, Clone)]
5137pub struct ConnectorRouterProxy {
5138    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5139}
5140
5141impl fidl::endpoints::Proxy for ConnectorRouterProxy {
5142    type Protocol = ConnectorRouterMarker;
5143
5144    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5145        Self::new(inner)
5146    }
5147
5148    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5149        self.client.into_channel().map_err(|client| Self { client })
5150    }
5151
5152    fn as_channel(&self) -> &::fidl::AsyncChannel {
5153        self.client.as_channel()
5154    }
5155}
5156
5157impl ConnectorRouterProxy {
5158    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouter.
5159    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5160        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5161        Self { client: fidl::client::Client::new(channel, protocol_name) }
5162    }
5163
5164    /// Get a Stream of events from the remote end of the protocol.
5165    ///
5166    /// # Panics
5167    ///
5168    /// Panics if the event stream was already taken.
5169    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
5170        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
5171    }
5172
5173    /// Attempts to produce a `Connector` capability from this
5174    /// `ConnectorRouter`.
5175    ///
5176    /// `request` contains context for this route, and `instance_token`
5177    /// references the component that the routing operation is being performed
5178    /// for.
5179    ///
5180    /// This will return:
5181    ///
5182    /// - `SUCCESS` if `handle` has been associated with a connector.
5183    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5184    ///   will be closed.
5185    /// - An error, if the operation failed.
5186    pub fn r#route(
5187        &self,
5188        mut request: RouteRequest,
5189        mut instance_token: fidl::EventPair,
5190        mut handle: fidl::EventPair,
5191    ) -> fidl::client::QueryResponseFut<
5192        ConnectorRouterRouteResult,
5193        fidl::encoding::DefaultFuchsiaResourceDialect,
5194    > {
5195        ConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
5196    }
5197}
5198
5199impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
5200    type RouteResponseFut = fidl::client::QueryResponseFut<
5201        ConnectorRouterRouteResult,
5202        fidl::encoding::DefaultFuchsiaResourceDialect,
5203    >;
5204    fn r#route(
5205        &self,
5206        mut request: RouteRequest,
5207        mut instance_token: fidl::EventPair,
5208        mut handle: fidl::EventPair,
5209    ) -> Self::RouteResponseFut {
5210        fn _decode(
5211            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5212        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5213            let _response = fidl::client::decode_transaction_body::<
5214                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5215                fidl::encoding::DefaultFuchsiaResourceDialect,
5216                0x57a912c92a38f9f8,
5217            >(_buf?)?
5218            .into_result::<ConnectorRouterMarker>("route")?;
5219            Ok(_response.map(|x| x.response))
5220        }
5221        self.client
5222            .send_query_and_decode::<ConnectorRouterRouteRequest, ConnectorRouterRouteResult>(
5223                (&mut request, instance_token, handle),
5224                0x57a912c92a38f9f8,
5225                fidl::encoding::DynamicFlags::FLEXIBLE,
5226                _decode,
5227            )
5228    }
5229}
5230
5231pub struct ConnectorRouterEventStream {
5232    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5233}
5234
5235impl std::marker::Unpin for ConnectorRouterEventStream {}
5236
5237impl futures::stream::FusedStream for ConnectorRouterEventStream {
5238    fn is_terminated(&self) -> bool {
5239        self.event_receiver.is_terminated()
5240    }
5241}
5242
5243impl futures::Stream for ConnectorRouterEventStream {
5244    type Item = Result<ConnectorRouterEvent, fidl::Error>;
5245
5246    fn poll_next(
5247        mut self: std::pin::Pin<&mut Self>,
5248        cx: &mut std::task::Context<'_>,
5249    ) -> std::task::Poll<Option<Self::Item>> {
5250        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5251            &mut self.event_receiver,
5252            cx
5253        )?) {
5254            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
5255            None => std::task::Poll::Ready(None),
5256        }
5257    }
5258}
5259
5260#[derive(Debug)]
5261pub enum ConnectorRouterEvent {
5262    #[non_exhaustive]
5263    _UnknownEvent {
5264        /// Ordinal of the event that was sent.
5265        ordinal: u64,
5266    },
5267}
5268
5269impl ConnectorRouterEvent {
5270    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
5271    fn decode(
5272        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5273    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5274        let (bytes, _handles) = buf.split_mut();
5275        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5276        debug_assert_eq!(tx_header.tx_id, 0);
5277        match tx_header.ordinal {
5278            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5279                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5280            }
5281            _ => Err(fidl::Error::UnknownOrdinal {
5282                ordinal: tx_header.ordinal,
5283                protocol_name:
5284                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5285            }),
5286        }
5287    }
5288}
5289
5290/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouter.
5291pub struct ConnectorRouterRequestStream {
5292    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5293    is_terminated: bool,
5294}
5295
5296impl std::marker::Unpin for ConnectorRouterRequestStream {}
5297
5298impl futures::stream::FusedStream for ConnectorRouterRequestStream {
5299    fn is_terminated(&self) -> bool {
5300        self.is_terminated
5301    }
5302}
5303
5304impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
5305    type Protocol = ConnectorRouterMarker;
5306    type ControlHandle = ConnectorRouterControlHandle;
5307
5308    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5309        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5310    }
5311
5312    fn control_handle(&self) -> Self::ControlHandle {
5313        ConnectorRouterControlHandle { inner: self.inner.clone() }
5314    }
5315
5316    fn into_inner(
5317        self,
5318    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5319    {
5320        (self.inner, self.is_terminated)
5321    }
5322
5323    fn from_inner(
5324        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5325        is_terminated: bool,
5326    ) -> Self {
5327        Self { inner, is_terminated }
5328    }
5329}
5330
5331impl futures::Stream for ConnectorRouterRequestStream {
5332    type Item = Result<ConnectorRouterRequest, fidl::Error>;
5333
5334    fn poll_next(
5335        mut self: std::pin::Pin<&mut Self>,
5336        cx: &mut std::task::Context<'_>,
5337    ) -> std::task::Poll<Option<Self::Item>> {
5338        let this = &mut *self;
5339        if this.inner.check_shutdown(cx) {
5340            this.is_terminated = true;
5341            return std::task::Poll::Ready(None);
5342        }
5343        if this.is_terminated {
5344            panic!("polled ConnectorRouterRequestStream after completion");
5345        }
5346        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5347            |bytes, handles| {
5348                match this.inner.channel().read_etc(cx, bytes, handles) {
5349                    std::task::Poll::Ready(Ok(())) => {}
5350                    std::task::Poll::Pending => return std::task::Poll::Pending,
5351                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5352                        this.is_terminated = true;
5353                        return std::task::Poll::Ready(None);
5354                    }
5355                    std::task::Poll::Ready(Err(e)) => {
5356                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5357                            e.into(),
5358                        ))));
5359                    }
5360                }
5361
5362                // A message has been received from the channel
5363                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5364
5365                std::task::Poll::Ready(Some(match header.ordinal {
5366                    0x57a912c92a38f9f8 => {
5367                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5368                        let mut req = fidl::new_empty!(
5369                            ConnectorRouterRouteRequest,
5370                            fidl::encoding::DefaultFuchsiaResourceDialect
5371                        );
5372                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5373                        let control_handle =
5374                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5375                        Ok(ConnectorRouterRequest::Route {
5376                            request: req.request,
5377                            instance_token: req.instance_token,
5378                            handle: req.handle,
5379
5380                            responder: ConnectorRouterRouteResponder {
5381                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5382                                tx_id: header.tx_id,
5383                            },
5384                        })
5385                    }
5386                    _ if header.tx_id == 0
5387                        && header
5388                            .dynamic_flags()
5389                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5390                    {
5391                        Ok(ConnectorRouterRequest::_UnknownMethod {
5392                            ordinal: header.ordinal,
5393                            control_handle: ConnectorRouterControlHandle {
5394                                inner: this.inner.clone(),
5395                            },
5396                            method_type: fidl::MethodType::OneWay,
5397                        })
5398                    }
5399                    _ if header
5400                        .dynamic_flags()
5401                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5402                    {
5403                        this.inner.send_framework_err(
5404                            fidl::encoding::FrameworkErr::UnknownMethod,
5405                            header.tx_id,
5406                            header.ordinal,
5407                            header.dynamic_flags(),
5408                            (bytes, handles),
5409                        )?;
5410                        Ok(ConnectorRouterRequest::_UnknownMethod {
5411                            ordinal: header.ordinal,
5412                            control_handle: ConnectorRouterControlHandle {
5413                                inner: this.inner.clone(),
5414                            },
5415                            method_type: fidl::MethodType::TwoWay,
5416                        })
5417                    }
5418                    _ => Err(fidl::Error::UnknownOrdinal {
5419                        ordinal: header.ordinal,
5420                        protocol_name:
5421                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5422                    }),
5423                }))
5424            },
5425        )
5426    }
5427}
5428
5429/// A factory for `Connector` capabilities.
5430#[derive(Debug)]
5431pub enum ConnectorRouterRequest {
5432    /// Attempts to produce a `Connector` capability from this
5433    /// `ConnectorRouter`.
5434    ///
5435    /// `request` contains context for this route, and `instance_token`
5436    /// references the component that the routing operation is being performed
5437    /// for.
5438    ///
5439    /// This will return:
5440    ///
5441    /// - `SUCCESS` if `handle` has been associated with a connector.
5442    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5443    ///   will be closed.
5444    /// - An error, if the operation failed.
5445    Route {
5446        request: RouteRequest,
5447        instance_token: fidl::EventPair,
5448        handle: fidl::EventPair,
5449        responder: ConnectorRouterRouteResponder,
5450    },
5451    /// An interaction was received which does not match any known method.
5452    #[non_exhaustive]
5453    _UnknownMethod {
5454        /// Ordinal of the method that was called.
5455        ordinal: u64,
5456        control_handle: ConnectorRouterControlHandle,
5457        method_type: fidl::MethodType,
5458    },
5459}
5460
5461impl ConnectorRouterRequest {
5462    #[allow(irrefutable_let_patterns)]
5463    pub fn into_route(
5464        self,
5465    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, ConnectorRouterRouteResponder)>
5466    {
5467        if let ConnectorRouterRequest::Route { request, instance_token, handle, responder } = self {
5468            Some((request, instance_token, handle, responder))
5469        } else {
5470            None
5471        }
5472    }
5473
5474    /// Name of the method defined in FIDL
5475    pub fn method_name(&self) -> &'static str {
5476        match *self {
5477            ConnectorRouterRequest::Route { .. } => "route",
5478            ConnectorRouterRequest::_UnknownMethod {
5479                method_type: fidl::MethodType::OneWay,
5480                ..
5481            } => "unknown one-way method",
5482            ConnectorRouterRequest::_UnknownMethod {
5483                method_type: fidl::MethodType::TwoWay,
5484                ..
5485            } => "unknown two-way method",
5486        }
5487    }
5488}
5489
5490#[derive(Debug, Clone)]
5491pub struct ConnectorRouterControlHandle {
5492    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5493}
5494
5495impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5496    fn shutdown(&self) {
5497        self.inner.shutdown()
5498    }
5499
5500    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5501        self.inner.shutdown_with_epitaph(status)
5502    }
5503
5504    fn is_closed(&self) -> bool {
5505        self.inner.channel().is_closed()
5506    }
5507    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5508        self.inner.channel().on_closed()
5509    }
5510
5511    #[cfg(target_os = "fuchsia")]
5512    fn signal_peer(
5513        &self,
5514        clear_mask: zx::Signals,
5515        set_mask: zx::Signals,
5516    ) -> Result<(), zx_status::Status> {
5517        use fidl::Peered;
5518        self.inner.channel().signal_peer(clear_mask, set_mask)
5519    }
5520}
5521
5522impl ConnectorRouterControlHandle {}
5523
5524#[must_use = "FIDL methods require a response to be sent"]
5525#[derive(Debug)]
5526pub struct ConnectorRouterRouteResponder {
5527    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5528    tx_id: u32,
5529}
5530
5531/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5532/// if the responder is dropped without sending a response, so that the client
5533/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5534impl std::ops::Drop for ConnectorRouterRouteResponder {
5535    fn drop(&mut self) {
5536        self.control_handle.shutdown();
5537        // Safety: drops once, never accessed again
5538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5539    }
5540}
5541
5542impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5543    type ControlHandle = ConnectorRouterControlHandle;
5544
5545    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5546        &self.control_handle
5547    }
5548
5549    fn drop_without_shutdown(mut self) {
5550        // Safety: drops once, never accessed again due to mem::forget
5551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5552        // Prevent Drop from running (which would shut down the channel)
5553        std::mem::forget(self);
5554    }
5555}
5556
5557impl ConnectorRouterRouteResponder {
5558    /// Sends a response to the FIDL transaction.
5559    ///
5560    /// Sets the channel to shutdown if an error occurs.
5561    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5562        let _result = self.send_raw(result);
5563        if _result.is_err() {
5564            self.control_handle.shutdown();
5565        }
5566        self.drop_without_shutdown();
5567        _result
5568    }
5569
5570    /// Similar to "send" but does not shutdown the channel if an error occurs.
5571    pub fn send_no_shutdown_on_err(
5572        self,
5573        mut result: Result<RouterResponse, i32>,
5574    ) -> Result<(), fidl::Error> {
5575        let _result = self.send_raw(result);
5576        self.drop_without_shutdown();
5577        _result
5578    }
5579
5580    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5581        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5582            ConnectorRouterRouteResponse,
5583            i32,
5584        >>(
5585            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
5586            self.tx_id,
5587            0x57a912c92a38f9f8,
5588            fidl::encoding::DynamicFlags::FLEXIBLE,
5589        )
5590    }
5591}
5592
5593#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5594pub struct DataRouterMarker;
5595
5596impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5597    type Proxy = DataRouterProxy;
5598    type RequestStream = DataRouterRequestStream;
5599    #[cfg(target_os = "fuchsia")]
5600    type SynchronousProxy = DataRouterSynchronousProxy;
5601
5602    const DEBUG_NAME: &'static str = "(anonymous) DataRouter";
5603}
5604pub type DataRouterRouteResult = Result<RouterResponse, i32>;
5605
5606pub trait DataRouterProxyInterface: Send + Sync {
5607    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5608        + Send;
5609    fn r#route(
5610        &self,
5611        request: RouteRequest,
5612        instance_token: fidl::EventPair,
5613        handle: fidl::EventPair,
5614    ) -> Self::RouteResponseFut;
5615}
5616#[derive(Debug)]
5617#[cfg(target_os = "fuchsia")]
5618pub struct DataRouterSynchronousProxy {
5619    client: fidl::client::sync::Client,
5620}
5621
5622#[cfg(target_os = "fuchsia")]
5623impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5624    type Proxy = DataRouterProxy;
5625    type Protocol = DataRouterMarker;
5626
5627    fn from_channel(inner: fidl::Channel) -> Self {
5628        Self::new(inner)
5629    }
5630
5631    fn into_channel(self) -> fidl::Channel {
5632        self.client.into_channel()
5633    }
5634
5635    fn as_channel(&self) -> &fidl::Channel {
5636        self.client.as_channel()
5637    }
5638}
5639
5640#[cfg(target_os = "fuchsia")]
5641impl DataRouterSynchronousProxy {
5642    pub fn new(channel: fidl::Channel) -> Self {
5643        Self { client: fidl::client::sync::Client::new(channel) }
5644    }
5645
5646    pub fn into_channel(self) -> fidl::Channel {
5647        self.client.into_channel()
5648    }
5649
5650    /// Waits until an event arrives and returns it. It is safe for other
5651    /// threads to make concurrent requests while waiting for an event.
5652    pub fn wait_for_event(
5653        &self,
5654        deadline: zx::MonotonicInstant,
5655    ) -> Result<DataRouterEvent, fidl::Error> {
5656        DataRouterEvent::decode(self.client.wait_for_event::<DataRouterMarker>(deadline)?)
5657    }
5658
5659    /// Attempts to produce a `Data` capability from this
5660    /// `DataRouter`.
5661    ///
5662    /// `request` contains context for this route, and `instance_token`
5663    /// references the component that the routing operation is being performed
5664    /// for.
5665    ///
5666    /// This will return:
5667    ///
5668    /// - `SUCCESS` if `handle` has been associated with a connector.
5669    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5670    ///   will be closed.
5671    /// - An error, if the operation failed.
5672    pub fn r#route(
5673        &self,
5674        mut request: RouteRequest,
5675        mut instance_token: fidl::EventPair,
5676        mut handle: fidl::EventPair,
5677        ___deadline: zx::MonotonicInstant,
5678    ) -> Result<DataRouterRouteResult, fidl::Error> {
5679        let _response = self.client.send_query::<
5680            DataRouterRouteRequest,
5681            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5682            DataRouterMarker,
5683        >(
5684            (&mut request, instance_token, handle,),
5685            0x646885ba7e10ceeb,
5686            fidl::encoding::DynamicFlags::FLEXIBLE,
5687            ___deadline,
5688        )?
5689        .into_result::<DataRouterMarker>("route")?;
5690        Ok(_response.map(|x| x.response))
5691    }
5692}
5693
5694#[cfg(target_os = "fuchsia")]
5695impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5696    fn from(value: DataRouterSynchronousProxy) -> Self {
5697        value.into_channel().into()
5698    }
5699}
5700
5701#[cfg(target_os = "fuchsia")]
5702impl From<fidl::Channel> for DataRouterSynchronousProxy {
5703    fn from(value: fidl::Channel) -> Self {
5704        Self::new(value)
5705    }
5706}
5707
5708#[cfg(target_os = "fuchsia")]
5709impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5710    type Protocol = DataRouterMarker;
5711
5712    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5713        Self::new(value.into_channel())
5714    }
5715}
5716
5717#[derive(Debug, Clone)]
5718pub struct DataRouterProxy {
5719    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5720}
5721
5722impl fidl::endpoints::Proxy for DataRouterProxy {
5723    type Protocol = DataRouterMarker;
5724
5725    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5726        Self::new(inner)
5727    }
5728
5729    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5730        self.client.into_channel().map_err(|client| Self { client })
5731    }
5732
5733    fn as_channel(&self) -> &::fidl::AsyncChannel {
5734        self.client.as_channel()
5735    }
5736}
5737
5738impl DataRouterProxy {
5739    /// Create a new Proxy for fuchsia.component.runtime/DataRouter.
5740    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5741        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5742        Self { client: fidl::client::Client::new(channel, protocol_name) }
5743    }
5744
5745    /// Get a Stream of events from the remote end of the protocol.
5746    ///
5747    /// # Panics
5748    ///
5749    /// Panics if the event stream was already taken.
5750    pub fn take_event_stream(&self) -> DataRouterEventStream {
5751        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5752    }
5753
5754    /// Attempts to produce a `Data` capability from this
5755    /// `DataRouter`.
5756    ///
5757    /// `request` contains context for this route, and `instance_token`
5758    /// references the component that the routing operation is being performed
5759    /// for.
5760    ///
5761    /// This will return:
5762    ///
5763    /// - `SUCCESS` if `handle` has been associated with a connector.
5764    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5765    ///   will be closed.
5766    /// - An error, if the operation failed.
5767    pub fn r#route(
5768        &self,
5769        mut request: RouteRequest,
5770        mut instance_token: fidl::EventPair,
5771        mut handle: fidl::EventPair,
5772    ) -> fidl::client::QueryResponseFut<
5773        DataRouterRouteResult,
5774        fidl::encoding::DefaultFuchsiaResourceDialect,
5775    > {
5776        DataRouterProxyInterface::r#route(self, request, instance_token, handle)
5777    }
5778}
5779
5780impl DataRouterProxyInterface for DataRouterProxy {
5781    type RouteResponseFut = fidl::client::QueryResponseFut<
5782        DataRouterRouteResult,
5783        fidl::encoding::DefaultFuchsiaResourceDialect,
5784    >;
5785    fn r#route(
5786        &self,
5787        mut request: RouteRequest,
5788        mut instance_token: fidl::EventPair,
5789        mut handle: fidl::EventPair,
5790    ) -> Self::RouteResponseFut {
5791        fn _decode(
5792            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5793        ) -> Result<DataRouterRouteResult, fidl::Error> {
5794            let _response = fidl::client::decode_transaction_body::<
5795                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5796                fidl::encoding::DefaultFuchsiaResourceDialect,
5797                0x646885ba7e10ceeb,
5798            >(_buf?)?
5799            .into_result::<DataRouterMarker>("route")?;
5800            Ok(_response.map(|x| x.response))
5801        }
5802        self.client.send_query_and_decode::<DataRouterRouteRequest, DataRouterRouteResult>(
5803            (&mut request, instance_token, handle),
5804            0x646885ba7e10ceeb,
5805            fidl::encoding::DynamicFlags::FLEXIBLE,
5806            _decode,
5807        )
5808    }
5809}
5810
5811pub struct DataRouterEventStream {
5812    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5813}
5814
5815impl std::marker::Unpin for DataRouterEventStream {}
5816
5817impl futures::stream::FusedStream for DataRouterEventStream {
5818    fn is_terminated(&self) -> bool {
5819        self.event_receiver.is_terminated()
5820    }
5821}
5822
5823impl futures::Stream for DataRouterEventStream {
5824    type Item = Result<DataRouterEvent, fidl::Error>;
5825
5826    fn poll_next(
5827        mut self: std::pin::Pin<&mut Self>,
5828        cx: &mut std::task::Context<'_>,
5829    ) -> std::task::Poll<Option<Self::Item>> {
5830        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5831            &mut self.event_receiver,
5832            cx
5833        )?) {
5834            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5835            None => std::task::Poll::Ready(None),
5836        }
5837    }
5838}
5839
5840#[derive(Debug)]
5841pub enum DataRouterEvent {
5842    #[non_exhaustive]
5843    _UnknownEvent {
5844        /// Ordinal of the event that was sent.
5845        ordinal: u64,
5846    },
5847}
5848
5849impl DataRouterEvent {
5850    /// Decodes a message buffer as a [`DataRouterEvent`].
5851    fn decode(
5852        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5853    ) -> Result<DataRouterEvent, fidl::Error> {
5854        let (bytes, _handles) = buf.split_mut();
5855        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5856        debug_assert_eq!(tx_header.tx_id, 0);
5857        match tx_header.ordinal {
5858            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5859                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5860            }
5861            _ => Err(fidl::Error::UnknownOrdinal {
5862                ordinal: tx_header.ordinal,
5863                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5864            }),
5865        }
5866    }
5867}
5868
5869/// A Stream of incoming requests for fuchsia.component.runtime/DataRouter.
5870pub struct DataRouterRequestStream {
5871    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5872    is_terminated: bool,
5873}
5874
5875impl std::marker::Unpin for DataRouterRequestStream {}
5876
5877impl futures::stream::FusedStream for DataRouterRequestStream {
5878    fn is_terminated(&self) -> bool {
5879        self.is_terminated
5880    }
5881}
5882
5883impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5884    type Protocol = DataRouterMarker;
5885    type ControlHandle = DataRouterControlHandle;
5886
5887    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5888        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5889    }
5890
5891    fn control_handle(&self) -> Self::ControlHandle {
5892        DataRouterControlHandle { inner: self.inner.clone() }
5893    }
5894
5895    fn into_inner(
5896        self,
5897    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5898    {
5899        (self.inner, self.is_terminated)
5900    }
5901
5902    fn from_inner(
5903        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5904        is_terminated: bool,
5905    ) -> Self {
5906        Self { inner, is_terminated }
5907    }
5908}
5909
5910impl futures::Stream for DataRouterRequestStream {
5911    type Item = Result<DataRouterRequest, fidl::Error>;
5912
5913    fn poll_next(
5914        mut self: std::pin::Pin<&mut Self>,
5915        cx: &mut std::task::Context<'_>,
5916    ) -> std::task::Poll<Option<Self::Item>> {
5917        let this = &mut *self;
5918        if this.inner.check_shutdown(cx) {
5919            this.is_terminated = true;
5920            return std::task::Poll::Ready(None);
5921        }
5922        if this.is_terminated {
5923            panic!("polled DataRouterRequestStream after completion");
5924        }
5925        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5926            |bytes, handles| {
5927                match this.inner.channel().read_etc(cx, bytes, handles) {
5928                    std::task::Poll::Ready(Ok(())) => {}
5929                    std::task::Poll::Pending => return std::task::Poll::Pending,
5930                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5931                        this.is_terminated = true;
5932                        return std::task::Poll::Ready(None);
5933                    }
5934                    std::task::Poll::Ready(Err(e)) => {
5935                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5936                            e.into(),
5937                        ))));
5938                    }
5939                }
5940
5941                // A message has been received from the channel
5942                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5943
5944                std::task::Poll::Ready(Some(match header.ordinal {
5945                    0x646885ba7e10ceeb => {
5946                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5947                        let mut req = fidl::new_empty!(
5948                            DataRouterRouteRequest,
5949                            fidl::encoding::DefaultFuchsiaResourceDialect
5950                        );
5951                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5952                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5953                        Ok(DataRouterRequest::Route {
5954                            request: req.request,
5955                            instance_token: req.instance_token,
5956                            handle: req.handle,
5957
5958                            responder: DataRouterRouteResponder {
5959                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5960                                tx_id: header.tx_id,
5961                            },
5962                        })
5963                    }
5964                    _ if header.tx_id == 0
5965                        && header
5966                            .dynamic_flags()
5967                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5968                    {
5969                        Ok(DataRouterRequest::_UnknownMethod {
5970                            ordinal: header.ordinal,
5971                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5972                            method_type: fidl::MethodType::OneWay,
5973                        })
5974                    }
5975                    _ if header
5976                        .dynamic_flags()
5977                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5978                    {
5979                        this.inner.send_framework_err(
5980                            fidl::encoding::FrameworkErr::UnknownMethod,
5981                            header.tx_id,
5982                            header.ordinal,
5983                            header.dynamic_flags(),
5984                            (bytes, handles),
5985                        )?;
5986                        Ok(DataRouterRequest::_UnknownMethod {
5987                            ordinal: header.ordinal,
5988                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5989                            method_type: fidl::MethodType::TwoWay,
5990                        })
5991                    }
5992                    _ => Err(fidl::Error::UnknownOrdinal {
5993                        ordinal: header.ordinal,
5994                        protocol_name:
5995                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5996                    }),
5997                }))
5998            },
5999        )
6000    }
6001}
6002
6003/// A factory for `Data` capabilities.
6004#[derive(Debug)]
6005pub enum DataRouterRequest {
6006    /// Attempts to produce a `Data` capability from this
6007    /// `DataRouter`.
6008    ///
6009    /// `request` contains context for this route, and `instance_token`
6010    /// references the component that the routing operation is being performed
6011    /// for.
6012    ///
6013    /// This will return:
6014    ///
6015    /// - `SUCCESS` if `handle` has been associated with a connector.
6016    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6017    ///   will be closed.
6018    /// - An error, if the operation failed.
6019    Route {
6020        request: RouteRequest,
6021        instance_token: fidl::EventPair,
6022        handle: fidl::EventPair,
6023        responder: DataRouterRouteResponder,
6024    },
6025    /// An interaction was received which does not match any known method.
6026    #[non_exhaustive]
6027    _UnknownMethod {
6028        /// Ordinal of the method that was called.
6029        ordinal: u64,
6030        control_handle: DataRouterControlHandle,
6031        method_type: fidl::MethodType,
6032    },
6033}
6034
6035impl DataRouterRequest {
6036    #[allow(irrefutable_let_patterns)]
6037    pub fn into_route(
6038        self,
6039    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DataRouterRouteResponder)> {
6040        if let DataRouterRequest::Route { request, instance_token, handle, responder } = self {
6041            Some((request, instance_token, handle, responder))
6042        } else {
6043            None
6044        }
6045    }
6046
6047    /// Name of the method defined in FIDL
6048    pub fn method_name(&self) -> &'static str {
6049        match *self {
6050            DataRouterRequest::Route { .. } => "route",
6051            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6052                "unknown one-way method"
6053            }
6054            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6055                "unknown two-way method"
6056            }
6057        }
6058    }
6059}
6060
6061#[derive(Debug, Clone)]
6062pub struct DataRouterControlHandle {
6063    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6064}
6065
6066impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
6067    fn shutdown(&self) {
6068        self.inner.shutdown()
6069    }
6070
6071    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6072        self.inner.shutdown_with_epitaph(status)
6073    }
6074
6075    fn is_closed(&self) -> bool {
6076        self.inner.channel().is_closed()
6077    }
6078    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6079        self.inner.channel().on_closed()
6080    }
6081
6082    #[cfg(target_os = "fuchsia")]
6083    fn signal_peer(
6084        &self,
6085        clear_mask: zx::Signals,
6086        set_mask: zx::Signals,
6087    ) -> Result<(), zx_status::Status> {
6088        use fidl::Peered;
6089        self.inner.channel().signal_peer(clear_mask, set_mask)
6090    }
6091}
6092
6093impl DataRouterControlHandle {}
6094
6095#[must_use = "FIDL methods require a response to be sent"]
6096#[derive(Debug)]
6097pub struct DataRouterRouteResponder {
6098    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
6099    tx_id: u32,
6100}
6101
6102/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
6103/// if the responder is dropped without sending a response, so that the client
6104/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6105impl std::ops::Drop for DataRouterRouteResponder {
6106    fn drop(&mut self) {
6107        self.control_handle.shutdown();
6108        // Safety: drops once, never accessed again
6109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6110    }
6111}
6112
6113impl fidl::endpoints::Responder for DataRouterRouteResponder {
6114    type ControlHandle = DataRouterControlHandle;
6115
6116    fn control_handle(&self) -> &DataRouterControlHandle {
6117        &self.control_handle
6118    }
6119
6120    fn drop_without_shutdown(mut self) {
6121        // Safety: drops once, never accessed again due to mem::forget
6122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6123        // Prevent Drop from running (which would shut down the channel)
6124        std::mem::forget(self);
6125    }
6126}
6127
6128impl DataRouterRouteResponder {
6129    /// Sends a response to the FIDL transaction.
6130    ///
6131    /// Sets the channel to shutdown if an error occurs.
6132    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6133        let _result = self.send_raw(result);
6134        if _result.is_err() {
6135            self.control_handle.shutdown();
6136        }
6137        self.drop_without_shutdown();
6138        _result
6139    }
6140
6141    /// Similar to "send" but does not shutdown the channel if an error occurs.
6142    pub fn send_no_shutdown_on_err(
6143        self,
6144        mut result: Result<RouterResponse, i32>,
6145    ) -> Result<(), fidl::Error> {
6146        let _result = self.send_raw(result);
6147        self.drop_without_shutdown();
6148        _result
6149    }
6150
6151    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6152        self.control_handle
6153            .inner
6154            .send::<fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>>(
6155                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
6156                self.tx_id,
6157                0x646885ba7e10ceeb,
6158                fidl::encoding::DynamicFlags::FLEXIBLE,
6159            )
6160    }
6161}
6162
6163#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6164pub struct DictionaryKeyIteratorMarker;
6165
6166impl fidl::endpoints::ProtocolMarker for DictionaryKeyIteratorMarker {
6167    type Proxy = DictionaryKeyIteratorProxy;
6168    type RequestStream = DictionaryKeyIteratorRequestStream;
6169    #[cfg(target_os = "fuchsia")]
6170    type SynchronousProxy = DictionaryKeyIteratorSynchronousProxy;
6171
6172    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeyIterator";
6173}
6174
6175pub trait DictionaryKeyIteratorProxyInterface: Send + Sync {
6176    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6177    fn r#get_next(&self) -> Self::GetNextResponseFut;
6178}
6179#[derive(Debug)]
6180#[cfg(target_os = "fuchsia")]
6181pub struct DictionaryKeyIteratorSynchronousProxy {
6182    client: fidl::client::sync::Client,
6183}
6184
6185#[cfg(target_os = "fuchsia")]
6186impl fidl::endpoints::SynchronousProxy for DictionaryKeyIteratorSynchronousProxy {
6187    type Proxy = DictionaryKeyIteratorProxy;
6188    type Protocol = DictionaryKeyIteratorMarker;
6189
6190    fn from_channel(inner: fidl::Channel) -> Self {
6191        Self::new(inner)
6192    }
6193
6194    fn into_channel(self) -> fidl::Channel {
6195        self.client.into_channel()
6196    }
6197
6198    fn as_channel(&self) -> &fidl::Channel {
6199        self.client.as_channel()
6200    }
6201}
6202
6203#[cfg(target_os = "fuchsia")]
6204impl DictionaryKeyIteratorSynchronousProxy {
6205    pub fn new(channel: fidl::Channel) -> Self {
6206        Self { client: fidl::client::sync::Client::new(channel) }
6207    }
6208
6209    pub fn into_channel(self) -> fidl::Channel {
6210        self.client.into_channel()
6211    }
6212
6213    /// Waits until an event arrives and returns it. It is safe for other
6214    /// threads to make concurrent requests while waiting for an event.
6215    pub fn wait_for_event(
6216        &self,
6217        deadline: zx::MonotonicInstant,
6218    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6219        DictionaryKeyIteratorEvent::decode(
6220            self.client.wait_for_event::<DictionaryKeyIteratorMarker>(deadline)?,
6221        )
6222    }
6223
6224    /// Returns the next set of keys in this dictionary. Returns an empty vector
6225    /// when there are no more keys to iterate.
6226    pub fn r#get_next(
6227        &self,
6228        ___deadline: zx::MonotonicInstant,
6229    ) -> Result<Vec<String>, fidl::Error> {
6230        let _response = self.client.send_query::<
6231            fidl::encoding::EmptyPayload,
6232            DictionaryKeyIteratorGetNextResponse,
6233            DictionaryKeyIteratorMarker,
6234        >(
6235            (),
6236            0x3806bda34433db54,
6237            fidl::encoding::DynamicFlags::empty(),
6238            ___deadline,
6239        )?;
6240        Ok(_response.keys)
6241    }
6242}
6243
6244#[cfg(target_os = "fuchsia")]
6245impl From<DictionaryKeyIteratorSynchronousProxy> for zx::NullableHandle {
6246    fn from(value: DictionaryKeyIteratorSynchronousProxy) -> Self {
6247        value.into_channel().into()
6248    }
6249}
6250
6251#[cfg(target_os = "fuchsia")]
6252impl From<fidl::Channel> for DictionaryKeyIteratorSynchronousProxy {
6253    fn from(value: fidl::Channel) -> Self {
6254        Self::new(value)
6255    }
6256}
6257
6258#[cfg(target_os = "fuchsia")]
6259impl fidl::endpoints::FromClient for DictionaryKeyIteratorSynchronousProxy {
6260    type Protocol = DictionaryKeyIteratorMarker;
6261
6262    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeyIteratorMarker>) -> Self {
6263        Self::new(value.into_channel())
6264    }
6265}
6266
6267#[derive(Debug, Clone)]
6268pub struct DictionaryKeyIteratorProxy {
6269    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6270}
6271
6272impl fidl::endpoints::Proxy for DictionaryKeyIteratorProxy {
6273    type Protocol = DictionaryKeyIteratorMarker;
6274
6275    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6276        Self::new(inner)
6277    }
6278
6279    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6280        self.client.into_channel().map_err(|client| Self { client })
6281    }
6282
6283    fn as_channel(&self) -> &::fidl::AsyncChannel {
6284        self.client.as_channel()
6285    }
6286}
6287
6288impl DictionaryKeyIteratorProxy {
6289    /// Create a new Proxy for fuchsia.component.runtime/DictionaryKeyIterator.
6290    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6291        let protocol_name =
6292            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6293        Self { client: fidl::client::Client::new(channel, protocol_name) }
6294    }
6295
6296    /// Get a Stream of events from the remote end of the protocol.
6297    ///
6298    /// # Panics
6299    ///
6300    /// Panics if the event stream was already taken.
6301    pub fn take_event_stream(&self) -> DictionaryKeyIteratorEventStream {
6302        DictionaryKeyIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6303    }
6304
6305    /// Returns the next set of keys in this dictionary. Returns an empty vector
6306    /// when there are no more keys to iterate.
6307    pub fn r#get_next(
6308        &self,
6309    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
6310    {
6311        DictionaryKeyIteratorProxyInterface::r#get_next(self)
6312    }
6313}
6314
6315impl DictionaryKeyIteratorProxyInterface for DictionaryKeyIteratorProxy {
6316    type GetNextResponseFut =
6317        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
6318    fn r#get_next(&self) -> Self::GetNextResponseFut {
6319        fn _decode(
6320            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6321        ) -> Result<Vec<String>, fidl::Error> {
6322            let _response = fidl::client::decode_transaction_body::<
6323                DictionaryKeyIteratorGetNextResponse,
6324                fidl::encoding::DefaultFuchsiaResourceDialect,
6325                0x3806bda34433db54,
6326            >(_buf?)?;
6327            Ok(_response.keys)
6328        }
6329        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6330            (),
6331            0x3806bda34433db54,
6332            fidl::encoding::DynamicFlags::empty(),
6333            _decode,
6334        )
6335    }
6336}
6337
6338pub struct DictionaryKeyIteratorEventStream {
6339    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6340}
6341
6342impl std::marker::Unpin for DictionaryKeyIteratorEventStream {}
6343
6344impl futures::stream::FusedStream for DictionaryKeyIteratorEventStream {
6345    fn is_terminated(&self) -> bool {
6346        self.event_receiver.is_terminated()
6347    }
6348}
6349
6350impl futures::Stream for DictionaryKeyIteratorEventStream {
6351    type Item = Result<DictionaryKeyIteratorEvent, fidl::Error>;
6352
6353    fn poll_next(
6354        mut self: std::pin::Pin<&mut Self>,
6355        cx: &mut std::task::Context<'_>,
6356    ) -> std::task::Poll<Option<Self::Item>> {
6357        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6358            &mut self.event_receiver,
6359            cx
6360        )?) {
6361            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeyIteratorEvent::decode(buf))),
6362            None => std::task::Poll::Ready(None),
6363        }
6364    }
6365}
6366
6367#[derive(Debug)]
6368pub enum DictionaryKeyIteratorEvent {}
6369
6370impl DictionaryKeyIteratorEvent {
6371    /// Decodes a message buffer as a [`DictionaryKeyIteratorEvent`].
6372    fn decode(
6373        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6374    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6375        let (bytes, _handles) = buf.split_mut();
6376        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6377        debug_assert_eq!(tx_header.tx_id, 0);
6378        match tx_header.ordinal {
6379            _ => Err(fidl::Error::UnknownOrdinal {
6380                ordinal: tx_header.ordinal,
6381                protocol_name:
6382                    <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6383            }),
6384        }
6385    }
6386}
6387
6388/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryKeyIterator.
6389pub struct DictionaryKeyIteratorRequestStream {
6390    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6391    is_terminated: bool,
6392}
6393
6394impl std::marker::Unpin for DictionaryKeyIteratorRequestStream {}
6395
6396impl futures::stream::FusedStream for DictionaryKeyIteratorRequestStream {
6397    fn is_terminated(&self) -> bool {
6398        self.is_terminated
6399    }
6400}
6401
6402impl fidl::endpoints::RequestStream for DictionaryKeyIteratorRequestStream {
6403    type Protocol = DictionaryKeyIteratorMarker;
6404    type ControlHandle = DictionaryKeyIteratorControlHandle;
6405
6406    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6407        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6408    }
6409
6410    fn control_handle(&self) -> Self::ControlHandle {
6411        DictionaryKeyIteratorControlHandle { inner: self.inner.clone() }
6412    }
6413
6414    fn into_inner(
6415        self,
6416    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6417    {
6418        (self.inner, self.is_terminated)
6419    }
6420
6421    fn from_inner(
6422        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6423        is_terminated: bool,
6424    ) -> Self {
6425        Self { inner, is_terminated }
6426    }
6427}
6428
6429impl futures::Stream for DictionaryKeyIteratorRequestStream {
6430    type Item = Result<DictionaryKeyIteratorRequest, fidl::Error>;
6431
6432    fn poll_next(
6433        mut self: std::pin::Pin<&mut Self>,
6434        cx: &mut std::task::Context<'_>,
6435    ) -> std::task::Poll<Option<Self::Item>> {
6436        let this = &mut *self;
6437        if this.inner.check_shutdown(cx) {
6438            this.is_terminated = true;
6439            return std::task::Poll::Ready(None);
6440        }
6441        if this.is_terminated {
6442            panic!("polled DictionaryKeyIteratorRequestStream after completion");
6443        }
6444        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6445            |bytes, handles| {
6446                match this.inner.channel().read_etc(cx, bytes, handles) {
6447                    std::task::Poll::Ready(Ok(())) => {}
6448                    std::task::Poll::Pending => return std::task::Poll::Pending,
6449                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6450                        this.is_terminated = true;
6451                        return std::task::Poll::Ready(None);
6452                    }
6453                    std::task::Poll::Ready(Err(e)) => {
6454                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6455                            e.into(),
6456                        ))));
6457                    }
6458                }
6459
6460                // A message has been received from the channel
6461                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6462
6463                std::task::Poll::Ready(Some(match header.ordinal {
6464                0x3806bda34433db54 => {
6465                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6466                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6467                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6468                    let control_handle = DictionaryKeyIteratorControlHandle {
6469                        inner: this.inner.clone(),
6470                    };
6471                    Ok(DictionaryKeyIteratorRequest::GetNext {
6472                        responder: DictionaryKeyIteratorGetNextResponder {
6473                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6474                            tx_id: header.tx_id,
6475                        },
6476                    })
6477                }
6478                _ => Err(fidl::Error::UnknownOrdinal {
6479                    ordinal: header.ordinal,
6480                    protocol_name: <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6481                }),
6482            }))
6483            },
6484        )
6485    }
6486}
6487
6488#[derive(Debug)]
6489pub enum DictionaryKeyIteratorRequest {
6490    /// Returns the next set of keys in this dictionary. Returns an empty vector
6491    /// when there are no more keys to iterate.
6492    GetNext { responder: DictionaryKeyIteratorGetNextResponder },
6493}
6494
6495impl DictionaryKeyIteratorRequest {
6496    #[allow(irrefutable_let_patterns)]
6497    pub fn into_get_next(self) -> Option<(DictionaryKeyIteratorGetNextResponder)> {
6498        if let DictionaryKeyIteratorRequest::GetNext { responder } = self {
6499            Some((responder))
6500        } else {
6501            None
6502        }
6503    }
6504
6505    /// Name of the method defined in FIDL
6506    pub fn method_name(&self) -> &'static str {
6507        match *self {
6508            DictionaryKeyIteratorRequest::GetNext { .. } => "get_next",
6509        }
6510    }
6511}
6512
6513#[derive(Debug, Clone)]
6514pub struct DictionaryKeyIteratorControlHandle {
6515    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6516}
6517
6518impl fidl::endpoints::ControlHandle for DictionaryKeyIteratorControlHandle {
6519    fn shutdown(&self) {
6520        self.inner.shutdown()
6521    }
6522
6523    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6524        self.inner.shutdown_with_epitaph(status)
6525    }
6526
6527    fn is_closed(&self) -> bool {
6528        self.inner.channel().is_closed()
6529    }
6530    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6531        self.inner.channel().on_closed()
6532    }
6533
6534    #[cfg(target_os = "fuchsia")]
6535    fn signal_peer(
6536        &self,
6537        clear_mask: zx::Signals,
6538        set_mask: zx::Signals,
6539    ) -> Result<(), zx_status::Status> {
6540        use fidl::Peered;
6541        self.inner.channel().signal_peer(clear_mask, set_mask)
6542    }
6543}
6544
6545impl DictionaryKeyIteratorControlHandle {}
6546
6547#[must_use = "FIDL methods require a response to be sent"]
6548#[derive(Debug)]
6549pub struct DictionaryKeyIteratorGetNextResponder {
6550    control_handle: std::mem::ManuallyDrop<DictionaryKeyIteratorControlHandle>,
6551    tx_id: u32,
6552}
6553
6554/// Set the the channel to be shutdown (see [`DictionaryKeyIteratorControlHandle::shutdown`])
6555/// if the responder is dropped without sending a response, so that the client
6556/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6557impl std::ops::Drop for DictionaryKeyIteratorGetNextResponder {
6558    fn drop(&mut self) {
6559        self.control_handle.shutdown();
6560        // Safety: drops once, never accessed again
6561        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6562    }
6563}
6564
6565impl fidl::endpoints::Responder for DictionaryKeyIteratorGetNextResponder {
6566    type ControlHandle = DictionaryKeyIteratorControlHandle;
6567
6568    fn control_handle(&self) -> &DictionaryKeyIteratorControlHandle {
6569        &self.control_handle
6570    }
6571
6572    fn drop_without_shutdown(mut self) {
6573        // Safety: drops once, never accessed again due to mem::forget
6574        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6575        // Prevent Drop from running (which would shut down the channel)
6576        std::mem::forget(self);
6577    }
6578}
6579
6580impl DictionaryKeyIteratorGetNextResponder {
6581    /// Sends a response to the FIDL transaction.
6582    ///
6583    /// Sets the channel to shutdown if an error occurs.
6584    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6585        let _result = self.send_raw(keys);
6586        if _result.is_err() {
6587            self.control_handle.shutdown();
6588        }
6589        self.drop_without_shutdown();
6590        _result
6591    }
6592
6593    /// Similar to "send" but does not shutdown the channel if an error occurs.
6594    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6595        let _result = self.send_raw(keys);
6596        self.drop_without_shutdown();
6597        _result
6598    }
6599
6600    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6601        self.control_handle.inner.send::<DictionaryKeyIteratorGetNextResponse>(
6602            (keys,),
6603            self.tx_id,
6604            0x3806bda34433db54,
6605            fidl::encoding::DynamicFlags::empty(),
6606        )
6607    }
6608}
6609
6610#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6611pub struct DictionaryRouterMarker;
6612
6613impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
6614    type Proxy = DictionaryRouterProxy;
6615    type RequestStream = DictionaryRouterRequestStream;
6616    #[cfg(target_os = "fuchsia")]
6617    type SynchronousProxy = DictionaryRouterSynchronousProxy;
6618
6619    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DictionaryRouter";
6620}
6621impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6622pub type DictionaryRouterRouteResult = Result<RouterResponse, i32>;
6623
6624pub trait DictionaryRouterProxyInterface: Send + Sync {
6625    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6626        + Send;
6627    fn r#route(
6628        &self,
6629        request: RouteRequest,
6630        instance_token: fidl::EventPair,
6631        handle: fidl::EventPair,
6632    ) -> Self::RouteResponseFut;
6633}
6634#[derive(Debug)]
6635#[cfg(target_os = "fuchsia")]
6636pub struct DictionaryRouterSynchronousProxy {
6637    client: fidl::client::sync::Client,
6638}
6639
6640#[cfg(target_os = "fuchsia")]
6641impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
6642    type Proxy = DictionaryRouterProxy;
6643    type Protocol = DictionaryRouterMarker;
6644
6645    fn from_channel(inner: fidl::Channel) -> Self {
6646        Self::new(inner)
6647    }
6648
6649    fn into_channel(self) -> fidl::Channel {
6650        self.client.into_channel()
6651    }
6652
6653    fn as_channel(&self) -> &fidl::Channel {
6654        self.client.as_channel()
6655    }
6656}
6657
6658#[cfg(target_os = "fuchsia")]
6659impl DictionaryRouterSynchronousProxy {
6660    pub fn new(channel: fidl::Channel) -> Self {
6661        Self { client: fidl::client::sync::Client::new(channel) }
6662    }
6663
6664    pub fn into_channel(self) -> fidl::Channel {
6665        self.client.into_channel()
6666    }
6667
6668    /// Waits until an event arrives and returns it. It is safe for other
6669    /// threads to make concurrent requests while waiting for an event.
6670    pub fn wait_for_event(
6671        &self,
6672        deadline: zx::MonotonicInstant,
6673    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6674        DictionaryRouterEvent::decode(
6675            self.client.wait_for_event::<DictionaryRouterMarker>(deadline)?,
6676        )
6677    }
6678
6679    /// Attempts to produce a `Dictionary` capability from this
6680    /// `DictionaryRouter`.
6681    ///
6682    /// `request` contains context for this route, and `instance_token`
6683    /// references the component that the routing operation is being performed
6684    /// for.
6685    ///
6686    /// This will return:
6687    ///
6688    /// - `SUCCESS` if `handle` has been associated with a connector.
6689    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6690    ///   will be closed.
6691    /// - An error, if the operation failed.
6692    pub fn r#route(
6693        &self,
6694        mut request: RouteRequest,
6695        mut instance_token: fidl::EventPair,
6696        mut handle: fidl::EventPair,
6697        ___deadline: zx::MonotonicInstant,
6698    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6699        let _response = self.client.send_query::<
6700            DictionaryRouterRouteRequest,
6701            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6702            DictionaryRouterMarker,
6703        >(
6704            (&mut request, instance_token, handle,),
6705            0x199389f437b3937b,
6706            fidl::encoding::DynamicFlags::FLEXIBLE,
6707            ___deadline,
6708        )?
6709        .into_result::<DictionaryRouterMarker>("route")?;
6710        Ok(_response.map(|x| x.response))
6711    }
6712}
6713
6714#[cfg(target_os = "fuchsia")]
6715impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
6716    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
6717        value.into_channel().into()
6718    }
6719}
6720
6721#[cfg(target_os = "fuchsia")]
6722impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
6723    fn from(value: fidl::Channel) -> Self {
6724        Self::new(value)
6725    }
6726}
6727
6728#[cfg(target_os = "fuchsia")]
6729impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
6730    type Protocol = DictionaryRouterMarker;
6731
6732    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
6733        Self::new(value.into_channel())
6734    }
6735}
6736
6737#[derive(Debug, Clone)]
6738pub struct DictionaryRouterProxy {
6739    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6740}
6741
6742impl fidl::endpoints::Proxy for DictionaryRouterProxy {
6743    type Protocol = DictionaryRouterMarker;
6744
6745    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6746        Self::new(inner)
6747    }
6748
6749    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6750        self.client.into_channel().map_err(|client| Self { client })
6751    }
6752
6753    fn as_channel(&self) -> &::fidl::AsyncChannel {
6754        self.client.as_channel()
6755    }
6756}
6757
6758impl DictionaryRouterProxy {
6759    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouter.
6760    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6761        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6762        Self { client: fidl::client::Client::new(channel, protocol_name) }
6763    }
6764
6765    /// Get a Stream of events from the remote end of the protocol.
6766    ///
6767    /// # Panics
6768    ///
6769    /// Panics if the event stream was already taken.
6770    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6771        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6772    }
6773
6774    /// Attempts to produce a `Dictionary` capability from this
6775    /// `DictionaryRouter`.
6776    ///
6777    /// `request` contains context for this route, and `instance_token`
6778    /// references the component that the routing operation is being performed
6779    /// for.
6780    ///
6781    /// This will return:
6782    ///
6783    /// - `SUCCESS` if `handle` has been associated with a connector.
6784    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6785    ///   will be closed.
6786    /// - An error, if the operation failed.
6787    pub fn r#route(
6788        &self,
6789        mut request: RouteRequest,
6790        mut instance_token: fidl::EventPair,
6791        mut handle: fidl::EventPair,
6792    ) -> fidl::client::QueryResponseFut<
6793        DictionaryRouterRouteResult,
6794        fidl::encoding::DefaultFuchsiaResourceDialect,
6795    > {
6796        DictionaryRouterProxyInterface::r#route(self, request, instance_token, handle)
6797    }
6798}
6799
6800impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6801    type RouteResponseFut = fidl::client::QueryResponseFut<
6802        DictionaryRouterRouteResult,
6803        fidl::encoding::DefaultFuchsiaResourceDialect,
6804    >;
6805    fn r#route(
6806        &self,
6807        mut request: RouteRequest,
6808        mut instance_token: fidl::EventPair,
6809        mut handle: fidl::EventPair,
6810    ) -> Self::RouteResponseFut {
6811        fn _decode(
6812            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6813        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6814            let _response = fidl::client::decode_transaction_body::<
6815                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6816                fidl::encoding::DefaultFuchsiaResourceDialect,
6817                0x199389f437b3937b,
6818            >(_buf?)?
6819            .into_result::<DictionaryRouterMarker>("route")?;
6820            Ok(_response.map(|x| x.response))
6821        }
6822        self.client
6823            .send_query_and_decode::<DictionaryRouterRouteRequest, DictionaryRouterRouteResult>(
6824                (&mut request, instance_token, handle),
6825                0x199389f437b3937b,
6826                fidl::encoding::DynamicFlags::FLEXIBLE,
6827                _decode,
6828            )
6829    }
6830}
6831
6832pub struct DictionaryRouterEventStream {
6833    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6834}
6835
6836impl std::marker::Unpin for DictionaryRouterEventStream {}
6837
6838impl futures::stream::FusedStream for DictionaryRouterEventStream {
6839    fn is_terminated(&self) -> bool {
6840        self.event_receiver.is_terminated()
6841    }
6842}
6843
6844impl futures::Stream for DictionaryRouterEventStream {
6845    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6846
6847    fn poll_next(
6848        mut self: std::pin::Pin<&mut Self>,
6849        cx: &mut std::task::Context<'_>,
6850    ) -> std::task::Poll<Option<Self::Item>> {
6851        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6852            &mut self.event_receiver,
6853            cx
6854        )?) {
6855            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6856            None => std::task::Poll::Ready(None),
6857        }
6858    }
6859}
6860
6861#[derive(Debug)]
6862pub enum DictionaryRouterEvent {
6863    #[non_exhaustive]
6864    _UnknownEvent {
6865        /// Ordinal of the event that was sent.
6866        ordinal: u64,
6867    },
6868}
6869
6870impl DictionaryRouterEvent {
6871    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6872    fn decode(
6873        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6874    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6875        let (bytes, _handles) = buf.split_mut();
6876        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6877        debug_assert_eq!(tx_header.tx_id, 0);
6878        match tx_header.ordinal {
6879            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6880                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6881            }
6882            _ => Err(fidl::Error::UnknownOrdinal {
6883                ordinal: tx_header.ordinal,
6884                protocol_name:
6885                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6886            }),
6887        }
6888    }
6889}
6890
6891/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouter.
6892pub struct DictionaryRouterRequestStream {
6893    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6894    is_terminated: bool,
6895}
6896
6897impl std::marker::Unpin for DictionaryRouterRequestStream {}
6898
6899impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6900    fn is_terminated(&self) -> bool {
6901        self.is_terminated
6902    }
6903}
6904
6905impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
6906    type Protocol = DictionaryRouterMarker;
6907    type ControlHandle = DictionaryRouterControlHandle;
6908
6909    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6910        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6911    }
6912
6913    fn control_handle(&self) -> Self::ControlHandle {
6914        DictionaryRouterControlHandle { inner: self.inner.clone() }
6915    }
6916
6917    fn into_inner(
6918        self,
6919    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6920    {
6921        (self.inner, self.is_terminated)
6922    }
6923
6924    fn from_inner(
6925        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6926        is_terminated: bool,
6927    ) -> Self {
6928        Self { inner, is_terminated }
6929    }
6930}
6931
6932impl futures::Stream for DictionaryRouterRequestStream {
6933    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6934
6935    fn poll_next(
6936        mut self: std::pin::Pin<&mut Self>,
6937        cx: &mut std::task::Context<'_>,
6938    ) -> std::task::Poll<Option<Self::Item>> {
6939        let this = &mut *self;
6940        if this.inner.check_shutdown(cx) {
6941            this.is_terminated = true;
6942            return std::task::Poll::Ready(None);
6943        }
6944        if this.is_terminated {
6945            panic!("polled DictionaryRouterRequestStream after completion");
6946        }
6947        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6948            |bytes, handles| {
6949                match this.inner.channel().read_etc(cx, bytes, handles) {
6950                    std::task::Poll::Ready(Ok(())) => {}
6951                    std::task::Poll::Pending => return std::task::Poll::Pending,
6952                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6953                        this.is_terminated = true;
6954                        return std::task::Poll::Ready(None);
6955                    }
6956                    std::task::Poll::Ready(Err(e)) => {
6957                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6958                            e.into(),
6959                        ))));
6960                    }
6961                }
6962
6963                // A message has been received from the channel
6964                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6965
6966                std::task::Poll::Ready(Some(match header.ordinal {
6967                    0x199389f437b3937b => {
6968                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6969                        let mut req = fidl::new_empty!(
6970                            DictionaryRouterRouteRequest,
6971                            fidl::encoding::DefaultFuchsiaResourceDialect
6972                        );
6973                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6974                        let control_handle =
6975                            DictionaryRouterControlHandle { inner: this.inner.clone() };
6976                        Ok(DictionaryRouterRequest::Route {
6977                            request: req.request,
6978                            instance_token: req.instance_token,
6979                            handle: req.handle,
6980
6981                            responder: DictionaryRouterRouteResponder {
6982                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6983                                tx_id: header.tx_id,
6984                            },
6985                        })
6986                    }
6987                    _ if header.tx_id == 0
6988                        && header
6989                            .dynamic_flags()
6990                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6991                    {
6992                        Ok(DictionaryRouterRequest::_UnknownMethod {
6993                            ordinal: header.ordinal,
6994                            control_handle: DictionaryRouterControlHandle {
6995                                inner: this.inner.clone(),
6996                            },
6997                            method_type: fidl::MethodType::OneWay,
6998                        })
6999                    }
7000                    _ if header
7001                        .dynamic_flags()
7002                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7003                    {
7004                        this.inner.send_framework_err(
7005                            fidl::encoding::FrameworkErr::UnknownMethod,
7006                            header.tx_id,
7007                            header.ordinal,
7008                            header.dynamic_flags(),
7009                            (bytes, handles),
7010                        )?;
7011                        Ok(DictionaryRouterRequest::_UnknownMethod {
7012                            ordinal: header.ordinal,
7013                            control_handle: DictionaryRouterControlHandle {
7014                                inner: this.inner.clone(),
7015                            },
7016                            method_type: fidl::MethodType::TwoWay,
7017                        })
7018                    }
7019                    _ => Err(fidl::Error::UnknownOrdinal {
7020                        ordinal: header.ordinal,
7021                        protocol_name:
7022                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7023                    }),
7024                }))
7025            },
7026        )
7027    }
7028}
7029
7030/// A factory for `Dictionary` capabilities.
7031#[derive(Debug)]
7032pub enum DictionaryRouterRequest {
7033    /// Attempts to produce a `Dictionary` capability from this
7034    /// `DictionaryRouter`.
7035    ///
7036    /// `request` contains context for this route, and `instance_token`
7037    /// references the component that the routing operation is being performed
7038    /// for.
7039    ///
7040    /// This will return:
7041    ///
7042    /// - `SUCCESS` if `handle` has been associated with a connector.
7043    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7044    ///   will be closed.
7045    /// - An error, if the operation failed.
7046    Route {
7047        request: RouteRequest,
7048        instance_token: fidl::EventPair,
7049        handle: fidl::EventPair,
7050        responder: DictionaryRouterRouteResponder,
7051    },
7052    /// An interaction was received which does not match any known method.
7053    #[non_exhaustive]
7054    _UnknownMethod {
7055        /// Ordinal of the method that was called.
7056        ordinal: u64,
7057        control_handle: DictionaryRouterControlHandle,
7058        method_type: fidl::MethodType,
7059    },
7060}
7061
7062impl DictionaryRouterRequest {
7063    #[allow(irrefutable_let_patterns)]
7064    pub fn into_route(
7065        self,
7066    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DictionaryRouterRouteResponder)>
7067    {
7068        if let DictionaryRouterRequest::Route { request, instance_token, handle, responder } = self
7069        {
7070            Some((request, instance_token, handle, responder))
7071        } else {
7072            None
7073        }
7074    }
7075
7076    /// Name of the method defined in FIDL
7077    pub fn method_name(&self) -> &'static str {
7078        match *self {
7079            DictionaryRouterRequest::Route { .. } => "route",
7080            DictionaryRouterRequest::_UnknownMethod {
7081                method_type: fidl::MethodType::OneWay,
7082                ..
7083            } => "unknown one-way method",
7084            DictionaryRouterRequest::_UnknownMethod {
7085                method_type: fidl::MethodType::TwoWay,
7086                ..
7087            } => "unknown two-way method",
7088        }
7089    }
7090}
7091
7092#[derive(Debug, Clone)]
7093pub struct DictionaryRouterControlHandle {
7094    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7095}
7096
7097impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7098    fn shutdown(&self) {
7099        self.inner.shutdown()
7100    }
7101
7102    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7103        self.inner.shutdown_with_epitaph(status)
7104    }
7105
7106    fn is_closed(&self) -> bool {
7107        self.inner.channel().is_closed()
7108    }
7109    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7110        self.inner.channel().on_closed()
7111    }
7112
7113    #[cfg(target_os = "fuchsia")]
7114    fn signal_peer(
7115        &self,
7116        clear_mask: zx::Signals,
7117        set_mask: zx::Signals,
7118    ) -> Result<(), zx_status::Status> {
7119        use fidl::Peered;
7120        self.inner.channel().signal_peer(clear_mask, set_mask)
7121    }
7122}
7123
7124impl DictionaryRouterControlHandle {}
7125
7126#[must_use = "FIDL methods require a response to be sent"]
7127#[derive(Debug)]
7128pub struct DictionaryRouterRouteResponder {
7129    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7130    tx_id: u32,
7131}
7132
7133/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7134/// if the responder is dropped without sending a response, so that the client
7135/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7136impl std::ops::Drop for DictionaryRouterRouteResponder {
7137    fn drop(&mut self) {
7138        self.control_handle.shutdown();
7139        // Safety: drops once, never accessed again
7140        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7141    }
7142}
7143
7144impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7145    type ControlHandle = DictionaryRouterControlHandle;
7146
7147    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7148        &self.control_handle
7149    }
7150
7151    fn drop_without_shutdown(mut self) {
7152        // Safety: drops once, never accessed again due to mem::forget
7153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7154        // Prevent Drop from running (which would shut down the channel)
7155        std::mem::forget(self);
7156    }
7157}
7158
7159impl DictionaryRouterRouteResponder {
7160    /// Sends a response to the FIDL transaction.
7161    ///
7162    /// Sets the channel to shutdown if an error occurs.
7163    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7164        let _result = self.send_raw(result);
7165        if _result.is_err() {
7166            self.control_handle.shutdown();
7167        }
7168        self.drop_without_shutdown();
7169        _result
7170    }
7171
7172    /// Similar to "send" but does not shutdown the channel if an error occurs.
7173    pub fn send_no_shutdown_on_err(
7174        self,
7175        mut result: Result<RouterResponse, i32>,
7176    ) -> Result<(), fidl::Error> {
7177        let _result = self.send_raw(result);
7178        self.drop_without_shutdown();
7179        _result
7180    }
7181
7182    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7183        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7184            DictionaryRouterRouteResponse,
7185            i32,
7186        >>(
7187            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7188            self.tx_id,
7189            0x199389f437b3937b,
7190            fidl::encoding::DynamicFlags::FLEXIBLE,
7191        )
7192    }
7193}
7194
7195#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7196pub struct DirConnectorRouterMarker;
7197
7198impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7199    type Proxy = DirConnectorRouterProxy;
7200    type RequestStream = DirConnectorRouterRequestStream;
7201    #[cfg(target_os = "fuchsia")]
7202    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7203
7204    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouter";
7205}
7206pub type DirConnectorRouterRouteResult = Result<RouterResponse, i32>;
7207
7208pub trait DirConnectorRouterProxyInterface: Send + Sync {
7209    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7210        + Send;
7211    fn r#route(
7212        &self,
7213        request: RouteRequest,
7214        instance_token: fidl::EventPair,
7215        handle: fidl::EventPair,
7216    ) -> Self::RouteResponseFut;
7217}
7218#[derive(Debug)]
7219#[cfg(target_os = "fuchsia")]
7220pub struct DirConnectorRouterSynchronousProxy {
7221    client: fidl::client::sync::Client,
7222}
7223
7224#[cfg(target_os = "fuchsia")]
7225impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7226    type Proxy = DirConnectorRouterProxy;
7227    type Protocol = DirConnectorRouterMarker;
7228
7229    fn from_channel(inner: fidl::Channel) -> Self {
7230        Self::new(inner)
7231    }
7232
7233    fn into_channel(self) -> fidl::Channel {
7234        self.client.into_channel()
7235    }
7236
7237    fn as_channel(&self) -> &fidl::Channel {
7238        self.client.as_channel()
7239    }
7240}
7241
7242#[cfg(target_os = "fuchsia")]
7243impl DirConnectorRouterSynchronousProxy {
7244    pub fn new(channel: fidl::Channel) -> Self {
7245        Self { client: fidl::client::sync::Client::new(channel) }
7246    }
7247
7248    pub fn into_channel(self) -> fidl::Channel {
7249        self.client.into_channel()
7250    }
7251
7252    /// Waits until an event arrives and returns it. It is safe for other
7253    /// threads to make concurrent requests while waiting for an event.
7254    pub fn wait_for_event(
7255        &self,
7256        deadline: zx::MonotonicInstant,
7257    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7258        DirConnectorRouterEvent::decode(
7259            self.client.wait_for_event::<DirConnectorRouterMarker>(deadline)?,
7260        )
7261    }
7262
7263    /// Attempts to produce a `DirConnector` capability from this
7264    /// `DirConnectorRouter`.
7265    ///
7266    /// `request` contains context for this route, and `instance_token`
7267    /// references the component that the routing operation is being performed
7268    /// for.
7269    ///
7270    /// This will return:
7271    ///
7272    /// - `SUCCESS` if `handle` has been associated with a connector.
7273    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7274    ///   will be closed.
7275    /// - An error, if the operation failed.
7276    pub fn r#route(
7277        &self,
7278        mut request: RouteRequest,
7279        mut instance_token: fidl::EventPair,
7280        mut handle: fidl::EventPair,
7281        ___deadline: zx::MonotonicInstant,
7282    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7283        let _response = self.client.send_query::<
7284            DirConnectorRouterRouteRequest,
7285            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7286            DirConnectorRouterMarker,
7287        >(
7288            (&mut request, instance_token, handle,),
7289            0x233f2ac038127462,
7290            fidl::encoding::DynamicFlags::FLEXIBLE,
7291            ___deadline,
7292        )?
7293        .into_result::<DirConnectorRouterMarker>("route")?;
7294        Ok(_response.map(|x| x.response))
7295    }
7296}
7297
7298#[cfg(target_os = "fuchsia")]
7299impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
7300    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
7301        value.into_channel().into()
7302    }
7303}
7304
7305#[cfg(target_os = "fuchsia")]
7306impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
7307    fn from(value: fidl::Channel) -> Self {
7308        Self::new(value)
7309    }
7310}
7311
7312#[cfg(target_os = "fuchsia")]
7313impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
7314    type Protocol = DirConnectorRouterMarker;
7315
7316    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
7317        Self::new(value.into_channel())
7318    }
7319}
7320
7321#[derive(Debug, Clone)]
7322pub struct DirConnectorRouterProxy {
7323    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7324}
7325
7326impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
7327    type Protocol = DirConnectorRouterMarker;
7328
7329    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7330        Self::new(inner)
7331    }
7332
7333    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7334        self.client.into_channel().map_err(|client| Self { client })
7335    }
7336
7337    fn as_channel(&self) -> &::fidl::AsyncChannel {
7338        self.client.as_channel()
7339    }
7340}
7341
7342impl DirConnectorRouterProxy {
7343    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouter.
7344    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7345        let protocol_name =
7346            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7347        Self { client: fidl::client::Client::new(channel, protocol_name) }
7348    }
7349
7350    /// Get a Stream of events from the remote end of the protocol.
7351    ///
7352    /// # Panics
7353    ///
7354    /// Panics if the event stream was already taken.
7355    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
7356        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
7357    }
7358
7359    /// Attempts to produce a `DirConnector` capability from this
7360    /// `DirConnectorRouter`.
7361    ///
7362    /// `request` contains context for this route, and `instance_token`
7363    /// references the component that the routing operation is being performed
7364    /// for.
7365    ///
7366    /// This will return:
7367    ///
7368    /// - `SUCCESS` if `handle` has been associated with a connector.
7369    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7370    ///   will be closed.
7371    /// - An error, if the operation failed.
7372    pub fn r#route(
7373        &self,
7374        mut request: RouteRequest,
7375        mut instance_token: fidl::EventPair,
7376        mut handle: fidl::EventPair,
7377    ) -> fidl::client::QueryResponseFut<
7378        DirConnectorRouterRouteResult,
7379        fidl::encoding::DefaultFuchsiaResourceDialect,
7380    > {
7381        DirConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
7382    }
7383}
7384
7385impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
7386    type RouteResponseFut = fidl::client::QueryResponseFut<
7387        DirConnectorRouterRouteResult,
7388        fidl::encoding::DefaultFuchsiaResourceDialect,
7389    >;
7390    fn r#route(
7391        &self,
7392        mut request: RouteRequest,
7393        mut instance_token: fidl::EventPair,
7394        mut handle: fidl::EventPair,
7395    ) -> Self::RouteResponseFut {
7396        fn _decode(
7397            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7398        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7399            let _response = fidl::client::decode_transaction_body::<
7400                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7401                fidl::encoding::DefaultFuchsiaResourceDialect,
7402                0x233f2ac038127462,
7403            >(_buf?)?
7404            .into_result::<DirConnectorRouterMarker>("route")?;
7405            Ok(_response.map(|x| x.response))
7406        }
7407        self.client
7408            .send_query_and_decode::<DirConnectorRouterRouteRequest, DirConnectorRouterRouteResult>(
7409                (&mut request, instance_token, handle),
7410                0x233f2ac038127462,
7411                fidl::encoding::DynamicFlags::FLEXIBLE,
7412                _decode,
7413            )
7414    }
7415}
7416
7417pub struct DirConnectorRouterEventStream {
7418    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7419}
7420
7421impl std::marker::Unpin for DirConnectorRouterEventStream {}
7422
7423impl futures::stream::FusedStream for DirConnectorRouterEventStream {
7424    fn is_terminated(&self) -> bool {
7425        self.event_receiver.is_terminated()
7426    }
7427}
7428
7429impl futures::Stream for DirConnectorRouterEventStream {
7430    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
7431
7432    fn poll_next(
7433        mut self: std::pin::Pin<&mut Self>,
7434        cx: &mut std::task::Context<'_>,
7435    ) -> std::task::Poll<Option<Self::Item>> {
7436        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7437            &mut self.event_receiver,
7438            cx
7439        )?) {
7440            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
7441            None => std::task::Poll::Ready(None),
7442        }
7443    }
7444}
7445
7446#[derive(Debug)]
7447pub enum DirConnectorRouterEvent {
7448    #[non_exhaustive]
7449    _UnknownEvent {
7450        /// Ordinal of the event that was sent.
7451        ordinal: u64,
7452    },
7453}
7454
7455impl DirConnectorRouterEvent {
7456    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
7457    fn decode(
7458        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7459    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7460        let (bytes, _handles) = buf.split_mut();
7461        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7462        debug_assert_eq!(tx_header.tx_id, 0);
7463        match tx_header.ordinal {
7464            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7465                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7466            }
7467            _ => Err(fidl::Error::UnknownOrdinal {
7468                ordinal: tx_header.ordinal,
7469                protocol_name:
7470                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7471            }),
7472        }
7473    }
7474}
7475
7476/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouter.
7477pub struct DirConnectorRouterRequestStream {
7478    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7479    is_terminated: bool,
7480}
7481
7482impl std::marker::Unpin for DirConnectorRouterRequestStream {}
7483
7484impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
7485    fn is_terminated(&self) -> bool {
7486        self.is_terminated
7487    }
7488}
7489
7490impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
7491    type Protocol = DirConnectorRouterMarker;
7492    type ControlHandle = DirConnectorRouterControlHandle;
7493
7494    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7495        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7496    }
7497
7498    fn control_handle(&self) -> Self::ControlHandle {
7499        DirConnectorRouterControlHandle { inner: self.inner.clone() }
7500    }
7501
7502    fn into_inner(
7503        self,
7504    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7505    {
7506        (self.inner, self.is_terminated)
7507    }
7508
7509    fn from_inner(
7510        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7511        is_terminated: bool,
7512    ) -> Self {
7513        Self { inner, is_terminated }
7514    }
7515}
7516
7517impl futures::Stream for DirConnectorRouterRequestStream {
7518    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
7519
7520    fn poll_next(
7521        mut self: std::pin::Pin<&mut Self>,
7522        cx: &mut std::task::Context<'_>,
7523    ) -> std::task::Poll<Option<Self::Item>> {
7524        let this = &mut *self;
7525        if this.inner.check_shutdown(cx) {
7526            this.is_terminated = true;
7527            return std::task::Poll::Ready(None);
7528        }
7529        if this.is_terminated {
7530            panic!("polled DirConnectorRouterRequestStream after completion");
7531        }
7532        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7533            |bytes, handles| {
7534                match this.inner.channel().read_etc(cx, bytes, handles) {
7535                    std::task::Poll::Ready(Ok(())) => {}
7536                    std::task::Poll::Pending => return std::task::Poll::Pending,
7537                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7538                        this.is_terminated = true;
7539                        return std::task::Poll::Ready(None);
7540                    }
7541                    std::task::Poll::Ready(Err(e)) => {
7542                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7543                            e.into(),
7544                        ))));
7545                    }
7546                }
7547
7548                // A message has been received from the channel
7549                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7550
7551                std::task::Poll::Ready(Some(match header.ordinal {
7552                0x233f2ac038127462 => {
7553                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7554                    let mut req = fidl::new_empty!(DirConnectorRouterRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7555                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7556                    let control_handle = DirConnectorRouterControlHandle {
7557                        inner: this.inner.clone(),
7558                    };
7559                    Ok(DirConnectorRouterRequest::Route {request: req.request,
7560instance_token: req.instance_token,
7561handle: req.handle,
7562
7563                        responder: DirConnectorRouterRouteResponder {
7564                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7565                            tx_id: header.tx_id,
7566                        },
7567                    })
7568                }
7569                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7570                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7571                        ordinal: header.ordinal,
7572                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7573                        method_type: fidl::MethodType::OneWay,
7574                    })
7575                }
7576                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7577                    this.inner.send_framework_err(
7578                        fidl::encoding::FrameworkErr::UnknownMethod,
7579                        header.tx_id,
7580                        header.ordinal,
7581                        header.dynamic_flags(),
7582                        (bytes, handles),
7583                    )?;
7584                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7585                        ordinal: header.ordinal,
7586                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7587                        method_type: fidl::MethodType::TwoWay,
7588                    })
7589                }
7590                _ => Err(fidl::Error::UnknownOrdinal {
7591                    ordinal: header.ordinal,
7592                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7593                }),
7594            }))
7595            },
7596        )
7597    }
7598}
7599
7600/// A factory for `DirConnector` capabilities.
7601#[derive(Debug)]
7602pub enum DirConnectorRouterRequest {
7603    /// Attempts to produce a `DirConnector` capability from this
7604    /// `DirConnectorRouter`.
7605    ///
7606    /// `request` contains context for this route, and `instance_token`
7607    /// references the component that the routing operation is being performed
7608    /// for.
7609    ///
7610    /// This will return:
7611    ///
7612    /// - `SUCCESS` if `handle` has been associated with a connector.
7613    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7614    ///   will be closed.
7615    /// - An error, if the operation failed.
7616    Route {
7617        request: RouteRequest,
7618        instance_token: fidl::EventPair,
7619        handle: fidl::EventPair,
7620        responder: DirConnectorRouterRouteResponder,
7621    },
7622    /// An interaction was received which does not match any known method.
7623    #[non_exhaustive]
7624    _UnknownMethod {
7625        /// Ordinal of the method that was called.
7626        ordinal: u64,
7627        control_handle: DirConnectorRouterControlHandle,
7628        method_type: fidl::MethodType,
7629    },
7630}
7631
7632impl DirConnectorRouterRequest {
7633    #[allow(irrefutable_let_patterns)]
7634    pub fn into_route(
7635        self,
7636    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DirConnectorRouterRouteResponder)>
7637    {
7638        if let DirConnectorRouterRequest::Route { request, instance_token, handle, responder } =
7639            self
7640        {
7641            Some((request, instance_token, handle, responder))
7642        } else {
7643            None
7644        }
7645    }
7646
7647    /// Name of the method defined in FIDL
7648    pub fn method_name(&self) -> &'static str {
7649        match *self {
7650            DirConnectorRouterRequest::Route { .. } => "route",
7651            DirConnectorRouterRequest::_UnknownMethod {
7652                method_type: fidl::MethodType::OneWay,
7653                ..
7654            } => "unknown one-way method",
7655            DirConnectorRouterRequest::_UnknownMethod {
7656                method_type: fidl::MethodType::TwoWay,
7657                ..
7658            } => "unknown two-way method",
7659        }
7660    }
7661}
7662
7663#[derive(Debug, Clone)]
7664pub struct DirConnectorRouterControlHandle {
7665    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7666}
7667
7668impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
7669    fn shutdown(&self) {
7670        self.inner.shutdown()
7671    }
7672
7673    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7674        self.inner.shutdown_with_epitaph(status)
7675    }
7676
7677    fn is_closed(&self) -> bool {
7678        self.inner.channel().is_closed()
7679    }
7680    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7681        self.inner.channel().on_closed()
7682    }
7683
7684    #[cfg(target_os = "fuchsia")]
7685    fn signal_peer(
7686        &self,
7687        clear_mask: zx::Signals,
7688        set_mask: zx::Signals,
7689    ) -> Result<(), zx_status::Status> {
7690        use fidl::Peered;
7691        self.inner.channel().signal_peer(clear_mask, set_mask)
7692    }
7693}
7694
7695impl DirConnectorRouterControlHandle {}
7696
7697#[must_use = "FIDL methods require a response to be sent"]
7698#[derive(Debug)]
7699pub struct DirConnectorRouterRouteResponder {
7700    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
7701    tx_id: u32,
7702}
7703
7704/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
7705/// if the responder is dropped without sending a response, so that the client
7706/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7707impl std::ops::Drop for DirConnectorRouterRouteResponder {
7708    fn drop(&mut self) {
7709        self.control_handle.shutdown();
7710        // Safety: drops once, never accessed again
7711        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7712    }
7713}
7714
7715impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
7716    type ControlHandle = DirConnectorRouterControlHandle;
7717
7718    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
7719        &self.control_handle
7720    }
7721
7722    fn drop_without_shutdown(mut self) {
7723        // Safety: drops once, never accessed again due to mem::forget
7724        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7725        // Prevent Drop from running (which would shut down the channel)
7726        std::mem::forget(self);
7727    }
7728}
7729
7730impl DirConnectorRouterRouteResponder {
7731    /// Sends a response to the FIDL transaction.
7732    ///
7733    /// Sets the channel to shutdown if an error occurs.
7734    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7735        let _result = self.send_raw(result);
7736        if _result.is_err() {
7737            self.control_handle.shutdown();
7738        }
7739        self.drop_without_shutdown();
7740        _result
7741    }
7742
7743    /// Similar to "send" but does not shutdown the channel if an error occurs.
7744    pub fn send_no_shutdown_on_err(
7745        self,
7746        mut result: Result<RouterResponse, i32>,
7747    ) -> Result<(), fidl::Error> {
7748        let _result = self.send_raw(result);
7749        self.drop_without_shutdown();
7750        _result
7751    }
7752
7753    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7754        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7755            DirConnectorRouterRouteResponse,
7756            i32,
7757        >>(
7758            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7759            self.tx_id,
7760            0x233f2ac038127462,
7761            fidl::encoding::DynamicFlags::FLEXIBLE,
7762        )
7763    }
7764}
7765
7766#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7767pub struct DirReceiverMarker;
7768
7769impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
7770    type Proxy = DirReceiverProxy;
7771    type RequestStream = DirReceiverRequestStream;
7772    #[cfg(target_os = "fuchsia")]
7773    type SynchronousProxy = DirReceiverSynchronousProxy;
7774
7775    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DirReceiver";
7776}
7777impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
7778
7779pub trait DirReceiverProxyInterface: Send + Sync {
7780    fn r#receive(
7781        &self,
7782        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7783        path: &str,
7784        rights: fidl_fuchsia_io::Flags,
7785    ) -> Result<(), fidl::Error>;
7786}
7787#[derive(Debug)]
7788#[cfg(target_os = "fuchsia")]
7789pub struct DirReceiverSynchronousProxy {
7790    client: fidl::client::sync::Client,
7791}
7792
7793#[cfg(target_os = "fuchsia")]
7794impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
7795    type Proxy = DirReceiverProxy;
7796    type Protocol = DirReceiverMarker;
7797
7798    fn from_channel(inner: fidl::Channel) -> Self {
7799        Self::new(inner)
7800    }
7801
7802    fn into_channel(self) -> fidl::Channel {
7803        self.client.into_channel()
7804    }
7805
7806    fn as_channel(&self) -> &fidl::Channel {
7807        self.client.as_channel()
7808    }
7809}
7810
7811#[cfg(target_os = "fuchsia")]
7812impl DirReceiverSynchronousProxy {
7813    pub fn new(channel: fidl::Channel) -> Self {
7814        Self { client: fidl::client::sync::Client::new(channel) }
7815    }
7816
7817    pub fn into_channel(self) -> fidl::Channel {
7818        self.client.into_channel()
7819    }
7820
7821    /// Waits until an event arrives and returns it. It is safe for other
7822    /// threads to make concurrent requests while waiting for an event.
7823    pub fn wait_for_event(
7824        &self,
7825        deadline: zx::MonotonicInstant,
7826    ) -> Result<DirReceiverEvent, fidl::Error> {
7827        DirReceiverEvent::decode(self.client.wait_for_event::<DirReceiverMarker>(deadline)?)
7828    }
7829
7830    /// `Receive` will be called by component manager whenever a new handle has
7831    /// been given to any `DirConnector` associated with this `DirReceiver`.
7832    pub fn r#receive(
7833        &self,
7834        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7835        mut path: &str,
7836        mut rights: fidl_fuchsia_io::Flags,
7837    ) -> Result<(), fidl::Error> {
7838        self.client.send::<DirReceiverReceiveRequest>(
7839            (channel, path, rights),
7840            0x4ac564d726bb325e,
7841            fidl::encoding::DynamicFlags::empty(),
7842        )
7843    }
7844}
7845
7846#[cfg(target_os = "fuchsia")]
7847impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
7848    fn from(value: DirReceiverSynchronousProxy) -> Self {
7849        value.into_channel().into()
7850    }
7851}
7852
7853#[cfg(target_os = "fuchsia")]
7854impl From<fidl::Channel> for DirReceiverSynchronousProxy {
7855    fn from(value: fidl::Channel) -> Self {
7856        Self::new(value)
7857    }
7858}
7859
7860#[cfg(target_os = "fuchsia")]
7861impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
7862    type Protocol = DirReceiverMarker;
7863
7864    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
7865        Self::new(value.into_channel())
7866    }
7867}
7868
7869#[derive(Debug, Clone)]
7870pub struct DirReceiverProxy {
7871    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7872}
7873
7874impl fidl::endpoints::Proxy for DirReceiverProxy {
7875    type Protocol = DirReceiverMarker;
7876
7877    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7878        Self::new(inner)
7879    }
7880
7881    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7882        self.client.into_channel().map_err(|client| Self { client })
7883    }
7884
7885    fn as_channel(&self) -> &::fidl::AsyncChannel {
7886        self.client.as_channel()
7887    }
7888}
7889
7890impl DirReceiverProxy {
7891    /// Create a new Proxy for fuchsia.component.runtime/DirReceiver.
7892    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7893        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7894        Self { client: fidl::client::Client::new(channel, protocol_name) }
7895    }
7896
7897    /// Get a Stream of events from the remote end of the protocol.
7898    ///
7899    /// # Panics
7900    ///
7901    /// Panics if the event stream was already taken.
7902    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7903        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7904    }
7905
7906    /// `Receive` will be called by component manager whenever a new handle has
7907    /// been given to any `DirConnector` associated with this `DirReceiver`.
7908    pub fn r#receive(
7909        &self,
7910        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7911        mut path: &str,
7912        mut rights: fidl_fuchsia_io::Flags,
7913    ) -> Result<(), fidl::Error> {
7914        DirReceiverProxyInterface::r#receive(self, channel, path, rights)
7915    }
7916}
7917
7918impl DirReceiverProxyInterface for DirReceiverProxy {
7919    fn r#receive(
7920        &self,
7921        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7922        mut path: &str,
7923        mut rights: fidl_fuchsia_io::Flags,
7924    ) -> Result<(), fidl::Error> {
7925        self.client.send::<DirReceiverReceiveRequest>(
7926            (channel, path, rights),
7927            0x4ac564d726bb325e,
7928            fidl::encoding::DynamicFlags::empty(),
7929        )
7930    }
7931}
7932
7933pub struct DirReceiverEventStream {
7934    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7935}
7936
7937impl std::marker::Unpin for DirReceiverEventStream {}
7938
7939impl futures::stream::FusedStream for DirReceiverEventStream {
7940    fn is_terminated(&self) -> bool {
7941        self.event_receiver.is_terminated()
7942    }
7943}
7944
7945impl futures::Stream for DirReceiverEventStream {
7946    type Item = Result<DirReceiverEvent, fidl::Error>;
7947
7948    fn poll_next(
7949        mut self: std::pin::Pin<&mut Self>,
7950        cx: &mut std::task::Context<'_>,
7951    ) -> std::task::Poll<Option<Self::Item>> {
7952        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7953            &mut self.event_receiver,
7954            cx
7955        )?) {
7956            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7957            None => std::task::Poll::Ready(None),
7958        }
7959    }
7960}
7961
7962#[derive(Debug)]
7963pub enum DirReceiverEvent {}
7964
7965impl DirReceiverEvent {
7966    /// Decodes a message buffer as a [`DirReceiverEvent`].
7967    fn decode(
7968        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7969    ) -> Result<DirReceiverEvent, fidl::Error> {
7970        let (bytes, _handles) = buf.split_mut();
7971        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7972        debug_assert_eq!(tx_header.tx_id, 0);
7973        match tx_header.ordinal {
7974            _ => Err(fidl::Error::UnknownOrdinal {
7975                ordinal: tx_header.ordinal,
7976                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7977            }),
7978        }
7979    }
7980}
7981
7982/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiver.
7983pub struct DirReceiverRequestStream {
7984    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7985    is_terminated: bool,
7986}
7987
7988impl std::marker::Unpin for DirReceiverRequestStream {}
7989
7990impl futures::stream::FusedStream for DirReceiverRequestStream {
7991    fn is_terminated(&self) -> bool {
7992        self.is_terminated
7993    }
7994}
7995
7996impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
7997    type Protocol = DirReceiverMarker;
7998    type ControlHandle = DirReceiverControlHandle;
7999
8000    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8001        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8002    }
8003
8004    fn control_handle(&self) -> Self::ControlHandle {
8005        DirReceiverControlHandle { inner: self.inner.clone() }
8006    }
8007
8008    fn into_inner(
8009        self,
8010    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8011    {
8012        (self.inner, self.is_terminated)
8013    }
8014
8015    fn from_inner(
8016        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8017        is_terminated: bool,
8018    ) -> Self {
8019        Self { inner, is_terminated }
8020    }
8021}
8022
8023impl futures::Stream for DirReceiverRequestStream {
8024    type Item = Result<DirReceiverRequest, fidl::Error>;
8025
8026    fn poll_next(
8027        mut self: std::pin::Pin<&mut Self>,
8028        cx: &mut std::task::Context<'_>,
8029    ) -> std::task::Poll<Option<Self::Item>> {
8030        let this = &mut *self;
8031        if this.inner.check_shutdown(cx) {
8032            this.is_terminated = true;
8033            return std::task::Poll::Ready(None);
8034        }
8035        if this.is_terminated {
8036            panic!("polled DirReceiverRequestStream after completion");
8037        }
8038        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8039            |bytes, handles| {
8040                match this.inner.channel().read_etc(cx, bytes, handles) {
8041                    std::task::Poll::Ready(Ok(())) => {}
8042                    std::task::Poll::Pending => return std::task::Poll::Pending,
8043                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8044                        this.is_terminated = true;
8045                        return std::task::Poll::Ready(None);
8046                    }
8047                    std::task::Poll::Ready(Err(e)) => {
8048                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8049                            e.into(),
8050                        ))));
8051                    }
8052                }
8053
8054                // A message has been received from the channel
8055                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8056
8057                std::task::Poll::Ready(Some(match header.ordinal {
8058                    0x4ac564d726bb325e => {
8059                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8060                        let mut req = fidl::new_empty!(
8061                            DirReceiverReceiveRequest,
8062                            fidl::encoding::DefaultFuchsiaResourceDialect
8063                        );
8064                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8065                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
8066                        Ok(DirReceiverRequest::Receive {
8067                            channel: req.channel,
8068                            path: req.path,
8069                            rights: req.rights,
8070
8071                            control_handle,
8072                        })
8073                    }
8074                    _ => Err(fidl::Error::UnknownOrdinal {
8075                        ordinal: header.ordinal,
8076                        protocol_name:
8077                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8078                    }),
8079                }))
8080            },
8081        )
8082    }
8083}
8084
8085/// A `DirReceiver` represents the receiving end of a `DirConnector`.
8086#[derive(Debug)]
8087pub enum DirReceiverRequest {
8088    /// `Receive` will be called by component manager whenever a new handle has
8089    /// been given to any `DirConnector` associated with this `DirReceiver`.
8090    Receive {
8091        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8092        path: String,
8093        rights: fidl_fuchsia_io::Flags,
8094        control_handle: DirReceiverControlHandle,
8095    },
8096}
8097
8098impl DirReceiverRequest {
8099    #[allow(irrefutable_let_patterns)]
8100    pub fn into_receive(
8101        self,
8102    ) -> Option<(
8103        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8104        String,
8105        fidl_fuchsia_io::Flags,
8106        DirReceiverControlHandle,
8107    )> {
8108        if let DirReceiverRequest::Receive { channel, path, rights, control_handle } = self {
8109            Some((channel, path, rights, control_handle))
8110        } else {
8111            None
8112        }
8113    }
8114
8115    /// Name of the method defined in FIDL
8116    pub fn method_name(&self) -> &'static str {
8117        match *self {
8118            DirReceiverRequest::Receive { .. } => "receive",
8119        }
8120    }
8121}
8122
8123#[derive(Debug, Clone)]
8124pub struct DirReceiverControlHandle {
8125    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8126}
8127
8128impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
8129    fn shutdown(&self) {
8130        self.inner.shutdown()
8131    }
8132
8133    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8134        self.inner.shutdown_with_epitaph(status)
8135    }
8136
8137    fn is_closed(&self) -> bool {
8138        self.inner.channel().is_closed()
8139    }
8140    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8141        self.inner.channel().on_closed()
8142    }
8143
8144    #[cfg(target_os = "fuchsia")]
8145    fn signal_peer(
8146        &self,
8147        clear_mask: zx::Signals,
8148        set_mask: zx::Signals,
8149    ) -> Result<(), zx_status::Status> {
8150        use fidl::Peered;
8151        self.inner.channel().signal_peer(clear_mask, set_mask)
8152    }
8153}
8154
8155impl DirReceiverControlHandle {}
8156
8157#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8158pub struct ReceiverMarker;
8159
8160impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
8161    type Proxy = ReceiverProxy;
8162    type RequestStream = ReceiverRequestStream;
8163    #[cfg(target_os = "fuchsia")]
8164    type SynchronousProxy = ReceiverSynchronousProxy;
8165
8166    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Receiver";
8167}
8168impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
8169
8170pub trait ReceiverProxyInterface: Send + Sync {
8171    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
8172}
8173#[derive(Debug)]
8174#[cfg(target_os = "fuchsia")]
8175pub struct ReceiverSynchronousProxy {
8176    client: fidl::client::sync::Client,
8177}
8178
8179#[cfg(target_os = "fuchsia")]
8180impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
8181    type Proxy = ReceiverProxy;
8182    type Protocol = ReceiverMarker;
8183
8184    fn from_channel(inner: fidl::Channel) -> Self {
8185        Self::new(inner)
8186    }
8187
8188    fn into_channel(self) -> fidl::Channel {
8189        self.client.into_channel()
8190    }
8191
8192    fn as_channel(&self) -> &fidl::Channel {
8193        self.client.as_channel()
8194    }
8195}
8196
8197#[cfg(target_os = "fuchsia")]
8198impl ReceiverSynchronousProxy {
8199    pub fn new(channel: fidl::Channel) -> Self {
8200        Self { client: fidl::client::sync::Client::new(channel) }
8201    }
8202
8203    pub fn into_channel(self) -> fidl::Channel {
8204        self.client.into_channel()
8205    }
8206
8207    /// Waits until an event arrives and returns it. It is safe for other
8208    /// threads to make concurrent requests while waiting for an event.
8209    pub fn wait_for_event(
8210        &self,
8211        deadline: zx::MonotonicInstant,
8212    ) -> Result<ReceiverEvent, fidl::Error> {
8213        ReceiverEvent::decode(self.client.wait_for_event::<ReceiverMarker>(deadline)?)
8214    }
8215
8216    /// `Receive` will be called by component manager whenever an new handle has
8217    /// been given to any `Connector` associated with this `Receiver`.
8218    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8219        self.client.send::<ReceiverReceiveRequest>(
8220            (channel,),
8221            0x609ca5c7943b58d0,
8222            fidl::encoding::DynamicFlags::empty(),
8223        )
8224    }
8225}
8226
8227#[cfg(target_os = "fuchsia")]
8228impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
8229    fn from(value: ReceiverSynchronousProxy) -> Self {
8230        value.into_channel().into()
8231    }
8232}
8233
8234#[cfg(target_os = "fuchsia")]
8235impl From<fidl::Channel> for ReceiverSynchronousProxy {
8236    fn from(value: fidl::Channel) -> Self {
8237        Self::new(value)
8238    }
8239}
8240
8241#[cfg(target_os = "fuchsia")]
8242impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
8243    type Protocol = ReceiverMarker;
8244
8245    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
8246        Self::new(value.into_channel())
8247    }
8248}
8249
8250#[derive(Debug, Clone)]
8251pub struct ReceiverProxy {
8252    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8253}
8254
8255impl fidl::endpoints::Proxy for ReceiverProxy {
8256    type Protocol = ReceiverMarker;
8257
8258    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8259        Self::new(inner)
8260    }
8261
8262    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8263        self.client.into_channel().map_err(|client| Self { client })
8264    }
8265
8266    fn as_channel(&self) -> &::fidl::AsyncChannel {
8267        self.client.as_channel()
8268    }
8269}
8270
8271impl ReceiverProxy {
8272    /// Create a new Proxy for fuchsia.component.runtime/Receiver.
8273    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8274        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8275        Self { client: fidl::client::Client::new(channel, protocol_name) }
8276    }
8277
8278    /// Get a Stream of events from the remote end of the protocol.
8279    ///
8280    /// # Panics
8281    ///
8282    /// Panics if the event stream was already taken.
8283    pub fn take_event_stream(&self) -> ReceiverEventStream {
8284        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8285    }
8286
8287    /// `Receive` will be called by component manager whenever an new handle has
8288    /// been given to any `Connector` associated with this `Receiver`.
8289    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8290        ReceiverProxyInterface::r#receive(self, channel)
8291    }
8292}
8293
8294impl ReceiverProxyInterface for ReceiverProxy {
8295    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8296        self.client.send::<ReceiverReceiveRequest>(
8297            (channel,),
8298            0x609ca5c7943b58d0,
8299            fidl::encoding::DynamicFlags::empty(),
8300        )
8301    }
8302}
8303
8304pub struct ReceiverEventStream {
8305    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8306}
8307
8308impl std::marker::Unpin for ReceiverEventStream {}
8309
8310impl futures::stream::FusedStream for ReceiverEventStream {
8311    fn is_terminated(&self) -> bool {
8312        self.event_receiver.is_terminated()
8313    }
8314}
8315
8316impl futures::Stream for ReceiverEventStream {
8317    type Item = Result<ReceiverEvent, fidl::Error>;
8318
8319    fn poll_next(
8320        mut self: std::pin::Pin<&mut Self>,
8321        cx: &mut std::task::Context<'_>,
8322    ) -> std::task::Poll<Option<Self::Item>> {
8323        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8324            &mut self.event_receiver,
8325            cx
8326        )?) {
8327            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8328            None => std::task::Poll::Ready(None),
8329        }
8330    }
8331}
8332
8333#[derive(Debug)]
8334pub enum ReceiverEvent {}
8335
8336impl ReceiverEvent {
8337    /// Decodes a message buffer as a [`ReceiverEvent`].
8338    fn decode(
8339        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8340    ) -> Result<ReceiverEvent, fidl::Error> {
8341        let (bytes, _handles) = buf.split_mut();
8342        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8343        debug_assert_eq!(tx_header.tx_id, 0);
8344        match tx_header.ordinal {
8345            _ => Err(fidl::Error::UnknownOrdinal {
8346                ordinal: tx_header.ordinal,
8347                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8348            }),
8349        }
8350    }
8351}
8352
8353/// A Stream of incoming requests for fuchsia.component.runtime/Receiver.
8354pub struct ReceiverRequestStream {
8355    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8356    is_terminated: bool,
8357}
8358
8359impl std::marker::Unpin for ReceiverRequestStream {}
8360
8361impl futures::stream::FusedStream for ReceiverRequestStream {
8362    fn is_terminated(&self) -> bool {
8363        self.is_terminated
8364    }
8365}
8366
8367impl fidl::endpoints::RequestStream for ReceiverRequestStream {
8368    type Protocol = ReceiverMarker;
8369    type ControlHandle = ReceiverControlHandle;
8370
8371    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8372        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8373    }
8374
8375    fn control_handle(&self) -> Self::ControlHandle {
8376        ReceiverControlHandle { inner: self.inner.clone() }
8377    }
8378
8379    fn into_inner(
8380        self,
8381    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8382    {
8383        (self.inner, self.is_terminated)
8384    }
8385
8386    fn from_inner(
8387        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8388        is_terminated: bool,
8389    ) -> Self {
8390        Self { inner, is_terminated }
8391    }
8392}
8393
8394impl futures::Stream for ReceiverRequestStream {
8395    type Item = Result<ReceiverRequest, fidl::Error>;
8396
8397    fn poll_next(
8398        mut self: std::pin::Pin<&mut Self>,
8399        cx: &mut std::task::Context<'_>,
8400    ) -> std::task::Poll<Option<Self::Item>> {
8401        let this = &mut *self;
8402        if this.inner.check_shutdown(cx) {
8403            this.is_terminated = true;
8404            return std::task::Poll::Ready(None);
8405        }
8406        if this.is_terminated {
8407            panic!("polled ReceiverRequestStream after completion");
8408        }
8409        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8410            |bytes, handles| {
8411                match this.inner.channel().read_etc(cx, bytes, handles) {
8412                    std::task::Poll::Ready(Ok(())) => {}
8413                    std::task::Poll::Pending => return std::task::Poll::Pending,
8414                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8415                        this.is_terminated = true;
8416                        return std::task::Poll::Ready(None);
8417                    }
8418                    std::task::Poll::Ready(Err(e)) => {
8419                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8420                            e.into(),
8421                        ))));
8422                    }
8423                }
8424
8425                // A message has been received from the channel
8426                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8427
8428                std::task::Poll::Ready(Some(match header.ordinal {
8429                    0x609ca5c7943b58d0 => {
8430                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8431                        let mut req = fidl::new_empty!(
8432                            ReceiverReceiveRequest,
8433                            fidl::encoding::DefaultFuchsiaResourceDialect
8434                        );
8435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8436                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8437                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8438                    }
8439                    _ => Err(fidl::Error::UnknownOrdinal {
8440                        ordinal: header.ordinal,
8441                        protocol_name:
8442                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8443                    }),
8444                }))
8445            },
8446        )
8447    }
8448}
8449
8450/// A `Receiver` represents the receiving end of a `Connector`.
8451#[derive(Debug)]
8452pub enum ReceiverRequest {
8453    /// `Receive` will be called by component manager whenever an new handle has
8454    /// been given to any `Connector` associated with this `Receiver`.
8455    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
8456}
8457
8458impl ReceiverRequest {
8459    #[allow(irrefutable_let_patterns)]
8460    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
8461        if let ReceiverRequest::Receive { channel, control_handle } = self {
8462            Some((channel, control_handle))
8463        } else {
8464            None
8465        }
8466    }
8467
8468    /// Name of the method defined in FIDL
8469    pub fn method_name(&self) -> &'static str {
8470        match *self {
8471            ReceiverRequest::Receive { .. } => "receive",
8472        }
8473    }
8474}
8475
8476#[derive(Debug, Clone)]
8477pub struct ReceiverControlHandle {
8478    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8479}
8480
8481impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
8482    fn shutdown(&self) {
8483        self.inner.shutdown()
8484    }
8485
8486    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8487        self.inner.shutdown_with_epitaph(status)
8488    }
8489
8490    fn is_closed(&self) -> bool {
8491        self.inner.channel().is_closed()
8492    }
8493    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8494        self.inner.channel().on_closed()
8495    }
8496
8497    #[cfg(target_os = "fuchsia")]
8498    fn signal_peer(
8499        &self,
8500        clear_mask: zx::Signals,
8501        set_mask: zx::Signals,
8502    ) -> Result<(), zx_status::Status> {
8503        use fidl::Peered;
8504        self.inner.channel().signal_peer(clear_mask, set_mask)
8505    }
8506}
8507
8508impl ReceiverControlHandle {}
8509
8510mod internal {
8511    use super::*;
8512
8513    impl fidl::encoding::ResourceTypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8514        type Borrowed<'a> = &'a mut Self;
8515        fn take_or_borrow<'a>(
8516            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8517        ) -> Self::Borrowed<'a> {
8518            value
8519        }
8520    }
8521
8522    unsafe impl fidl::encoding::TypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8523        type Owned = Self;
8524
8525        #[inline(always)]
8526        fn inline_align(_context: fidl::encoding::Context) -> usize {
8527            4
8528        }
8529
8530        #[inline(always)]
8531        fn inline_size(_context: fidl::encoding::Context) -> usize {
8532            8
8533        }
8534    }
8535
8536    unsafe impl
8537        fidl::encoding::Encode<
8538            CapabilitiesCapabilityAssociateHandleRequest,
8539            fidl::encoding::DefaultFuchsiaResourceDialect,
8540        > for &mut CapabilitiesCapabilityAssociateHandleRequest
8541    {
8542        #[inline]
8543        unsafe fn encode(
8544            self,
8545            encoder: &mut fidl::encoding::Encoder<
8546                '_,
8547                fidl::encoding::DefaultFuchsiaResourceDialect,
8548            >,
8549            offset: usize,
8550            _depth: fidl::encoding::Depth,
8551        ) -> fidl::Result<()> {
8552            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8553            // Delegate to tuple encoding.
8554            fidl::encoding::Encode::<
8555                CapabilitiesCapabilityAssociateHandleRequest,
8556                fidl::encoding::DefaultFuchsiaResourceDialect,
8557            >::encode(
8558                (
8559                    <fidl::encoding::HandleType<
8560                        fidl::EventPair,
8561                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8562                        2147483648,
8563                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8564                        &mut self.capability_handle,
8565                    ),
8566                    <fidl::encoding::HandleType<
8567                        fidl::EventPair,
8568                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8569                        2147483648,
8570                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8571                        &mut self.other_handle,
8572                    ),
8573                ),
8574                encoder,
8575                offset,
8576                _depth,
8577            )
8578        }
8579    }
8580    unsafe impl<
8581        T0: fidl::encoding::Encode<
8582                fidl::encoding::HandleType<
8583                    fidl::EventPair,
8584                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8585                    2147483648,
8586                >,
8587                fidl::encoding::DefaultFuchsiaResourceDialect,
8588            >,
8589        T1: fidl::encoding::Encode<
8590                fidl::encoding::HandleType<
8591                    fidl::EventPair,
8592                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8593                    2147483648,
8594                >,
8595                fidl::encoding::DefaultFuchsiaResourceDialect,
8596            >,
8597    >
8598        fidl::encoding::Encode<
8599            CapabilitiesCapabilityAssociateHandleRequest,
8600            fidl::encoding::DefaultFuchsiaResourceDialect,
8601        > for (T0, T1)
8602    {
8603        #[inline]
8604        unsafe fn encode(
8605            self,
8606            encoder: &mut fidl::encoding::Encoder<
8607                '_,
8608                fidl::encoding::DefaultFuchsiaResourceDialect,
8609            >,
8610            offset: usize,
8611            depth: fidl::encoding::Depth,
8612        ) -> fidl::Result<()> {
8613            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8614            // Zero out padding regions. There's no need to apply masks
8615            // because the unmasked parts will be overwritten by fields.
8616            // Write the fields.
8617            self.0.encode(encoder, offset + 0, depth)?;
8618            self.1.encode(encoder, offset + 4, depth)?;
8619            Ok(())
8620        }
8621    }
8622
8623    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8624        for CapabilitiesCapabilityAssociateHandleRequest
8625    {
8626        #[inline(always)]
8627        fn new_empty() -> Self {
8628            Self {
8629                capability_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8630                other_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8631            }
8632        }
8633
8634        #[inline]
8635        unsafe fn decode(
8636            &mut self,
8637            decoder: &mut fidl::encoding::Decoder<
8638                '_,
8639                fidl::encoding::DefaultFuchsiaResourceDialect,
8640            >,
8641            offset: usize,
8642            _depth: fidl::encoding::Depth,
8643        ) -> fidl::Result<()> {
8644            decoder.debug_check_bounds::<Self>(offset);
8645            // Verify that padding bytes are zero.
8646            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.capability_handle, decoder, offset + 0, _depth)?;
8647            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.other_handle, decoder, offset + 4, _depth)?;
8648            Ok(())
8649        }
8650    }
8651
8652    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorCreateRequest {
8653        type Borrowed<'a> = &'a mut Self;
8654        fn take_or_borrow<'a>(
8655            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8656        ) -> Self::Borrowed<'a> {
8657            value
8658        }
8659    }
8660
8661    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorCreateRequest {
8662        type Owned = Self;
8663
8664        #[inline(always)]
8665        fn inline_align(_context: fidl::encoding::Context) -> usize {
8666            4
8667        }
8668
8669        #[inline(always)]
8670        fn inline_size(_context: fidl::encoding::Context) -> usize {
8671            8
8672        }
8673    }
8674
8675    unsafe impl
8676        fidl::encoding::Encode<
8677            CapabilitiesConnectorCreateRequest,
8678            fidl::encoding::DefaultFuchsiaResourceDialect,
8679        > for &mut CapabilitiesConnectorCreateRequest
8680    {
8681        #[inline]
8682        unsafe fn encode(
8683            self,
8684            encoder: &mut fidl::encoding::Encoder<
8685                '_,
8686                fidl::encoding::DefaultFuchsiaResourceDialect,
8687            >,
8688            offset: usize,
8689            _depth: fidl::encoding::Depth,
8690        ) -> fidl::Result<()> {
8691            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8692            // Delegate to tuple encoding.
8693            fidl::encoding::Encode::<CapabilitiesConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8694                (
8695                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector),
8696                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
8697                ),
8698                encoder, offset, _depth
8699            )
8700        }
8701    }
8702    unsafe impl<
8703        T0: fidl::encoding::Encode<
8704                fidl::encoding::HandleType<
8705                    fidl::EventPair,
8706                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8707                    2147483648,
8708                >,
8709                fidl::encoding::DefaultFuchsiaResourceDialect,
8710            >,
8711        T1: fidl::encoding::Encode<
8712                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8713                fidl::encoding::DefaultFuchsiaResourceDialect,
8714            >,
8715    >
8716        fidl::encoding::Encode<
8717            CapabilitiesConnectorCreateRequest,
8718            fidl::encoding::DefaultFuchsiaResourceDialect,
8719        > for (T0, T1)
8720    {
8721        #[inline]
8722        unsafe fn encode(
8723            self,
8724            encoder: &mut fidl::encoding::Encoder<
8725                '_,
8726                fidl::encoding::DefaultFuchsiaResourceDialect,
8727            >,
8728            offset: usize,
8729            depth: fidl::encoding::Depth,
8730        ) -> fidl::Result<()> {
8731            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8732            // Zero out padding regions. There's no need to apply masks
8733            // because the unmasked parts will be overwritten by fields.
8734            // Write the fields.
8735            self.0.encode(encoder, offset + 0, depth)?;
8736            self.1.encode(encoder, offset + 4, depth)?;
8737            Ok(())
8738        }
8739    }
8740
8741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8742        for CapabilitiesConnectorCreateRequest
8743    {
8744        #[inline(always)]
8745        fn new_empty() -> Self {
8746            Self {
8747                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8748                receiver_client_end: fidl::new_empty!(
8749                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8750                    fidl::encoding::DefaultFuchsiaResourceDialect
8751                ),
8752            }
8753        }
8754
8755        #[inline]
8756        unsafe fn decode(
8757            &mut self,
8758            decoder: &mut fidl::encoding::Decoder<
8759                '_,
8760                fidl::encoding::DefaultFuchsiaResourceDialect,
8761            >,
8762            offset: usize,
8763            _depth: fidl::encoding::Depth,
8764        ) -> fidl::Result<()> {
8765            decoder.debug_check_bounds::<Self>(offset);
8766            // Verify that padding bytes are zero.
8767            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8768            fidl::decode!(
8769                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8770                fidl::encoding::DefaultFuchsiaResourceDialect,
8771                &mut self.receiver_client_end,
8772                decoder,
8773                offset + 4,
8774                _depth
8775            )?;
8776            Ok(())
8777        }
8778    }
8779
8780    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorOpenRequest {
8781        type Borrowed<'a> = &'a mut Self;
8782        fn take_or_borrow<'a>(
8783            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8784        ) -> Self::Borrowed<'a> {
8785            value
8786        }
8787    }
8788
8789    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorOpenRequest {
8790        type Owned = Self;
8791
8792        #[inline(always)]
8793        fn inline_align(_context: fidl::encoding::Context) -> usize {
8794            4
8795        }
8796
8797        #[inline(always)]
8798        fn inline_size(_context: fidl::encoding::Context) -> usize {
8799            8
8800        }
8801    }
8802
8803    unsafe impl
8804        fidl::encoding::Encode<
8805            CapabilitiesConnectorOpenRequest,
8806            fidl::encoding::DefaultFuchsiaResourceDialect,
8807        > for &mut CapabilitiesConnectorOpenRequest
8808    {
8809        #[inline]
8810        unsafe fn encode(
8811            self,
8812            encoder: &mut fidl::encoding::Encoder<
8813                '_,
8814                fidl::encoding::DefaultFuchsiaResourceDialect,
8815            >,
8816            offset: usize,
8817            _depth: fidl::encoding::Depth,
8818        ) -> fidl::Result<()> {
8819            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8820            // Delegate to tuple encoding.
8821            fidl::encoding::Encode::<
8822                CapabilitiesConnectorOpenRequest,
8823                fidl::encoding::DefaultFuchsiaResourceDialect,
8824            >::encode(
8825                (
8826                    <fidl::encoding::HandleType<
8827                        fidl::EventPair,
8828                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8829                        2147483648,
8830                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8831                        &mut self.connector
8832                    ),
8833                    <fidl::encoding::HandleType<
8834                        fidl::Channel,
8835                        { fidl::ObjectType::CHANNEL.into_raw() },
8836                        2147483648,
8837                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8838                        &mut self.channel
8839                    ),
8840                ),
8841                encoder,
8842                offset,
8843                _depth,
8844            )
8845        }
8846    }
8847    unsafe impl<
8848        T0: fidl::encoding::Encode<
8849                fidl::encoding::HandleType<
8850                    fidl::EventPair,
8851                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8852                    2147483648,
8853                >,
8854                fidl::encoding::DefaultFuchsiaResourceDialect,
8855            >,
8856        T1: fidl::encoding::Encode<
8857                fidl::encoding::HandleType<
8858                    fidl::Channel,
8859                    { fidl::ObjectType::CHANNEL.into_raw() },
8860                    2147483648,
8861                >,
8862                fidl::encoding::DefaultFuchsiaResourceDialect,
8863            >,
8864    >
8865        fidl::encoding::Encode<
8866            CapabilitiesConnectorOpenRequest,
8867            fidl::encoding::DefaultFuchsiaResourceDialect,
8868        > for (T0, T1)
8869    {
8870        #[inline]
8871        unsafe fn encode(
8872            self,
8873            encoder: &mut fidl::encoding::Encoder<
8874                '_,
8875                fidl::encoding::DefaultFuchsiaResourceDialect,
8876            >,
8877            offset: usize,
8878            depth: fidl::encoding::Depth,
8879        ) -> fidl::Result<()> {
8880            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8881            // Zero out padding regions. There's no need to apply masks
8882            // because the unmasked parts will be overwritten by fields.
8883            // Write the fields.
8884            self.0.encode(encoder, offset + 0, depth)?;
8885            self.1.encode(encoder, offset + 4, depth)?;
8886            Ok(())
8887        }
8888    }
8889
8890    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8891        for CapabilitiesConnectorOpenRequest
8892    {
8893        #[inline(always)]
8894        fn new_empty() -> Self {
8895            Self {
8896                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8897                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8898            }
8899        }
8900
8901        #[inline]
8902        unsafe fn decode(
8903            &mut self,
8904            decoder: &mut fidl::encoding::Decoder<
8905                '_,
8906                fidl::encoding::DefaultFuchsiaResourceDialect,
8907            >,
8908            offset: usize,
8909            _depth: fidl::encoding::Depth,
8910        ) -> fidl::Result<()> {
8911            decoder.debug_check_bounds::<Self>(offset);
8912            // Verify that padding bytes are zero.
8913            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8914            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
8915            Ok(())
8916        }
8917    }
8918
8919    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterCreateRequest {
8920        type Borrowed<'a> = &'a mut Self;
8921        fn take_or_borrow<'a>(
8922            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8923        ) -> Self::Borrowed<'a> {
8924            value
8925        }
8926    }
8927
8928    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterCreateRequest {
8929        type Owned = Self;
8930
8931        #[inline(always)]
8932        fn inline_align(_context: fidl::encoding::Context) -> usize {
8933            4
8934        }
8935
8936        #[inline(always)]
8937        fn inline_size(_context: fidl::encoding::Context) -> usize {
8938            8
8939        }
8940    }
8941
8942    unsafe impl
8943        fidl::encoding::Encode<
8944            CapabilitiesConnectorRouterCreateRequest,
8945            fidl::encoding::DefaultFuchsiaResourceDialect,
8946        > for &mut CapabilitiesConnectorRouterCreateRequest
8947    {
8948        #[inline]
8949        unsafe fn encode(
8950            self,
8951            encoder: &mut fidl::encoding::Encoder<
8952                '_,
8953                fidl::encoding::DefaultFuchsiaResourceDialect,
8954            >,
8955            offset: usize,
8956            _depth: fidl::encoding::Depth,
8957        ) -> fidl::Result<()> {
8958            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8959            // Delegate to tuple encoding.
8960            fidl::encoding::Encode::<CapabilitiesConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8961                (
8962                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
8963                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
8964                ),
8965                encoder, offset, _depth
8966            )
8967        }
8968    }
8969    unsafe impl<
8970        T0: fidl::encoding::Encode<
8971                fidl::encoding::HandleType<
8972                    fidl::EventPair,
8973                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8974                    2147483648,
8975                >,
8976                fidl::encoding::DefaultFuchsiaResourceDialect,
8977            >,
8978        T1: fidl::encoding::Encode<
8979                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
8980                fidl::encoding::DefaultFuchsiaResourceDialect,
8981            >,
8982    >
8983        fidl::encoding::Encode<
8984            CapabilitiesConnectorRouterCreateRequest,
8985            fidl::encoding::DefaultFuchsiaResourceDialect,
8986        > for (T0, T1)
8987    {
8988        #[inline]
8989        unsafe fn encode(
8990            self,
8991            encoder: &mut fidl::encoding::Encoder<
8992                '_,
8993                fidl::encoding::DefaultFuchsiaResourceDialect,
8994            >,
8995            offset: usize,
8996            depth: fidl::encoding::Depth,
8997        ) -> fidl::Result<()> {
8998            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8999            // Zero out padding regions. There's no need to apply masks
9000            // because the unmasked parts will be overwritten by fields.
9001            // Write the fields.
9002            self.0.encode(encoder, offset + 0, depth)?;
9003            self.1.encode(encoder, offset + 4, depth)?;
9004            Ok(())
9005        }
9006    }
9007
9008    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9009        for CapabilitiesConnectorRouterCreateRequest
9010    {
9011        #[inline(always)]
9012        fn new_empty() -> Self {
9013            Self {
9014                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9015                router_client_end: fidl::new_empty!(
9016                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9017                    fidl::encoding::DefaultFuchsiaResourceDialect
9018                ),
9019            }
9020        }
9021
9022        #[inline]
9023        unsafe fn decode(
9024            &mut self,
9025            decoder: &mut fidl::encoding::Decoder<
9026                '_,
9027                fidl::encoding::DefaultFuchsiaResourceDialect,
9028            >,
9029            offset: usize,
9030            _depth: fidl::encoding::Depth,
9031        ) -> fidl::Result<()> {
9032            decoder.debug_check_bounds::<Self>(offset);
9033            // Verify that padding bytes are zero.
9034            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9035            fidl::decode!(
9036                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9037                fidl::encoding::DefaultFuchsiaResourceDialect,
9038                &mut self.router_client_end,
9039                decoder,
9040                offset + 4,
9041                _depth
9042            )?;
9043            Ok(())
9044        }
9045    }
9046
9047    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterRouteRequest {
9048        type Borrowed<'a> = &'a mut Self;
9049        fn take_or_borrow<'a>(
9050            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9051        ) -> Self::Borrowed<'a> {
9052            value
9053        }
9054    }
9055
9056    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteRequest {
9057        type Owned = Self;
9058
9059        #[inline(always)]
9060        fn inline_align(_context: fidl::encoding::Context) -> usize {
9061            8
9062        }
9063
9064        #[inline(always)]
9065        fn inline_size(_context: fidl::encoding::Context) -> usize {
9066            32
9067        }
9068    }
9069
9070    unsafe impl
9071        fidl::encoding::Encode<
9072            CapabilitiesConnectorRouterRouteRequest,
9073            fidl::encoding::DefaultFuchsiaResourceDialect,
9074        > for &mut CapabilitiesConnectorRouterRouteRequest
9075    {
9076        #[inline]
9077        unsafe fn encode(
9078            self,
9079            encoder: &mut fidl::encoding::Encoder<
9080                '_,
9081                fidl::encoding::DefaultFuchsiaResourceDialect,
9082            >,
9083            offset: usize,
9084            _depth: fidl::encoding::Depth,
9085        ) -> fidl::Result<()> {
9086            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9087            // Delegate to tuple encoding.
9088            fidl::encoding::Encode::<
9089                CapabilitiesConnectorRouterRouteRequest,
9090                fidl::encoding::DefaultFuchsiaResourceDialect,
9091            >::encode(
9092                (
9093                    <fidl::encoding::HandleType<
9094                        fidl::EventPair,
9095                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9096                        2147483648,
9097                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9098                        &mut self.router
9099                    ),
9100                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9101                        &mut self.request,
9102                    ),
9103                    <fidl::encoding::HandleType<
9104                        fidl::EventPair,
9105                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9106                        2147483648,
9107                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9108                        &mut self.instance_token,
9109                    ),
9110                    <fidl::encoding::HandleType<
9111                        fidl::EventPair,
9112                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9113                        2147483648,
9114                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9115                        &mut self.connector
9116                    ),
9117                ),
9118                encoder,
9119                offset,
9120                _depth,
9121            )
9122        }
9123    }
9124    unsafe impl<
9125        T0: fidl::encoding::Encode<
9126                fidl::encoding::HandleType<
9127                    fidl::EventPair,
9128                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9129                    2147483648,
9130                >,
9131                fidl::encoding::DefaultFuchsiaResourceDialect,
9132            >,
9133        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9134        T2: fidl::encoding::Encode<
9135                fidl::encoding::HandleType<
9136                    fidl::EventPair,
9137                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9138                    2147483648,
9139                >,
9140                fidl::encoding::DefaultFuchsiaResourceDialect,
9141            >,
9142        T3: fidl::encoding::Encode<
9143                fidl::encoding::HandleType<
9144                    fidl::EventPair,
9145                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9146                    2147483648,
9147                >,
9148                fidl::encoding::DefaultFuchsiaResourceDialect,
9149            >,
9150    >
9151        fidl::encoding::Encode<
9152            CapabilitiesConnectorRouterRouteRequest,
9153            fidl::encoding::DefaultFuchsiaResourceDialect,
9154        > for (T0, T1, T2, T3)
9155    {
9156        #[inline]
9157        unsafe fn encode(
9158            self,
9159            encoder: &mut fidl::encoding::Encoder<
9160                '_,
9161                fidl::encoding::DefaultFuchsiaResourceDialect,
9162            >,
9163            offset: usize,
9164            depth: fidl::encoding::Depth,
9165        ) -> fidl::Result<()> {
9166            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9167            // Zero out padding regions. There's no need to apply masks
9168            // because the unmasked parts will be overwritten by fields.
9169            unsafe {
9170                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9171                (ptr as *mut u64).write_unaligned(0);
9172            }
9173            // Write the fields.
9174            self.0.encode(encoder, offset + 0, depth)?;
9175            self.1.encode(encoder, offset + 8, depth)?;
9176            self.2.encode(encoder, offset + 24, depth)?;
9177            self.3.encode(encoder, offset + 28, depth)?;
9178            Ok(())
9179        }
9180    }
9181
9182    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9183        for CapabilitiesConnectorRouterRouteRequest
9184    {
9185        #[inline(always)]
9186        fn new_empty() -> Self {
9187            Self {
9188                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9189                request: fidl::new_empty!(
9190                    RouteRequest,
9191                    fidl::encoding::DefaultFuchsiaResourceDialect
9192                ),
9193                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9194                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9195            }
9196        }
9197
9198        #[inline]
9199        unsafe fn decode(
9200            &mut self,
9201            decoder: &mut fidl::encoding::Decoder<
9202                '_,
9203                fidl::encoding::DefaultFuchsiaResourceDialect,
9204            >,
9205            offset: usize,
9206            _depth: fidl::encoding::Depth,
9207        ) -> fidl::Result<()> {
9208            decoder.debug_check_bounds::<Self>(offset);
9209            // Verify that padding bytes are zero.
9210            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9211            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9212            let mask = 0xffffffff00000000u64;
9213            let maskedval = padval & mask;
9214            if maskedval != 0 {
9215                return Err(fidl::Error::NonZeroPadding {
9216                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9217                });
9218            }
9219            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9220            fidl::decode!(
9221                RouteRequest,
9222                fidl::encoding::DefaultFuchsiaResourceDialect,
9223                &mut self.request,
9224                decoder,
9225                offset + 8,
9226                _depth
9227            )?;
9228            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9229            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 28, _depth)?;
9230            Ok(())
9231        }
9232    }
9233
9234    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataCreateRequest {
9235        type Borrowed<'a> = &'a mut Self;
9236        fn take_or_borrow<'a>(
9237            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9238        ) -> Self::Borrowed<'a> {
9239            value
9240        }
9241    }
9242
9243    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataCreateRequest {
9244        type Owned = Self;
9245
9246        #[inline(always)]
9247        fn inline_align(_context: fidl::encoding::Context) -> usize {
9248            8
9249        }
9250
9251        #[inline(always)]
9252        fn inline_size(_context: fidl::encoding::Context) -> usize {
9253            24
9254        }
9255    }
9256
9257    unsafe impl
9258        fidl::encoding::Encode<
9259            CapabilitiesDataCreateRequest,
9260            fidl::encoding::DefaultFuchsiaResourceDialect,
9261        > for &mut CapabilitiesDataCreateRequest
9262    {
9263        #[inline]
9264        unsafe fn encode(
9265            self,
9266            encoder: &mut fidl::encoding::Encoder<
9267                '_,
9268                fidl::encoding::DefaultFuchsiaResourceDialect,
9269            >,
9270            offset: usize,
9271            _depth: fidl::encoding::Depth,
9272        ) -> fidl::Result<()> {
9273            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
9274            // Delegate to tuple encoding.
9275            fidl::encoding::Encode::<
9276                CapabilitiesDataCreateRequest,
9277                fidl::encoding::DefaultFuchsiaResourceDialect,
9278            >::encode(
9279                (
9280                    <fidl::encoding::HandleType<
9281                        fidl::EventPair,
9282                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9283                        2147483648,
9284                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9285                        &mut self.data_handle
9286                    ),
9287                    <Data as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
9288                ),
9289                encoder,
9290                offset,
9291                _depth,
9292            )
9293        }
9294    }
9295    unsafe impl<
9296        T0: fidl::encoding::Encode<
9297                fidl::encoding::HandleType<
9298                    fidl::EventPair,
9299                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9300                    2147483648,
9301                >,
9302                fidl::encoding::DefaultFuchsiaResourceDialect,
9303            >,
9304        T1: fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>,
9305    >
9306        fidl::encoding::Encode<
9307            CapabilitiesDataCreateRequest,
9308            fidl::encoding::DefaultFuchsiaResourceDialect,
9309        > for (T0, T1)
9310    {
9311        #[inline]
9312        unsafe fn encode(
9313            self,
9314            encoder: &mut fidl::encoding::Encoder<
9315                '_,
9316                fidl::encoding::DefaultFuchsiaResourceDialect,
9317            >,
9318            offset: usize,
9319            depth: fidl::encoding::Depth,
9320        ) -> fidl::Result<()> {
9321            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
9322            // Zero out padding regions. There's no need to apply masks
9323            // because the unmasked parts will be overwritten by fields.
9324            unsafe {
9325                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9326                (ptr as *mut u64).write_unaligned(0);
9327            }
9328            // Write the fields.
9329            self.0.encode(encoder, offset + 0, depth)?;
9330            self.1.encode(encoder, offset + 8, depth)?;
9331            Ok(())
9332        }
9333    }
9334
9335    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9336        for CapabilitiesDataCreateRequest
9337    {
9338        #[inline(always)]
9339        fn new_empty() -> Self {
9340            Self {
9341                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9342                data: fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect),
9343            }
9344        }
9345
9346        #[inline]
9347        unsafe fn decode(
9348            &mut self,
9349            decoder: &mut fidl::encoding::Decoder<
9350                '_,
9351                fidl::encoding::DefaultFuchsiaResourceDialect,
9352            >,
9353            offset: usize,
9354            _depth: fidl::encoding::Depth,
9355        ) -> fidl::Result<()> {
9356            decoder.debug_check_bounds::<Self>(offset);
9357            // Verify that padding bytes are zero.
9358            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9359            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9360            let mask = 0xffffffff00000000u64;
9361            let maskedval = padval & mask;
9362            if maskedval != 0 {
9363                return Err(fidl::Error::NonZeroPadding {
9364                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9365                });
9366            }
9367            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9368            fidl::decode!(
9369                Data,
9370                fidl::encoding::DefaultFuchsiaResourceDialect,
9371                &mut self.data,
9372                decoder,
9373                offset + 8,
9374                _depth
9375            )?;
9376            Ok(())
9377        }
9378    }
9379
9380    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataGetRequest {
9381        type Borrowed<'a> = &'a mut Self;
9382        fn take_or_borrow<'a>(
9383            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9384        ) -> Self::Borrowed<'a> {
9385            value
9386        }
9387    }
9388
9389    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataGetRequest {
9390        type Owned = Self;
9391
9392        #[inline(always)]
9393        fn inline_align(_context: fidl::encoding::Context) -> usize {
9394            4
9395        }
9396
9397        #[inline(always)]
9398        fn inline_size(_context: fidl::encoding::Context) -> usize {
9399            4
9400        }
9401    }
9402
9403    unsafe impl
9404        fidl::encoding::Encode<
9405            CapabilitiesDataGetRequest,
9406            fidl::encoding::DefaultFuchsiaResourceDialect,
9407        > for &mut CapabilitiesDataGetRequest
9408    {
9409        #[inline]
9410        unsafe fn encode(
9411            self,
9412            encoder: &mut fidl::encoding::Encoder<
9413                '_,
9414                fidl::encoding::DefaultFuchsiaResourceDialect,
9415            >,
9416            offset: usize,
9417            _depth: fidl::encoding::Depth,
9418        ) -> fidl::Result<()> {
9419            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9420            // Delegate to tuple encoding.
9421            fidl::encoding::Encode::<
9422                CapabilitiesDataGetRequest,
9423                fidl::encoding::DefaultFuchsiaResourceDialect,
9424            >::encode(
9425                (<fidl::encoding::HandleType<
9426                    fidl::EventPair,
9427                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9428                    2147483648,
9429                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9430                    &mut self.data_handle
9431                ),),
9432                encoder,
9433                offset,
9434                _depth,
9435            )
9436        }
9437    }
9438    unsafe impl<
9439        T0: fidl::encoding::Encode<
9440                fidl::encoding::HandleType<
9441                    fidl::EventPair,
9442                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9443                    2147483648,
9444                >,
9445                fidl::encoding::DefaultFuchsiaResourceDialect,
9446            >,
9447    >
9448        fidl::encoding::Encode<
9449            CapabilitiesDataGetRequest,
9450            fidl::encoding::DefaultFuchsiaResourceDialect,
9451        > for (T0,)
9452    {
9453        #[inline]
9454        unsafe fn encode(
9455            self,
9456            encoder: &mut fidl::encoding::Encoder<
9457                '_,
9458                fidl::encoding::DefaultFuchsiaResourceDialect,
9459            >,
9460            offset: usize,
9461            depth: fidl::encoding::Depth,
9462        ) -> fidl::Result<()> {
9463            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9464            // Zero out padding regions. There's no need to apply masks
9465            // because the unmasked parts will be overwritten by fields.
9466            // Write the fields.
9467            self.0.encode(encoder, offset + 0, depth)?;
9468            Ok(())
9469        }
9470    }
9471
9472    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9473        for CapabilitiesDataGetRequest
9474    {
9475        #[inline(always)]
9476        fn new_empty() -> Self {
9477            Self {
9478                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9479            }
9480        }
9481
9482        #[inline]
9483        unsafe fn decode(
9484            &mut self,
9485            decoder: &mut fidl::encoding::Decoder<
9486                '_,
9487                fidl::encoding::DefaultFuchsiaResourceDialect,
9488            >,
9489            offset: usize,
9490            _depth: fidl::encoding::Depth,
9491        ) -> fidl::Result<()> {
9492            decoder.debug_check_bounds::<Self>(offset);
9493            // Verify that padding bytes are zero.
9494            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9495            Ok(())
9496        }
9497    }
9498
9499    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterCreateRequest {
9500        type Borrowed<'a> = &'a mut Self;
9501        fn take_or_borrow<'a>(
9502            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9503        ) -> Self::Borrowed<'a> {
9504            value
9505        }
9506    }
9507
9508    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterCreateRequest {
9509        type Owned = Self;
9510
9511        #[inline(always)]
9512        fn inline_align(_context: fidl::encoding::Context) -> usize {
9513            4
9514        }
9515
9516        #[inline(always)]
9517        fn inline_size(_context: fidl::encoding::Context) -> usize {
9518            8
9519        }
9520    }
9521
9522    unsafe impl
9523        fidl::encoding::Encode<
9524            CapabilitiesDataRouterCreateRequest,
9525            fidl::encoding::DefaultFuchsiaResourceDialect,
9526        > for &mut CapabilitiesDataRouterCreateRequest
9527    {
9528        #[inline]
9529        unsafe fn encode(
9530            self,
9531            encoder: &mut fidl::encoding::Encoder<
9532                '_,
9533                fidl::encoding::DefaultFuchsiaResourceDialect,
9534            >,
9535            offset: usize,
9536            _depth: fidl::encoding::Depth,
9537        ) -> fidl::Result<()> {
9538            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9539            // Delegate to tuple encoding.
9540            fidl::encoding::Encode::<CapabilitiesDataRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9541                (
9542                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
9543                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
9544                ),
9545                encoder, offset, _depth
9546            )
9547        }
9548    }
9549    unsafe impl<
9550        T0: fidl::encoding::Encode<
9551                fidl::encoding::HandleType<
9552                    fidl::EventPair,
9553                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9554                    2147483648,
9555                >,
9556                fidl::encoding::DefaultFuchsiaResourceDialect,
9557            >,
9558        T1: fidl::encoding::Encode<
9559                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9560                fidl::encoding::DefaultFuchsiaResourceDialect,
9561            >,
9562    >
9563        fidl::encoding::Encode<
9564            CapabilitiesDataRouterCreateRequest,
9565            fidl::encoding::DefaultFuchsiaResourceDialect,
9566        > for (T0, T1)
9567    {
9568        #[inline]
9569        unsafe fn encode(
9570            self,
9571            encoder: &mut fidl::encoding::Encoder<
9572                '_,
9573                fidl::encoding::DefaultFuchsiaResourceDialect,
9574            >,
9575            offset: usize,
9576            depth: fidl::encoding::Depth,
9577        ) -> fidl::Result<()> {
9578            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9579            // Zero out padding regions. There's no need to apply masks
9580            // because the unmasked parts will be overwritten by fields.
9581            // Write the fields.
9582            self.0.encode(encoder, offset + 0, depth)?;
9583            self.1.encode(encoder, offset + 4, depth)?;
9584            Ok(())
9585        }
9586    }
9587
9588    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9589        for CapabilitiesDataRouterCreateRequest
9590    {
9591        #[inline(always)]
9592        fn new_empty() -> Self {
9593            Self {
9594                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9595                router_client_end: fidl::new_empty!(
9596                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9597                    fidl::encoding::DefaultFuchsiaResourceDialect
9598                ),
9599            }
9600        }
9601
9602        #[inline]
9603        unsafe fn decode(
9604            &mut self,
9605            decoder: &mut fidl::encoding::Decoder<
9606                '_,
9607                fidl::encoding::DefaultFuchsiaResourceDialect,
9608            >,
9609            offset: usize,
9610            _depth: fidl::encoding::Depth,
9611        ) -> fidl::Result<()> {
9612            decoder.debug_check_bounds::<Self>(offset);
9613            // Verify that padding bytes are zero.
9614            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9615            fidl::decode!(
9616                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9617                fidl::encoding::DefaultFuchsiaResourceDialect,
9618                &mut self.router_client_end,
9619                decoder,
9620                offset + 4,
9621                _depth
9622            )?;
9623            Ok(())
9624        }
9625    }
9626
9627    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterRouteRequest {
9628        type Borrowed<'a> = &'a mut Self;
9629        fn take_or_borrow<'a>(
9630            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9631        ) -> Self::Borrowed<'a> {
9632            value
9633        }
9634    }
9635
9636    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteRequest {
9637        type Owned = Self;
9638
9639        #[inline(always)]
9640        fn inline_align(_context: fidl::encoding::Context) -> usize {
9641            8
9642        }
9643
9644        #[inline(always)]
9645        fn inline_size(_context: fidl::encoding::Context) -> usize {
9646            32
9647        }
9648    }
9649
9650    unsafe impl
9651        fidl::encoding::Encode<
9652            CapabilitiesDataRouterRouteRequest,
9653            fidl::encoding::DefaultFuchsiaResourceDialect,
9654        > for &mut CapabilitiesDataRouterRouteRequest
9655    {
9656        #[inline]
9657        unsafe fn encode(
9658            self,
9659            encoder: &mut fidl::encoding::Encoder<
9660                '_,
9661                fidl::encoding::DefaultFuchsiaResourceDialect,
9662            >,
9663            offset: usize,
9664            _depth: fidl::encoding::Depth,
9665        ) -> fidl::Result<()> {
9666            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9667            // Delegate to tuple encoding.
9668            fidl::encoding::Encode::<
9669                CapabilitiesDataRouterRouteRequest,
9670                fidl::encoding::DefaultFuchsiaResourceDialect,
9671            >::encode(
9672                (
9673                    <fidl::encoding::HandleType<
9674                        fidl::EventPair,
9675                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9676                        2147483648,
9677                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9678                        &mut self.router
9679                    ),
9680                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9681                        &mut self.request,
9682                    ),
9683                    <fidl::encoding::HandleType<
9684                        fidl::EventPair,
9685                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9686                        2147483648,
9687                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9688                        &mut self.instance_token,
9689                    ),
9690                    <fidl::encoding::HandleType<
9691                        fidl::EventPair,
9692                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9693                        2147483648,
9694                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9695                        &mut self.data
9696                    ),
9697                ),
9698                encoder,
9699                offset,
9700                _depth,
9701            )
9702        }
9703    }
9704    unsafe impl<
9705        T0: fidl::encoding::Encode<
9706                fidl::encoding::HandleType<
9707                    fidl::EventPair,
9708                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9709                    2147483648,
9710                >,
9711                fidl::encoding::DefaultFuchsiaResourceDialect,
9712            >,
9713        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9714        T2: fidl::encoding::Encode<
9715                fidl::encoding::HandleType<
9716                    fidl::EventPair,
9717                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9718                    2147483648,
9719                >,
9720                fidl::encoding::DefaultFuchsiaResourceDialect,
9721            >,
9722        T3: fidl::encoding::Encode<
9723                fidl::encoding::HandleType<
9724                    fidl::EventPair,
9725                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9726                    2147483648,
9727                >,
9728                fidl::encoding::DefaultFuchsiaResourceDialect,
9729            >,
9730    >
9731        fidl::encoding::Encode<
9732            CapabilitiesDataRouterRouteRequest,
9733            fidl::encoding::DefaultFuchsiaResourceDialect,
9734        > for (T0, T1, T2, T3)
9735    {
9736        #[inline]
9737        unsafe fn encode(
9738            self,
9739            encoder: &mut fidl::encoding::Encoder<
9740                '_,
9741                fidl::encoding::DefaultFuchsiaResourceDialect,
9742            >,
9743            offset: usize,
9744            depth: fidl::encoding::Depth,
9745        ) -> fidl::Result<()> {
9746            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9747            // Zero out padding regions. There's no need to apply masks
9748            // because the unmasked parts will be overwritten by fields.
9749            unsafe {
9750                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9751                (ptr as *mut u64).write_unaligned(0);
9752            }
9753            // Write the fields.
9754            self.0.encode(encoder, offset + 0, depth)?;
9755            self.1.encode(encoder, offset + 8, depth)?;
9756            self.2.encode(encoder, offset + 24, depth)?;
9757            self.3.encode(encoder, offset + 28, depth)?;
9758            Ok(())
9759        }
9760    }
9761
9762    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9763        for CapabilitiesDataRouterRouteRequest
9764    {
9765        #[inline(always)]
9766        fn new_empty() -> Self {
9767            Self {
9768                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9769                request: fidl::new_empty!(
9770                    RouteRequest,
9771                    fidl::encoding::DefaultFuchsiaResourceDialect
9772                ),
9773                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9774                data: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9775            }
9776        }
9777
9778        #[inline]
9779        unsafe fn decode(
9780            &mut self,
9781            decoder: &mut fidl::encoding::Decoder<
9782                '_,
9783                fidl::encoding::DefaultFuchsiaResourceDialect,
9784            >,
9785            offset: usize,
9786            _depth: fidl::encoding::Depth,
9787        ) -> fidl::Result<()> {
9788            decoder.debug_check_bounds::<Self>(offset);
9789            // Verify that padding bytes are zero.
9790            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9791            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9792            let mask = 0xffffffff00000000u64;
9793            let maskedval = padval & mask;
9794            if maskedval != 0 {
9795                return Err(fidl::Error::NonZeroPadding {
9796                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9797                });
9798            }
9799            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9800            fidl::decode!(
9801                RouteRequest,
9802                fidl::encoding::DefaultFuchsiaResourceDialect,
9803                &mut self.request,
9804                decoder,
9805                offset + 8,
9806                _depth
9807            )?;
9808            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9809            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data, decoder, offset + 28, _depth)?;
9810            Ok(())
9811        }
9812    }
9813
9814    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryCreateRequest {
9815        type Borrowed<'a> = &'a mut Self;
9816        fn take_or_borrow<'a>(
9817            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9818        ) -> Self::Borrowed<'a> {
9819            value
9820        }
9821    }
9822
9823    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryCreateRequest {
9824        type Owned = Self;
9825
9826        #[inline(always)]
9827        fn inline_align(_context: fidl::encoding::Context) -> usize {
9828            4
9829        }
9830
9831        #[inline(always)]
9832        fn inline_size(_context: fidl::encoding::Context) -> usize {
9833            4
9834        }
9835    }
9836
9837    unsafe impl
9838        fidl::encoding::Encode<
9839            CapabilitiesDictionaryCreateRequest,
9840            fidl::encoding::DefaultFuchsiaResourceDialect,
9841        > for &mut CapabilitiesDictionaryCreateRequest
9842    {
9843        #[inline]
9844        unsafe fn encode(
9845            self,
9846            encoder: &mut fidl::encoding::Encoder<
9847                '_,
9848                fidl::encoding::DefaultFuchsiaResourceDialect,
9849            >,
9850            offset: usize,
9851            _depth: fidl::encoding::Depth,
9852        ) -> fidl::Result<()> {
9853            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9854            // Delegate to tuple encoding.
9855            fidl::encoding::Encode::<
9856                CapabilitiesDictionaryCreateRequest,
9857                fidl::encoding::DefaultFuchsiaResourceDialect,
9858            >::encode(
9859                (<fidl::encoding::HandleType<
9860                    fidl::EventPair,
9861                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9862                    2147483648,
9863                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9864                    &mut self.dictionary
9865                ),),
9866                encoder,
9867                offset,
9868                _depth,
9869            )
9870        }
9871    }
9872    unsafe impl<
9873        T0: fidl::encoding::Encode<
9874                fidl::encoding::HandleType<
9875                    fidl::EventPair,
9876                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9877                    2147483648,
9878                >,
9879                fidl::encoding::DefaultFuchsiaResourceDialect,
9880            >,
9881    >
9882        fidl::encoding::Encode<
9883            CapabilitiesDictionaryCreateRequest,
9884            fidl::encoding::DefaultFuchsiaResourceDialect,
9885        > for (T0,)
9886    {
9887        #[inline]
9888        unsafe fn encode(
9889            self,
9890            encoder: &mut fidl::encoding::Encoder<
9891                '_,
9892                fidl::encoding::DefaultFuchsiaResourceDialect,
9893            >,
9894            offset: usize,
9895            depth: fidl::encoding::Depth,
9896        ) -> fidl::Result<()> {
9897            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9898            // Zero out padding regions. There's no need to apply masks
9899            // because the unmasked parts will be overwritten by fields.
9900            // Write the fields.
9901            self.0.encode(encoder, offset + 0, depth)?;
9902            Ok(())
9903        }
9904    }
9905
9906    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9907        for CapabilitiesDictionaryCreateRequest
9908    {
9909        #[inline(always)]
9910        fn new_empty() -> Self {
9911            Self {
9912                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9913            }
9914        }
9915
9916        #[inline]
9917        unsafe fn decode(
9918            &mut self,
9919            decoder: &mut fidl::encoding::Decoder<
9920                '_,
9921                fidl::encoding::DefaultFuchsiaResourceDialect,
9922            >,
9923            offset: usize,
9924            _depth: fidl::encoding::Depth,
9925        ) -> fidl::Result<()> {
9926            decoder.debug_check_bounds::<Self>(offset);
9927            // Verify that padding bytes are zero.
9928            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9929            Ok(())
9930        }
9931    }
9932
9933    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetRequest {
9934        type Borrowed<'a> = &'a mut Self;
9935        fn take_or_borrow<'a>(
9936            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9937        ) -> Self::Borrowed<'a> {
9938            value
9939        }
9940    }
9941
9942    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetRequest {
9943        type Owned = Self;
9944
9945        #[inline(always)]
9946        fn inline_align(_context: fidl::encoding::Context) -> usize {
9947            8
9948        }
9949
9950        #[inline(always)]
9951        fn inline_size(_context: fidl::encoding::Context) -> usize {
9952            32
9953        }
9954    }
9955
9956    unsafe impl
9957        fidl::encoding::Encode<
9958            CapabilitiesDictionaryGetRequest,
9959            fidl::encoding::DefaultFuchsiaResourceDialect,
9960        > for &mut CapabilitiesDictionaryGetRequest
9961    {
9962        #[inline]
9963        unsafe fn encode(
9964            self,
9965            encoder: &mut fidl::encoding::Encoder<
9966                '_,
9967                fidl::encoding::DefaultFuchsiaResourceDialect,
9968            >,
9969            offset: usize,
9970            _depth: fidl::encoding::Depth,
9971        ) -> fidl::Result<()> {
9972            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
9973            // Delegate to tuple encoding.
9974            fidl::encoding::Encode::<
9975                CapabilitiesDictionaryGetRequest,
9976                fidl::encoding::DefaultFuchsiaResourceDialect,
9977            >::encode(
9978                (
9979                    <fidl::encoding::HandleType<
9980                        fidl::EventPair,
9981                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9982                        2147483648,
9983                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9984                        &mut self.dictionary
9985                    ),
9986                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
9987                        &self.key,
9988                    ),
9989                    <fidl::encoding::HandleType<
9990                        fidl::EventPair,
9991                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9992                        2147483648,
9993                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9994                        &mut self.value
9995                    ),
9996                ),
9997                encoder,
9998                offset,
9999                _depth,
10000            )
10001        }
10002    }
10003    unsafe impl<
10004        T0: fidl::encoding::Encode<
10005                fidl::encoding::HandleType<
10006                    fidl::EventPair,
10007                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10008                    2147483648,
10009                >,
10010                fidl::encoding::DefaultFuchsiaResourceDialect,
10011            >,
10012        T1: fidl::encoding::Encode<
10013                fidl::encoding::BoundedString<100>,
10014                fidl::encoding::DefaultFuchsiaResourceDialect,
10015            >,
10016        T2: fidl::encoding::Encode<
10017                fidl::encoding::HandleType<
10018                    fidl::EventPair,
10019                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10020                    2147483648,
10021                >,
10022                fidl::encoding::DefaultFuchsiaResourceDialect,
10023            >,
10024    >
10025        fidl::encoding::Encode<
10026            CapabilitiesDictionaryGetRequest,
10027            fidl::encoding::DefaultFuchsiaResourceDialect,
10028        > for (T0, T1, T2)
10029    {
10030        #[inline]
10031        unsafe fn encode(
10032            self,
10033            encoder: &mut fidl::encoding::Encoder<
10034                '_,
10035                fidl::encoding::DefaultFuchsiaResourceDialect,
10036            >,
10037            offset: usize,
10038            depth: fidl::encoding::Depth,
10039        ) -> fidl::Result<()> {
10040            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
10041            // Zero out padding regions. There's no need to apply masks
10042            // because the unmasked parts will be overwritten by fields.
10043            unsafe {
10044                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10045                (ptr as *mut u64).write_unaligned(0);
10046            }
10047            unsafe {
10048                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10049                (ptr as *mut u64).write_unaligned(0);
10050            }
10051            // Write the fields.
10052            self.0.encode(encoder, offset + 0, depth)?;
10053            self.1.encode(encoder, offset + 8, depth)?;
10054            self.2.encode(encoder, offset + 24, depth)?;
10055            Ok(())
10056        }
10057    }
10058
10059    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10060        for CapabilitiesDictionaryGetRequest
10061    {
10062        #[inline(always)]
10063        fn new_empty() -> Self {
10064            Self {
10065                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10066                key: fidl::new_empty!(
10067                    fidl::encoding::BoundedString<100>,
10068                    fidl::encoding::DefaultFuchsiaResourceDialect
10069                ),
10070                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10071            }
10072        }
10073
10074        #[inline]
10075        unsafe fn decode(
10076            &mut self,
10077            decoder: &mut fidl::encoding::Decoder<
10078                '_,
10079                fidl::encoding::DefaultFuchsiaResourceDialect,
10080            >,
10081            offset: usize,
10082            _depth: fidl::encoding::Depth,
10083        ) -> fidl::Result<()> {
10084            decoder.debug_check_bounds::<Self>(offset);
10085            // Verify that padding bytes are zero.
10086            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10087            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10088            let mask = 0xffffffff00000000u64;
10089            let maskedval = padval & mask;
10090            if maskedval != 0 {
10091                return Err(fidl::Error::NonZeroPadding {
10092                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10093                });
10094            }
10095            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10096            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10097            let mask = 0xffffffff00000000u64;
10098            let maskedval = padval & mask;
10099            if maskedval != 0 {
10100                return Err(fidl::Error::NonZeroPadding {
10101                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10102                });
10103            }
10104            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10105            fidl::decode!(
10106                fidl::encoding::BoundedString<100>,
10107                fidl::encoding::DefaultFuchsiaResourceDialect,
10108                &mut self.key,
10109                decoder,
10110                offset + 8,
10111                _depth
10112            )?;
10113            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10114            Ok(())
10115        }
10116    }
10117
10118    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryInsertRequest {
10119        type Borrowed<'a> = &'a mut Self;
10120        fn take_or_borrow<'a>(
10121            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10122        ) -> Self::Borrowed<'a> {
10123            value
10124        }
10125    }
10126
10127    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryInsertRequest {
10128        type Owned = Self;
10129
10130        #[inline(always)]
10131        fn inline_align(_context: fidl::encoding::Context) -> usize {
10132            8
10133        }
10134
10135        #[inline(always)]
10136        fn inline_size(_context: fidl::encoding::Context) -> usize {
10137            32
10138        }
10139    }
10140
10141    unsafe impl
10142        fidl::encoding::Encode<
10143            CapabilitiesDictionaryInsertRequest,
10144            fidl::encoding::DefaultFuchsiaResourceDialect,
10145        > for &mut CapabilitiesDictionaryInsertRequest
10146    {
10147        #[inline]
10148        unsafe fn encode(
10149            self,
10150            encoder: &mut fidl::encoding::Encoder<
10151                '_,
10152                fidl::encoding::DefaultFuchsiaResourceDialect,
10153            >,
10154            offset: usize,
10155            _depth: fidl::encoding::Depth,
10156        ) -> fidl::Result<()> {
10157            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10158            // Delegate to tuple encoding.
10159            fidl::encoding::Encode::<
10160                CapabilitiesDictionaryInsertRequest,
10161                fidl::encoding::DefaultFuchsiaResourceDialect,
10162            >::encode(
10163                (
10164                    <fidl::encoding::HandleType<
10165                        fidl::EventPair,
10166                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10167                        2147483648,
10168                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10169                        &mut self.dictionary
10170                    ),
10171                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10172                        &self.key,
10173                    ),
10174                    <fidl::encoding::HandleType<
10175                        fidl::EventPair,
10176                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10177                        2147483648,
10178                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10179                        &mut self.value
10180                    ),
10181                ),
10182                encoder,
10183                offset,
10184                _depth,
10185            )
10186        }
10187    }
10188    unsafe impl<
10189        T0: fidl::encoding::Encode<
10190                fidl::encoding::HandleType<
10191                    fidl::EventPair,
10192                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10193                    2147483648,
10194                >,
10195                fidl::encoding::DefaultFuchsiaResourceDialect,
10196            >,
10197        T1: fidl::encoding::Encode<
10198                fidl::encoding::BoundedString<100>,
10199                fidl::encoding::DefaultFuchsiaResourceDialect,
10200            >,
10201        T2: fidl::encoding::Encode<
10202                fidl::encoding::HandleType<
10203                    fidl::EventPair,
10204                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10205                    2147483648,
10206                >,
10207                fidl::encoding::DefaultFuchsiaResourceDialect,
10208            >,
10209    >
10210        fidl::encoding::Encode<
10211            CapabilitiesDictionaryInsertRequest,
10212            fidl::encoding::DefaultFuchsiaResourceDialect,
10213        > for (T0, T1, T2)
10214    {
10215        #[inline]
10216        unsafe fn encode(
10217            self,
10218            encoder: &mut fidl::encoding::Encoder<
10219                '_,
10220                fidl::encoding::DefaultFuchsiaResourceDialect,
10221            >,
10222            offset: usize,
10223            depth: fidl::encoding::Depth,
10224        ) -> fidl::Result<()> {
10225            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10226            // Zero out padding regions. There's no need to apply masks
10227            // because the unmasked parts will be overwritten by fields.
10228            unsafe {
10229                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10230                (ptr as *mut u64).write_unaligned(0);
10231            }
10232            unsafe {
10233                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10234                (ptr as *mut u64).write_unaligned(0);
10235            }
10236            // Write the fields.
10237            self.0.encode(encoder, offset + 0, depth)?;
10238            self.1.encode(encoder, offset + 8, depth)?;
10239            self.2.encode(encoder, offset + 24, depth)?;
10240            Ok(())
10241        }
10242    }
10243
10244    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10245        for CapabilitiesDictionaryInsertRequest
10246    {
10247        #[inline(always)]
10248        fn new_empty() -> Self {
10249            Self {
10250                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10251                key: fidl::new_empty!(
10252                    fidl::encoding::BoundedString<100>,
10253                    fidl::encoding::DefaultFuchsiaResourceDialect
10254                ),
10255                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10256            }
10257        }
10258
10259        #[inline]
10260        unsafe fn decode(
10261            &mut self,
10262            decoder: &mut fidl::encoding::Decoder<
10263                '_,
10264                fidl::encoding::DefaultFuchsiaResourceDialect,
10265            >,
10266            offset: usize,
10267            _depth: fidl::encoding::Depth,
10268        ) -> fidl::Result<()> {
10269            decoder.debug_check_bounds::<Self>(offset);
10270            // Verify that padding bytes are zero.
10271            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10272            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10273            let mask = 0xffffffff00000000u64;
10274            let maskedval = padval & mask;
10275            if maskedval != 0 {
10276                return Err(fidl::Error::NonZeroPadding {
10277                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10278                });
10279            }
10280            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10281            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10282            let mask = 0xffffffff00000000u64;
10283            let maskedval = padval & mask;
10284            if maskedval != 0 {
10285                return Err(fidl::Error::NonZeroPadding {
10286                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10287                });
10288            }
10289            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10290            fidl::decode!(
10291                fidl::encoding::BoundedString<100>,
10292                fidl::encoding::DefaultFuchsiaResourceDialect,
10293                &mut self.key,
10294                decoder,
10295                offset + 8,
10296                _depth
10297            )?;
10298            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10299            Ok(())
10300        }
10301    }
10302
10303    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10304        type Borrowed<'a> = &'a mut Self;
10305        fn take_or_borrow<'a>(
10306            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10307        ) -> Self::Borrowed<'a> {
10308            value
10309        }
10310    }
10311
10312    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10313        type Owned = Self;
10314
10315        #[inline(always)]
10316        fn inline_align(_context: fidl::encoding::Context) -> usize {
10317            4
10318        }
10319
10320        #[inline(always)]
10321        fn inline_size(_context: fidl::encoding::Context) -> usize {
10322            8
10323        }
10324    }
10325
10326    unsafe impl
10327        fidl::encoding::Encode<
10328            CapabilitiesDictionaryIterateKeysRequest,
10329            fidl::encoding::DefaultFuchsiaResourceDialect,
10330        > for &mut CapabilitiesDictionaryIterateKeysRequest
10331    {
10332        #[inline]
10333        unsafe fn encode(
10334            self,
10335            encoder: &mut fidl::encoding::Encoder<
10336                '_,
10337                fidl::encoding::DefaultFuchsiaResourceDialect,
10338            >,
10339            offset: usize,
10340            _depth: fidl::encoding::Depth,
10341        ) -> fidl::Result<()> {
10342            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10343            // Delegate to tuple encoding.
10344            fidl::encoding::Encode::<
10345                CapabilitiesDictionaryIterateKeysRequest,
10346                fidl::encoding::DefaultFuchsiaResourceDialect,
10347            >::encode(
10348                (
10349                    <fidl::encoding::HandleType<
10350                        fidl::EventPair,
10351                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10352                        2147483648,
10353                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10354                        &mut self.dictionary
10355                    ),
10356                    <fidl::encoding::Endpoint<
10357                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10358                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10359                        &mut self.key_iterator,
10360                    ),
10361                ),
10362                encoder,
10363                offset,
10364                _depth,
10365            )
10366        }
10367    }
10368    unsafe impl<
10369        T0: fidl::encoding::Encode<
10370                fidl::encoding::HandleType<
10371                    fidl::EventPair,
10372                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10373                    2147483648,
10374                >,
10375                fidl::encoding::DefaultFuchsiaResourceDialect,
10376            >,
10377        T1: fidl::encoding::Encode<
10378                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10379                fidl::encoding::DefaultFuchsiaResourceDialect,
10380            >,
10381    >
10382        fidl::encoding::Encode<
10383            CapabilitiesDictionaryIterateKeysRequest,
10384            fidl::encoding::DefaultFuchsiaResourceDialect,
10385        > for (T0, T1)
10386    {
10387        #[inline]
10388        unsafe fn encode(
10389            self,
10390            encoder: &mut fidl::encoding::Encoder<
10391                '_,
10392                fidl::encoding::DefaultFuchsiaResourceDialect,
10393            >,
10394            offset: usize,
10395            depth: fidl::encoding::Depth,
10396        ) -> fidl::Result<()> {
10397            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10398            // Zero out padding regions. There's no need to apply masks
10399            // because the unmasked parts will be overwritten by fields.
10400            // Write the fields.
10401            self.0.encode(encoder, offset + 0, depth)?;
10402            self.1.encode(encoder, offset + 4, depth)?;
10403            Ok(())
10404        }
10405    }
10406
10407    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10408        for CapabilitiesDictionaryIterateKeysRequest
10409    {
10410        #[inline(always)]
10411        fn new_empty() -> Self {
10412            Self {
10413                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10414                key_iterator: fidl::new_empty!(
10415                    fidl::encoding::Endpoint<
10416                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10417                    >,
10418                    fidl::encoding::DefaultFuchsiaResourceDialect
10419                ),
10420            }
10421        }
10422
10423        #[inline]
10424        unsafe fn decode(
10425            &mut self,
10426            decoder: &mut fidl::encoding::Decoder<
10427                '_,
10428                fidl::encoding::DefaultFuchsiaResourceDialect,
10429            >,
10430            offset: usize,
10431            _depth: fidl::encoding::Depth,
10432        ) -> fidl::Result<()> {
10433            decoder.debug_check_bounds::<Self>(offset);
10434            // Verify that padding bytes are zero.
10435            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10436            fidl::decode!(
10437                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10438                fidl::encoding::DefaultFuchsiaResourceDialect,
10439                &mut self.key_iterator,
10440                decoder,
10441                offset + 4,
10442                _depth
10443            )?;
10444            Ok(())
10445        }
10446    }
10447
10448    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10449        type Borrowed<'a> = &'a mut Self;
10450        fn take_or_borrow<'a>(
10451            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10452        ) -> Self::Borrowed<'a> {
10453            value
10454        }
10455    }
10456
10457    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10458        type Owned = Self;
10459
10460        #[inline(always)]
10461        fn inline_align(_context: fidl::encoding::Context) -> usize {
10462            4
10463        }
10464
10465        #[inline(always)]
10466        fn inline_size(_context: fidl::encoding::Context) -> usize {
10467            8
10468        }
10469    }
10470
10471    unsafe impl
10472        fidl::encoding::Encode<
10473            CapabilitiesDictionaryRouterCreateRequest,
10474            fidl::encoding::DefaultFuchsiaResourceDialect,
10475        > for &mut CapabilitiesDictionaryRouterCreateRequest
10476    {
10477        #[inline]
10478        unsafe fn encode(
10479            self,
10480            encoder: &mut fidl::encoding::Encoder<
10481                '_,
10482                fidl::encoding::DefaultFuchsiaResourceDialect,
10483            >,
10484            offset: usize,
10485            _depth: fidl::encoding::Depth,
10486        ) -> fidl::Result<()> {
10487            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10488            // Delegate to tuple encoding.
10489            fidl::encoding::Encode::<CapabilitiesDictionaryRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10490                (
10491                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10492                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10493                ),
10494                encoder, offset, _depth
10495            )
10496        }
10497    }
10498    unsafe impl<
10499        T0: fidl::encoding::Encode<
10500                fidl::encoding::HandleType<
10501                    fidl::EventPair,
10502                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10503                    2147483648,
10504                >,
10505                fidl::encoding::DefaultFuchsiaResourceDialect,
10506            >,
10507        T1: fidl::encoding::Encode<
10508                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10509                fidl::encoding::DefaultFuchsiaResourceDialect,
10510            >,
10511    >
10512        fidl::encoding::Encode<
10513            CapabilitiesDictionaryRouterCreateRequest,
10514            fidl::encoding::DefaultFuchsiaResourceDialect,
10515        > for (T0, T1)
10516    {
10517        #[inline]
10518        unsafe fn encode(
10519            self,
10520            encoder: &mut fidl::encoding::Encoder<
10521                '_,
10522                fidl::encoding::DefaultFuchsiaResourceDialect,
10523            >,
10524            offset: usize,
10525            depth: fidl::encoding::Depth,
10526        ) -> fidl::Result<()> {
10527            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10528            // Zero out padding regions. There's no need to apply masks
10529            // because the unmasked parts will be overwritten by fields.
10530            // Write the fields.
10531            self.0.encode(encoder, offset + 0, depth)?;
10532            self.1.encode(encoder, offset + 4, depth)?;
10533            Ok(())
10534        }
10535    }
10536
10537    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10538        for CapabilitiesDictionaryRouterCreateRequest
10539    {
10540        #[inline(always)]
10541        fn new_empty() -> Self {
10542            Self {
10543                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10544                router_client_end: fidl::new_empty!(
10545                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10546                    fidl::encoding::DefaultFuchsiaResourceDialect
10547                ),
10548            }
10549        }
10550
10551        #[inline]
10552        unsafe fn decode(
10553            &mut self,
10554            decoder: &mut fidl::encoding::Decoder<
10555                '_,
10556                fidl::encoding::DefaultFuchsiaResourceDialect,
10557            >,
10558            offset: usize,
10559            _depth: fidl::encoding::Depth,
10560        ) -> fidl::Result<()> {
10561            decoder.debug_check_bounds::<Self>(offset);
10562            // Verify that padding bytes are zero.
10563            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10564            fidl::decode!(
10565                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10566                fidl::encoding::DefaultFuchsiaResourceDialect,
10567                &mut self.router_client_end,
10568                decoder,
10569                offset + 4,
10570                _depth
10571            )?;
10572            Ok(())
10573        }
10574    }
10575
10576    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10577        type Borrowed<'a> = &'a mut Self;
10578        fn take_or_borrow<'a>(
10579            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10580        ) -> Self::Borrowed<'a> {
10581            value
10582        }
10583    }
10584
10585    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10586        type Owned = Self;
10587
10588        #[inline(always)]
10589        fn inline_align(_context: fidl::encoding::Context) -> usize {
10590            8
10591        }
10592
10593        #[inline(always)]
10594        fn inline_size(_context: fidl::encoding::Context) -> usize {
10595            32
10596        }
10597    }
10598
10599    unsafe impl
10600        fidl::encoding::Encode<
10601            CapabilitiesDictionaryRouterRouteRequest,
10602            fidl::encoding::DefaultFuchsiaResourceDialect,
10603        > for &mut CapabilitiesDictionaryRouterRouteRequest
10604    {
10605        #[inline]
10606        unsafe fn encode(
10607            self,
10608            encoder: &mut fidl::encoding::Encoder<
10609                '_,
10610                fidl::encoding::DefaultFuchsiaResourceDialect,
10611            >,
10612            offset: usize,
10613            _depth: fidl::encoding::Depth,
10614        ) -> fidl::Result<()> {
10615            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10616            // Delegate to tuple encoding.
10617            fidl::encoding::Encode::<
10618                CapabilitiesDictionaryRouterRouteRequest,
10619                fidl::encoding::DefaultFuchsiaResourceDialect,
10620            >::encode(
10621                (
10622                    <fidl::encoding::HandleType<
10623                        fidl::EventPair,
10624                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10625                        2147483648,
10626                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10627                        &mut self.router
10628                    ),
10629                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10630                        &mut self.request,
10631                    ),
10632                    <fidl::encoding::HandleType<
10633                        fidl::EventPair,
10634                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10635                        2147483648,
10636                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10637                        &mut self.instance_token,
10638                    ),
10639                    <fidl::encoding::HandleType<
10640                        fidl::EventPair,
10641                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10642                        2147483648,
10643                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10644                        &mut self.dictionary
10645                    ),
10646                ),
10647                encoder,
10648                offset,
10649                _depth,
10650            )
10651        }
10652    }
10653    unsafe impl<
10654        T0: fidl::encoding::Encode<
10655                fidl::encoding::HandleType<
10656                    fidl::EventPair,
10657                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10658                    2147483648,
10659                >,
10660                fidl::encoding::DefaultFuchsiaResourceDialect,
10661            >,
10662        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
10663        T2: fidl::encoding::Encode<
10664                fidl::encoding::HandleType<
10665                    fidl::EventPair,
10666                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10667                    2147483648,
10668                >,
10669                fidl::encoding::DefaultFuchsiaResourceDialect,
10670            >,
10671        T3: fidl::encoding::Encode<
10672                fidl::encoding::HandleType<
10673                    fidl::EventPair,
10674                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10675                    2147483648,
10676                >,
10677                fidl::encoding::DefaultFuchsiaResourceDialect,
10678            >,
10679    >
10680        fidl::encoding::Encode<
10681            CapabilitiesDictionaryRouterRouteRequest,
10682            fidl::encoding::DefaultFuchsiaResourceDialect,
10683        > for (T0, T1, T2, T3)
10684    {
10685        #[inline]
10686        unsafe fn encode(
10687            self,
10688            encoder: &mut fidl::encoding::Encoder<
10689                '_,
10690                fidl::encoding::DefaultFuchsiaResourceDialect,
10691            >,
10692            offset: usize,
10693            depth: fidl::encoding::Depth,
10694        ) -> fidl::Result<()> {
10695            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10696            // Zero out padding regions. There's no need to apply masks
10697            // because the unmasked parts will be overwritten by fields.
10698            unsafe {
10699                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10700                (ptr as *mut u64).write_unaligned(0);
10701            }
10702            // Write the fields.
10703            self.0.encode(encoder, offset + 0, depth)?;
10704            self.1.encode(encoder, offset + 8, depth)?;
10705            self.2.encode(encoder, offset + 24, depth)?;
10706            self.3.encode(encoder, offset + 28, depth)?;
10707            Ok(())
10708        }
10709    }
10710
10711    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10712        for CapabilitiesDictionaryRouterRouteRequest
10713    {
10714        #[inline(always)]
10715        fn new_empty() -> Self {
10716            Self {
10717                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10718                request: fidl::new_empty!(
10719                    RouteRequest,
10720                    fidl::encoding::DefaultFuchsiaResourceDialect
10721                ),
10722                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10723                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10724            }
10725        }
10726
10727        #[inline]
10728        unsafe fn decode(
10729            &mut self,
10730            decoder: &mut fidl::encoding::Decoder<
10731                '_,
10732                fidl::encoding::DefaultFuchsiaResourceDialect,
10733            >,
10734            offset: usize,
10735            _depth: fidl::encoding::Depth,
10736        ) -> fidl::Result<()> {
10737            decoder.debug_check_bounds::<Self>(offset);
10738            // Verify that padding bytes are zero.
10739            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10740            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10741            let mask = 0xffffffff00000000u64;
10742            let maskedval = padval & mask;
10743            if maskedval != 0 {
10744                return Err(fidl::Error::NonZeroPadding {
10745                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10746                });
10747            }
10748            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10749            fidl::decode!(
10750                RouteRequest,
10751                fidl::encoding::DefaultFuchsiaResourceDialect,
10752                &mut self.request,
10753                decoder,
10754                offset + 8,
10755                _depth
10756            )?;
10757            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
10758            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 28, _depth)?;
10759            Ok(())
10760        }
10761    }
10762
10763    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorCreateRequest {
10764        type Borrowed<'a> = &'a mut Self;
10765        fn take_or_borrow<'a>(
10766            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10767        ) -> Self::Borrowed<'a> {
10768            value
10769        }
10770    }
10771
10772    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorCreateRequest {
10773        type Owned = Self;
10774
10775        #[inline(always)]
10776        fn inline_align(_context: fidl::encoding::Context) -> usize {
10777            4
10778        }
10779
10780        #[inline(always)]
10781        fn inline_size(_context: fidl::encoding::Context) -> usize {
10782            8
10783        }
10784    }
10785
10786    unsafe impl
10787        fidl::encoding::Encode<
10788            CapabilitiesDirConnectorCreateRequest,
10789            fidl::encoding::DefaultFuchsiaResourceDialect,
10790        > for &mut CapabilitiesDirConnectorCreateRequest
10791    {
10792        #[inline]
10793        unsafe fn encode(
10794            self,
10795            encoder: &mut fidl::encoding::Encoder<
10796                '_,
10797                fidl::encoding::DefaultFuchsiaResourceDialect,
10798            >,
10799            offset: usize,
10800            _depth: fidl::encoding::Depth,
10801        ) -> fidl::Result<()> {
10802            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10803            // Delegate to tuple encoding.
10804            fidl::encoding::Encode::<CapabilitiesDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10805                (
10806                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector),
10807                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
10808                ),
10809                encoder, offset, _depth
10810            )
10811        }
10812    }
10813    unsafe impl<
10814        T0: fidl::encoding::Encode<
10815                fidl::encoding::HandleType<
10816                    fidl::EventPair,
10817                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10818                    2147483648,
10819                >,
10820                fidl::encoding::DefaultFuchsiaResourceDialect,
10821            >,
10822        T1: fidl::encoding::Encode<
10823                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10824                fidl::encoding::DefaultFuchsiaResourceDialect,
10825            >,
10826    >
10827        fidl::encoding::Encode<
10828            CapabilitiesDirConnectorCreateRequest,
10829            fidl::encoding::DefaultFuchsiaResourceDialect,
10830        > for (T0, T1)
10831    {
10832        #[inline]
10833        unsafe fn encode(
10834            self,
10835            encoder: &mut fidl::encoding::Encoder<
10836                '_,
10837                fidl::encoding::DefaultFuchsiaResourceDialect,
10838            >,
10839            offset: usize,
10840            depth: fidl::encoding::Depth,
10841        ) -> fidl::Result<()> {
10842            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10843            // Zero out padding regions. There's no need to apply masks
10844            // because the unmasked parts will be overwritten by fields.
10845            // Write the fields.
10846            self.0.encode(encoder, offset + 0, depth)?;
10847            self.1.encode(encoder, offset + 4, depth)?;
10848            Ok(())
10849        }
10850    }
10851
10852    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10853        for CapabilitiesDirConnectorCreateRequest
10854    {
10855        #[inline(always)]
10856        fn new_empty() -> Self {
10857            Self {
10858                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10859                receiver_client_end: fidl::new_empty!(
10860                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10861                    fidl::encoding::DefaultFuchsiaResourceDialect
10862                ),
10863            }
10864        }
10865
10866        #[inline]
10867        unsafe fn decode(
10868            &mut self,
10869            decoder: &mut fidl::encoding::Decoder<
10870                '_,
10871                fidl::encoding::DefaultFuchsiaResourceDialect,
10872            >,
10873            offset: usize,
10874            _depth: fidl::encoding::Depth,
10875        ) -> fidl::Result<()> {
10876            decoder.debug_check_bounds::<Self>(offset);
10877            // Verify that padding bytes are zero.
10878            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 0, _depth)?;
10879            fidl::decode!(
10880                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10881                fidl::encoding::DefaultFuchsiaResourceDialect,
10882                &mut self.receiver_client_end,
10883                decoder,
10884                offset + 4,
10885                _depth
10886            )?;
10887            Ok(())
10888        }
10889    }
10890
10891    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10892        type Borrowed<'a> = &'a mut Self;
10893        fn take_or_borrow<'a>(
10894            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10895        ) -> Self::Borrowed<'a> {
10896            value
10897        }
10898    }
10899
10900    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10901        type Owned = Self;
10902
10903        #[inline(always)]
10904        fn inline_align(_context: fidl::encoding::Context) -> usize {
10905            4
10906        }
10907
10908        #[inline(always)]
10909        fn inline_size(_context: fidl::encoding::Context) -> usize {
10910            8
10911        }
10912    }
10913
10914    unsafe impl
10915        fidl::encoding::Encode<
10916            CapabilitiesDirConnectorRouterCreateRequest,
10917            fidl::encoding::DefaultFuchsiaResourceDialect,
10918        > for &mut CapabilitiesDirConnectorRouterCreateRequest
10919    {
10920        #[inline]
10921        unsafe fn encode(
10922            self,
10923            encoder: &mut fidl::encoding::Encoder<
10924                '_,
10925                fidl::encoding::DefaultFuchsiaResourceDialect,
10926            >,
10927            offset: usize,
10928            _depth: fidl::encoding::Depth,
10929        ) -> fidl::Result<()> {
10930            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10931            // Delegate to tuple encoding.
10932            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10933                (
10934                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10935                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10936                ),
10937                encoder, offset, _depth
10938            )
10939        }
10940    }
10941    unsafe impl<
10942        T0: fidl::encoding::Encode<
10943                fidl::encoding::HandleType<
10944                    fidl::EventPair,
10945                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10946                    2147483648,
10947                >,
10948                fidl::encoding::DefaultFuchsiaResourceDialect,
10949            >,
10950        T1: fidl::encoding::Encode<
10951                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10952                fidl::encoding::DefaultFuchsiaResourceDialect,
10953            >,
10954    >
10955        fidl::encoding::Encode<
10956            CapabilitiesDirConnectorRouterCreateRequest,
10957            fidl::encoding::DefaultFuchsiaResourceDialect,
10958        > for (T0, T1)
10959    {
10960        #[inline]
10961        unsafe fn encode(
10962            self,
10963            encoder: &mut fidl::encoding::Encoder<
10964                '_,
10965                fidl::encoding::DefaultFuchsiaResourceDialect,
10966            >,
10967            offset: usize,
10968            depth: fidl::encoding::Depth,
10969        ) -> fidl::Result<()> {
10970            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10971            // Zero out padding regions. There's no need to apply masks
10972            // because the unmasked parts will be overwritten by fields.
10973            // Write the fields.
10974            self.0.encode(encoder, offset + 0, depth)?;
10975            self.1.encode(encoder, offset + 4, depth)?;
10976            Ok(())
10977        }
10978    }
10979
10980    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10981        for CapabilitiesDirConnectorRouterCreateRequest
10982    {
10983        #[inline(always)]
10984        fn new_empty() -> Self {
10985            Self {
10986                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10987                router_client_end: fidl::new_empty!(
10988                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10989                    fidl::encoding::DefaultFuchsiaResourceDialect
10990                ),
10991            }
10992        }
10993
10994        #[inline]
10995        unsafe fn decode(
10996            &mut self,
10997            decoder: &mut fidl::encoding::Decoder<
10998                '_,
10999                fidl::encoding::DefaultFuchsiaResourceDialect,
11000            >,
11001            offset: usize,
11002            _depth: fidl::encoding::Depth,
11003        ) -> fidl::Result<()> {
11004            decoder.debug_check_bounds::<Self>(offset);
11005            // Verify that padding bytes are zero.
11006            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11007            fidl::decode!(
11008                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
11009                fidl::encoding::DefaultFuchsiaResourceDialect,
11010                &mut self.router_client_end,
11011                decoder,
11012                offset + 4,
11013                _depth
11014            )?;
11015            Ok(())
11016        }
11017    }
11018
11019    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11020        type Borrowed<'a> = &'a mut Self;
11021        fn take_or_borrow<'a>(
11022            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11023        ) -> Self::Borrowed<'a> {
11024            value
11025        }
11026    }
11027
11028    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11029        type Owned = Self;
11030
11031        #[inline(always)]
11032        fn inline_align(_context: fidl::encoding::Context) -> usize {
11033            8
11034        }
11035
11036        #[inline(always)]
11037        fn inline_size(_context: fidl::encoding::Context) -> usize {
11038            32
11039        }
11040    }
11041
11042    unsafe impl
11043        fidl::encoding::Encode<
11044            CapabilitiesDirConnectorRouterRouteRequest,
11045            fidl::encoding::DefaultFuchsiaResourceDialect,
11046        > for &mut CapabilitiesDirConnectorRouterRouteRequest
11047    {
11048        #[inline]
11049        unsafe fn encode(
11050            self,
11051            encoder: &mut fidl::encoding::Encoder<
11052                '_,
11053                fidl::encoding::DefaultFuchsiaResourceDialect,
11054            >,
11055            offset: usize,
11056            _depth: fidl::encoding::Depth,
11057        ) -> fidl::Result<()> {
11058            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11059            // Delegate to tuple encoding.
11060            fidl::encoding::Encode::<
11061                CapabilitiesDirConnectorRouterRouteRequest,
11062                fidl::encoding::DefaultFuchsiaResourceDialect,
11063            >::encode(
11064                (
11065                    <fidl::encoding::HandleType<
11066                        fidl::EventPair,
11067                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11068                        2147483648,
11069                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11070                        &mut self.router
11071                    ),
11072                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11073                        &mut self.request,
11074                    ),
11075                    <fidl::encoding::HandleType<
11076                        fidl::EventPair,
11077                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11078                        2147483648,
11079                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11080                        &mut self.instance_token,
11081                    ),
11082                    <fidl::encoding::HandleType<
11083                        fidl::EventPair,
11084                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11085                        2147483648,
11086                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11087                        &mut self.dir_connector,
11088                    ),
11089                ),
11090                encoder,
11091                offset,
11092                _depth,
11093            )
11094        }
11095    }
11096    unsafe impl<
11097        T0: fidl::encoding::Encode<
11098                fidl::encoding::HandleType<
11099                    fidl::EventPair,
11100                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11101                    2147483648,
11102                >,
11103                fidl::encoding::DefaultFuchsiaResourceDialect,
11104            >,
11105        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11106        T2: fidl::encoding::Encode<
11107                fidl::encoding::HandleType<
11108                    fidl::EventPair,
11109                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11110                    2147483648,
11111                >,
11112                fidl::encoding::DefaultFuchsiaResourceDialect,
11113            >,
11114        T3: fidl::encoding::Encode<
11115                fidl::encoding::HandleType<
11116                    fidl::EventPair,
11117                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11118                    2147483648,
11119                >,
11120                fidl::encoding::DefaultFuchsiaResourceDialect,
11121            >,
11122    >
11123        fidl::encoding::Encode<
11124            CapabilitiesDirConnectorRouterRouteRequest,
11125            fidl::encoding::DefaultFuchsiaResourceDialect,
11126        > for (T0, T1, T2, T3)
11127    {
11128        #[inline]
11129        unsafe fn encode(
11130            self,
11131            encoder: &mut fidl::encoding::Encoder<
11132                '_,
11133                fidl::encoding::DefaultFuchsiaResourceDialect,
11134            >,
11135            offset: usize,
11136            depth: fidl::encoding::Depth,
11137        ) -> fidl::Result<()> {
11138            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11139            // Zero out padding regions. There's no need to apply masks
11140            // because the unmasked parts will be overwritten by fields.
11141            unsafe {
11142                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11143                (ptr as *mut u64).write_unaligned(0);
11144            }
11145            // Write the fields.
11146            self.0.encode(encoder, offset + 0, depth)?;
11147            self.1.encode(encoder, offset + 8, depth)?;
11148            self.2.encode(encoder, offset + 24, depth)?;
11149            self.3.encode(encoder, offset + 28, depth)?;
11150            Ok(())
11151        }
11152    }
11153
11154    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11155        for CapabilitiesDirConnectorRouterRouteRequest
11156    {
11157        #[inline(always)]
11158        fn new_empty() -> Self {
11159            Self {
11160                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11161                request: fidl::new_empty!(
11162                    RouteRequest,
11163                    fidl::encoding::DefaultFuchsiaResourceDialect
11164                ),
11165                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11166                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11167            }
11168        }
11169
11170        #[inline]
11171        unsafe fn decode(
11172            &mut self,
11173            decoder: &mut fidl::encoding::Decoder<
11174                '_,
11175                fidl::encoding::DefaultFuchsiaResourceDialect,
11176            >,
11177            offset: usize,
11178            _depth: fidl::encoding::Depth,
11179        ) -> fidl::Result<()> {
11180            decoder.debug_check_bounds::<Self>(offset);
11181            // Verify that padding bytes are zero.
11182            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11183            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11184            let mask = 0xffffffff00000000u64;
11185            let maskedval = padval & mask;
11186            if maskedval != 0 {
11187                return Err(fidl::Error::NonZeroPadding {
11188                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11189                });
11190            }
11191            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11192            fidl::decode!(
11193                RouteRequest,
11194                fidl::encoding::DefaultFuchsiaResourceDialect,
11195                &mut self.request,
11196                decoder,
11197                offset + 8,
11198                _depth
11199            )?;
11200            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
11201            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 28, _depth)?;
11202            Ok(())
11203        }
11204    }
11205
11206    impl fidl::encoding::ResourceTypeMarker for CapabilitiesInstanceTokenCreateRequest {
11207        type Borrowed<'a> = &'a mut Self;
11208        fn take_or_borrow<'a>(
11209            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11210        ) -> Self::Borrowed<'a> {
11211            value
11212        }
11213    }
11214
11215    unsafe impl fidl::encoding::TypeMarker for CapabilitiesInstanceTokenCreateRequest {
11216        type Owned = Self;
11217
11218        #[inline(always)]
11219        fn inline_align(_context: fidl::encoding::Context) -> usize {
11220            4
11221        }
11222
11223        #[inline(always)]
11224        fn inline_size(_context: fidl::encoding::Context) -> usize {
11225            4
11226        }
11227    }
11228
11229    unsafe impl
11230        fidl::encoding::Encode<
11231            CapabilitiesInstanceTokenCreateRequest,
11232            fidl::encoding::DefaultFuchsiaResourceDialect,
11233        > for &mut CapabilitiesInstanceTokenCreateRequest
11234    {
11235        #[inline]
11236        unsafe fn encode(
11237            self,
11238            encoder: &mut fidl::encoding::Encoder<
11239                '_,
11240                fidl::encoding::DefaultFuchsiaResourceDialect,
11241            >,
11242            offset: usize,
11243            _depth: fidl::encoding::Depth,
11244        ) -> fidl::Result<()> {
11245            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11246            // Delegate to tuple encoding.
11247            fidl::encoding::Encode::<
11248                CapabilitiesInstanceTokenCreateRequest,
11249                fidl::encoding::DefaultFuchsiaResourceDialect,
11250            >::encode(
11251                (<fidl::encoding::HandleType<
11252                    fidl::EventPair,
11253                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11254                    2147483648,
11255                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11256                    &mut self.instance_token
11257                ),),
11258                encoder,
11259                offset,
11260                _depth,
11261            )
11262        }
11263    }
11264    unsafe impl<
11265        T0: fidl::encoding::Encode<
11266                fidl::encoding::HandleType<
11267                    fidl::EventPair,
11268                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11269                    2147483648,
11270                >,
11271                fidl::encoding::DefaultFuchsiaResourceDialect,
11272            >,
11273    >
11274        fidl::encoding::Encode<
11275            CapabilitiesInstanceTokenCreateRequest,
11276            fidl::encoding::DefaultFuchsiaResourceDialect,
11277        > for (T0,)
11278    {
11279        #[inline]
11280        unsafe fn encode(
11281            self,
11282            encoder: &mut fidl::encoding::Encoder<
11283                '_,
11284                fidl::encoding::DefaultFuchsiaResourceDialect,
11285            >,
11286            offset: usize,
11287            depth: fidl::encoding::Depth,
11288        ) -> fidl::Result<()> {
11289            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11290            // Zero out padding regions. There's no need to apply masks
11291            // because the unmasked parts will be overwritten by fields.
11292            // Write the fields.
11293            self.0.encode(encoder, offset + 0, depth)?;
11294            Ok(())
11295        }
11296    }
11297
11298    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11299        for CapabilitiesInstanceTokenCreateRequest
11300    {
11301        #[inline(always)]
11302        fn new_empty() -> Self {
11303            Self {
11304                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11305            }
11306        }
11307
11308        #[inline]
11309        unsafe fn decode(
11310            &mut self,
11311            decoder: &mut fidl::encoding::Decoder<
11312                '_,
11313                fidl::encoding::DefaultFuchsiaResourceDialect,
11314            >,
11315            offset: usize,
11316            _depth: fidl::encoding::Depth,
11317        ) -> fidl::Result<()> {
11318            decoder.debug_check_bounds::<Self>(offset);
11319            // Verify that padding bytes are zero.
11320            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 0, _depth)?;
11321            Ok(())
11322        }
11323    }
11324
11325    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetResponse {
11326        type Borrowed<'a> = &'a mut Self;
11327        fn take_or_borrow<'a>(
11328            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11329        ) -> Self::Borrowed<'a> {
11330            value
11331        }
11332    }
11333
11334    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetResponse {
11335        type Owned = Self;
11336
11337        #[inline(always)]
11338        fn inline_align(_context: fidl::encoding::Context) -> usize {
11339            4
11340        }
11341
11342        #[inline(always)]
11343        fn inline_size(_context: fidl::encoding::Context) -> usize {
11344            4
11345        }
11346    }
11347
11348    unsafe impl
11349        fidl::encoding::Encode<
11350            CapabilitiesDictionaryGetResponse,
11351            fidl::encoding::DefaultFuchsiaResourceDialect,
11352        > for &mut CapabilitiesDictionaryGetResponse
11353    {
11354        #[inline]
11355        unsafe fn encode(
11356            self,
11357            encoder: &mut fidl::encoding::Encoder<
11358                '_,
11359                fidl::encoding::DefaultFuchsiaResourceDialect,
11360            >,
11361            offset: usize,
11362            _depth: fidl::encoding::Depth,
11363        ) -> fidl::Result<()> {
11364            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11365            // Delegate to tuple encoding.
11366            fidl::encoding::Encode::<
11367                CapabilitiesDictionaryGetResponse,
11368                fidl::encoding::DefaultFuchsiaResourceDialect,
11369            >::encode(
11370                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11371                    &self.capability_type,
11372                ),),
11373                encoder,
11374                offset,
11375                _depth,
11376            )
11377        }
11378    }
11379    unsafe impl<
11380        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11381    >
11382        fidl::encoding::Encode<
11383            CapabilitiesDictionaryGetResponse,
11384            fidl::encoding::DefaultFuchsiaResourceDialect,
11385        > for (T0,)
11386    {
11387        #[inline]
11388        unsafe fn encode(
11389            self,
11390            encoder: &mut fidl::encoding::Encoder<
11391                '_,
11392                fidl::encoding::DefaultFuchsiaResourceDialect,
11393            >,
11394            offset: usize,
11395            depth: fidl::encoding::Depth,
11396        ) -> fidl::Result<()> {
11397            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11398            // Zero out padding regions. There's no need to apply masks
11399            // because the unmasked parts will be overwritten by fields.
11400            // Write the fields.
11401            self.0.encode(encoder, offset + 0, depth)?;
11402            Ok(())
11403        }
11404    }
11405
11406    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11407        for CapabilitiesDictionaryGetResponse
11408    {
11409        #[inline(always)]
11410        fn new_empty() -> Self {
11411            Self {
11412                capability_type: fidl::new_empty!(
11413                    CapabilityType,
11414                    fidl::encoding::DefaultFuchsiaResourceDialect
11415                ),
11416            }
11417        }
11418
11419        #[inline]
11420        unsafe fn decode(
11421            &mut self,
11422            decoder: &mut fidl::encoding::Decoder<
11423                '_,
11424                fidl::encoding::DefaultFuchsiaResourceDialect,
11425            >,
11426            offset: usize,
11427            _depth: fidl::encoding::Depth,
11428        ) -> fidl::Result<()> {
11429            decoder.debug_check_bounds::<Self>(offset);
11430            // Verify that padding bytes are zero.
11431            fidl::decode!(
11432                CapabilityType,
11433                fidl::encoding::DefaultFuchsiaResourceDialect,
11434                &mut self.capability_type,
11435                decoder,
11436                offset + 0,
11437                _depth
11438            )?;
11439            Ok(())
11440        }
11441    }
11442
11443    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveResponse {
11444        type Borrowed<'a> = &'a mut Self;
11445        fn take_or_borrow<'a>(
11446            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11447        ) -> Self::Borrowed<'a> {
11448            value
11449        }
11450    }
11451
11452    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveResponse {
11453        type Owned = Self;
11454
11455        #[inline(always)]
11456        fn inline_align(_context: fidl::encoding::Context) -> usize {
11457            4
11458        }
11459
11460        #[inline(always)]
11461        fn inline_size(_context: fidl::encoding::Context) -> usize {
11462            4
11463        }
11464    }
11465
11466    unsafe impl
11467        fidl::encoding::Encode<
11468            CapabilitiesDictionaryRemoveResponse,
11469            fidl::encoding::DefaultFuchsiaResourceDialect,
11470        > for &mut CapabilitiesDictionaryRemoveResponse
11471    {
11472        #[inline]
11473        unsafe fn encode(
11474            self,
11475            encoder: &mut fidl::encoding::Encoder<
11476                '_,
11477                fidl::encoding::DefaultFuchsiaResourceDialect,
11478            >,
11479            offset: usize,
11480            _depth: fidl::encoding::Depth,
11481        ) -> fidl::Result<()> {
11482            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11483            // Delegate to tuple encoding.
11484            fidl::encoding::Encode::<
11485                CapabilitiesDictionaryRemoveResponse,
11486                fidl::encoding::DefaultFuchsiaResourceDialect,
11487            >::encode(
11488                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11489                    &self.capability_type,
11490                ),),
11491                encoder,
11492                offset,
11493                _depth,
11494            )
11495        }
11496    }
11497    unsafe impl<
11498        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11499    >
11500        fidl::encoding::Encode<
11501            CapabilitiesDictionaryRemoveResponse,
11502            fidl::encoding::DefaultFuchsiaResourceDialect,
11503        > for (T0,)
11504    {
11505        #[inline]
11506        unsafe fn encode(
11507            self,
11508            encoder: &mut fidl::encoding::Encoder<
11509                '_,
11510                fidl::encoding::DefaultFuchsiaResourceDialect,
11511            >,
11512            offset: usize,
11513            depth: fidl::encoding::Depth,
11514        ) -> fidl::Result<()> {
11515            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11516            // Zero out padding regions. There's no need to apply masks
11517            // because the unmasked parts will be overwritten by fields.
11518            // Write the fields.
11519            self.0.encode(encoder, offset + 0, depth)?;
11520            Ok(())
11521        }
11522    }
11523
11524    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11525        for CapabilitiesDictionaryRemoveResponse
11526    {
11527        #[inline(always)]
11528        fn new_empty() -> Self {
11529            Self {
11530                capability_type: fidl::new_empty!(
11531                    CapabilityType,
11532                    fidl::encoding::DefaultFuchsiaResourceDialect
11533                ),
11534            }
11535        }
11536
11537        #[inline]
11538        unsafe fn decode(
11539            &mut self,
11540            decoder: &mut fidl::encoding::Decoder<
11541                '_,
11542                fidl::encoding::DefaultFuchsiaResourceDialect,
11543            >,
11544            offset: usize,
11545            _depth: fidl::encoding::Depth,
11546        ) -> fidl::Result<()> {
11547            decoder.debug_check_bounds::<Self>(offset);
11548            // Verify that padding bytes are zero.
11549            fidl::decode!(
11550                CapabilityType,
11551                fidl::encoding::DefaultFuchsiaResourceDialect,
11552                &mut self.capability_type,
11553                decoder,
11554                offset + 0,
11555                _depth
11556            )?;
11557            Ok(())
11558        }
11559    }
11560
11561    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteRequest {
11562        type Borrowed<'a> = &'a mut Self;
11563        fn take_or_borrow<'a>(
11564            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11565        ) -> Self::Borrowed<'a> {
11566            value
11567        }
11568    }
11569
11570    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteRequest {
11571        type Owned = Self;
11572
11573        #[inline(always)]
11574        fn inline_align(_context: fidl::encoding::Context) -> usize {
11575            8
11576        }
11577
11578        #[inline(always)]
11579        fn inline_size(_context: fidl::encoding::Context) -> usize {
11580            24
11581        }
11582    }
11583
11584    unsafe impl
11585        fidl::encoding::Encode<
11586            ConnectorRouterRouteRequest,
11587            fidl::encoding::DefaultFuchsiaResourceDialect,
11588        > for &mut ConnectorRouterRouteRequest
11589    {
11590        #[inline]
11591        unsafe fn encode(
11592            self,
11593            encoder: &mut fidl::encoding::Encoder<
11594                '_,
11595                fidl::encoding::DefaultFuchsiaResourceDialect,
11596            >,
11597            offset: usize,
11598            _depth: fidl::encoding::Depth,
11599        ) -> fidl::Result<()> {
11600            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11601            // Delegate to tuple encoding.
11602            fidl::encoding::Encode::<
11603                ConnectorRouterRouteRequest,
11604                fidl::encoding::DefaultFuchsiaResourceDialect,
11605            >::encode(
11606                (
11607                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11608                        &mut self.request,
11609                    ),
11610                    <fidl::encoding::HandleType<
11611                        fidl::EventPair,
11612                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11613                        2147483648,
11614                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11615                        &mut self.instance_token,
11616                    ),
11617                    <fidl::encoding::HandleType<
11618                        fidl::EventPair,
11619                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11620                        2147483648,
11621                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11622                        &mut self.handle
11623                    ),
11624                ),
11625                encoder,
11626                offset,
11627                _depth,
11628            )
11629        }
11630    }
11631    unsafe impl<
11632        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11633        T1: fidl::encoding::Encode<
11634                fidl::encoding::HandleType<
11635                    fidl::EventPair,
11636                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11637                    2147483648,
11638                >,
11639                fidl::encoding::DefaultFuchsiaResourceDialect,
11640            >,
11641        T2: fidl::encoding::Encode<
11642                fidl::encoding::HandleType<
11643                    fidl::EventPair,
11644                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11645                    2147483648,
11646                >,
11647                fidl::encoding::DefaultFuchsiaResourceDialect,
11648            >,
11649    >
11650        fidl::encoding::Encode<
11651            ConnectorRouterRouteRequest,
11652            fidl::encoding::DefaultFuchsiaResourceDialect,
11653        > for (T0, T1, T2)
11654    {
11655        #[inline]
11656        unsafe fn encode(
11657            self,
11658            encoder: &mut fidl::encoding::Encoder<
11659                '_,
11660                fidl::encoding::DefaultFuchsiaResourceDialect,
11661            >,
11662            offset: usize,
11663            depth: fidl::encoding::Depth,
11664        ) -> fidl::Result<()> {
11665            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11666            // Zero out padding regions. There's no need to apply masks
11667            // because the unmasked parts will be overwritten by fields.
11668            // Write the fields.
11669            self.0.encode(encoder, offset + 0, depth)?;
11670            self.1.encode(encoder, offset + 16, depth)?;
11671            self.2.encode(encoder, offset + 20, depth)?;
11672            Ok(())
11673        }
11674    }
11675
11676    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11677        for ConnectorRouterRouteRequest
11678    {
11679        #[inline(always)]
11680        fn new_empty() -> Self {
11681            Self {
11682                request: fidl::new_empty!(
11683                    RouteRequest,
11684                    fidl::encoding::DefaultFuchsiaResourceDialect
11685                ),
11686                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11687                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11688            }
11689        }
11690
11691        #[inline]
11692        unsafe fn decode(
11693            &mut self,
11694            decoder: &mut fidl::encoding::Decoder<
11695                '_,
11696                fidl::encoding::DefaultFuchsiaResourceDialect,
11697            >,
11698            offset: usize,
11699            _depth: fidl::encoding::Depth,
11700        ) -> fidl::Result<()> {
11701            decoder.debug_check_bounds::<Self>(offset);
11702            // Verify that padding bytes are zero.
11703            fidl::decode!(
11704                RouteRequest,
11705                fidl::encoding::DefaultFuchsiaResourceDialect,
11706                &mut self.request,
11707                decoder,
11708                offset + 0,
11709                _depth
11710            )?;
11711            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11712            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11713            Ok(())
11714        }
11715    }
11716
11717    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteRequest {
11718        type Borrowed<'a> = &'a mut Self;
11719        fn take_or_borrow<'a>(
11720            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11721        ) -> Self::Borrowed<'a> {
11722            value
11723        }
11724    }
11725
11726    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteRequest {
11727        type Owned = Self;
11728
11729        #[inline(always)]
11730        fn inline_align(_context: fidl::encoding::Context) -> usize {
11731            8
11732        }
11733
11734        #[inline(always)]
11735        fn inline_size(_context: fidl::encoding::Context) -> usize {
11736            24
11737        }
11738    }
11739
11740    unsafe impl
11741        fidl::encoding::Encode<
11742            DataRouterRouteRequest,
11743            fidl::encoding::DefaultFuchsiaResourceDialect,
11744        > for &mut DataRouterRouteRequest
11745    {
11746        #[inline]
11747        unsafe fn encode(
11748            self,
11749            encoder: &mut fidl::encoding::Encoder<
11750                '_,
11751                fidl::encoding::DefaultFuchsiaResourceDialect,
11752            >,
11753            offset: usize,
11754            _depth: fidl::encoding::Depth,
11755        ) -> fidl::Result<()> {
11756            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11757            // Delegate to tuple encoding.
11758            fidl::encoding::Encode::<
11759                DataRouterRouteRequest,
11760                fidl::encoding::DefaultFuchsiaResourceDialect,
11761            >::encode(
11762                (
11763                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11764                        &mut self.request,
11765                    ),
11766                    <fidl::encoding::HandleType<
11767                        fidl::EventPair,
11768                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11769                        2147483648,
11770                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11771                        &mut self.instance_token,
11772                    ),
11773                    <fidl::encoding::HandleType<
11774                        fidl::EventPair,
11775                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11776                        2147483648,
11777                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11778                        &mut self.handle
11779                    ),
11780                ),
11781                encoder,
11782                offset,
11783                _depth,
11784            )
11785        }
11786    }
11787    unsafe impl<
11788        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11789        T1: fidl::encoding::Encode<
11790                fidl::encoding::HandleType<
11791                    fidl::EventPair,
11792                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11793                    2147483648,
11794                >,
11795                fidl::encoding::DefaultFuchsiaResourceDialect,
11796            >,
11797        T2: fidl::encoding::Encode<
11798                fidl::encoding::HandleType<
11799                    fidl::EventPair,
11800                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11801                    2147483648,
11802                >,
11803                fidl::encoding::DefaultFuchsiaResourceDialect,
11804            >,
11805    >
11806        fidl::encoding::Encode<
11807            DataRouterRouteRequest,
11808            fidl::encoding::DefaultFuchsiaResourceDialect,
11809        > for (T0, T1, T2)
11810    {
11811        #[inline]
11812        unsafe fn encode(
11813            self,
11814            encoder: &mut fidl::encoding::Encoder<
11815                '_,
11816                fidl::encoding::DefaultFuchsiaResourceDialect,
11817            >,
11818            offset: usize,
11819            depth: fidl::encoding::Depth,
11820        ) -> fidl::Result<()> {
11821            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11822            // Zero out padding regions. There's no need to apply masks
11823            // because the unmasked parts will be overwritten by fields.
11824            // Write the fields.
11825            self.0.encode(encoder, offset + 0, depth)?;
11826            self.1.encode(encoder, offset + 16, depth)?;
11827            self.2.encode(encoder, offset + 20, depth)?;
11828            Ok(())
11829        }
11830    }
11831
11832    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11833        for DataRouterRouteRequest
11834    {
11835        #[inline(always)]
11836        fn new_empty() -> Self {
11837            Self {
11838                request: fidl::new_empty!(
11839                    RouteRequest,
11840                    fidl::encoding::DefaultFuchsiaResourceDialect
11841                ),
11842                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11843                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11844            }
11845        }
11846
11847        #[inline]
11848        unsafe fn decode(
11849            &mut self,
11850            decoder: &mut fidl::encoding::Decoder<
11851                '_,
11852                fidl::encoding::DefaultFuchsiaResourceDialect,
11853            >,
11854            offset: usize,
11855            _depth: fidl::encoding::Depth,
11856        ) -> fidl::Result<()> {
11857            decoder.debug_check_bounds::<Self>(offset);
11858            // Verify that padding bytes are zero.
11859            fidl::decode!(
11860                RouteRequest,
11861                fidl::encoding::DefaultFuchsiaResourceDialect,
11862                &mut self.request,
11863                decoder,
11864                offset + 0,
11865                _depth
11866            )?;
11867            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11868            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11869            Ok(())
11870        }
11871    }
11872
11873    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteRequest {
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 DictionaryRouterRouteRequest {
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            24
11893        }
11894    }
11895
11896    unsafe impl
11897        fidl::encoding::Encode<
11898            DictionaryRouterRouteRequest,
11899            fidl::encoding::DefaultFuchsiaResourceDialect,
11900        > for &mut DictionaryRouterRouteRequest
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::<DictionaryRouterRouteRequest>(offset);
11913            // Delegate to tuple encoding.
11914            fidl::encoding::Encode::<
11915                DictionaryRouterRouteRequest,
11916                fidl::encoding::DefaultFuchsiaResourceDialect,
11917            >::encode(
11918                (
11919                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11920                        &mut self.request,
11921                    ),
11922                    <fidl::encoding::HandleType<
11923                        fidl::EventPair,
11924                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11925                        2147483648,
11926                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11927                        &mut self.instance_token,
11928                    ),
11929                    <fidl::encoding::HandleType<
11930                        fidl::EventPair,
11931                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11932                        2147483648,
11933                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11934                        &mut self.handle
11935                    ),
11936                ),
11937                encoder,
11938                offset,
11939                _depth,
11940            )
11941        }
11942    }
11943    unsafe impl<
11944        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11945        T1: fidl::encoding::Encode<
11946                fidl::encoding::HandleType<
11947                    fidl::EventPair,
11948                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11949                    2147483648,
11950                >,
11951                fidl::encoding::DefaultFuchsiaResourceDialect,
11952            >,
11953        T2: fidl::encoding::Encode<
11954                fidl::encoding::HandleType<
11955                    fidl::EventPair,
11956                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11957                    2147483648,
11958                >,
11959                fidl::encoding::DefaultFuchsiaResourceDialect,
11960            >,
11961    >
11962        fidl::encoding::Encode<
11963            DictionaryRouterRouteRequest,
11964            fidl::encoding::DefaultFuchsiaResourceDialect,
11965        > for (T0, T1, T2)
11966    {
11967        #[inline]
11968        unsafe fn encode(
11969            self,
11970            encoder: &mut fidl::encoding::Encoder<
11971                '_,
11972                fidl::encoding::DefaultFuchsiaResourceDialect,
11973            >,
11974            offset: usize,
11975            depth: fidl::encoding::Depth,
11976        ) -> fidl::Result<()> {
11977            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11978            // Zero out padding regions. There's no need to apply masks
11979            // because the unmasked parts will be overwritten by fields.
11980            // Write the fields.
11981            self.0.encode(encoder, offset + 0, depth)?;
11982            self.1.encode(encoder, offset + 16, depth)?;
11983            self.2.encode(encoder, offset + 20, depth)?;
11984            Ok(())
11985        }
11986    }
11987
11988    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11989        for DictionaryRouterRouteRequest
11990    {
11991        #[inline(always)]
11992        fn new_empty() -> Self {
11993            Self {
11994                request: fidl::new_empty!(
11995                    RouteRequest,
11996                    fidl::encoding::DefaultFuchsiaResourceDialect
11997                ),
11998                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11999                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12000            }
12001        }
12002
12003        #[inline]
12004        unsafe fn decode(
12005            &mut self,
12006            decoder: &mut fidl::encoding::Decoder<
12007                '_,
12008                fidl::encoding::DefaultFuchsiaResourceDialect,
12009            >,
12010            offset: usize,
12011            _depth: fidl::encoding::Depth,
12012        ) -> fidl::Result<()> {
12013            decoder.debug_check_bounds::<Self>(offset);
12014            // Verify that padding bytes are zero.
12015            fidl::decode!(
12016                RouteRequest,
12017                fidl::encoding::DefaultFuchsiaResourceDialect,
12018                &mut self.request,
12019                decoder,
12020                offset + 0,
12021                _depth
12022            )?;
12023            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12024            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12025            Ok(())
12026        }
12027    }
12028
12029    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteRequest {
12030        type Borrowed<'a> = &'a mut Self;
12031        fn take_or_borrow<'a>(
12032            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12033        ) -> Self::Borrowed<'a> {
12034            value
12035        }
12036    }
12037
12038    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteRequest {
12039        type Owned = Self;
12040
12041        #[inline(always)]
12042        fn inline_align(_context: fidl::encoding::Context) -> usize {
12043            8
12044        }
12045
12046        #[inline(always)]
12047        fn inline_size(_context: fidl::encoding::Context) -> usize {
12048            24
12049        }
12050    }
12051
12052    unsafe impl
12053        fidl::encoding::Encode<
12054            DirConnectorRouterRouteRequest,
12055            fidl::encoding::DefaultFuchsiaResourceDialect,
12056        > for &mut DirConnectorRouterRouteRequest
12057    {
12058        #[inline]
12059        unsafe fn encode(
12060            self,
12061            encoder: &mut fidl::encoding::Encoder<
12062                '_,
12063                fidl::encoding::DefaultFuchsiaResourceDialect,
12064            >,
12065            offset: usize,
12066            _depth: fidl::encoding::Depth,
12067        ) -> fidl::Result<()> {
12068            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12069            // Delegate to tuple encoding.
12070            fidl::encoding::Encode::<
12071                DirConnectorRouterRouteRequest,
12072                fidl::encoding::DefaultFuchsiaResourceDialect,
12073            >::encode(
12074                (
12075                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12076                        &mut self.request,
12077                    ),
12078                    <fidl::encoding::HandleType<
12079                        fidl::EventPair,
12080                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12081                        2147483648,
12082                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12083                        &mut self.instance_token,
12084                    ),
12085                    <fidl::encoding::HandleType<
12086                        fidl::EventPair,
12087                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12088                        2147483648,
12089                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12090                        &mut self.handle
12091                    ),
12092                ),
12093                encoder,
12094                offset,
12095                _depth,
12096            )
12097        }
12098    }
12099    unsafe impl<
12100        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
12101        T1: fidl::encoding::Encode<
12102                fidl::encoding::HandleType<
12103                    fidl::EventPair,
12104                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12105                    2147483648,
12106                >,
12107                fidl::encoding::DefaultFuchsiaResourceDialect,
12108            >,
12109        T2: fidl::encoding::Encode<
12110                fidl::encoding::HandleType<
12111                    fidl::EventPair,
12112                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12113                    2147483648,
12114                >,
12115                fidl::encoding::DefaultFuchsiaResourceDialect,
12116            >,
12117    >
12118        fidl::encoding::Encode<
12119            DirConnectorRouterRouteRequest,
12120            fidl::encoding::DefaultFuchsiaResourceDialect,
12121        > for (T0, T1, T2)
12122    {
12123        #[inline]
12124        unsafe fn encode(
12125            self,
12126            encoder: &mut fidl::encoding::Encoder<
12127                '_,
12128                fidl::encoding::DefaultFuchsiaResourceDialect,
12129            >,
12130            offset: usize,
12131            depth: fidl::encoding::Depth,
12132        ) -> fidl::Result<()> {
12133            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12134            // Zero out padding regions. There's no need to apply masks
12135            // because the unmasked parts will be overwritten by fields.
12136            // Write the fields.
12137            self.0.encode(encoder, offset + 0, depth)?;
12138            self.1.encode(encoder, offset + 16, depth)?;
12139            self.2.encode(encoder, offset + 20, depth)?;
12140            Ok(())
12141        }
12142    }
12143
12144    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12145        for DirConnectorRouterRouteRequest
12146    {
12147        #[inline(always)]
12148        fn new_empty() -> Self {
12149            Self {
12150                request: fidl::new_empty!(
12151                    RouteRequest,
12152                    fidl::encoding::DefaultFuchsiaResourceDialect
12153                ),
12154                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12155                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12156            }
12157        }
12158
12159        #[inline]
12160        unsafe fn decode(
12161            &mut self,
12162            decoder: &mut fidl::encoding::Decoder<
12163                '_,
12164                fidl::encoding::DefaultFuchsiaResourceDialect,
12165            >,
12166            offset: usize,
12167            _depth: fidl::encoding::Depth,
12168        ) -> fidl::Result<()> {
12169            decoder.debug_check_bounds::<Self>(offset);
12170            // Verify that padding bytes are zero.
12171            fidl::decode!(
12172                RouteRequest,
12173                fidl::encoding::DefaultFuchsiaResourceDialect,
12174                &mut self.request,
12175                decoder,
12176                offset + 0,
12177                _depth
12178            )?;
12179            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12180            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12181            Ok(())
12182        }
12183    }
12184
12185    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12186        type Borrowed<'a> = &'a mut Self;
12187        fn take_or_borrow<'a>(
12188            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12189        ) -> Self::Borrowed<'a> {
12190            value
12191        }
12192    }
12193
12194    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12195        type Owned = Self;
12196
12197        #[inline(always)]
12198        fn inline_align(_context: fidl::encoding::Context) -> usize {
12199            8
12200        }
12201
12202        #[inline(always)]
12203        fn inline_size(_context: fidl::encoding::Context) -> usize {
12204            32
12205        }
12206    }
12207
12208    unsafe impl
12209        fidl::encoding::Encode<
12210            DirReceiverReceiveRequest,
12211            fidl::encoding::DefaultFuchsiaResourceDialect,
12212        > for &mut DirReceiverReceiveRequest
12213    {
12214        #[inline]
12215        unsafe fn encode(
12216            self,
12217            encoder: &mut fidl::encoding::Encoder<
12218                '_,
12219                fidl::encoding::DefaultFuchsiaResourceDialect,
12220            >,
12221            offset: usize,
12222            _depth: fidl::encoding::Depth,
12223        ) -> fidl::Result<()> {
12224            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12225            // Delegate to tuple encoding.
12226            fidl::encoding::Encode::<DirReceiverReceiveRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12227                (
12228                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12229                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
12230                    <fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
12231                ),
12232                encoder, offset, _depth
12233            )
12234        }
12235    }
12236    unsafe impl<
12237        T0: fidl::encoding::Encode<
12238                fidl::encoding::Endpoint<
12239                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12240                >,
12241                fidl::encoding::DefaultFuchsiaResourceDialect,
12242            >,
12243        T1: fidl::encoding::Encode<
12244                fidl::encoding::BoundedString<4095>,
12245                fidl::encoding::DefaultFuchsiaResourceDialect,
12246            >,
12247        T2: fidl::encoding::Encode<
12248                fidl_fuchsia_io::Flags,
12249                fidl::encoding::DefaultFuchsiaResourceDialect,
12250            >,
12251    >
12252        fidl::encoding::Encode<
12253            DirReceiverReceiveRequest,
12254            fidl::encoding::DefaultFuchsiaResourceDialect,
12255        > for (T0, T1, T2)
12256    {
12257        #[inline]
12258        unsafe fn encode(
12259            self,
12260            encoder: &mut fidl::encoding::Encoder<
12261                '_,
12262                fidl::encoding::DefaultFuchsiaResourceDialect,
12263            >,
12264            offset: usize,
12265            depth: fidl::encoding::Depth,
12266        ) -> fidl::Result<()> {
12267            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12268            // Zero out padding regions. There's no need to apply masks
12269            // because the unmasked parts will be overwritten by fields.
12270            unsafe {
12271                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12272                (ptr as *mut u64).write_unaligned(0);
12273            }
12274            // Write the fields.
12275            self.0.encode(encoder, offset + 0, depth)?;
12276            self.1.encode(encoder, offset + 8, depth)?;
12277            self.2.encode(encoder, offset + 24, depth)?;
12278            Ok(())
12279        }
12280    }
12281
12282    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12283        for DirReceiverReceiveRequest
12284    {
12285        #[inline(always)]
12286        fn new_empty() -> Self {
12287            Self {
12288                channel: fidl::new_empty!(
12289                    fidl::encoding::Endpoint<
12290                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12291                    >,
12292                    fidl::encoding::DefaultFuchsiaResourceDialect
12293                ),
12294                path: fidl::new_empty!(
12295                    fidl::encoding::BoundedString<4095>,
12296                    fidl::encoding::DefaultFuchsiaResourceDialect
12297                ),
12298                rights: fidl::new_empty!(
12299                    fidl_fuchsia_io::Flags,
12300                    fidl::encoding::DefaultFuchsiaResourceDialect
12301                ),
12302            }
12303        }
12304
12305        #[inline]
12306        unsafe fn decode(
12307            &mut self,
12308            decoder: &mut fidl::encoding::Decoder<
12309                '_,
12310                fidl::encoding::DefaultFuchsiaResourceDialect,
12311            >,
12312            offset: usize,
12313            _depth: fidl::encoding::Depth,
12314        ) -> fidl::Result<()> {
12315            decoder.debug_check_bounds::<Self>(offset);
12316            // Verify that padding bytes are zero.
12317            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12318            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12319            let mask = 0xffffffff00000000u64;
12320            let maskedval = padval & mask;
12321            if maskedval != 0 {
12322                return Err(fidl::Error::NonZeroPadding {
12323                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12324                });
12325            }
12326            fidl::decode!(
12327                fidl::encoding::Endpoint<
12328                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12329                >,
12330                fidl::encoding::DefaultFuchsiaResourceDialect,
12331                &mut self.channel,
12332                decoder,
12333                offset + 0,
12334                _depth
12335            )?;
12336            fidl::decode!(
12337                fidl::encoding::BoundedString<4095>,
12338                fidl::encoding::DefaultFuchsiaResourceDialect,
12339                &mut self.path,
12340                decoder,
12341                offset + 8,
12342                _depth
12343            )?;
12344            fidl::decode!(
12345                fidl_fuchsia_io::Flags,
12346                fidl::encoding::DefaultFuchsiaResourceDialect,
12347                &mut self.rights,
12348                decoder,
12349                offset + 24,
12350                _depth
12351            )?;
12352            Ok(())
12353        }
12354    }
12355
12356    impl fidl::encoding::ResourceTypeMarker for ReceiverReceiveRequest {
12357        type Borrowed<'a> = &'a mut Self;
12358        fn take_or_borrow<'a>(
12359            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12360        ) -> Self::Borrowed<'a> {
12361            value
12362        }
12363    }
12364
12365    unsafe impl fidl::encoding::TypeMarker for ReceiverReceiveRequest {
12366        type Owned = Self;
12367
12368        #[inline(always)]
12369        fn inline_align(_context: fidl::encoding::Context) -> usize {
12370            4
12371        }
12372
12373        #[inline(always)]
12374        fn inline_size(_context: fidl::encoding::Context) -> usize {
12375            4
12376        }
12377    }
12378
12379    unsafe impl
12380        fidl::encoding::Encode<
12381            ReceiverReceiveRequest,
12382            fidl::encoding::DefaultFuchsiaResourceDialect,
12383        > for &mut ReceiverReceiveRequest
12384    {
12385        #[inline]
12386        unsafe fn encode(
12387            self,
12388            encoder: &mut fidl::encoding::Encoder<
12389                '_,
12390                fidl::encoding::DefaultFuchsiaResourceDialect,
12391            >,
12392            offset: usize,
12393            _depth: fidl::encoding::Depth,
12394        ) -> fidl::Result<()> {
12395            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12396            // Delegate to tuple encoding.
12397            fidl::encoding::Encode::<
12398                ReceiverReceiveRequest,
12399                fidl::encoding::DefaultFuchsiaResourceDialect,
12400            >::encode(
12401                (<fidl::encoding::HandleType<
12402                    fidl::Channel,
12403                    { fidl::ObjectType::CHANNEL.into_raw() },
12404                    2147483648,
12405                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12406                    &mut self.channel
12407                ),),
12408                encoder,
12409                offset,
12410                _depth,
12411            )
12412        }
12413    }
12414    unsafe impl<
12415        T0: fidl::encoding::Encode<
12416                fidl::encoding::HandleType<
12417                    fidl::Channel,
12418                    { fidl::ObjectType::CHANNEL.into_raw() },
12419                    2147483648,
12420                >,
12421                fidl::encoding::DefaultFuchsiaResourceDialect,
12422            >,
12423    >
12424        fidl::encoding::Encode<
12425            ReceiverReceiveRequest,
12426            fidl::encoding::DefaultFuchsiaResourceDialect,
12427        > for (T0,)
12428    {
12429        #[inline]
12430        unsafe fn encode(
12431            self,
12432            encoder: &mut fidl::encoding::Encoder<
12433                '_,
12434                fidl::encoding::DefaultFuchsiaResourceDialect,
12435            >,
12436            offset: usize,
12437            depth: fidl::encoding::Depth,
12438        ) -> fidl::Result<()> {
12439            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12440            // Zero out padding regions. There's no need to apply masks
12441            // because the unmasked parts will be overwritten by fields.
12442            // Write the fields.
12443            self.0.encode(encoder, offset + 0, depth)?;
12444            Ok(())
12445        }
12446    }
12447
12448    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12449        for ReceiverReceiveRequest
12450    {
12451        #[inline(always)]
12452        fn new_empty() -> Self {
12453            Self {
12454                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12455            }
12456        }
12457
12458        #[inline]
12459        unsafe fn decode(
12460            &mut self,
12461            decoder: &mut fidl::encoding::Decoder<
12462                '_,
12463                fidl::encoding::DefaultFuchsiaResourceDialect,
12464            >,
12465            offset: usize,
12466            _depth: fidl::encoding::Depth,
12467        ) -> fidl::Result<()> {
12468            decoder.debug_check_bounds::<Self>(offset);
12469            // Verify that padding bytes are zero.
12470            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12471            Ok(())
12472        }
12473    }
12474
12475    impl CapabilitiesDictionaryRemoveRequest {
12476        #[inline(always)]
12477        fn max_ordinal_present(&self) -> u64 {
12478            if let Some(_) = self.value {
12479                return 3;
12480            }
12481            if let Some(_) = self.key {
12482                return 2;
12483            }
12484            if let Some(_) = self.dictionary {
12485                return 1;
12486            }
12487            0
12488        }
12489    }
12490
12491    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveRequest {
12492        type Borrowed<'a> = &'a mut Self;
12493        fn take_or_borrow<'a>(
12494            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12495        ) -> Self::Borrowed<'a> {
12496            value
12497        }
12498    }
12499
12500    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveRequest {
12501        type Owned = Self;
12502
12503        #[inline(always)]
12504        fn inline_align(_context: fidl::encoding::Context) -> usize {
12505            8
12506        }
12507
12508        #[inline(always)]
12509        fn inline_size(_context: fidl::encoding::Context) -> usize {
12510            16
12511        }
12512    }
12513
12514    unsafe impl
12515        fidl::encoding::Encode<
12516            CapabilitiesDictionaryRemoveRequest,
12517            fidl::encoding::DefaultFuchsiaResourceDialect,
12518        > for &mut CapabilitiesDictionaryRemoveRequest
12519    {
12520        unsafe fn encode(
12521            self,
12522            encoder: &mut fidl::encoding::Encoder<
12523                '_,
12524                fidl::encoding::DefaultFuchsiaResourceDialect,
12525            >,
12526            offset: usize,
12527            mut depth: fidl::encoding::Depth,
12528        ) -> fidl::Result<()> {
12529            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveRequest>(offset);
12530            // Vector header
12531            let max_ordinal: u64 = self.max_ordinal_present();
12532            encoder.write_num(max_ordinal, offset);
12533            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12534            // Calling encoder.out_of_line_offset(0) is not allowed.
12535            if max_ordinal == 0 {
12536                return Ok(());
12537            }
12538            depth.increment()?;
12539            let envelope_size = 8;
12540            let bytes_len = max_ordinal as usize * envelope_size;
12541            #[allow(unused_variables)]
12542            let offset = encoder.out_of_line_offset(bytes_len);
12543            let mut _prev_end_offset: usize = 0;
12544            if 1 > max_ordinal {
12545                return Ok(());
12546            }
12547
12548            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12549            // are envelope_size bytes.
12550            let cur_offset: usize = (1 - 1) * envelope_size;
12551
12552            // Zero reserved fields.
12553            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12554
12555            // Safety:
12556            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12557            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12558            //   envelope_size bytes, there is always sufficient room.
12559            fidl::encoding::encode_in_envelope_optional::<
12560                fidl::encoding::HandleType<
12561                    fidl::EventPair,
12562                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12563                    2147483648,
12564                >,
12565                fidl::encoding::DefaultFuchsiaResourceDialect,
12566            >(
12567                self.dictionary.as_mut().map(
12568                    <fidl::encoding::HandleType<
12569                        fidl::EventPair,
12570                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12571                        2147483648,
12572                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12573                ),
12574                encoder,
12575                offset + cur_offset,
12576                depth,
12577            )?;
12578
12579            _prev_end_offset = cur_offset + envelope_size;
12580            if 2 > max_ordinal {
12581                return Ok(());
12582            }
12583
12584            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12585            // are envelope_size bytes.
12586            let cur_offset: usize = (2 - 1) * envelope_size;
12587
12588            // Zero reserved fields.
12589            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12590
12591            // Safety:
12592            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12593            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12594            //   envelope_size bytes, there is always sufficient room.
12595            fidl::encoding::encode_in_envelope_optional::<
12596                fidl::encoding::BoundedString<100>,
12597                fidl::encoding::DefaultFuchsiaResourceDialect,
12598            >(
12599                self.key.as_ref().map(
12600                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12601                ),
12602                encoder,
12603                offset + cur_offset,
12604                depth,
12605            )?;
12606
12607            _prev_end_offset = cur_offset + envelope_size;
12608            if 3 > max_ordinal {
12609                return Ok(());
12610            }
12611
12612            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12613            // are envelope_size bytes.
12614            let cur_offset: usize = (3 - 1) * envelope_size;
12615
12616            // Zero reserved fields.
12617            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12618
12619            // Safety:
12620            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12621            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12622            //   envelope_size bytes, there is always sufficient room.
12623            fidl::encoding::encode_in_envelope_optional::<
12624                fidl::encoding::HandleType<
12625                    fidl::EventPair,
12626                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12627                    2147483648,
12628                >,
12629                fidl::encoding::DefaultFuchsiaResourceDialect,
12630            >(
12631                self.value.as_mut().map(
12632                    <fidl::encoding::HandleType<
12633                        fidl::EventPair,
12634                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12635                        2147483648,
12636                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12637                ),
12638                encoder,
12639                offset + cur_offset,
12640                depth,
12641            )?;
12642
12643            _prev_end_offset = cur_offset + envelope_size;
12644
12645            Ok(())
12646        }
12647    }
12648
12649    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12650        for CapabilitiesDictionaryRemoveRequest
12651    {
12652        #[inline(always)]
12653        fn new_empty() -> Self {
12654            Self::default()
12655        }
12656
12657        unsafe fn decode(
12658            &mut self,
12659            decoder: &mut fidl::encoding::Decoder<
12660                '_,
12661                fidl::encoding::DefaultFuchsiaResourceDialect,
12662            >,
12663            offset: usize,
12664            mut depth: fidl::encoding::Depth,
12665        ) -> fidl::Result<()> {
12666            decoder.debug_check_bounds::<Self>(offset);
12667            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12668                None => return Err(fidl::Error::NotNullable),
12669                Some(len) => len,
12670            };
12671            // Calling decoder.out_of_line_offset(0) is not allowed.
12672            if len == 0 {
12673                return Ok(());
12674            };
12675            depth.increment()?;
12676            let envelope_size = 8;
12677            let bytes_len = len * envelope_size;
12678            let offset = decoder.out_of_line_offset(bytes_len)?;
12679            // Decode the envelope for each type.
12680            let mut _next_ordinal_to_read = 0;
12681            let mut next_offset = offset;
12682            let end_offset = offset + bytes_len;
12683            _next_ordinal_to_read += 1;
12684            if next_offset >= end_offset {
12685                return Ok(());
12686            }
12687
12688            // Decode unknown envelopes for gaps in ordinals.
12689            while _next_ordinal_to_read < 1 {
12690                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12691                _next_ordinal_to_read += 1;
12692                next_offset += envelope_size;
12693            }
12694
12695            let next_out_of_line = decoder.next_out_of_line();
12696            let handles_before = decoder.remaining_handles();
12697            if let Some((inlined, num_bytes, num_handles)) =
12698                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12699            {
12700                let member_inline_size = <fidl::encoding::HandleType<
12701                    fidl::EventPair,
12702                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12703                    2147483648,
12704                > as fidl::encoding::TypeMarker>::inline_size(
12705                    decoder.context
12706                );
12707                if inlined != (member_inline_size <= 4) {
12708                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12709                }
12710                let inner_offset;
12711                let mut inner_depth = depth.clone();
12712                if inlined {
12713                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12714                    inner_offset = next_offset;
12715                } else {
12716                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12717                    inner_depth.increment()?;
12718                }
12719                let val_ref =
12720                self.dictionary.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12721                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12722                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12723                {
12724                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12725                }
12726                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12727                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12728                }
12729            }
12730
12731            next_offset += envelope_size;
12732            _next_ordinal_to_read += 1;
12733            if next_offset >= end_offset {
12734                return Ok(());
12735            }
12736
12737            // Decode unknown envelopes for gaps in ordinals.
12738            while _next_ordinal_to_read < 2 {
12739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12740                _next_ordinal_to_read += 1;
12741                next_offset += envelope_size;
12742            }
12743
12744            let next_out_of_line = decoder.next_out_of_line();
12745            let handles_before = decoder.remaining_handles();
12746            if let Some((inlined, num_bytes, num_handles)) =
12747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12748            {
12749                let member_inline_size =
12750                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12751                        decoder.context,
12752                    );
12753                if inlined != (member_inline_size <= 4) {
12754                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12755                }
12756                let inner_offset;
12757                let mut inner_depth = depth.clone();
12758                if inlined {
12759                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12760                    inner_offset = next_offset;
12761                } else {
12762                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12763                    inner_depth.increment()?;
12764                }
12765                let val_ref = self.key.get_or_insert_with(|| {
12766                    fidl::new_empty!(
12767                        fidl::encoding::BoundedString<100>,
12768                        fidl::encoding::DefaultFuchsiaResourceDialect
12769                    )
12770                });
12771                fidl::decode!(
12772                    fidl::encoding::BoundedString<100>,
12773                    fidl::encoding::DefaultFuchsiaResourceDialect,
12774                    val_ref,
12775                    decoder,
12776                    inner_offset,
12777                    inner_depth
12778                )?;
12779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12780                {
12781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12782                }
12783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12785                }
12786            }
12787
12788            next_offset += envelope_size;
12789            _next_ordinal_to_read += 1;
12790            if next_offset >= end_offset {
12791                return Ok(());
12792            }
12793
12794            // Decode unknown envelopes for gaps in ordinals.
12795            while _next_ordinal_to_read < 3 {
12796                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12797                _next_ordinal_to_read += 1;
12798                next_offset += envelope_size;
12799            }
12800
12801            let next_out_of_line = decoder.next_out_of_line();
12802            let handles_before = decoder.remaining_handles();
12803            if let Some((inlined, num_bytes, num_handles)) =
12804                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12805            {
12806                let member_inline_size = <fidl::encoding::HandleType<
12807                    fidl::EventPair,
12808                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12809                    2147483648,
12810                > as fidl::encoding::TypeMarker>::inline_size(
12811                    decoder.context
12812                );
12813                if inlined != (member_inline_size <= 4) {
12814                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12815                }
12816                let inner_offset;
12817                let mut inner_depth = depth.clone();
12818                if inlined {
12819                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12820                    inner_offset = next_offset;
12821                } else {
12822                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12823                    inner_depth.increment()?;
12824                }
12825                let val_ref =
12826                self.value.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12827                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12828                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12829                {
12830                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12831                }
12832                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12833                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12834                }
12835            }
12836
12837            next_offset += envelope_size;
12838
12839            // Decode the remaining unknown envelopes.
12840            while next_offset < end_offset {
12841                _next_ordinal_to_read += 1;
12842                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12843                next_offset += envelope_size;
12844            }
12845
12846            Ok(())
12847        }
12848    }
12849
12850    impl CapabilitiesDirConnectorOpenRequest {
12851        #[inline(always)]
12852        fn max_ordinal_present(&self) -> u64 {
12853            if let Some(_) = self.path {
12854                return 4;
12855            }
12856            if let Some(_) = self.flags {
12857                return 3;
12858            }
12859            if let Some(_) = self.channel {
12860                return 2;
12861            }
12862            if let Some(_) = self.dir_connector {
12863                return 1;
12864            }
12865            0
12866        }
12867    }
12868
12869    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorOpenRequest {
12870        type Borrowed<'a> = &'a mut Self;
12871        fn take_or_borrow<'a>(
12872            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12873        ) -> Self::Borrowed<'a> {
12874            value
12875        }
12876    }
12877
12878    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorOpenRequest {
12879        type Owned = Self;
12880
12881        #[inline(always)]
12882        fn inline_align(_context: fidl::encoding::Context) -> usize {
12883            8
12884        }
12885
12886        #[inline(always)]
12887        fn inline_size(_context: fidl::encoding::Context) -> usize {
12888            16
12889        }
12890    }
12891
12892    unsafe impl
12893        fidl::encoding::Encode<
12894            CapabilitiesDirConnectorOpenRequest,
12895            fidl::encoding::DefaultFuchsiaResourceDialect,
12896        > for &mut CapabilitiesDirConnectorOpenRequest
12897    {
12898        unsafe fn encode(
12899            self,
12900            encoder: &mut fidl::encoding::Encoder<
12901                '_,
12902                fidl::encoding::DefaultFuchsiaResourceDialect,
12903            >,
12904            offset: usize,
12905            mut depth: fidl::encoding::Depth,
12906        ) -> fidl::Result<()> {
12907            encoder.debug_check_bounds::<CapabilitiesDirConnectorOpenRequest>(offset);
12908            // Vector header
12909            let max_ordinal: u64 = self.max_ordinal_present();
12910            encoder.write_num(max_ordinal, offset);
12911            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12912            // Calling encoder.out_of_line_offset(0) is not allowed.
12913            if max_ordinal == 0 {
12914                return Ok(());
12915            }
12916            depth.increment()?;
12917            let envelope_size = 8;
12918            let bytes_len = max_ordinal as usize * envelope_size;
12919            #[allow(unused_variables)]
12920            let offset = encoder.out_of_line_offset(bytes_len);
12921            let mut _prev_end_offset: usize = 0;
12922            if 1 > max_ordinal {
12923                return Ok(());
12924            }
12925
12926            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12927            // are envelope_size bytes.
12928            let cur_offset: usize = (1 - 1) * envelope_size;
12929
12930            // Zero reserved fields.
12931            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12932
12933            // Safety:
12934            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12935            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12936            //   envelope_size bytes, there is always sufficient room.
12937            fidl::encoding::encode_in_envelope_optional::<
12938                fidl::encoding::HandleType<
12939                    fidl::EventPair,
12940                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12941                    2147483648,
12942                >,
12943                fidl::encoding::DefaultFuchsiaResourceDialect,
12944            >(
12945                self.dir_connector.as_mut().map(
12946                    <fidl::encoding::HandleType<
12947                        fidl::EventPair,
12948                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12949                        2147483648,
12950                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12951                ),
12952                encoder,
12953                offset + cur_offset,
12954                depth,
12955            )?;
12956
12957            _prev_end_offset = cur_offset + envelope_size;
12958            if 2 > max_ordinal {
12959                return Ok(());
12960            }
12961
12962            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12963            // are envelope_size bytes.
12964            let cur_offset: usize = (2 - 1) * envelope_size;
12965
12966            // Zero reserved fields.
12967            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12968
12969            // Safety:
12970            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12971            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12972            //   envelope_size bytes, there is always sufficient room.
12973            fidl::encoding::encode_in_envelope_optional::<
12974                fidl::encoding::Endpoint<
12975                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12976                >,
12977                fidl::encoding::DefaultFuchsiaResourceDialect,
12978            >(
12979                self.channel.as_mut().map(
12980                    <fidl::encoding::Endpoint<
12981                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12982                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12983                ),
12984                encoder,
12985                offset + cur_offset,
12986                depth,
12987            )?;
12988
12989            _prev_end_offset = cur_offset + envelope_size;
12990            if 3 > max_ordinal {
12991                return Ok(());
12992            }
12993
12994            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12995            // are envelope_size bytes.
12996            let cur_offset: usize = (3 - 1) * envelope_size;
12997
12998            // Zero reserved fields.
12999            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13000
13001            // Safety:
13002            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13003            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13004            //   envelope_size bytes, there is always sufficient room.
13005            fidl::encoding::encode_in_envelope_optional::<
13006                fidl_fuchsia_io::Flags,
13007                fidl::encoding::DefaultFuchsiaResourceDialect,
13008            >(
13009                self.flags
13010                    .as_ref()
13011                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13012                encoder,
13013                offset + cur_offset,
13014                depth,
13015            )?;
13016
13017            _prev_end_offset = cur_offset + envelope_size;
13018            if 4 > max_ordinal {
13019                return Ok(());
13020            }
13021
13022            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13023            // are envelope_size bytes.
13024            let cur_offset: usize = (4 - 1) * envelope_size;
13025
13026            // Zero reserved fields.
13027            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13028
13029            // Safety:
13030            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13031            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13032            //   envelope_size bytes, there is always sufficient room.
13033            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13034            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13035            encoder, offset + cur_offset, depth
13036        )?;
13037
13038            _prev_end_offset = cur_offset + envelope_size;
13039
13040            Ok(())
13041        }
13042    }
13043
13044    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13045        for CapabilitiesDirConnectorOpenRequest
13046    {
13047        #[inline(always)]
13048        fn new_empty() -> Self {
13049            Self::default()
13050        }
13051
13052        unsafe fn decode(
13053            &mut self,
13054            decoder: &mut fidl::encoding::Decoder<
13055                '_,
13056                fidl::encoding::DefaultFuchsiaResourceDialect,
13057            >,
13058            offset: usize,
13059            mut depth: fidl::encoding::Depth,
13060        ) -> fidl::Result<()> {
13061            decoder.debug_check_bounds::<Self>(offset);
13062            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13063                None => return Err(fidl::Error::NotNullable),
13064                Some(len) => len,
13065            };
13066            // Calling decoder.out_of_line_offset(0) is not allowed.
13067            if len == 0 {
13068                return Ok(());
13069            };
13070            depth.increment()?;
13071            let envelope_size = 8;
13072            let bytes_len = len * envelope_size;
13073            let offset = decoder.out_of_line_offset(bytes_len)?;
13074            // Decode the envelope for each type.
13075            let mut _next_ordinal_to_read = 0;
13076            let mut next_offset = offset;
13077            let end_offset = offset + bytes_len;
13078            _next_ordinal_to_read += 1;
13079            if next_offset >= end_offset {
13080                return Ok(());
13081            }
13082
13083            // Decode unknown envelopes for gaps in ordinals.
13084            while _next_ordinal_to_read < 1 {
13085                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13086                _next_ordinal_to_read += 1;
13087                next_offset += envelope_size;
13088            }
13089
13090            let next_out_of_line = decoder.next_out_of_line();
13091            let handles_before = decoder.remaining_handles();
13092            if let Some((inlined, num_bytes, num_handles)) =
13093                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13094            {
13095                let member_inline_size = <fidl::encoding::HandleType<
13096                    fidl::EventPair,
13097                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13098                    2147483648,
13099                > as fidl::encoding::TypeMarker>::inline_size(
13100                    decoder.context
13101                );
13102                if inlined != (member_inline_size <= 4) {
13103                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13104                }
13105                let inner_offset;
13106                let mut inner_depth = depth.clone();
13107                if inlined {
13108                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13109                    inner_offset = next_offset;
13110                } else {
13111                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13112                    inner_depth.increment()?;
13113                }
13114                let val_ref =
13115                self.dir_connector.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13116                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13118                {
13119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13120                }
13121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13123                }
13124            }
13125
13126            next_offset += envelope_size;
13127            _next_ordinal_to_read += 1;
13128            if next_offset >= end_offset {
13129                return Ok(());
13130            }
13131
13132            // Decode unknown envelopes for gaps in ordinals.
13133            while _next_ordinal_to_read < 2 {
13134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13135                _next_ordinal_to_read += 1;
13136                next_offset += envelope_size;
13137            }
13138
13139            let next_out_of_line = decoder.next_out_of_line();
13140            let handles_before = decoder.remaining_handles();
13141            if let Some((inlined, num_bytes, num_handles)) =
13142                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13143            {
13144                let member_inline_size = <fidl::encoding::Endpoint<
13145                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13146                > as fidl::encoding::TypeMarker>::inline_size(
13147                    decoder.context
13148                );
13149                if inlined != (member_inline_size <= 4) {
13150                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13151                }
13152                let inner_offset;
13153                let mut inner_depth = depth.clone();
13154                if inlined {
13155                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13156                    inner_offset = next_offset;
13157                } else {
13158                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13159                    inner_depth.increment()?;
13160                }
13161                let val_ref = self.channel.get_or_insert_with(|| {
13162                    fidl::new_empty!(
13163                        fidl::encoding::Endpoint<
13164                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13165                        >,
13166                        fidl::encoding::DefaultFuchsiaResourceDialect
13167                    )
13168                });
13169                fidl::decode!(
13170                    fidl::encoding::Endpoint<
13171                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13172                    >,
13173                    fidl::encoding::DefaultFuchsiaResourceDialect,
13174                    val_ref,
13175                    decoder,
13176                    inner_offset,
13177                    inner_depth
13178                )?;
13179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13180                {
13181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13182                }
13183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13185                }
13186            }
13187
13188            next_offset += envelope_size;
13189            _next_ordinal_to_read += 1;
13190            if next_offset >= end_offset {
13191                return Ok(());
13192            }
13193
13194            // Decode unknown envelopes for gaps in ordinals.
13195            while _next_ordinal_to_read < 3 {
13196                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13197                _next_ordinal_to_read += 1;
13198                next_offset += envelope_size;
13199            }
13200
13201            let next_out_of_line = decoder.next_out_of_line();
13202            let handles_before = decoder.remaining_handles();
13203            if let Some((inlined, num_bytes, num_handles)) =
13204                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13205            {
13206                let member_inline_size =
13207                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13208                        decoder.context,
13209                    );
13210                if inlined != (member_inline_size <= 4) {
13211                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13212                }
13213                let inner_offset;
13214                let mut inner_depth = depth.clone();
13215                if inlined {
13216                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13217                    inner_offset = next_offset;
13218                } else {
13219                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13220                    inner_depth.increment()?;
13221                }
13222                let val_ref = self.flags.get_or_insert_with(|| {
13223                    fidl::new_empty!(
13224                        fidl_fuchsia_io::Flags,
13225                        fidl::encoding::DefaultFuchsiaResourceDialect
13226                    )
13227                });
13228                fidl::decode!(
13229                    fidl_fuchsia_io::Flags,
13230                    fidl::encoding::DefaultFuchsiaResourceDialect,
13231                    val_ref,
13232                    decoder,
13233                    inner_offset,
13234                    inner_depth
13235                )?;
13236                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13237                {
13238                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13239                }
13240                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13241                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13242                }
13243            }
13244
13245            next_offset += envelope_size;
13246            _next_ordinal_to_read += 1;
13247            if next_offset >= end_offset {
13248                return Ok(());
13249            }
13250
13251            // Decode unknown envelopes for gaps in ordinals.
13252            while _next_ordinal_to_read < 4 {
13253                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13254                _next_ordinal_to_read += 1;
13255                next_offset += envelope_size;
13256            }
13257
13258            let next_out_of_line = decoder.next_out_of_line();
13259            let handles_before = decoder.remaining_handles();
13260            if let Some((inlined, num_bytes, num_handles)) =
13261                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13262            {
13263                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13264                if inlined != (member_inline_size <= 4) {
13265                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13266                }
13267                let inner_offset;
13268                let mut inner_depth = depth.clone();
13269                if inlined {
13270                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13271                    inner_offset = next_offset;
13272                } else {
13273                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13274                    inner_depth.increment()?;
13275                }
13276                let val_ref = self.path.get_or_insert_with(|| {
13277                    fidl::new_empty!(
13278                        fidl::encoding::BoundedString<4095>,
13279                        fidl::encoding::DefaultFuchsiaResourceDialect
13280                    )
13281                });
13282                fidl::decode!(
13283                    fidl::encoding::BoundedString<4095>,
13284                    fidl::encoding::DefaultFuchsiaResourceDialect,
13285                    val_ref,
13286                    decoder,
13287                    inner_offset,
13288                    inner_depth
13289                )?;
13290                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13291                {
13292                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13293                }
13294                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13295                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13296                }
13297            }
13298
13299            next_offset += envelope_size;
13300
13301            // Decode the remaining unknown envelopes.
13302            while next_offset < end_offset {
13303                _next_ordinal_to_read += 1;
13304                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13305                next_offset += envelope_size;
13306            }
13307
13308            Ok(())
13309        }
13310    }
13311
13312    impl RouteRequest {
13313        #[inline(always)]
13314        fn max_ordinal_present(&self) -> u64 {
13315            if let Some(_) = self.metadata {
13316                return 1;
13317            }
13318            0
13319        }
13320    }
13321
13322    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13323        type Borrowed<'a> = &'a mut Self;
13324        fn take_or_borrow<'a>(
13325            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13326        ) -> Self::Borrowed<'a> {
13327            value
13328        }
13329    }
13330
13331    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13332        type Owned = Self;
13333
13334        #[inline(always)]
13335        fn inline_align(_context: fidl::encoding::Context) -> usize {
13336            8
13337        }
13338
13339        #[inline(always)]
13340        fn inline_size(_context: fidl::encoding::Context) -> usize {
13341            16
13342        }
13343    }
13344
13345    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13346        for &mut RouteRequest
13347    {
13348        unsafe fn encode(
13349            self,
13350            encoder: &mut fidl::encoding::Encoder<
13351                '_,
13352                fidl::encoding::DefaultFuchsiaResourceDialect,
13353            >,
13354            offset: usize,
13355            mut depth: fidl::encoding::Depth,
13356        ) -> fidl::Result<()> {
13357            encoder.debug_check_bounds::<RouteRequest>(offset);
13358            // Vector header
13359            let max_ordinal: u64 = self.max_ordinal_present();
13360            encoder.write_num(max_ordinal, offset);
13361            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13362            // Calling encoder.out_of_line_offset(0) is not allowed.
13363            if max_ordinal == 0 {
13364                return Ok(());
13365            }
13366            depth.increment()?;
13367            let envelope_size = 8;
13368            let bytes_len = max_ordinal as usize * envelope_size;
13369            #[allow(unused_variables)]
13370            let offset = encoder.out_of_line_offset(bytes_len);
13371            let mut _prev_end_offset: usize = 0;
13372            if 1 > max_ordinal {
13373                return Ok(());
13374            }
13375
13376            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13377            // are envelope_size bytes.
13378            let cur_offset: usize = (1 - 1) * envelope_size;
13379
13380            // Zero reserved fields.
13381            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13382
13383            // Safety:
13384            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13385            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13386            //   envelope_size bytes, there is always sufficient room.
13387            fidl::encoding::encode_in_envelope_optional::<
13388                fidl::encoding::HandleType<
13389                    fidl::EventPair,
13390                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13391                    2147483648,
13392                >,
13393                fidl::encoding::DefaultFuchsiaResourceDialect,
13394            >(
13395                self.metadata.as_mut().map(
13396                    <fidl::encoding::HandleType<
13397                        fidl::EventPair,
13398                        { fidl::ObjectType::EVENTPAIR.into_raw() },
13399                        2147483648,
13400                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13401                ),
13402                encoder,
13403                offset + cur_offset,
13404                depth,
13405            )?;
13406
13407            _prev_end_offset = cur_offset + envelope_size;
13408
13409            Ok(())
13410        }
13411    }
13412
13413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13414        #[inline(always)]
13415        fn new_empty() -> Self {
13416            Self::default()
13417        }
13418
13419        unsafe fn decode(
13420            &mut self,
13421            decoder: &mut fidl::encoding::Decoder<
13422                '_,
13423                fidl::encoding::DefaultFuchsiaResourceDialect,
13424            >,
13425            offset: usize,
13426            mut depth: fidl::encoding::Depth,
13427        ) -> fidl::Result<()> {
13428            decoder.debug_check_bounds::<Self>(offset);
13429            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13430                None => return Err(fidl::Error::NotNullable),
13431                Some(len) => len,
13432            };
13433            // Calling decoder.out_of_line_offset(0) is not allowed.
13434            if len == 0 {
13435                return Ok(());
13436            };
13437            depth.increment()?;
13438            let envelope_size = 8;
13439            let bytes_len = len * envelope_size;
13440            let offset = decoder.out_of_line_offset(bytes_len)?;
13441            // Decode the envelope for each type.
13442            let mut _next_ordinal_to_read = 0;
13443            let mut next_offset = offset;
13444            let end_offset = offset + bytes_len;
13445            _next_ordinal_to_read += 1;
13446            if next_offset >= end_offset {
13447                return Ok(());
13448            }
13449
13450            // Decode unknown envelopes for gaps in ordinals.
13451            while _next_ordinal_to_read < 1 {
13452                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13453                _next_ordinal_to_read += 1;
13454                next_offset += envelope_size;
13455            }
13456
13457            let next_out_of_line = decoder.next_out_of_line();
13458            let handles_before = decoder.remaining_handles();
13459            if let Some((inlined, num_bytes, num_handles)) =
13460                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13461            {
13462                let member_inline_size = <fidl::encoding::HandleType<
13463                    fidl::EventPair,
13464                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13465                    2147483648,
13466                > as fidl::encoding::TypeMarker>::inline_size(
13467                    decoder.context
13468                );
13469                if inlined != (member_inline_size <= 4) {
13470                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13471                }
13472                let inner_offset;
13473                let mut inner_depth = depth.clone();
13474                if inlined {
13475                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13476                    inner_offset = next_offset;
13477                } else {
13478                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13479                    inner_depth.increment()?;
13480                }
13481                let val_ref =
13482                self.metadata.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13483                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13484                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13485                {
13486                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13487                }
13488                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13489                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13490                }
13491            }
13492
13493            next_offset += envelope_size;
13494
13495            // Decode the remaining unknown envelopes.
13496            while next_offset < end_offset {
13497                _next_ordinal_to_read += 1;
13498                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13499                next_offset += envelope_size;
13500            }
13501
13502            Ok(())
13503        }
13504    }
13505}