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        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
572        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
573    }
574
575    pub fn into_channel(self) -> fidl::Channel {
576        self.client.into_channel()
577    }
578
579    /// Waits until an event arrives and returns it. It is safe for other
580    /// threads to make concurrent requests while waiting for an event.
581    pub fn wait_for_event(
582        &self,
583        deadline: zx::MonotonicInstant,
584    ) -> Result<CapabilitiesEvent, fidl::Error> {
585        CapabilitiesEvent::decode(self.client.wait_for_event(deadline)?)
586    }
587
588    /// Creates a reference to a new connector capability. When the connector is
589    /// opened, the channel given to the open call will be sent over
590    /// `receiver_client_end`.
591    ///
592    /// Make sure this method returns before passing the handle's peer to other
593    /// methods in this API. The creation may not be complete before then.
594    pub fn r#connector_create(
595        &self,
596        mut connector: fidl::EventPair,
597        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
598        ___deadline: zx::MonotonicInstant,
599    ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
600        let _response = self.client.send_query::<
601            CapabilitiesConnectorCreateRequest,
602            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
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        >(
629            (dir_connector, receiver_client_end,),
630            0x721911e05da2a3bf,
631            fidl::encoding::DynamicFlags::FLEXIBLE,
632            ___deadline,
633        )?
634        .into_result::<CapabilitiesMarker>("dir_connector_create")?;
635        Ok(_response.map(|x| x))
636    }
637
638    /// Creates a reference to a new dictionary capability.
639    ///
640    /// Make sure this method returns before passing the handle's peer to other
641    /// methods in this API. The creation may not be complete before then.
642    pub fn r#dictionary_create(
643        &self,
644        mut dictionary: fidl::EventPair,
645        ___deadline: zx::MonotonicInstant,
646    ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
647        let _response = self.client.send_query::<
648            CapabilitiesDictionaryCreateRequest,
649            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
650        >(
651            (dictionary,),
652            0x7f8bd91f0942a36e,
653            fidl::encoding::DynamicFlags::FLEXIBLE,
654            ___deadline,
655        )?
656        .into_result::<CapabilitiesMarker>("dictionary_create")?;
657        Ok(_response.map(|x| x))
658    }
659
660    /// Creates a reference to a new data capability with the given value.
661    ///
662    /// Make sure this method returns before passing the handle's peer to other
663    /// methods in this API. The creation may not be complete before then.
664    pub fn r#data_create(
665        &self,
666        mut data_handle: fidl::EventPair,
667        mut data: &Data,
668        ___deadline: zx::MonotonicInstant,
669    ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
670        let _response = self.client.send_query::<
671            CapabilitiesDataCreateRequest,
672            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
673        >(
674            (data_handle, data,),
675            0x40ef43e45372ee6a,
676            fidl::encoding::DynamicFlags::FLEXIBLE,
677            ___deadline,
678        )?
679        .into_result::<CapabilitiesMarker>("data_create")?;
680        Ok(_response.map(|x| x))
681    }
682
683    /// Creates a reference to a new router capability that will return a
684    /// connector capability when used.
685    ///
686    /// Make sure this method returns before passing the handle's peer to other
687    /// methods in this API. The creation may not be complete before then.
688    pub fn r#connector_router_create(
689        &self,
690        mut router: fidl::EventPair,
691        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
692        ___deadline: zx::MonotonicInstant,
693    ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
694        let _response = self.client.send_query::<
695            CapabilitiesConnectorRouterCreateRequest,
696            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
697        >(
698            (router, router_client_end,),
699            0x7f7e7fbafcdf1761,
700            fidl::encoding::DynamicFlags::FLEXIBLE,
701            ___deadline,
702        )?
703        .into_result::<CapabilitiesMarker>("connector_router_create")?;
704        Ok(_response.map(|x| x))
705    }
706
707    /// Creates a reference to a new router capability that will return a
708    /// directory connector capability when used.
709    ///
710    /// Make sure this method returns before passing the handle's peer to other
711    /// methods in this API. The creation may not be complete before then.
712    pub fn r#dir_connector_router_create(
713        &self,
714        mut router: fidl::EventPair,
715        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
716        ___deadline: zx::MonotonicInstant,
717    ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
718        let _response = self.client.send_query::<
719            CapabilitiesDirConnectorRouterCreateRequest,
720            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
721        >(
722            (router, router_client_end,),
723            0x56520da453fad19f,
724            fidl::encoding::DynamicFlags::FLEXIBLE,
725            ___deadline,
726        )?
727        .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
728        Ok(_response.map(|x| x))
729    }
730
731    /// Creates a reference to a new router capability that will return a
732    /// dictionary capability when used.
733    ///
734    /// Make sure this method returns before passing the handle's peer to other
735    /// methods in this API. The creation may not be complete before then.
736    pub fn r#dictionary_router_create(
737        &self,
738        mut router: fidl::EventPair,
739        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
740        ___deadline: zx::MonotonicInstant,
741    ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
742        let _response = self.client.send_query::<
743            CapabilitiesDictionaryRouterCreateRequest,
744            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
745        >(
746            (router, router_client_end,),
747            0x37acef18cd423d42,
748            fidl::encoding::DynamicFlags::FLEXIBLE,
749            ___deadline,
750        )?
751        .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
752        Ok(_response.map(|x| x))
753    }
754
755    /// Creates a reference to a new router capability that will return a data
756    /// value when used.
757    ///
758    /// Make sure this method returns before passing the handle's peer to other
759    /// methods in this API. The creation may not be complete before then.
760    pub fn r#data_router_create(
761        &self,
762        mut router: fidl::EventPair,
763        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
764        ___deadline: zx::MonotonicInstant,
765    ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
766        let _response = self.client.send_query::<
767            CapabilitiesDataRouterCreateRequest,
768            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
769        >(
770            (router, router_client_end,),
771            0x24e471395b95088,
772            fidl::encoding::DynamicFlags::FLEXIBLE,
773            ___deadline,
774        )?
775        .into_result::<CapabilitiesMarker>("data_router_create")?;
776        Ok(_response.map(|x| x))
777    }
778
779    /// Creates a new instance token, which is an opaque identifier associated
780    /// with a specific component. This instance token will be associated with
781    /// the component this connection is opened from.
782    ///
783    /// Make sure this method returns before passing the handle's peer to other
784    /// methods in this API. The creation may not be complete before then.
785    pub fn r#instance_token_create(
786        &self,
787        mut instance_token: fidl::EventPair,
788        ___deadline: zx::MonotonicInstant,
789    ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
790        let _response = self.client.send_query::<
791            CapabilitiesInstanceTokenCreateRequest,
792            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
793        >(
794            (instance_token,),
795            0x3576e31727c40813,
796            fidl::encoding::DynamicFlags::FLEXIBLE,
797            ___deadline,
798        )?
799        .into_result::<CapabilitiesMarker>("instance_token_create")?;
800        Ok(_response.map(|x| x))
801    }
802
803    /// Uses the provided `connector` to open a new connection by delivering
804    /// this channel to whoever created the connector.
805    ///
806    /// If there is an error, it will be reported as a zx.Status epitaph on
807    /// `channel`.
808    ///
809    /// If the `connector` event pair handle is not correlated with a handle
810    /// given to `ConnectorCreate`, this connection will be closed.
811    pub fn r#connector_open(
812        &self,
813        mut connector: fidl::EventPair,
814        mut channel: fidl::Channel,
815        ___deadline: zx::MonotonicInstant,
816    ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
817        let _response = self.client.send_query::<
818            CapabilitiesConnectorOpenRequest,
819            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
820        >(
821            (connector, channel,),
822            0xc0646965f1884eb,
823            fidl::encoding::DynamicFlags::FLEXIBLE,
824            ___deadline,
825        )?
826        .into_result::<CapabilitiesMarker>("connector_open")?;
827        Ok(_response.map(|x| x))
828    }
829
830    /// Uses the provided `dir_connector` to open a new directory connection by
831    /// delivering this channel to whoever created the directory connector.
832    ///
833    /// If there is an error, it will be reported as a zx.Status epitaph on
834    /// `channel`.
835    ///
836    /// If the `dir_connector` event pair handle is not correlated with a handle
837    /// given to `DirConnectorCreate`, this connection will be closed.
838    ///
839    /// `dir_connector` and `channel` are both required. `flags` and `path`
840    /// may be omitted.
841    pub fn r#dir_connector_open(
842        &self,
843        mut payload: CapabilitiesDirConnectorOpenRequest,
844        ___deadline: zx::MonotonicInstant,
845    ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
846        let _response = self.client.send_query::<
847            CapabilitiesDirConnectorOpenRequest,
848            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
849        >(
850            &mut payload,
851            0x1332bbf5debd6c20,
852            fidl::encoding::DynamicFlags::FLEXIBLE,
853            ___deadline,
854        )?
855        .into_result::<CapabilitiesMarker>("dir_connector_open")?;
856        Ok(_response.map(|x| x))
857    }
858
859    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
860    /// Overwrites any existing entry.
861    pub fn r#dictionary_insert(
862        &self,
863        mut dictionary: fidl::EventPair,
864        mut key: &str,
865        mut value: fidl::EventPair,
866        ___deadline: zx::MonotonicInstant,
867    ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
868        let _response = self.client.send_query::<
869            CapabilitiesDictionaryInsertRequest,
870            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
871        >(
872            (dictionary, key, value,),
873            0x5972e3061a760e7a,
874            fidl::encoding::DynamicFlags::FLEXIBLE,
875            ___deadline,
876        )?
877        .into_result::<CapabilitiesMarker>("dictionary_insert")?;
878        Ok(_response.map(|x| x))
879    }
880
881    /// Creates a new reference to the `capability` named `key` in this
882    /// dictionary, if that capability exists. That capability will remain in
883    /// the dictionary. To take a capability out of the dictionary, use
884    /// `DictionaryRemove`.
885    ///
886    /// If `key` does not exist, `value` will not reference any capability and
887    /// the `NO_SUCH_CAPABILITY` error value will be returned.
888    ///
889    /// Make sure this method returns before passing the handle's peer to other
890    /// methods in this API. The creation may not be complete before then.
891    pub fn r#dictionary_get(
892        &self,
893        mut dictionary: fidl::EventPair,
894        mut key: &str,
895        mut value: fidl::EventPair,
896        ___deadline: zx::MonotonicInstant,
897    ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
898        let _response = self
899            .client
900            .send_query::<CapabilitiesDictionaryGetRequest, fidl::encoding::FlexibleResultType<
901                CapabilitiesDictionaryGetResponse,
902                CapabilitiesError,
903            >>(
904                (dictionary, key, value),
905                0x31fafe2280a283d5,
906                fidl::encoding::DynamicFlags::FLEXIBLE,
907                ___deadline,
908            )?
909            .into_result::<CapabilitiesMarker>("dictionary_get")?;
910        Ok(_response.map(|x| x.capability_type))
911    }
912
913    /// Removes the `capability` named `key` from this dictionary and returns a
914    /// reference to it, if that capability exists.
915    ///
916    /// `dictionary` and `key` are required. `capability` is optional, and when
917    /// set will become associated with the capability that was removed from the
918    /// dictionary.
919    ///
920    /// If `key` does not exist, `value` will not reference any capability and
921    /// the `NO_SUCH_CAPABILITY` error value will be returned.
922    ///
923    /// Make sure this method returns before passing the peer of `capability` to
924    /// other methods in this API. The creation may not be complete before then.
925    pub fn r#dictionary_remove(
926        &self,
927        mut payload: CapabilitiesDictionaryRemoveRequest,
928        ___deadline: zx::MonotonicInstant,
929    ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
930        let _response = self
931            .client
932            .send_query::<CapabilitiesDictionaryRemoveRequest, fidl::encoding::FlexibleResultType<
933                CapabilitiesDictionaryRemoveResponse,
934                CapabilitiesError,
935            >>(
936                &mut payload,
937                0x6827c83106ac5a2c,
938                fidl::encoding::DynamicFlags::FLEXIBLE,
939                ___deadline,
940            )?
941            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
942        Ok(_response.map(|x| x.capability_type))
943    }
944
945    /// Opens an iterator which can be used to iterate over the keys of this
946    /// dictionary.
947    pub fn r#dictionary_iterate_keys(
948        &self,
949        mut dictionary: fidl::EventPair,
950        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
951        ___deadline: zx::MonotonicInstant,
952    ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
953        let _response = self.client.send_query::<
954            CapabilitiesDictionaryIterateKeysRequest,
955            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
956        >(
957            (dictionary, key_iterator,),
958            0x3d4ea59c80df9bb8,
959            fidl::encoding::DynamicFlags::FLEXIBLE,
960            ___deadline,
961        )?
962        .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
963        Ok(_response.map(|x| x))
964    }
965
966    /// Returns the `Data` value that was provided to the `DataCreate` call used
967    /// with `data_handle`.
968    pub fn r#data_get(
969        &self,
970        mut data_handle: fidl::EventPair,
971        ___deadline: zx::MonotonicInstant,
972    ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
973        let _response = self.client.send_query::<
974            CapabilitiesDataGetRequest,
975            fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
976        >(
977            (data_handle,),
978            0x65ae25b59f9e0daf,
979            fidl::encoding::DynamicFlags::FLEXIBLE,
980            ___deadline,
981        )?
982        .into_result::<CapabilitiesMarker>("data_get")?;
983        Ok(_response.map(|x| x))
984    }
985
986    /// Attempts to produce a `Connector` capability from this
987    /// `ConnectorRouter`.
988    ///
989    /// `request` contains context for this route, and `instance_token`
990    /// references the component that the routing operation is being performed
991    /// for.
992    ///
993    /// This will return:
994    ///
995    /// - `SUCCESS` if `connector` has been associated with a connector.
996    /// - `UNAVAILABLE` if the capability is unavailable, in which case
997    ///   `connector` will be closed.
998    /// - An error, if the operation failed.
999    pub fn r#connector_router_route(
1000        &self,
1001        mut router: fidl::EventPair,
1002        mut request: RouteRequest,
1003        mut instance_token: fidl::EventPair,
1004        mut connector: fidl::EventPair,
1005        ___deadline: zx::MonotonicInstant,
1006    ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
1007        let _response = self.client.send_query::<
1008            CapabilitiesConnectorRouterRouteRequest,
1009            fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
1010        >(
1011            (router, &mut request, instance_token, connector,),
1012            0x1bd9c6e7e3dd487e,
1013            fidl::encoding::DynamicFlags::FLEXIBLE,
1014            ___deadline,
1015        )?
1016        .into_result::<CapabilitiesMarker>("connector_router_route")?;
1017        Ok(_response.map(|x| x.response))
1018    }
1019
1020    /// Attempts to produce a `DirConnector` capability from this
1021    /// `DirConnectorRouter`.
1022    ///
1023    /// `request` contains context for this route, and `instance_token`
1024    /// references the component that the routing operation is being performed
1025    /// for.
1026    ///
1027    /// This will return:
1028    ///
1029    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1030    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1031    ///   `dir_connector` will be closed.
1032    /// - An error, if the operation failed.
1033    pub fn r#dir_connector_router_route(
1034        &self,
1035        mut router: fidl::EventPair,
1036        mut request: RouteRequest,
1037        mut instance_token: fidl::EventPair,
1038        mut dir_connector: fidl::EventPair,
1039        ___deadline: zx::MonotonicInstant,
1040    ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
1041        let _response = self.client.send_query::<
1042            CapabilitiesDirConnectorRouterRouteRequest,
1043            fidl::encoding::FlexibleResultType<CapabilitiesDirConnectorRouterRouteResponse, i32>,
1044        >(
1045            (router, &mut request, instance_token, dir_connector,),
1046            0x3afdcc1b79e0799d,
1047            fidl::encoding::DynamicFlags::FLEXIBLE,
1048            ___deadline,
1049        )?
1050        .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
1051        Ok(_response.map(|x| x.response))
1052    }
1053
1054    /// Attempts to produce a `Dictionary` capability from this
1055    /// `DictionaryRouter`.
1056    ///
1057    /// `request` contains context for this route, and `instance_token`
1058    /// references the component that the routing operation is being performed
1059    /// for.
1060    ///
1061    /// This will return:
1062    ///
1063    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1064    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1065    ///   `dictionary` will be closed.
1066    /// - An error, if the operation failed.
1067    pub fn r#dictionary_router_route(
1068        &self,
1069        mut router: fidl::EventPair,
1070        mut request: RouteRequest,
1071        mut instance_token: fidl::EventPair,
1072        mut dictionary: fidl::EventPair,
1073        ___deadline: zx::MonotonicInstant,
1074    ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
1075        let _response = self.client.send_query::<
1076            CapabilitiesDictionaryRouterRouteRequest,
1077            fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
1078        >(
1079            (router, &mut request, instance_token, dictionary,),
1080            0xcf72de10714a708,
1081            fidl::encoding::DynamicFlags::FLEXIBLE,
1082            ___deadline,
1083        )?
1084        .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
1085        Ok(_response.map(|x| x.response))
1086    }
1087
1088    /// Attempts to produce a `Data` capability from this `DataRouter`.
1089    ///
1090    /// `request` contains context for this route, and `instance_token`
1091    /// references the component that the routing operation is being performed
1092    /// for.
1093    ///
1094    /// This will return:
1095    ///
1096    /// - `SUCCESS` if `data` has been associated with a connector.
1097    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1098    ///   will be closed.
1099    /// - An error, if the operation failed.
1100    pub fn r#data_router_route(
1101        &self,
1102        mut router: fidl::EventPair,
1103        mut request: RouteRequest,
1104        mut instance_token: fidl::EventPair,
1105        mut data: fidl::EventPair,
1106        ___deadline: zx::MonotonicInstant,
1107    ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
1108        let _response = self.client.send_query::<
1109            CapabilitiesDataRouterRouteRequest,
1110            fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
1111        >(
1112            (router, &mut request, instance_token, data,),
1113            0x61ab188455ed0643,
1114            fidl::encoding::DynamicFlags::FLEXIBLE,
1115            ___deadline,
1116        )?
1117        .into_result::<CapabilitiesMarker>("data_router_route")?;
1118        Ok(_response.map(|x| x.response))
1119    }
1120
1121    /// Associates `other_handle` with the same capability referenced by
1122    /// `capability_handle`.
1123    ///
1124    /// Typically if one already has `capability_handle` the handle can be
1125    /// duplicated to make a new handle that references the same object, but
1126    /// this doesn't work when someone else has provided a handle that should be
1127    /// associated with an existing object.
1128    pub fn r#capability_associate_handle(
1129        &self,
1130        mut capability_handle: fidl::EventPair,
1131        mut other_handle: fidl::EventPair,
1132        ___deadline: zx::MonotonicInstant,
1133    ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
1134        let _response = self.client.send_query::<
1135            CapabilitiesCapabilityAssociateHandleRequest,
1136            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1137        >(
1138            (capability_handle, other_handle,),
1139            0x1d69bb61953d8e7,
1140            fidl::encoding::DynamicFlags::FLEXIBLE,
1141            ___deadline,
1142        )?
1143        .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
1144        Ok(_response.map(|x| x))
1145    }
1146}
1147
1148#[cfg(target_os = "fuchsia")]
1149impl From<CapabilitiesSynchronousProxy> for zx::NullableHandle {
1150    fn from(value: CapabilitiesSynchronousProxy) -> Self {
1151        value.into_channel().into()
1152    }
1153}
1154
1155#[cfg(target_os = "fuchsia")]
1156impl From<fidl::Channel> for CapabilitiesSynchronousProxy {
1157    fn from(value: fidl::Channel) -> Self {
1158        Self::new(value)
1159    }
1160}
1161
1162#[cfg(target_os = "fuchsia")]
1163impl fidl::endpoints::FromClient for CapabilitiesSynchronousProxy {
1164    type Protocol = CapabilitiesMarker;
1165
1166    fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesMarker>) -> Self {
1167        Self::new(value.into_channel())
1168    }
1169}
1170
1171#[derive(Debug, Clone)]
1172pub struct CapabilitiesProxy {
1173    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1174}
1175
1176impl fidl::endpoints::Proxy for CapabilitiesProxy {
1177    type Protocol = CapabilitiesMarker;
1178
1179    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1180        Self::new(inner)
1181    }
1182
1183    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1184        self.client.into_channel().map_err(|client| Self { client })
1185    }
1186
1187    fn as_channel(&self) -> &::fidl::AsyncChannel {
1188        self.client.as_channel()
1189    }
1190}
1191
1192impl CapabilitiesProxy {
1193    /// Create a new Proxy for fuchsia.component.runtime/Capabilities.
1194    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1195        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1196        Self { client: fidl::client::Client::new(channel, protocol_name) }
1197    }
1198
1199    /// Get a Stream of events from the remote end of the protocol.
1200    ///
1201    /// # Panics
1202    ///
1203    /// Panics if the event stream was already taken.
1204    pub fn take_event_stream(&self) -> CapabilitiesEventStream {
1205        CapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
1206    }
1207
1208    /// Creates a reference to a new connector capability. When the connector is
1209    /// opened, the channel given to the open call will be sent over
1210    /// `receiver_client_end`.
1211    ///
1212    /// Make sure this method returns before passing the handle's peer to other
1213    /// methods in this API. The creation may not be complete before then.
1214    pub fn r#connector_create(
1215        &self,
1216        mut connector: fidl::EventPair,
1217        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1218    ) -> fidl::client::QueryResponseFut<
1219        CapabilitiesConnectorCreateResult,
1220        fidl::encoding::DefaultFuchsiaResourceDialect,
1221    > {
1222        CapabilitiesProxyInterface::r#connector_create(self, connector, receiver_client_end)
1223    }
1224
1225    /// Creates a reference to a new directory connector capability. When the
1226    /// directory connector is opened, the channel given to the open call will
1227    /// be sent over `receiver_client_end`.
1228    ///
1229    /// Make sure this method returns before passing the handle's peer to other
1230    /// methods in this API. The creation may not be complete before then.
1231    pub fn r#dir_connector_create(
1232        &self,
1233        mut dir_connector: fidl::EventPair,
1234        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1235    ) -> fidl::client::QueryResponseFut<
1236        CapabilitiesDirConnectorCreateResult,
1237        fidl::encoding::DefaultFuchsiaResourceDialect,
1238    > {
1239        CapabilitiesProxyInterface::r#dir_connector_create(self, dir_connector, receiver_client_end)
1240    }
1241
1242    /// Creates a reference to a new dictionary capability.
1243    ///
1244    /// Make sure this method returns before passing the handle's peer to other
1245    /// methods in this API. The creation may not be complete before then.
1246    pub fn r#dictionary_create(
1247        &self,
1248        mut dictionary: fidl::EventPair,
1249    ) -> fidl::client::QueryResponseFut<
1250        CapabilitiesDictionaryCreateResult,
1251        fidl::encoding::DefaultFuchsiaResourceDialect,
1252    > {
1253        CapabilitiesProxyInterface::r#dictionary_create(self, dictionary)
1254    }
1255
1256    /// Creates a reference to a new data capability with the given value.
1257    ///
1258    /// Make sure this method returns before passing the handle's peer to other
1259    /// methods in this API. The creation may not be complete before then.
1260    pub fn r#data_create(
1261        &self,
1262        mut data_handle: fidl::EventPair,
1263        mut data: &Data,
1264    ) -> fidl::client::QueryResponseFut<
1265        CapabilitiesDataCreateResult,
1266        fidl::encoding::DefaultFuchsiaResourceDialect,
1267    > {
1268        CapabilitiesProxyInterface::r#data_create(self, data_handle, data)
1269    }
1270
1271    /// Creates a reference to a new router capability that will return a
1272    /// connector capability when used.
1273    ///
1274    /// Make sure this method returns before passing the handle's peer to other
1275    /// methods in this API. The creation may not be complete before then.
1276    pub fn r#connector_router_create(
1277        &self,
1278        mut router: fidl::EventPair,
1279        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1280    ) -> fidl::client::QueryResponseFut<
1281        CapabilitiesConnectorRouterCreateResult,
1282        fidl::encoding::DefaultFuchsiaResourceDialect,
1283    > {
1284        CapabilitiesProxyInterface::r#connector_router_create(self, router, router_client_end)
1285    }
1286
1287    /// Creates a reference to a new router capability that will return a
1288    /// directory connector capability when used.
1289    ///
1290    /// Make sure this method returns before passing the handle's peer to other
1291    /// methods in this API. The creation may not be complete before then.
1292    pub fn r#dir_connector_router_create(
1293        &self,
1294        mut router: fidl::EventPair,
1295        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1296    ) -> fidl::client::QueryResponseFut<
1297        CapabilitiesDirConnectorRouterCreateResult,
1298        fidl::encoding::DefaultFuchsiaResourceDialect,
1299    > {
1300        CapabilitiesProxyInterface::r#dir_connector_router_create(self, router, router_client_end)
1301    }
1302
1303    /// Creates a reference to a new router capability that will return a
1304    /// dictionary capability when used.
1305    ///
1306    /// Make sure this method returns before passing the handle's peer to other
1307    /// methods in this API. The creation may not be complete before then.
1308    pub fn r#dictionary_router_create(
1309        &self,
1310        mut router: fidl::EventPair,
1311        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1312    ) -> fidl::client::QueryResponseFut<
1313        CapabilitiesDictionaryRouterCreateResult,
1314        fidl::encoding::DefaultFuchsiaResourceDialect,
1315    > {
1316        CapabilitiesProxyInterface::r#dictionary_router_create(self, router, router_client_end)
1317    }
1318
1319    /// Creates a reference to a new router capability that will return a data
1320    /// value when used.
1321    ///
1322    /// Make sure this method returns before passing the handle's peer to other
1323    /// methods in this API. The creation may not be complete before then.
1324    pub fn r#data_router_create(
1325        &self,
1326        mut router: fidl::EventPair,
1327        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1328    ) -> fidl::client::QueryResponseFut<
1329        CapabilitiesDataRouterCreateResult,
1330        fidl::encoding::DefaultFuchsiaResourceDialect,
1331    > {
1332        CapabilitiesProxyInterface::r#data_router_create(self, router, router_client_end)
1333    }
1334
1335    /// Creates a new instance token, which is an opaque identifier associated
1336    /// with a specific component. This instance token will be associated with
1337    /// the component this connection is opened from.
1338    ///
1339    /// Make sure this method returns before passing the handle's peer to other
1340    /// methods in this API. The creation may not be complete before then.
1341    pub fn r#instance_token_create(
1342        &self,
1343        mut instance_token: fidl::EventPair,
1344    ) -> fidl::client::QueryResponseFut<
1345        CapabilitiesInstanceTokenCreateResult,
1346        fidl::encoding::DefaultFuchsiaResourceDialect,
1347    > {
1348        CapabilitiesProxyInterface::r#instance_token_create(self, instance_token)
1349    }
1350
1351    /// Uses the provided `connector` to open a new connection by delivering
1352    /// this channel to whoever created the connector.
1353    ///
1354    /// If there is an error, it will be reported as a zx.Status epitaph on
1355    /// `channel`.
1356    ///
1357    /// If the `connector` event pair handle is not correlated with a handle
1358    /// given to `ConnectorCreate`, this connection will be closed.
1359    pub fn r#connector_open(
1360        &self,
1361        mut connector: fidl::EventPair,
1362        mut channel: fidl::Channel,
1363    ) -> fidl::client::QueryResponseFut<
1364        CapabilitiesConnectorOpenResult,
1365        fidl::encoding::DefaultFuchsiaResourceDialect,
1366    > {
1367        CapabilitiesProxyInterface::r#connector_open(self, connector, channel)
1368    }
1369
1370    /// Uses the provided `dir_connector` to open a new directory connection by
1371    /// delivering this channel to whoever created the directory connector.
1372    ///
1373    /// If there is an error, it will be reported as a zx.Status epitaph on
1374    /// `channel`.
1375    ///
1376    /// If the `dir_connector` event pair handle is not correlated with a handle
1377    /// given to `DirConnectorCreate`, this connection will be closed.
1378    ///
1379    /// `dir_connector` and `channel` are both required. `flags` and `path`
1380    /// may be omitted.
1381    pub fn r#dir_connector_open(
1382        &self,
1383        mut payload: CapabilitiesDirConnectorOpenRequest,
1384    ) -> fidl::client::QueryResponseFut<
1385        CapabilitiesDirConnectorOpenResult,
1386        fidl::encoding::DefaultFuchsiaResourceDialect,
1387    > {
1388        CapabilitiesProxyInterface::r#dir_connector_open(self, payload)
1389    }
1390
1391    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
1392    /// Overwrites any existing entry.
1393    pub fn r#dictionary_insert(
1394        &self,
1395        mut dictionary: fidl::EventPair,
1396        mut key: &str,
1397        mut value: fidl::EventPair,
1398    ) -> fidl::client::QueryResponseFut<
1399        CapabilitiesDictionaryInsertResult,
1400        fidl::encoding::DefaultFuchsiaResourceDialect,
1401    > {
1402        CapabilitiesProxyInterface::r#dictionary_insert(self, dictionary, key, value)
1403    }
1404
1405    /// Creates a new reference to the `capability` named `key` in this
1406    /// dictionary, if that capability exists. That capability will remain in
1407    /// the dictionary. To take a capability out of the dictionary, use
1408    /// `DictionaryRemove`.
1409    ///
1410    /// If `key` does not exist, `value` will not reference any capability and
1411    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1412    ///
1413    /// Make sure this method returns before passing the handle's peer to other
1414    /// methods in this API. The creation may not be complete before then.
1415    pub fn r#dictionary_get(
1416        &self,
1417        mut dictionary: fidl::EventPair,
1418        mut key: &str,
1419        mut value: fidl::EventPair,
1420    ) -> fidl::client::QueryResponseFut<
1421        CapabilitiesDictionaryGetResult,
1422        fidl::encoding::DefaultFuchsiaResourceDialect,
1423    > {
1424        CapabilitiesProxyInterface::r#dictionary_get(self, dictionary, key, value)
1425    }
1426
1427    /// Removes the `capability` named `key` from this dictionary and returns a
1428    /// reference to it, if that capability exists.
1429    ///
1430    /// `dictionary` and `key` are required. `capability` is optional, and when
1431    /// set will become associated with the capability that was removed from the
1432    /// dictionary.
1433    ///
1434    /// If `key` does not exist, `value` will not reference any capability and
1435    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1436    ///
1437    /// Make sure this method returns before passing the peer of `capability` to
1438    /// other methods in this API. The creation may not be complete before then.
1439    pub fn r#dictionary_remove(
1440        &self,
1441        mut payload: CapabilitiesDictionaryRemoveRequest,
1442    ) -> fidl::client::QueryResponseFut<
1443        CapabilitiesDictionaryRemoveResult,
1444        fidl::encoding::DefaultFuchsiaResourceDialect,
1445    > {
1446        CapabilitiesProxyInterface::r#dictionary_remove(self, payload)
1447    }
1448
1449    /// Opens an iterator which can be used to iterate over the keys of this
1450    /// dictionary.
1451    pub fn r#dictionary_iterate_keys(
1452        &self,
1453        mut dictionary: fidl::EventPair,
1454        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
1455    ) -> fidl::client::QueryResponseFut<
1456        CapabilitiesDictionaryIterateKeysResult,
1457        fidl::encoding::DefaultFuchsiaResourceDialect,
1458    > {
1459        CapabilitiesProxyInterface::r#dictionary_iterate_keys(self, dictionary, key_iterator)
1460    }
1461
1462    /// Returns the `Data` value that was provided to the `DataCreate` call used
1463    /// with `data_handle`.
1464    pub fn r#data_get(
1465        &self,
1466        mut data_handle: fidl::EventPair,
1467    ) -> fidl::client::QueryResponseFut<
1468        CapabilitiesDataGetResult,
1469        fidl::encoding::DefaultFuchsiaResourceDialect,
1470    > {
1471        CapabilitiesProxyInterface::r#data_get(self, data_handle)
1472    }
1473
1474    /// Attempts to produce a `Connector` capability from this
1475    /// `ConnectorRouter`.
1476    ///
1477    /// `request` contains context for this route, and `instance_token`
1478    /// references the component that the routing operation is being performed
1479    /// for.
1480    ///
1481    /// This will return:
1482    ///
1483    /// - `SUCCESS` if `connector` has been associated with a connector.
1484    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1485    ///   `connector` will be closed.
1486    /// - An error, if the operation failed.
1487    pub fn r#connector_router_route(
1488        &self,
1489        mut router: fidl::EventPair,
1490        mut request: RouteRequest,
1491        mut instance_token: fidl::EventPair,
1492        mut connector: fidl::EventPair,
1493    ) -> fidl::client::QueryResponseFut<
1494        CapabilitiesConnectorRouterRouteResult,
1495        fidl::encoding::DefaultFuchsiaResourceDialect,
1496    > {
1497        CapabilitiesProxyInterface::r#connector_router_route(
1498            self,
1499            router,
1500            request,
1501            instance_token,
1502            connector,
1503        )
1504    }
1505
1506    /// Attempts to produce a `DirConnector` capability from this
1507    /// `DirConnectorRouter`.
1508    ///
1509    /// `request` contains context for this route, and `instance_token`
1510    /// references the component that the routing operation is being performed
1511    /// for.
1512    ///
1513    /// This will return:
1514    ///
1515    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1516    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1517    ///   `dir_connector` will be closed.
1518    /// - An error, if the operation failed.
1519    pub fn r#dir_connector_router_route(
1520        &self,
1521        mut router: fidl::EventPair,
1522        mut request: RouteRequest,
1523        mut instance_token: fidl::EventPair,
1524        mut dir_connector: fidl::EventPair,
1525    ) -> fidl::client::QueryResponseFut<
1526        CapabilitiesDirConnectorRouterRouteResult,
1527        fidl::encoding::DefaultFuchsiaResourceDialect,
1528    > {
1529        CapabilitiesProxyInterface::r#dir_connector_router_route(
1530            self,
1531            router,
1532            request,
1533            instance_token,
1534            dir_connector,
1535        )
1536    }
1537
1538    /// Attempts to produce a `Dictionary` capability from this
1539    /// `DictionaryRouter`.
1540    ///
1541    /// `request` contains context for this route, and `instance_token`
1542    /// references the component that the routing operation is being performed
1543    /// for.
1544    ///
1545    /// This will return:
1546    ///
1547    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1548    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1549    ///   `dictionary` will be closed.
1550    /// - An error, if the operation failed.
1551    pub fn r#dictionary_router_route(
1552        &self,
1553        mut router: fidl::EventPair,
1554        mut request: RouteRequest,
1555        mut instance_token: fidl::EventPair,
1556        mut dictionary: fidl::EventPair,
1557    ) -> fidl::client::QueryResponseFut<
1558        CapabilitiesDictionaryRouterRouteResult,
1559        fidl::encoding::DefaultFuchsiaResourceDialect,
1560    > {
1561        CapabilitiesProxyInterface::r#dictionary_router_route(
1562            self,
1563            router,
1564            request,
1565            instance_token,
1566            dictionary,
1567        )
1568    }
1569
1570    /// Attempts to produce a `Data` capability from this `DataRouter`.
1571    ///
1572    /// `request` contains context for this route, and `instance_token`
1573    /// references the component that the routing operation is being performed
1574    /// for.
1575    ///
1576    /// This will return:
1577    ///
1578    /// - `SUCCESS` if `data` has been associated with a connector.
1579    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1580    ///   will be closed.
1581    /// - An error, if the operation failed.
1582    pub fn r#data_router_route(
1583        &self,
1584        mut router: fidl::EventPair,
1585        mut request: RouteRequest,
1586        mut instance_token: fidl::EventPair,
1587        mut data: fidl::EventPair,
1588    ) -> fidl::client::QueryResponseFut<
1589        CapabilitiesDataRouterRouteResult,
1590        fidl::encoding::DefaultFuchsiaResourceDialect,
1591    > {
1592        CapabilitiesProxyInterface::r#data_router_route(self, router, request, instance_token, data)
1593    }
1594
1595    /// Associates `other_handle` with the same capability referenced by
1596    /// `capability_handle`.
1597    ///
1598    /// Typically if one already has `capability_handle` the handle can be
1599    /// duplicated to make a new handle that references the same object, but
1600    /// this doesn't work when someone else has provided a handle that should be
1601    /// associated with an existing object.
1602    pub fn r#capability_associate_handle(
1603        &self,
1604        mut capability_handle: fidl::EventPair,
1605        mut other_handle: fidl::EventPair,
1606    ) -> fidl::client::QueryResponseFut<
1607        CapabilitiesCapabilityAssociateHandleResult,
1608        fidl::encoding::DefaultFuchsiaResourceDialect,
1609    > {
1610        CapabilitiesProxyInterface::r#capability_associate_handle(
1611            self,
1612            capability_handle,
1613            other_handle,
1614        )
1615    }
1616}
1617
1618impl CapabilitiesProxyInterface for CapabilitiesProxy {
1619    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1620        CapabilitiesConnectorCreateResult,
1621        fidl::encoding::DefaultFuchsiaResourceDialect,
1622    >;
1623    fn r#connector_create(
1624        &self,
1625        mut connector: fidl::EventPair,
1626        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1627    ) -> Self::ConnectorCreateResponseFut {
1628        fn _decode(
1629            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1630        ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
1631            let _response = fidl::client::decode_transaction_body::<
1632                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1633                fidl::encoding::DefaultFuchsiaResourceDialect,
1634                0xac2bc2dbd7033d1,
1635            >(_buf?)?
1636            .into_result::<CapabilitiesMarker>("connector_create")?;
1637            Ok(_response.map(|x| x))
1638        }
1639        self.client.send_query_and_decode::<
1640            CapabilitiesConnectorCreateRequest,
1641            CapabilitiesConnectorCreateResult,
1642        >(
1643            (connector, receiver_client_end,),
1644            0xac2bc2dbd7033d1,
1645            fidl::encoding::DynamicFlags::FLEXIBLE,
1646            _decode,
1647        )
1648    }
1649
1650    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1651        CapabilitiesDirConnectorCreateResult,
1652        fidl::encoding::DefaultFuchsiaResourceDialect,
1653    >;
1654    fn r#dir_connector_create(
1655        &self,
1656        mut dir_connector: fidl::EventPair,
1657        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1658    ) -> Self::DirConnectorCreateResponseFut {
1659        fn _decode(
1660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1661        ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
1662            let _response = fidl::client::decode_transaction_body::<
1663                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1664                fidl::encoding::DefaultFuchsiaResourceDialect,
1665                0x721911e05da2a3bf,
1666            >(_buf?)?
1667            .into_result::<CapabilitiesMarker>("dir_connector_create")?;
1668            Ok(_response.map(|x| x))
1669        }
1670        self.client.send_query_and_decode::<
1671            CapabilitiesDirConnectorCreateRequest,
1672            CapabilitiesDirConnectorCreateResult,
1673        >(
1674            (dir_connector, receiver_client_end,),
1675            0x721911e05da2a3bf,
1676            fidl::encoding::DynamicFlags::FLEXIBLE,
1677            _decode,
1678        )
1679    }
1680
1681    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1682        CapabilitiesDictionaryCreateResult,
1683        fidl::encoding::DefaultFuchsiaResourceDialect,
1684    >;
1685    fn r#dictionary_create(
1686        &self,
1687        mut dictionary: fidl::EventPair,
1688    ) -> Self::DictionaryCreateResponseFut {
1689        fn _decode(
1690            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1691        ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
1692            let _response = fidl::client::decode_transaction_body::<
1693                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1694                fidl::encoding::DefaultFuchsiaResourceDialect,
1695                0x7f8bd91f0942a36e,
1696            >(_buf?)?
1697            .into_result::<CapabilitiesMarker>("dictionary_create")?;
1698            Ok(_response.map(|x| x))
1699        }
1700        self.client.send_query_and_decode::<
1701            CapabilitiesDictionaryCreateRequest,
1702            CapabilitiesDictionaryCreateResult,
1703        >(
1704            (dictionary,),
1705            0x7f8bd91f0942a36e,
1706            fidl::encoding::DynamicFlags::FLEXIBLE,
1707            _decode,
1708        )
1709    }
1710
1711    type DataCreateResponseFut = fidl::client::QueryResponseFut<
1712        CapabilitiesDataCreateResult,
1713        fidl::encoding::DefaultFuchsiaResourceDialect,
1714    >;
1715    fn r#data_create(
1716        &self,
1717        mut data_handle: fidl::EventPair,
1718        mut data: &Data,
1719    ) -> Self::DataCreateResponseFut {
1720        fn _decode(
1721            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1722        ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
1723            let _response = fidl::client::decode_transaction_body::<
1724                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1725                fidl::encoding::DefaultFuchsiaResourceDialect,
1726                0x40ef43e45372ee6a,
1727            >(_buf?)?
1728            .into_result::<CapabilitiesMarker>("data_create")?;
1729            Ok(_response.map(|x| x))
1730        }
1731        self.client
1732            .send_query_and_decode::<CapabilitiesDataCreateRequest, CapabilitiesDataCreateResult>(
1733                (data_handle, data),
1734                0x40ef43e45372ee6a,
1735                fidl::encoding::DynamicFlags::FLEXIBLE,
1736                _decode,
1737            )
1738    }
1739
1740    type ConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1741        CapabilitiesConnectorRouterCreateResult,
1742        fidl::encoding::DefaultFuchsiaResourceDialect,
1743    >;
1744    fn r#connector_router_create(
1745        &self,
1746        mut router: fidl::EventPair,
1747        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1748    ) -> Self::ConnectorRouterCreateResponseFut {
1749        fn _decode(
1750            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1751        ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
1752            let _response = fidl::client::decode_transaction_body::<
1753                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1754                fidl::encoding::DefaultFuchsiaResourceDialect,
1755                0x7f7e7fbafcdf1761,
1756            >(_buf?)?
1757            .into_result::<CapabilitiesMarker>("connector_router_create")?;
1758            Ok(_response.map(|x| x))
1759        }
1760        self.client.send_query_and_decode::<
1761            CapabilitiesConnectorRouterCreateRequest,
1762            CapabilitiesConnectorRouterCreateResult,
1763        >(
1764            (router, router_client_end,),
1765            0x7f7e7fbafcdf1761,
1766            fidl::encoding::DynamicFlags::FLEXIBLE,
1767            _decode,
1768        )
1769    }
1770
1771    type DirConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1772        CapabilitiesDirConnectorRouterCreateResult,
1773        fidl::encoding::DefaultFuchsiaResourceDialect,
1774    >;
1775    fn r#dir_connector_router_create(
1776        &self,
1777        mut router: fidl::EventPair,
1778        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1779    ) -> Self::DirConnectorRouterCreateResponseFut {
1780        fn _decode(
1781            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1782        ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
1783            let _response = fidl::client::decode_transaction_body::<
1784                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1785                fidl::encoding::DefaultFuchsiaResourceDialect,
1786                0x56520da453fad19f,
1787            >(_buf?)?
1788            .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
1789            Ok(_response.map(|x| x))
1790        }
1791        self.client.send_query_and_decode::<
1792            CapabilitiesDirConnectorRouterCreateRequest,
1793            CapabilitiesDirConnectorRouterCreateResult,
1794        >(
1795            (router, router_client_end,),
1796            0x56520da453fad19f,
1797            fidl::encoding::DynamicFlags::FLEXIBLE,
1798            _decode,
1799        )
1800    }
1801
1802    type DictionaryRouterCreateResponseFut = fidl::client::QueryResponseFut<
1803        CapabilitiesDictionaryRouterCreateResult,
1804        fidl::encoding::DefaultFuchsiaResourceDialect,
1805    >;
1806    fn r#dictionary_router_create(
1807        &self,
1808        mut router: fidl::EventPair,
1809        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1810    ) -> Self::DictionaryRouterCreateResponseFut {
1811        fn _decode(
1812            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1813        ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
1814            let _response = fidl::client::decode_transaction_body::<
1815                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1816                fidl::encoding::DefaultFuchsiaResourceDialect,
1817                0x37acef18cd423d42,
1818            >(_buf?)?
1819            .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
1820            Ok(_response.map(|x| x))
1821        }
1822        self.client.send_query_and_decode::<
1823            CapabilitiesDictionaryRouterCreateRequest,
1824            CapabilitiesDictionaryRouterCreateResult,
1825        >(
1826            (router, router_client_end,),
1827            0x37acef18cd423d42,
1828            fidl::encoding::DynamicFlags::FLEXIBLE,
1829            _decode,
1830        )
1831    }
1832
1833    type DataRouterCreateResponseFut = fidl::client::QueryResponseFut<
1834        CapabilitiesDataRouterCreateResult,
1835        fidl::encoding::DefaultFuchsiaResourceDialect,
1836    >;
1837    fn r#data_router_create(
1838        &self,
1839        mut router: fidl::EventPair,
1840        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1841    ) -> Self::DataRouterCreateResponseFut {
1842        fn _decode(
1843            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1844        ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
1845            let _response = fidl::client::decode_transaction_body::<
1846                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1847                fidl::encoding::DefaultFuchsiaResourceDialect,
1848                0x24e471395b95088,
1849            >(_buf?)?
1850            .into_result::<CapabilitiesMarker>("data_router_create")?;
1851            Ok(_response.map(|x| x))
1852        }
1853        self.client.send_query_and_decode::<
1854            CapabilitiesDataRouterCreateRequest,
1855            CapabilitiesDataRouterCreateResult,
1856        >(
1857            (router, router_client_end,),
1858            0x24e471395b95088,
1859            fidl::encoding::DynamicFlags::FLEXIBLE,
1860            _decode,
1861        )
1862    }
1863
1864    type InstanceTokenCreateResponseFut = fidl::client::QueryResponseFut<
1865        CapabilitiesInstanceTokenCreateResult,
1866        fidl::encoding::DefaultFuchsiaResourceDialect,
1867    >;
1868    fn r#instance_token_create(
1869        &self,
1870        mut instance_token: fidl::EventPair,
1871    ) -> Self::InstanceTokenCreateResponseFut {
1872        fn _decode(
1873            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1874        ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
1875            let _response = fidl::client::decode_transaction_body::<
1876                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1877                fidl::encoding::DefaultFuchsiaResourceDialect,
1878                0x3576e31727c40813,
1879            >(_buf?)?
1880            .into_result::<CapabilitiesMarker>("instance_token_create")?;
1881            Ok(_response.map(|x| x))
1882        }
1883        self.client.send_query_and_decode::<
1884            CapabilitiesInstanceTokenCreateRequest,
1885            CapabilitiesInstanceTokenCreateResult,
1886        >(
1887            (instance_token,),
1888            0x3576e31727c40813,
1889            fidl::encoding::DynamicFlags::FLEXIBLE,
1890            _decode,
1891        )
1892    }
1893
1894    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1895        CapabilitiesConnectorOpenResult,
1896        fidl::encoding::DefaultFuchsiaResourceDialect,
1897    >;
1898    fn r#connector_open(
1899        &self,
1900        mut connector: fidl::EventPair,
1901        mut channel: fidl::Channel,
1902    ) -> Self::ConnectorOpenResponseFut {
1903        fn _decode(
1904            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1905        ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
1906            let _response = fidl::client::decode_transaction_body::<
1907                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1908                fidl::encoding::DefaultFuchsiaResourceDialect,
1909                0xc0646965f1884eb,
1910            >(_buf?)?
1911            .into_result::<CapabilitiesMarker>("connector_open")?;
1912            Ok(_response.map(|x| x))
1913        }
1914        self.client.send_query_and_decode::<
1915            CapabilitiesConnectorOpenRequest,
1916            CapabilitiesConnectorOpenResult,
1917        >(
1918            (connector, channel,),
1919            0xc0646965f1884eb,
1920            fidl::encoding::DynamicFlags::FLEXIBLE,
1921            _decode,
1922        )
1923    }
1924
1925    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1926        CapabilitiesDirConnectorOpenResult,
1927        fidl::encoding::DefaultFuchsiaResourceDialect,
1928    >;
1929    fn r#dir_connector_open(
1930        &self,
1931        mut payload: CapabilitiesDirConnectorOpenRequest,
1932    ) -> Self::DirConnectorOpenResponseFut {
1933        fn _decode(
1934            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935        ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
1936            let _response = fidl::client::decode_transaction_body::<
1937                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1938                fidl::encoding::DefaultFuchsiaResourceDialect,
1939                0x1332bbf5debd6c20,
1940            >(_buf?)?
1941            .into_result::<CapabilitiesMarker>("dir_connector_open")?;
1942            Ok(_response.map(|x| x))
1943        }
1944        self.client.send_query_and_decode::<
1945            CapabilitiesDirConnectorOpenRequest,
1946            CapabilitiesDirConnectorOpenResult,
1947        >(
1948            &mut payload,
1949            0x1332bbf5debd6c20,
1950            fidl::encoding::DynamicFlags::FLEXIBLE,
1951            _decode,
1952        )
1953    }
1954
1955    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1956        CapabilitiesDictionaryInsertResult,
1957        fidl::encoding::DefaultFuchsiaResourceDialect,
1958    >;
1959    fn r#dictionary_insert(
1960        &self,
1961        mut dictionary: fidl::EventPair,
1962        mut key: &str,
1963        mut value: fidl::EventPair,
1964    ) -> Self::DictionaryInsertResponseFut {
1965        fn _decode(
1966            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1967        ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
1968            let _response = fidl::client::decode_transaction_body::<
1969                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1970                fidl::encoding::DefaultFuchsiaResourceDialect,
1971                0x5972e3061a760e7a,
1972            >(_buf?)?
1973            .into_result::<CapabilitiesMarker>("dictionary_insert")?;
1974            Ok(_response.map(|x| x))
1975        }
1976        self.client.send_query_and_decode::<
1977            CapabilitiesDictionaryInsertRequest,
1978            CapabilitiesDictionaryInsertResult,
1979        >(
1980            (dictionary, key, value,),
1981            0x5972e3061a760e7a,
1982            fidl::encoding::DynamicFlags::FLEXIBLE,
1983            _decode,
1984        )
1985    }
1986
1987    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1988        CapabilitiesDictionaryGetResult,
1989        fidl::encoding::DefaultFuchsiaResourceDialect,
1990    >;
1991    fn r#dictionary_get(
1992        &self,
1993        mut dictionary: fidl::EventPair,
1994        mut key: &str,
1995        mut value: fidl::EventPair,
1996    ) -> Self::DictionaryGetResponseFut {
1997        fn _decode(
1998            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1999        ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
2000            let _response = fidl::client::decode_transaction_body::<
2001                fidl::encoding::FlexibleResultType<
2002                    CapabilitiesDictionaryGetResponse,
2003                    CapabilitiesError,
2004                >,
2005                fidl::encoding::DefaultFuchsiaResourceDialect,
2006                0x31fafe2280a283d5,
2007            >(_buf?)?
2008            .into_result::<CapabilitiesMarker>("dictionary_get")?;
2009            Ok(_response.map(|x| x.capability_type))
2010        }
2011        self.client.send_query_and_decode::<
2012            CapabilitiesDictionaryGetRequest,
2013            CapabilitiesDictionaryGetResult,
2014        >(
2015            (dictionary, key, value,),
2016            0x31fafe2280a283d5,
2017            fidl::encoding::DynamicFlags::FLEXIBLE,
2018            _decode,
2019        )
2020    }
2021
2022    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
2023        CapabilitiesDictionaryRemoveResult,
2024        fidl::encoding::DefaultFuchsiaResourceDialect,
2025    >;
2026    fn r#dictionary_remove(
2027        &self,
2028        mut payload: CapabilitiesDictionaryRemoveRequest,
2029    ) -> Self::DictionaryRemoveResponseFut {
2030        fn _decode(
2031            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2032        ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
2033            let _response = fidl::client::decode_transaction_body::<
2034                fidl::encoding::FlexibleResultType<
2035                    CapabilitiesDictionaryRemoveResponse,
2036                    CapabilitiesError,
2037                >,
2038                fidl::encoding::DefaultFuchsiaResourceDialect,
2039                0x6827c83106ac5a2c,
2040            >(_buf?)?
2041            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
2042            Ok(_response.map(|x| x.capability_type))
2043        }
2044        self.client.send_query_and_decode::<
2045            CapabilitiesDictionaryRemoveRequest,
2046            CapabilitiesDictionaryRemoveResult,
2047        >(
2048            &mut payload,
2049            0x6827c83106ac5a2c,
2050            fidl::encoding::DynamicFlags::FLEXIBLE,
2051            _decode,
2052        )
2053    }
2054
2055    type DictionaryIterateKeysResponseFut = fidl::client::QueryResponseFut<
2056        CapabilitiesDictionaryIterateKeysResult,
2057        fidl::encoding::DefaultFuchsiaResourceDialect,
2058    >;
2059    fn r#dictionary_iterate_keys(
2060        &self,
2061        mut dictionary: fidl::EventPair,
2062        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
2063    ) -> Self::DictionaryIterateKeysResponseFut {
2064        fn _decode(
2065            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2066        ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
2067            let _response = fidl::client::decode_transaction_body::<
2068                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2069                fidl::encoding::DefaultFuchsiaResourceDialect,
2070                0x3d4ea59c80df9bb8,
2071            >(_buf?)?
2072            .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
2073            Ok(_response.map(|x| x))
2074        }
2075        self.client.send_query_and_decode::<
2076            CapabilitiesDictionaryIterateKeysRequest,
2077            CapabilitiesDictionaryIterateKeysResult,
2078        >(
2079            (dictionary, key_iterator,),
2080            0x3d4ea59c80df9bb8,
2081            fidl::encoding::DynamicFlags::FLEXIBLE,
2082            _decode,
2083        )
2084    }
2085
2086    type DataGetResponseFut = fidl::client::QueryResponseFut<
2087        CapabilitiesDataGetResult,
2088        fidl::encoding::DefaultFuchsiaResourceDialect,
2089    >;
2090    fn r#data_get(&self, mut data_handle: fidl::EventPair) -> Self::DataGetResponseFut {
2091        fn _decode(
2092            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2093        ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
2094            let _response = fidl::client::decode_transaction_body::<
2095                fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
2096                fidl::encoding::DefaultFuchsiaResourceDialect,
2097                0x65ae25b59f9e0daf,
2098            >(_buf?)?
2099            .into_result::<CapabilitiesMarker>("data_get")?;
2100            Ok(_response.map(|x| x))
2101        }
2102        self.client.send_query_and_decode::<CapabilitiesDataGetRequest, CapabilitiesDataGetResult>(
2103            (data_handle,),
2104            0x65ae25b59f9e0daf,
2105            fidl::encoding::DynamicFlags::FLEXIBLE,
2106            _decode,
2107        )
2108    }
2109
2110    type ConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2111        CapabilitiesConnectorRouterRouteResult,
2112        fidl::encoding::DefaultFuchsiaResourceDialect,
2113    >;
2114    fn r#connector_router_route(
2115        &self,
2116        mut router: fidl::EventPair,
2117        mut request: RouteRequest,
2118        mut instance_token: fidl::EventPair,
2119        mut connector: fidl::EventPair,
2120    ) -> Self::ConnectorRouterRouteResponseFut {
2121        fn _decode(
2122            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2123        ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
2124            let _response = fidl::client::decode_transaction_body::<
2125                fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
2126                fidl::encoding::DefaultFuchsiaResourceDialect,
2127                0x1bd9c6e7e3dd487e,
2128            >(_buf?)?
2129            .into_result::<CapabilitiesMarker>("connector_router_route")?;
2130            Ok(_response.map(|x| x.response))
2131        }
2132        self.client.send_query_and_decode::<
2133            CapabilitiesConnectorRouterRouteRequest,
2134            CapabilitiesConnectorRouterRouteResult,
2135        >(
2136            (router, &mut request, instance_token, connector,),
2137            0x1bd9c6e7e3dd487e,
2138            fidl::encoding::DynamicFlags::FLEXIBLE,
2139            _decode,
2140        )
2141    }
2142
2143    type DirConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2144        CapabilitiesDirConnectorRouterRouteResult,
2145        fidl::encoding::DefaultFuchsiaResourceDialect,
2146    >;
2147    fn r#dir_connector_router_route(
2148        &self,
2149        mut router: fidl::EventPair,
2150        mut request: RouteRequest,
2151        mut instance_token: fidl::EventPair,
2152        mut dir_connector: fidl::EventPair,
2153    ) -> Self::DirConnectorRouterRouteResponseFut {
2154        fn _decode(
2155            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2156        ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
2157            let _response = fidl::client::decode_transaction_body::<
2158                fidl::encoding::FlexibleResultType<
2159                    CapabilitiesDirConnectorRouterRouteResponse,
2160                    i32,
2161                >,
2162                fidl::encoding::DefaultFuchsiaResourceDialect,
2163                0x3afdcc1b79e0799d,
2164            >(_buf?)?
2165            .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
2166            Ok(_response.map(|x| x.response))
2167        }
2168        self.client.send_query_and_decode::<
2169            CapabilitiesDirConnectorRouterRouteRequest,
2170            CapabilitiesDirConnectorRouterRouteResult,
2171        >(
2172            (router, &mut request, instance_token, dir_connector,),
2173            0x3afdcc1b79e0799d,
2174            fidl::encoding::DynamicFlags::FLEXIBLE,
2175            _decode,
2176        )
2177    }
2178
2179    type DictionaryRouterRouteResponseFut = fidl::client::QueryResponseFut<
2180        CapabilitiesDictionaryRouterRouteResult,
2181        fidl::encoding::DefaultFuchsiaResourceDialect,
2182    >;
2183    fn r#dictionary_router_route(
2184        &self,
2185        mut router: fidl::EventPair,
2186        mut request: RouteRequest,
2187        mut instance_token: fidl::EventPair,
2188        mut dictionary: fidl::EventPair,
2189    ) -> Self::DictionaryRouterRouteResponseFut {
2190        fn _decode(
2191            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2192        ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
2193            let _response = fidl::client::decode_transaction_body::<
2194                fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
2195                fidl::encoding::DefaultFuchsiaResourceDialect,
2196                0xcf72de10714a708,
2197            >(_buf?)?
2198            .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
2199            Ok(_response.map(|x| x.response))
2200        }
2201        self.client.send_query_and_decode::<
2202            CapabilitiesDictionaryRouterRouteRequest,
2203            CapabilitiesDictionaryRouterRouteResult,
2204        >(
2205            (router, &mut request, instance_token, dictionary,),
2206            0xcf72de10714a708,
2207            fidl::encoding::DynamicFlags::FLEXIBLE,
2208            _decode,
2209        )
2210    }
2211
2212    type DataRouterRouteResponseFut = fidl::client::QueryResponseFut<
2213        CapabilitiesDataRouterRouteResult,
2214        fidl::encoding::DefaultFuchsiaResourceDialect,
2215    >;
2216    fn r#data_router_route(
2217        &self,
2218        mut router: fidl::EventPair,
2219        mut request: RouteRequest,
2220        mut instance_token: fidl::EventPair,
2221        mut data: fidl::EventPair,
2222    ) -> Self::DataRouterRouteResponseFut {
2223        fn _decode(
2224            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2225        ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
2226            let _response = fidl::client::decode_transaction_body::<
2227                fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
2228                fidl::encoding::DefaultFuchsiaResourceDialect,
2229                0x61ab188455ed0643,
2230            >(_buf?)?
2231            .into_result::<CapabilitiesMarker>("data_router_route")?;
2232            Ok(_response.map(|x| x.response))
2233        }
2234        self.client.send_query_and_decode::<
2235            CapabilitiesDataRouterRouteRequest,
2236            CapabilitiesDataRouterRouteResult,
2237        >(
2238            (router, &mut request, instance_token, data,),
2239            0x61ab188455ed0643,
2240            fidl::encoding::DynamicFlags::FLEXIBLE,
2241            _decode,
2242        )
2243    }
2244
2245    type CapabilityAssociateHandleResponseFut = fidl::client::QueryResponseFut<
2246        CapabilitiesCapabilityAssociateHandleResult,
2247        fidl::encoding::DefaultFuchsiaResourceDialect,
2248    >;
2249    fn r#capability_associate_handle(
2250        &self,
2251        mut capability_handle: fidl::EventPair,
2252        mut other_handle: fidl::EventPair,
2253    ) -> Self::CapabilityAssociateHandleResponseFut {
2254        fn _decode(
2255            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2256        ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
2257            let _response = fidl::client::decode_transaction_body::<
2258                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2259                fidl::encoding::DefaultFuchsiaResourceDialect,
2260                0x1d69bb61953d8e7,
2261            >(_buf?)?
2262            .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
2263            Ok(_response.map(|x| x))
2264        }
2265        self.client.send_query_and_decode::<
2266            CapabilitiesCapabilityAssociateHandleRequest,
2267            CapabilitiesCapabilityAssociateHandleResult,
2268        >(
2269            (capability_handle, other_handle,),
2270            0x1d69bb61953d8e7,
2271            fidl::encoding::DynamicFlags::FLEXIBLE,
2272            _decode,
2273        )
2274    }
2275}
2276
2277pub struct CapabilitiesEventStream {
2278    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2279}
2280
2281impl std::marker::Unpin for CapabilitiesEventStream {}
2282
2283impl futures::stream::FusedStream for CapabilitiesEventStream {
2284    fn is_terminated(&self) -> bool {
2285        self.event_receiver.is_terminated()
2286    }
2287}
2288
2289impl futures::Stream for CapabilitiesEventStream {
2290    type Item = Result<CapabilitiesEvent, fidl::Error>;
2291
2292    fn poll_next(
2293        mut self: std::pin::Pin<&mut Self>,
2294        cx: &mut std::task::Context<'_>,
2295    ) -> std::task::Poll<Option<Self::Item>> {
2296        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2297            &mut self.event_receiver,
2298            cx
2299        )?) {
2300            Some(buf) => std::task::Poll::Ready(Some(CapabilitiesEvent::decode(buf))),
2301            None => std::task::Poll::Ready(None),
2302        }
2303    }
2304}
2305
2306#[derive(Debug)]
2307pub enum CapabilitiesEvent {
2308    #[non_exhaustive]
2309    _UnknownEvent {
2310        /// Ordinal of the event that was sent.
2311        ordinal: u64,
2312    },
2313}
2314
2315impl CapabilitiesEvent {
2316    /// Decodes a message buffer as a [`CapabilitiesEvent`].
2317    fn decode(
2318        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2319    ) -> Result<CapabilitiesEvent, fidl::Error> {
2320        let (bytes, _handles) = buf.split_mut();
2321        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2322        debug_assert_eq!(tx_header.tx_id, 0);
2323        match tx_header.ordinal {
2324            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2325                Ok(CapabilitiesEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2326            }
2327            _ => Err(fidl::Error::UnknownOrdinal {
2328                ordinal: tx_header.ordinal,
2329                protocol_name: <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2330            }),
2331        }
2332    }
2333}
2334
2335/// A Stream of incoming requests for fuchsia.component.runtime/Capabilities.
2336pub struct CapabilitiesRequestStream {
2337    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2338    is_terminated: bool,
2339}
2340
2341impl std::marker::Unpin for CapabilitiesRequestStream {}
2342
2343impl futures::stream::FusedStream for CapabilitiesRequestStream {
2344    fn is_terminated(&self) -> bool {
2345        self.is_terminated
2346    }
2347}
2348
2349impl fidl::endpoints::RequestStream for CapabilitiesRequestStream {
2350    type Protocol = CapabilitiesMarker;
2351    type ControlHandle = CapabilitiesControlHandle;
2352
2353    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2354        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2355    }
2356
2357    fn control_handle(&self) -> Self::ControlHandle {
2358        CapabilitiesControlHandle { inner: self.inner.clone() }
2359    }
2360
2361    fn into_inner(
2362        self,
2363    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2364    {
2365        (self.inner, self.is_terminated)
2366    }
2367
2368    fn from_inner(
2369        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2370        is_terminated: bool,
2371    ) -> Self {
2372        Self { inner, is_terminated }
2373    }
2374}
2375
2376impl futures::Stream for CapabilitiesRequestStream {
2377    type Item = Result<CapabilitiesRequest, fidl::Error>;
2378
2379    fn poll_next(
2380        mut self: std::pin::Pin<&mut Self>,
2381        cx: &mut std::task::Context<'_>,
2382    ) -> std::task::Poll<Option<Self::Item>> {
2383        let this = &mut *self;
2384        if this.inner.check_shutdown(cx) {
2385            this.is_terminated = true;
2386            return std::task::Poll::Ready(None);
2387        }
2388        if this.is_terminated {
2389            panic!("polled CapabilitiesRequestStream after completion");
2390        }
2391        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2392            |bytes, handles| {
2393                match this.inner.channel().read_etc(cx, bytes, handles) {
2394                    std::task::Poll::Ready(Ok(())) => {}
2395                    std::task::Poll::Pending => return std::task::Poll::Pending,
2396                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2397                        this.is_terminated = true;
2398                        return std::task::Poll::Ready(None);
2399                    }
2400                    std::task::Poll::Ready(Err(e)) => {
2401                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2402                            e.into(),
2403                        ))));
2404                    }
2405                }
2406
2407                // A message has been received from the channel
2408                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2409
2410                std::task::Poll::Ready(Some(match header.ordinal {
2411                    0xac2bc2dbd7033d1 => {
2412                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2413                        let mut req = fidl::new_empty!(
2414                            CapabilitiesConnectorCreateRequest,
2415                            fidl::encoding::DefaultFuchsiaResourceDialect
2416                        );
2417                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2418                        let control_handle =
2419                            CapabilitiesControlHandle { inner: this.inner.clone() };
2420                        Ok(CapabilitiesRequest::ConnectorCreate {
2421                            connector: req.connector,
2422                            receiver_client_end: req.receiver_client_end,
2423
2424                            responder: CapabilitiesConnectorCreateResponder {
2425                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2426                                tx_id: header.tx_id,
2427                            },
2428                        })
2429                    }
2430                    0x721911e05da2a3bf => {
2431                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2432                        let mut req = fidl::new_empty!(
2433                            CapabilitiesDirConnectorCreateRequest,
2434                            fidl::encoding::DefaultFuchsiaResourceDialect
2435                        );
2436                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2437                        let control_handle =
2438                            CapabilitiesControlHandle { inner: this.inner.clone() };
2439                        Ok(CapabilitiesRequest::DirConnectorCreate {
2440                            dir_connector: req.dir_connector,
2441                            receiver_client_end: req.receiver_client_end,
2442
2443                            responder: CapabilitiesDirConnectorCreateResponder {
2444                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2445                                tx_id: header.tx_id,
2446                            },
2447                        })
2448                    }
2449                    0x7f8bd91f0942a36e => {
2450                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2451                        let mut req = fidl::new_empty!(
2452                            CapabilitiesDictionaryCreateRequest,
2453                            fidl::encoding::DefaultFuchsiaResourceDialect
2454                        );
2455                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2456                        let control_handle =
2457                            CapabilitiesControlHandle { inner: this.inner.clone() };
2458                        Ok(CapabilitiesRequest::DictionaryCreate {
2459                            dictionary: req.dictionary,
2460
2461                            responder: CapabilitiesDictionaryCreateResponder {
2462                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2463                                tx_id: header.tx_id,
2464                            },
2465                        })
2466                    }
2467                    0x40ef43e45372ee6a => {
2468                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2469                        let mut req = fidl::new_empty!(
2470                            CapabilitiesDataCreateRequest,
2471                            fidl::encoding::DefaultFuchsiaResourceDialect
2472                        );
2473                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2474                        let control_handle =
2475                            CapabilitiesControlHandle { inner: this.inner.clone() };
2476                        Ok(CapabilitiesRequest::DataCreate {
2477                            data_handle: req.data_handle,
2478                            data: req.data,
2479
2480                            responder: CapabilitiesDataCreateResponder {
2481                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2482                                tx_id: header.tx_id,
2483                            },
2484                        })
2485                    }
2486                    0x7f7e7fbafcdf1761 => {
2487                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2488                        let mut req = fidl::new_empty!(
2489                            CapabilitiesConnectorRouterCreateRequest,
2490                            fidl::encoding::DefaultFuchsiaResourceDialect
2491                        );
2492                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2493                        let control_handle =
2494                            CapabilitiesControlHandle { inner: this.inner.clone() };
2495                        Ok(CapabilitiesRequest::ConnectorRouterCreate {
2496                            router: req.router,
2497                            router_client_end: req.router_client_end,
2498
2499                            responder: CapabilitiesConnectorRouterCreateResponder {
2500                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2501                                tx_id: header.tx_id,
2502                            },
2503                        })
2504                    }
2505                    0x56520da453fad19f => {
2506                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2507                        let mut req = fidl::new_empty!(
2508                            CapabilitiesDirConnectorRouterCreateRequest,
2509                            fidl::encoding::DefaultFuchsiaResourceDialect
2510                        );
2511                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2512                        let control_handle =
2513                            CapabilitiesControlHandle { inner: this.inner.clone() };
2514                        Ok(CapabilitiesRequest::DirConnectorRouterCreate {
2515                            router: req.router,
2516                            router_client_end: req.router_client_end,
2517
2518                            responder: CapabilitiesDirConnectorRouterCreateResponder {
2519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2520                                tx_id: header.tx_id,
2521                            },
2522                        })
2523                    }
2524                    0x37acef18cd423d42 => {
2525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2526                        let mut req = fidl::new_empty!(
2527                            CapabilitiesDictionaryRouterCreateRequest,
2528                            fidl::encoding::DefaultFuchsiaResourceDialect
2529                        );
2530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2531                        let control_handle =
2532                            CapabilitiesControlHandle { inner: this.inner.clone() };
2533                        Ok(CapabilitiesRequest::DictionaryRouterCreate {
2534                            router: req.router,
2535                            router_client_end: req.router_client_end,
2536
2537                            responder: CapabilitiesDictionaryRouterCreateResponder {
2538                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2539                                tx_id: header.tx_id,
2540                            },
2541                        })
2542                    }
2543                    0x24e471395b95088 => {
2544                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2545                        let mut req = fidl::new_empty!(
2546                            CapabilitiesDataRouterCreateRequest,
2547                            fidl::encoding::DefaultFuchsiaResourceDialect
2548                        );
2549                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2550                        let control_handle =
2551                            CapabilitiesControlHandle { inner: this.inner.clone() };
2552                        Ok(CapabilitiesRequest::DataRouterCreate {
2553                            router: req.router,
2554                            router_client_end: req.router_client_end,
2555
2556                            responder: CapabilitiesDataRouterCreateResponder {
2557                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2558                                tx_id: header.tx_id,
2559                            },
2560                        })
2561                    }
2562                    0x3576e31727c40813 => {
2563                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2564                        let mut req = fidl::new_empty!(
2565                            CapabilitiesInstanceTokenCreateRequest,
2566                            fidl::encoding::DefaultFuchsiaResourceDialect
2567                        );
2568                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesInstanceTokenCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2569                        let control_handle =
2570                            CapabilitiesControlHandle { inner: this.inner.clone() };
2571                        Ok(CapabilitiesRequest::InstanceTokenCreate {
2572                            instance_token: req.instance_token,
2573
2574                            responder: CapabilitiesInstanceTokenCreateResponder {
2575                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2576                                tx_id: header.tx_id,
2577                            },
2578                        })
2579                    }
2580                    0xc0646965f1884eb => {
2581                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2582                        let mut req = fidl::new_empty!(
2583                            CapabilitiesConnectorOpenRequest,
2584                            fidl::encoding::DefaultFuchsiaResourceDialect
2585                        );
2586                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2587                        let control_handle =
2588                            CapabilitiesControlHandle { inner: this.inner.clone() };
2589                        Ok(CapabilitiesRequest::ConnectorOpen {
2590                            connector: req.connector,
2591                            channel: req.channel,
2592
2593                            responder: CapabilitiesConnectorOpenResponder {
2594                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2595                                tx_id: header.tx_id,
2596                            },
2597                        })
2598                    }
2599                    0x1332bbf5debd6c20 => {
2600                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2601                        let mut req = fidl::new_empty!(
2602                            CapabilitiesDirConnectorOpenRequest,
2603                            fidl::encoding::DefaultFuchsiaResourceDialect
2604                        );
2605                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2606                        let control_handle =
2607                            CapabilitiesControlHandle { inner: this.inner.clone() };
2608                        Ok(CapabilitiesRequest::DirConnectorOpen {
2609                            payload: req,
2610                            responder: CapabilitiesDirConnectorOpenResponder {
2611                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2612                                tx_id: header.tx_id,
2613                            },
2614                        })
2615                    }
2616                    0x5972e3061a760e7a => {
2617                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2618                        let mut req = fidl::new_empty!(
2619                            CapabilitiesDictionaryInsertRequest,
2620                            fidl::encoding::DefaultFuchsiaResourceDialect
2621                        );
2622                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2623                        let control_handle =
2624                            CapabilitiesControlHandle { inner: this.inner.clone() };
2625                        Ok(CapabilitiesRequest::DictionaryInsert {
2626                            dictionary: req.dictionary,
2627                            key: req.key,
2628                            value: req.value,
2629
2630                            responder: CapabilitiesDictionaryInsertResponder {
2631                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2632                                tx_id: header.tx_id,
2633                            },
2634                        })
2635                    }
2636                    0x31fafe2280a283d5 => {
2637                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2638                        let mut req = fidl::new_empty!(
2639                            CapabilitiesDictionaryGetRequest,
2640                            fidl::encoding::DefaultFuchsiaResourceDialect
2641                        );
2642                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2643                        let control_handle =
2644                            CapabilitiesControlHandle { inner: this.inner.clone() };
2645                        Ok(CapabilitiesRequest::DictionaryGet {
2646                            dictionary: req.dictionary,
2647                            key: req.key,
2648                            value: req.value,
2649
2650                            responder: CapabilitiesDictionaryGetResponder {
2651                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2652                                tx_id: header.tx_id,
2653                            },
2654                        })
2655                    }
2656                    0x6827c83106ac5a2c => {
2657                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2658                        let mut req = fidl::new_empty!(
2659                            CapabilitiesDictionaryRemoveRequest,
2660                            fidl::encoding::DefaultFuchsiaResourceDialect
2661                        );
2662                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2663                        let control_handle =
2664                            CapabilitiesControlHandle { inner: this.inner.clone() };
2665                        Ok(CapabilitiesRequest::DictionaryRemove {
2666                            payload: req,
2667                            responder: CapabilitiesDictionaryRemoveResponder {
2668                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2669                                tx_id: header.tx_id,
2670                            },
2671                        })
2672                    }
2673                    0x3d4ea59c80df9bb8 => {
2674                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2675                        let mut req = fidl::new_empty!(
2676                            CapabilitiesDictionaryIterateKeysRequest,
2677                            fidl::encoding::DefaultFuchsiaResourceDialect
2678                        );
2679                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryIterateKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2680                        let control_handle =
2681                            CapabilitiesControlHandle { inner: this.inner.clone() };
2682                        Ok(CapabilitiesRequest::DictionaryIterateKeys {
2683                            dictionary: req.dictionary,
2684                            key_iterator: req.key_iterator,
2685
2686                            responder: CapabilitiesDictionaryIterateKeysResponder {
2687                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2688                                tx_id: header.tx_id,
2689                            },
2690                        })
2691                    }
2692                    0x65ae25b59f9e0daf => {
2693                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2694                        let mut req = fidl::new_empty!(
2695                            CapabilitiesDataGetRequest,
2696                            fidl::encoding::DefaultFuchsiaResourceDialect
2697                        );
2698                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataGetRequest>(&header, _body_bytes, handles, &mut req)?;
2699                        let control_handle =
2700                            CapabilitiesControlHandle { inner: this.inner.clone() };
2701                        Ok(CapabilitiesRequest::DataGet {
2702                            data_handle: req.data_handle,
2703
2704                            responder: CapabilitiesDataGetResponder {
2705                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2706                                tx_id: header.tx_id,
2707                            },
2708                        })
2709                    }
2710                    0x1bd9c6e7e3dd487e => {
2711                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2712                        let mut req = fidl::new_empty!(
2713                            CapabilitiesConnectorRouterRouteRequest,
2714                            fidl::encoding::DefaultFuchsiaResourceDialect
2715                        );
2716                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2717                        let control_handle =
2718                            CapabilitiesControlHandle { inner: this.inner.clone() };
2719                        Ok(CapabilitiesRequest::ConnectorRouterRoute {
2720                            router: req.router,
2721                            request: req.request,
2722                            instance_token: req.instance_token,
2723                            connector: req.connector,
2724
2725                            responder: CapabilitiesConnectorRouterRouteResponder {
2726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2727                                tx_id: header.tx_id,
2728                            },
2729                        })
2730                    }
2731                    0x3afdcc1b79e0799d => {
2732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2733                        let mut req = fidl::new_empty!(
2734                            CapabilitiesDirConnectorRouterRouteRequest,
2735                            fidl::encoding::DefaultFuchsiaResourceDialect
2736                        );
2737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2738                        let control_handle =
2739                            CapabilitiesControlHandle { inner: this.inner.clone() };
2740                        Ok(CapabilitiesRequest::DirConnectorRouterRoute {
2741                            router: req.router,
2742                            request: req.request,
2743                            instance_token: req.instance_token,
2744                            dir_connector: req.dir_connector,
2745
2746                            responder: CapabilitiesDirConnectorRouterRouteResponder {
2747                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2748                                tx_id: header.tx_id,
2749                            },
2750                        })
2751                    }
2752                    0xcf72de10714a708 => {
2753                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2754                        let mut req = fidl::new_empty!(
2755                            CapabilitiesDictionaryRouterRouteRequest,
2756                            fidl::encoding::DefaultFuchsiaResourceDialect
2757                        );
2758                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2759                        let control_handle =
2760                            CapabilitiesControlHandle { inner: this.inner.clone() };
2761                        Ok(CapabilitiesRequest::DictionaryRouterRoute {
2762                            router: req.router,
2763                            request: req.request,
2764                            instance_token: req.instance_token,
2765                            dictionary: req.dictionary,
2766
2767                            responder: CapabilitiesDictionaryRouterRouteResponder {
2768                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2769                                tx_id: header.tx_id,
2770                            },
2771                        })
2772                    }
2773                    0x61ab188455ed0643 => {
2774                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2775                        let mut req = fidl::new_empty!(
2776                            CapabilitiesDataRouterRouteRequest,
2777                            fidl::encoding::DefaultFuchsiaResourceDialect
2778                        );
2779                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2780                        let control_handle =
2781                            CapabilitiesControlHandle { inner: this.inner.clone() };
2782                        Ok(CapabilitiesRequest::DataRouterRoute {
2783                            router: req.router,
2784                            request: req.request,
2785                            instance_token: req.instance_token,
2786                            data: req.data,
2787
2788                            responder: CapabilitiesDataRouterRouteResponder {
2789                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2790                                tx_id: header.tx_id,
2791                            },
2792                        })
2793                    }
2794                    0x1d69bb61953d8e7 => {
2795                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2796                        let mut req = fidl::new_empty!(
2797                            CapabilitiesCapabilityAssociateHandleRequest,
2798                            fidl::encoding::DefaultFuchsiaResourceDialect
2799                        );
2800                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesCapabilityAssociateHandleRequest>(&header, _body_bytes, handles, &mut req)?;
2801                        let control_handle =
2802                            CapabilitiesControlHandle { inner: this.inner.clone() };
2803                        Ok(CapabilitiesRequest::CapabilityAssociateHandle {
2804                            capability_handle: req.capability_handle,
2805                            other_handle: req.other_handle,
2806
2807                            responder: CapabilitiesCapabilityAssociateHandleResponder {
2808                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2809                                tx_id: header.tx_id,
2810                            },
2811                        })
2812                    }
2813                    _ if header.tx_id == 0
2814                        && header
2815                            .dynamic_flags()
2816                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2817                    {
2818                        Ok(CapabilitiesRequest::_UnknownMethod {
2819                            ordinal: header.ordinal,
2820                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2821                            method_type: fidl::MethodType::OneWay,
2822                        })
2823                    }
2824                    _ if header
2825                        .dynamic_flags()
2826                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2827                    {
2828                        this.inner.send_framework_err(
2829                            fidl::encoding::FrameworkErr::UnknownMethod,
2830                            header.tx_id,
2831                            header.ordinal,
2832                            header.dynamic_flags(),
2833                            (bytes, handles),
2834                        )?;
2835                        Ok(CapabilitiesRequest::_UnknownMethod {
2836                            ordinal: header.ordinal,
2837                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2838                            method_type: fidl::MethodType::TwoWay,
2839                        })
2840                    }
2841                    _ => Err(fidl::Error::UnknownOrdinal {
2842                        ordinal: header.ordinal,
2843                        protocol_name:
2844                            <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2845                    }),
2846                }))
2847            },
2848        )
2849    }
2850}
2851
2852/// An API for creating and manipulating references to runtime capabilities in
2853/// the component framework. These capabilities are all reference counted by
2854/// component manager, and when accessed with this protocol the references are
2855/// implemented as event pair handles.
2856#[derive(Debug)]
2857pub enum CapabilitiesRequest {
2858    /// Creates a reference to a new connector capability. When the connector is
2859    /// opened, the channel given to the open call will be sent over
2860    /// `receiver_client_end`.
2861    ///
2862    /// Make sure this method returns before passing the handle's peer to other
2863    /// methods in this API. The creation may not be complete before then.
2864    ConnectorCreate {
2865        connector: fidl::EventPair,
2866        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
2867        responder: CapabilitiesConnectorCreateResponder,
2868    },
2869    /// Creates a reference to a new directory connector capability. When the
2870    /// directory connector is opened, the channel given to the open call will
2871    /// be sent over `receiver_client_end`.
2872    ///
2873    /// Make sure this method returns before passing the handle's peer to other
2874    /// methods in this API. The creation may not be complete before then.
2875    DirConnectorCreate {
2876        dir_connector: fidl::EventPair,
2877        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2878        responder: CapabilitiesDirConnectorCreateResponder,
2879    },
2880    /// Creates a reference to a new dictionary capability.
2881    ///
2882    /// Make sure this method returns before passing the handle's peer to other
2883    /// methods in this API. The creation may not be complete before then.
2884    DictionaryCreate {
2885        dictionary: fidl::EventPair,
2886        responder: CapabilitiesDictionaryCreateResponder,
2887    },
2888    /// Creates a reference to a new data capability with the given value.
2889    ///
2890    /// Make sure this method returns before passing the handle's peer to other
2891    /// methods in this API. The creation may not be complete before then.
2892    DataCreate {
2893        data_handle: fidl::EventPair,
2894        data: Data,
2895        responder: CapabilitiesDataCreateResponder,
2896    },
2897    /// Creates a reference to a new router capability that will return a
2898    /// connector capability when used.
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    ConnectorRouterCreate {
2903        router: fidl::EventPair,
2904        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
2905        responder: CapabilitiesConnectorRouterCreateResponder,
2906    },
2907    /// Creates a reference to a new router capability that will return a
2908    /// directory connector capability when used.
2909    ///
2910    /// Make sure this method returns before passing the handle's peer to other
2911    /// methods in this API. The creation may not be complete before then.
2912    DirConnectorRouterCreate {
2913        router: fidl::EventPair,
2914        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
2915        responder: CapabilitiesDirConnectorRouterCreateResponder,
2916    },
2917    /// Creates a reference to a new router capability that will return a
2918    /// dictionary capability when used.
2919    ///
2920    /// Make sure this method returns before passing the handle's peer to other
2921    /// methods in this API. The creation may not be complete before then.
2922    DictionaryRouterCreate {
2923        router: fidl::EventPair,
2924        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
2925        responder: CapabilitiesDictionaryRouterCreateResponder,
2926    },
2927    /// Creates a reference to a new router capability that will return a data
2928    /// value when used.
2929    ///
2930    /// Make sure this method returns before passing the handle's peer to other
2931    /// methods in this API. The creation may not be complete before then.
2932    DataRouterCreate {
2933        router: fidl::EventPair,
2934        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
2935        responder: CapabilitiesDataRouterCreateResponder,
2936    },
2937    /// Creates a new instance token, which is an opaque identifier associated
2938    /// with a specific component. This instance token will be associated with
2939    /// the component this connection is opened from.
2940    ///
2941    /// Make sure this method returns before passing the handle's peer to other
2942    /// methods in this API. The creation may not be complete before then.
2943    InstanceTokenCreate {
2944        instance_token: fidl::EventPair,
2945        responder: CapabilitiesInstanceTokenCreateResponder,
2946    },
2947    /// Uses the provided `connector` to open a new connection by delivering
2948    /// this channel to whoever created the connector.
2949    ///
2950    /// If there is an error, it will be reported as a zx.Status epitaph on
2951    /// `channel`.
2952    ///
2953    /// If the `connector` event pair handle is not correlated with a handle
2954    /// given to `ConnectorCreate`, this connection will be closed.
2955    ConnectorOpen {
2956        connector: fidl::EventPair,
2957        channel: fidl::Channel,
2958        responder: CapabilitiesConnectorOpenResponder,
2959    },
2960    /// Uses the provided `dir_connector` to open a new directory connection by
2961    /// delivering this channel to whoever created the directory connector.
2962    ///
2963    /// If there is an error, it will be reported as a zx.Status epitaph on
2964    /// `channel`.
2965    ///
2966    /// If the `dir_connector` event pair handle is not correlated with a handle
2967    /// given to `DirConnectorCreate`, this connection will be closed.
2968    ///
2969    /// `dir_connector` and `channel` are both required. `flags` and `path`
2970    /// may be omitted.
2971    DirConnectorOpen {
2972        payload: CapabilitiesDirConnectorOpenRequest,
2973        responder: CapabilitiesDirConnectorOpenResponder,
2974    },
2975    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
2976    /// Overwrites any existing entry.
2977    DictionaryInsert {
2978        dictionary: fidl::EventPair,
2979        key: String,
2980        value: fidl::EventPair,
2981        responder: CapabilitiesDictionaryInsertResponder,
2982    },
2983    /// Creates a new reference to the `capability` named `key` in this
2984    /// dictionary, if that capability exists. That capability will remain in
2985    /// the dictionary. To take a capability out of the dictionary, use
2986    /// `DictionaryRemove`.
2987    ///
2988    /// If `key` does not exist, `value` will not reference any capability and
2989    /// the `NO_SUCH_CAPABILITY` error value will be returned.
2990    ///
2991    /// Make sure this method returns before passing the handle's peer to other
2992    /// methods in this API. The creation may not be complete before then.
2993    DictionaryGet {
2994        dictionary: fidl::EventPair,
2995        key: String,
2996        value: fidl::EventPair,
2997        responder: CapabilitiesDictionaryGetResponder,
2998    },
2999    /// Removes the `capability` named `key` from this dictionary and returns a
3000    /// reference to it, if that capability exists.
3001    ///
3002    /// `dictionary` and `key` are required. `capability` is optional, and when
3003    /// set will become associated with the capability that was removed from the
3004    /// dictionary.
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 peer of `capability` to
3010    /// other methods in this API. The creation may not be complete before then.
3011    DictionaryRemove {
3012        payload: CapabilitiesDictionaryRemoveRequest,
3013        responder: CapabilitiesDictionaryRemoveResponder,
3014    },
3015    /// Opens an iterator which can be used to iterate over the keys of this
3016    /// dictionary.
3017    DictionaryIterateKeys {
3018        dictionary: fidl::EventPair,
3019        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3020        responder: CapabilitiesDictionaryIterateKeysResponder,
3021    },
3022    /// Returns the `Data` value that was provided to the `DataCreate` call used
3023    /// with `data_handle`.
3024    DataGet { data_handle: fidl::EventPair, responder: CapabilitiesDataGetResponder },
3025    /// Attempts to produce a `Connector` capability from this
3026    /// `ConnectorRouter`.
3027    ///
3028    /// `request` contains context for this route, and `instance_token`
3029    /// references the component that the routing operation is being performed
3030    /// for.
3031    ///
3032    /// This will return:
3033    ///
3034    /// - `SUCCESS` if `connector` has been associated with a connector.
3035    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3036    ///   `connector` will be closed.
3037    /// - An error, if the operation failed.
3038    ConnectorRouterRoute {
3039        router: fidl::EventPair,
3040        request: RouteRequest,
3041        instance_token: fidl::EventPair,
3042        connector: fidl::EventPair,
3043        responder: CapabilitiesConnectorRouterRouteResponder,
3044    },
3045    /// Attempts to produce a `DirConnector` capability from this
3046    /// `DirConnectorRouter`.
3047    ///
3048    /// `request` contains context for this route, and `instance_token`
3049    /// references the component that the routing operation is being performed
3050    /// for.
3051    ///
3052    /// This will return:
3053    ///
3054    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
3055    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3056    ///   `dir_connector` will be closed.
3057    /// - An error, if the operation failed.
3058    DirConnectorRouterRoute {
3059        router: fidl::EventPair,
3060        request: RouteRequest,
3061        instance_token: fidl::EventPair,
3062        dir_connector: fidl::EventPair,
3063        responder: CapabilitiesDirConnectorRouterRouteResponder,
3064    },
3065    /// Attempts to produce a `Dictionary` capability from this
3066    /// `DictionaryRouter`.
3067    ///
3068    /// `request` contains context for this route, and `instance_token`
3069    /// references the component that the routing operation is being performed
3070    /// for.
3071    ///
3072    /// This will return:
3073    ///
3074    /// - `SUCCESS` if `dictionary` has been associated with a connector.
3075    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3076    ///   `dictionary` will be closed.
3077    /// - An error, if the operation failed.
3078    DictionaryRouterRoute {
3079        router: fidl::EventPair,
3080        request: RouteRequest,
3081        instance_token: fidl::EventPair,
3082        dictionary: fidl::EventPair,
3083        responder: CapabilitiesDictionaryRouterRouteResponder,
3084    },
3085    /// Attempts to produce a `Data` capability from this `DataRouter`.
3086    ///
3087    /// `request` contains context for this route, and `instance_token`
3088    /// references the component that the routing operation is being performed
3089    /// for.
3090    ///
3091    /// This will return:
3092    ///
3093    /// - `SUCCESS` if `data` has been associated with a connector.
3094    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
3095    ///   will be closed.
3096    /// - An error, if the operation failed.
3097    DataRouterRoute {
3098        router: fidl::EventPair,
3099        request: RouteRequest,
3100        instance_token: fidl::EventPair,
3101        data: fidl::EventPair,
3102        responder: CapabilitiesDataRouterRouteResponder,
3103    },
3104    /// Associates `other_handle` with the same capability referenced by
3105    /// `capability_handle`.
3106    ///
3107    /// Typically if one already has `capability_handle` the handle can be
3108    /// duplicated to make a new handle that references the same object, but
3109    /// this doesn't work when someone else has provided a handle that should be
3110    /// associated with an existing object.
3111    CapabilityAssociateHandle {
3112        capability_handle: fidl::EventPair,
3113        other_handle: fidl::EventPair,
3114        responder: CapabilitiesCapabilityAssociateHandleResponder,
3115    },
3116    /// An interaction was received which does not match any known method.
3117    #[non_exhaustive]
3118    _UnknownMethod {
3119        /// Ordinal of the method that was called.
3120        ordinal: u64,
3121        control_handle: CapabilitiesControlHandle,
3122        method_type: fidl::MethodType,
3123    },
3124}
3125
3126impl CapabilitiesRequest {
3127    #[allow(irrefutable_let_patterns)]
3128    pub fn into_connector_create(
3129        self,
3130    ) -> Option<(
3131        fidl::EventPair,
3132        fidl::endpoints::ClientEnd<ReceiverMarker>,
3133        CapabilitiesConnectorCreateResponder,
3134    )> {
3135        if let CapabilitiesRequest::ConnectorCreate { connector, receiver_client_end, responder } =
3136            self
3137        {
3138            Some((connector, receiver_client_end, responder))
3139        } else {
3140            None
3141        }
3142    }
3143
3144    #[allow(irrefutable_let_patterns)]
3145    pub fn into_dir_connector_create(
3146        self,
3147    ) -> Option<(
3148        fidl::EventPair,
3149        fidl::endpoints::ClientEnd<DirReceiverMarker>,
3150        CapabilitiesDirConnectorCreateResponder,
3151    )> {
3152        if let CapabilitiesRequest::DirConnectorCreate {
3153            dir_connector,
3154            receiver_client_end,
3155            responder,
3156        } = self
3157        {
3158            Some((dir_connector, receiver_client_end, responder))
3159        } else {
3160            None
3161        }
3162    }
3163
3164    #[allow(irrefutable_let_patterns)]
3165    pub fn into_dictionary_create(
3166        self,
3167    ) -> Option<(fidl::EventPair, CapabilitiesDictionaryCreateResponder)> {
3168        if let CapabilitiesRequest::DictionaryCreate { dictionary, responder } = self {
3169            Some((dictionary, responder))
3170        } else {
3171            None
3172        }
3173    }
3174
3175    #[allow(irrefutable_let_patterns)]
3176    pub fn into_data_create(
3177        self,
3178    ) -> Option<(fidl::EventPair, Data, CapabilitiesDataCreateResponder)> {
3179        if let CapabilitiesRequest::DataCreate { data_handle, data, responder } = self {
3180            Some((data_handle, data, responder))
3181        } else {
3182            None
3183        }
3184    }
3185
3186    #[allow(irrefutable_let_patterns)]
3187    pub fn into_connector_router_create(
3188        self,
3189    ) -> Option<(
3190        fidl::EventPair,
3191        fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
3192        CapabilitiesConnectorRouterCreateResponder,
3193    )> {
3194        if let CapabilitiesRequest::ConnectorRouterCreate { router, router_client_end, responder } =
3195            self
3196        {
3197            Some((router, router_client_end, responder))
3198        } else {
3199            None
3200        }
3201    }
3202
3203    #[allow(irrefutable_let_patterns)]
3204    pub fn into_dir_connector_router_create(
3205        self,
3206    ) -> Option<(
3207        fidl::EventPair,
3208        fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
3209        CapabilitiesDirConnectorRouterCreateResponder,
3210    )> {
3211        if let CapabilitiesRequest::DirConnectorRouterCreate {
3212            router,
3213            router_client_end,
3214            responder,
3215        } = self
3216        {
3217            Some((router, router_client_end, responder))
3218        } else {
3219            None
3220        }
3221    }
3222
3223    #[allow(irrefutable_let_patterns)]
3224    pub fn into_dictionary_router_create(
3225        self,
3226    ) -> Option<(
3227        fidl::EventPair,
3228        fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
3229        CapabilitiesDictionaryRouterCreateResponder,
3230    )> {
3231        if let CapabilitiesRequest::DictionaryRouterCreate {
3232            router,
3233            router_client_end,
3234            responder,
3235        } = self
3236        {
3237            Some((router, router_client_end, responder))
3238        } else {
3239            None
3240        }
3241    }
3242
3243    #[allow(irrefutable_let_patterns)]
3244    pub fn into_data_router_create(
3245        self,
3246    ) -> Option<(
3247        fidl::EventPair,
3248        fidl::endpoints::ClientEnd<DataRouterMarker>,
3249        CapabilitiesDataRouterCreateResponder,
3250    )> {
3251        if let CapabilitiesRequest::DataRouterCreate { router, router_client_end, responder } = self
3252        {
3253            Some((router, router_client_end, responder))
3254        } else {
3255            None
3256        }
3257    }
3258
3259    #[allow(irrefutable_let_patterns)]
3260    pub fn into_instance_token_create(
3261        self,
3262    ) -> Option<(fidl::EventPair, CapabilitiesInstanceTokenCreateResponder)> {
3263        if let CapabilitiesRequest::InstanceTokenCreate { instance_token, responder } = self {
3264            Some((instance_token, responder))
3265        } else {
3266            None
3267        }
3268    }
3269
3270    #[allow(irrefutable_let_patterns)]
3271    pub fn into_connector_open(
3272        self,
3273    ) -> Option<(fidl::EventPair, fidl::Channel, CapabilitiesConnectorOpenResponder)> {
3274        if let CapabilitiesRequest::ConnectorOpen { connector, channel, responder } = self {
3275            Some((connector, channel, responder))
3276        } else {
3277            None
3278        }
3279    }
3280
3281    #[allow(irrefutable_let_patterns)]
3282    pub fn into_dir_connector_open(
3283        self,
3284    ) -> Option<(CapabilitiesDirConnectorOpenRequest, CapabilitiesDirConnectorOpenResponder)> {
3285        if let CapabilitiesRequest::DirConnectorOpen { payload, responder } = self {
3286            Some((payload, responder))
3287        } else {
3288            None
3289        }
3290    }
3291
3292    #[allow(irrefutable_let_patterns)]
3293    pub fn into_dictionary_insert(
3294        self,
3295    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryInsertResponder)>
3296    {
3297        if let CapabilitiesRequest::DictionaryInsert { dictionary, key, value, responder } = self {
3298            Some((dictionary, key, value, responder))
3299        } else {
3300            None
3301        }
3302    }
3303
3304    #[allow(irrefutable_let_patterns)]
3305    pub fn into_dictionary_get(
3306        self,
3307    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryGetResponder)>
3308    {
3309        if let CapabilitiesRequest::DictionaryGet { dictionary, key, value, responder } = self {
3310            Some((dictionary, key, value, responder))
3311        } else {
3312            None
3313        }
3314    }
3315
3316    #[allow(irrefutable_let_patterns)]
3317    pub fn into_dictionary_remove(
3318        self,
3319    ) -> Option<(CapabilitiesDictionaryRemoveRequest, CapabilitiesDictionaryRemoveResponder)> {
3320        if let CapabilitiesRequest::DictionaryRemove { payload, responder } = self {
3321            Some((payload, responder))
3322        } else {
3323            None
3324        }
3325    }
3326
3327    #[allow(irrefutable_let_patterns)]
3328    pub fn into_dictionary_iterate_keys(
3329        self,
3330    ) -> Option<(
3331        fidl::EventPair,
3332        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3333        CapabilitiesDictionaryIterateKeysResponder,
3334    )> {
3335        if let CapabilitiesRequest::DictionaryIterateKeys { dictionary, key_iterator, responder } =
3336            self
3337        {
3338            Some((dictionary, key_iterator, responder))
3339        } else {
3340            None
3341        }
3342    }
3343
3344    #[allow(irrefutable_let_patterns)]
3345    pub fn into_data_get(self) -> Option<(fidl::EventPair, CapabilitiesDataGetResponder)> {
3346        if let CapabilitiesRequest::DataGet { data_handle, responder } = self {
3347            Some((data_handle, responder))
3348        } else {
3349            None
3350        }
3351    }
3352
3353    #[allow(irrefutable_let_patterns)]
3354    pub fn into_connector_router_route(
3355        self,
3356    ) -> Option<(
3357        fidl::EventPair,
3358        RouteRequest,
3359        fidl::EventPair,
3360        fidl::EventPair,
3361        CapabilitiesConnectorRouterRouteResponder,
3362    )> {
3363        if let CapabilitiesRequest::ConnectorRouterRoute {
3364            router,
3365            request,
3366            instance_token,
3367            connector,
3368            responder,
3369        } = self
3370        {
3371            Some((router, request, instance_token, connector, responder))
3372        } else {
3373            None
3374        }
3375    }
3376
3377    #[allow(irrefutable_let_patterns)]
3378    pub fn into_dir_connector_router_route(
3379        self,
3380    ) -> Option<(
3381        fidl::EventPair,
3382        RouteRequest,
3383        fidl::EventPair,
3384        fidl::EventPair,
3385        CapabilitiesDirConnectorRouterRouteResponder,
3386    )> {
3387        if let CapabilitiesRequest::DirConnectorRouterRoute {
3388            router,
3389            request,
3390            instance_token,
3391            dir_connector,
3392            responder,
3393        } = self
3394        {
3395            Some((router, request, instance_token, dir_connector, responder))
3396        } else {
3397            None
3398        }
3399    }
3400
3401    #[allow(irrefutable_let_patterns)]
3402    pub fn into_dictionary_router_route(
3403        self,
3404    ) -> Option<(
3405        fidl::EventPair,
3406        RouteRequest,
3407        fidl::EventPair,
3408        fidl::EventPair,
3409        CapabilitiesDictionaryRouterRouteResponder,
3410    )> {
3411        if let CapabilitiesRequest::DictionaryRouterRoute {
3412            router,
3413            request,
3414            instance_token,
3415            dictionary,
3416            responder,
3417        } = self
3418        {
3419            Some((router, request, instance_token, dictionary, responder))
3420        } else {
3421            None
3422        }
3423    }
3424
3425    #[allow(irrefutable_let_patterns)]
3426    pub fn into_data_router_route(
3427        self,
3428    ) -> Option<(
3429        fidl::EventPair,
3430        RouteRequest,
3431        fidl::EventPair,
3432        fidl::EventPair,
3433        CapabilitiesDataRouterRouteResponder,
3434    )> {
3435        if let CapabilitiesRequest::DataRouterRoute {
3436            router,
3437            request,
3438            instance_token,
3439            data,
3440            responder,
3441        } = self
3442        {
3443            Some((router, request, instance_token, data, responder))
3444        } else {
3445            None
3446        }
3447    }
3448
3449    #[allow(irrefutable_let_patterns)]
3450    pub fn into_capability_associate_handle(
3451        self,
3452    ) -> Option<(fidl::EventPair, fidl::EventPair, CapabilitiesCapabilityAssociateHandleResponder)>
3453    {
3454        if let CapabilitiesRequest::CapabilityAssociateHandle {
3455            capability_handle,
3456            other_handle,
3457            responder,
3458        } = self
3459        {
3460            Some((capability_handle, other_handle, responder))
3461        } else {
3462            None
3463        }
3464    }
3465
3466    /// Name of the method defined in FIDL
3467    pub fn method_name(&self) -> &'static str {
3468        match *self {
3469            CapabilitiesRequest::ConnectorCreate { .. } => "connector_create",
3470            CapabilitiesRequest::DirConnectorCreate { .. } => "dir_connector_create",
3471            CapabilitiesRequest::DictionaryCreate { .. } => "dictionary_create",
3472            CapabilitiesRequest::DataCreate { .. } => "data_create",
3473            CapabilitiesRequest::ConnectorRouterCreate { .. } => "connector_router_create",
3474            CapabilitiesRequest::DirConnectorRouterCreate { .. } => "dir_connector_router_create",
3475            CapabilitiesRequest::DictionaryRouterCreate { .. } => "dictionary_router_create",
3476            CapabilitiesRequest::DataRouterCreate { .. } => "data_router_create",
3477            CapabilitiesRequest::InstanceTokenCreate { .. } => "instance_token_create",
3478            CapabilitiesRequest::ConnectorOpen { .. } => "connector_open",
3479            CapabilitiesRequest::DirConnectorOpen { .. } => "dir_connector_open",
3480            CapabilitiesRequest::DictionaryInsert { .. } => "dictionary_insert",
3481            CapabilitiesRequest::DictionaryGet { .. } => "dictionary_get",
3482            CapabilitiesRequest::DictionaryRemove { .. } => "dictionary_remove",
3483            CapabilitiesRequest::DictionaryIterateKeys { .. } => "dictionary_iterate_keys",
3484            CapabilitiesRequest::DataGet { .. } => "data_get",
3485            CapabilitiesRequest::ConnectorRouterRoute { .. } => "connector_router_route",
3486            CapabilitiesRequest::DirConnectorRouterRoute { .. } => "dir_connector_router_route",
3487            CapabilitiesRequest::DictionaryRouterRoute { .. } => "dictionary_router_route",
3488            CapabilitiesRequest::DataRouterRoute { .. } => "data_router_route",
3489            CapabilitiesRequest::CapabilityAssociateHandle { .. } => "capability_associate_handle",
3490            CapabilitiesRequest::_UnknownMethod {
3491                method_type: fidl::MethodType::OneWay, ..
3492            } => "unknown one-way method",
3493            CapabilitiesRequest::_UnknownMethod {
3494                method_type: fidl::MethodType::TwoWay, ..
3495            } => "unknown two-way method",
3496        }
3497    }
3498}
3499
3500#[derive(Debug, Clone)]
3501pub struct CapabilitiesControlHandle {
3502    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3503}
3504
3505impl fidl::endpoints::ControlHandle for CapabilitiesControlHandle {
3506    fn shutdown(&self) {
3507        self.inner.shutdown()
3508    }
3509
3510    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3511        self.inner.shutdown_with_epitaph(status)
3512    }
3513
3514    fn is_closed(&self) -> bool {
3515        self.inner.channel().is_closed()
3516    }
3517    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3518        self.inner.channel().on_closed()
3519    }
3520
3521    #[cfg(target_os = "fuchsia")]
3522    fn signal_peer(
3523        &self,
3524        clear_mask: zx::Signals,
3525        set_mask: zx::Signals,
3526    ) -> Result<(), zx_status::Status> {
3527        use fidl::Peered;
3528        self.inner.channel().signal_peer(clear_mask, set_mask)
3529    }
3530}
3531
3532impl CapabilitiesControlHandle {}
3533
3534#[must_use = "FIDL methods require a response to be sent"]
3535#[derive(Debug)]
3536pub struct CapabilitiesConnectorCreateResponder {
3537    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3538    tx_id: u32,
3539}
3540
3541/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3542/// if the responder is dropped without sending a response, so that the client
3543/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3544impl std::ops::Drop for CapabilitiesConnectorCreateResponder {
3545    fn drop(&mut self) {
3546        self.control_handle.shutdown();
3547        // Safety: drops once, never accessed again
3548        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3549    }
3550}
3551
3552impl fidl::endpoints::Responder for CapabilitiesConnectorCreateResponder {
3553    type ControlHandle = CapabilitiesControlHandle;
3554
3555    fn control_handle(&self) -> &CapabilitiesControlHandle {
3556        &self.control_handle
3557    }
3558
3559    fn drop_without_shutdown(mut self) {
3560        // Safety: drops once, never accessed again due to mem::forget
3561        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3562        // Prevent Drop from running (which would shut down the channel)
3563        std::mem::forget(self);
3564    }
3565}
3566
3567impl CapabilitiesConnectorCreateResponder {
3568    /// Sends a response to the FIDL transaction.
3569    ///
3570    /// Sets the channel to shutdown if an error occurs.
3571    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3572        let _result = self.send_raw(result);
3573        if _result.is_err() {
3574            self.control_handle.shutdown();
3575        }
3576        self.drop_without_shutdown();
3577        _result
3578    }
3579
3580    /// Similar to "send" but does not shutdown the channel if an error occurs.
3581    pub fn send_no_shutdown_on_err(
3582        self,
3583        mut result: Result<(), CapabilitiesError>,
3584    ) -> Result<(), fidl::Error> {
3585        let _result = self.send_raw(result);
3586        self.drop_without_shutdown();
3587        _result
3588    }
3589
3590    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3591        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3592            fidl::encoding::EmptyStruct,
3593            CapabilitiesError,
3594        >>(
3595            fidl::encoding::FlexibleResult::new(result),
3596            self.tx_id,
3597            0xac2bc2dbd7033d1,
3598            fidl::encoding::DynamicFlags::FLEXIBLE,
3599        )
3600    }
3601}
3602
3603#[must_use = "FIDL methods require a response to be sent"]
3604#[derive(Debug)]
3605pub struct CapabilitiesDirConnectorCreateResponder {
3606    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3607    tx_id: u32,
3608}
3609
3610/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3611/// if the responder is dropped without sending a response, so that the client
3612/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3613impl std::ops::Drop for CapabilitiesDirConnectorCreateResponder {
3614    fn drop(&mut self) {
3615        self.control_handle.shutdown();
3616        // Safety: drops once, never accessed again
3617        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3618    }
3619}
3620
3621impl fidl::endpoints::Responder for CapabilitiesDirConnectorCreateResponder {
3622    type ControlHandle = CapabilitiesControlHandle;
3623
3624    fn control_handle(&self) -> &CapabilitiesControlHandle {
3625        &self.control_handle
3626    }
3627
3628    fn drop_without_shutdown(mut self) {
3629        // Safety: drops once, never accessed again due to mem::forget
3630        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3631        // Prevent Drop from running (which would shut down the channel)
3632        std::mem::forget(self);
3633    }
3634}
3635
3636impl CapabilitiesDirConnectorCreateResponder {
3637    /// Sends a response to the FIDL transaction.
3638    ///
3639    /// Sets the channel to shutdown if an error occurs.
3640    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3641        let _result = self.send_raw(result);
3642        if _result.is_err() {
3643            self.control_handle.shutdown();
3644        }
3645        self.drop_without_shutdown();
3646        _result
3647    }
3648
3649    /// Similar to "send" but does not shutdown the channel if an error occurs.
3650    pub fn send_no_shutdown_on_err(
3651        self,
3652        mut result: Result<(), CapabilitiesError>,
3653    ) -> Result<(), fidl::Error> {
3654        let _result = self.send_raw(result);
3655        self.drop_without_shutdown();
3656        _result
3657    }
3658
3659    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3660        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3661            fidl::encoding::EmptyStruct,
3662            CapabilitiesError,
3663        >>(
3664            fidl::encoding::FlexibleResult::new(result),
3665            self.tx_id,
3666            0x721911e05da2a3bf,
3667            fidl::encoding::DynamicFlags::FLEXIBLE,
3668        )
3669    }
3670}
3671
3672#[must_use = "FIDL methods require a response to be sent"]
3673#[derive(Debug)]
3674pub struct CapabilitiesDictionaryCreateResponder {
3675    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3676    tx_id: u32,
3677}
3678
3679/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3680/// if the responder is dropped without sending a response, so that the client
3681/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3682impl std::ops::Drop for CapabilitiesDictionaryCreateResponder {
3683    fn drop(&mut self) {
3684        self.control_handle.shutdown();
3685        // Safety: drops once, never accessed again
3686        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3687    }
3688}
3689
3690impl fidl::endpoints::Responder for CapabilitiesDictionaryCreateResponder {
3691    type ControlHandle = CapabilitiesControlHandle;
3692
3693    fn control_handle(&self) -> &CapabilitiesControlHandle {
3694        &self.control_handle
3695    }
3696
3697    fn drop_without_shutdown(mut self) {
3698        // Safety: drops once, never accessed again due to mem::forget
3699        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3700        // Prevent Drop from running (which would shut down the channel)
3701        std::mem::forget(self);
3702    }
3703}
3704
3705impl CapabilitiesDictionaryCreateResponder {
3706    /// Sends a response to the FIDL transaction.
3707    ///
3708    /// Sets the channel to shutdown if an error occurs.
3709    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3710        let _result = self.send_raw(result);
3711        if _result.is_err() {
3712            self.control_handle.shutdown();
3713        }
3714        self.drop_without_shutdown();
3715        _result
3716    }
3717
3718    /// Similar to "send" but does not shutdown the channel if an error occurs.
3719    pub fn send_no_shutdown_on_err(
3720        self,
3721        mut result: Result<(), CapabilitiesError>,
3722    ) -> Result<(), fidl::Error> {
3723        let _result = self.send_raw(result);
3724        self.drop_without_shutdown();
3725        _result
3726    }
3727
3728    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3729        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3730            fidl::encoding::EmptyStruct,
3731            CapabilitiesError,
3732        >>(
3733            fidl::encoding::FlexibleResult::new(result),
3734            self.tx_id,
3735            0x7f8bd91f0942a36e,
3736            fidl::encoding::DynamicFlags::FLEXIBLE,
3737        )
3738    }
3739}
3740
3741#[must_use = "FIDL methods require a response to be sent"]
3742#[derive(Debug)]
3743pub struct CapabilitiesDataCreateResponder {
3744    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3745    tx_id: u32,
3746}
3747
3748/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3749/// if the responder is dropped without sending a response, so that the client
3750/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3751impl std::ops::Drop for CapabilitiesDataCreateResponder {
3752    fn drop(&mut self) {
3753        self.control_handle.shutdown();
3754        // Safety: drops once, never accessed again
3755        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3756    }
3757}
3758
3759impl fidl::endpoints::Responder for CapabilitiesDataCreateResponder {
3760    type ControlHandle = CapabilitiesControlHandle;
3761
3762    fn control_handle(&self) -> &CapabilitiesControlHandle {
3763        &self.control_handle
3764    }
3765
3766    fn drop_without_shutdown(mut self) {
3767        // Safety: drops once, never accessed again due to mem::forget
3768        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3769        // Prevent Drop from running (which would shut down the channel)
3770        std::mem::forget(self);
3771    }
3772}
3773
3774impl CapabilitiesDataCreateResponder {
3775    /// Sends a response to the FIDL transaction.
3776    ///
3777    /// Sets the channel to shutdown if an error occurs.
3778    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3779        let _result = self.send_raw(result);
3780        if _result.is_err() {
3781            self.control_handle.shutdown();
3782        }
3783        self.drop_without_shutdown();
3784        _result
3785    }
3786
3787    /// Similar to "send" but does not shutdown the channel if an error occurs.
3788    pub fn send_no_shutdown_on_err(
3789        self,
3790        mut result: Result<(), CapabilitiesError>,
3791    ) -> Result<(), fidl::Error> {
3792        let _result = self.send_raw(result);
3793        self.drop_without_shutdown();
3794        _result
3795    }
3796
3797    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3798        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3799            fidl::encoding::EmptyStruct,
3800            CapabilitiesError,
3801        >>(
3802            fidl::encoding::FlexibleResult::new(result),
3803            self.tx_id,
3804            0x40ef43e45372ee6a,
3805            fidl::encoding::DynamicFlags::FLEXIBLE,
3806        )
3807    }
3808}
3809
3810#[must_use = "FIDL methods require a response to be sent"]
3811#[derive(Debug)]
3812pub struct CapabilitiesConnectorRouterCreateResponder {
3813    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3814    tx_id: u32,
3815}
3816
3817/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3818/// if the responder is dropped without sending a response, so that the client
3819/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3820impl std::ops::Drop for CapabilitiesConnectorRouterCreateResponder {
3821    fn drop(&mut self) {
3822        self.control_handle.shutdown();
3823        // Safety: drops once, never accessed again
3824        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3825    }
3826}
3827
3828impl fidl::endpoints::Responder for CapabilitiesConnectorRouterCreateResponder {
3829    type ControlHandle = CapabilitiesControlHandle;
3830
3831    fn control_handle(&self) -> &CapabilitiesControlHandle {
3832        &self.control_handle
3833    }
3834
3835    fn drop_without_shutdown(mut self) {
3836        // Safety: drops once, never accessed again due to mem::forget
3837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3838        // Prevent Drop from running (which would shut down the channel)
3839        std::mem::forget(self);
3840    }
3841}
3842
3843impl CapabilitiesConnectorRouterCreateResponder {
3844    /// Sends a response to the FIDL transaction.
3845    ///
3846    /// Sets the channel to shutdown if an error occurs.
3847    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3848        let _result = self.send_raw(result);
3849        if _result.is_err() {
3850            self.control_handle.shutdown();
3851        }
3852        self.drop_without_shutdown();
3853        _result
3854    }
3855
3856    /// Similar to "send" but does not shutdown the channel if an error occurs.
3857    pub fn send_no_shutdown_on_err(
3858        self,
3859        mut result: Result<(), CapabilitiesError>,
3860    ) -> Result<(), fidl::Error> {
3861        let _result = self.send_raw(result);
3862        self.drop_without_shutdown();
3863        _result
3864    }
3865
3866    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3867        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3868            fidl::encoding::EmptyStruct,
3869            CapabilitiesError,
3870        >>(
3871            fidl::encoding::FlexibleResult::new(result),
3872            self.tx_id,
3873            0x7f7e7fbafcdf1761,
3874            fidl::encoding::DynamicFlags::FLEXIBLE,
3875        )
3876    }
3877}
3878
3879#[must_use = "FIDL methods require a response to be sent"]
3880#[derive(Debug)]
3881pub struct CapabilitiesDirConnectorRouterCreateResponder {
3882    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3883    tx_id: u32,
3884}
3885
3886/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3887/// if the responder is dropped without sending a response, so that the client
3888/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3889impl std::ops::Drop for CapabilitiesDirConnectorRouterCreateResponder {
3890    fn drop(&mut self) {
3891        self.control_handle.shutdown();
3892        // Safety: drops once, never accessed again
3893        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3894    }
3895}
3896
3897impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterCreateResponder {
3898    type ControlHandle = CapabilitiesControlHandle;
3899
3900    fn control_handle(&self) -> &CapabilitiesControlHandle {
3901        &self.control_handle
3902    }
3903
3904    fn drop_without_shutdown(mut self) {
3905        // Safety: drops once, never accessed again due to mem::forget
3906        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3907        // Prevent Drop from running (which would shut down the channel)
3908        std::mem::forget(self);
3909    }
3910}
3911
3912impl CapabilitiesDirConnectorRouterCreateResponder {
3913    /// Sends a response to the FIDL transaction.
3914    ///
3915    /// Sets the channel to shutdown if an error occurs.
3916    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3917        let _result = self.send_raw(result);
3918        if _result.is_err() {
3919            self.control_handle.shutdown();
3920        }
3921        self.drop_without_shutdown();
3922        _result
3923    }
3924
3925    /// Similar to "send" but does not shutdown the channel if an error occurs.
3926    pub fn send_no_shutdown_on_err(
3927        self,
3928        mut result: Result<(), CapabilitiesError>,
3929    ) -> Result<(), fidl::Error> {
3930        let _result = self.send_raw(result);
3931        self.drop_without_shutdown();
3932        _result
3933    }
3934
3935    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3936        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3937            fidl::encoding::EmptyStruct,
3938            CapabilitiesError,
3939        >>(
3940            fidl::encoding::FlexibleResult::new(result),
3941            self.tx_id,
3942            0x56520da453fad19f,
3943            fidl::encoding::DynamicFlags::FLEXIBLE,
3944        )
3945    }
3946}
3947
3948#[must_use = "FIDL methods require a response to be sent"]
3949#[derive(Debug)]
3950pub struct CapabilitiesDictionaryRouterCreateResponder {
3951    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3952    tx_id: u32,
3953}
3954
3955/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3956/// if the responder is dropped without sending a response, so that the client
3957/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3958impl std::ops::Drop for CapabilitiesDictionaryRouterCreateResponder {
3959    fn drop(&mut self) {
3960        self.control_handle.shutdown();
3961        // Safety: drops once, never accessed again
3962        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3963    }
3964}
3965
3966impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterCreateResponder {
3967    type ControlHandle = CapabilitiesControlHandle;
3968
3969    fn control_handle(&self) -> &CapabilitiesControlHandle {
3970        &self.control_handle
3971    }
3972
3973    fn drop_without_shutdown(mut self) {
3974        // Safety: drops once, never accessed again due to mem::forget
3975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3976        // Prevent Drop from running (which would shut down the channel)
3977        std::mem::forget(self);
3978    }
3979}
3980
3981impl CapabilitiesDictionaryRouterCreateResponder {
3982    /// Sends a response to the FIDL transaction.
3983    ///
3984    /// Sets the channel to shutdown if an error occurs.
3985    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3986        let _result = self.send_raw(result);
3987        if _result.is_err() {
3988            self.control_handle.shutdown();
3989        }
3990        self.drop_without_shutdown();
3991        _result
3992    }
3993
3994    /// Similar to "send" but does not shutdown the channel if an error occurs.
3995    pub fn send_no_shutdown_on_err(
3996        self,
3997        mut result: Result<(), CapabilitiesError>,
3998    ) -> Result<(), fidl::Error> {
3999        let _result = self.send_raw(result);
4000        self.drop_without_shutdown();
4001        _result
4002    }
4003
4004    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4005        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4006            fidl::encoding::EmptyStruct,
4007            CapabilitiesError,
4008        >>(
4009            fidl::encoding::FlexibleResult::new(result),
4010            self.tx_id,
4011            0x37acef18cd423d42,
4012            fidl::encoding::DynamicFlags::FLEXIBLE,
4013        )
4014    }
4015}
4016
4017#[must_use = "FIDL methods require a response to be sent"]
4018#[derive(Debug)]
4019pub struct CapabilitiesDataRouterCreateResponder {
4020    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4021    tx_id: u32,
4022}
4023
4024/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4025/// if the responder is dropped without sending a response, so that the client
4026/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4027impl std::ops::Drop for CapabilitiesDataRouterCreateResponder {
4028    fn drop(&mut self) {
4029        self.control_handle.shutdown();
4030        // Safety: drops once, never accessed again
4031        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4032    }
4033}
4034
4035impl fidl::endpoints::Responder for CapabilitiesDataRouterCreateResponder {
4036    type ControlHandle = CapabilitiesControlHandle;
4037
4038    fn control_handle(&self) -> &CapabilitiesControlHandle {
4039        &self.control_handle
4040    }
4041
4042    fn drop_without_shutdown(mut self) {
4043        // Safety: drops once, never accessed again due to mem::forget
4044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4045        // Prevent Drop from running (which would shut down the channel)
4046        std::mem::forget(self);
4047    }
4048}
4049
4050impl CapabilitiesDataRouterCreateResponder {
4051    /// Sends a response to the FIDL transaction.
4052    ///
4053    /// Sets the channel to shutdown if an error occurs.
4054    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4055        let _result = self.send_raw(result);
4056        if _result.is_err() {
4057            self.control_handle.shutdown();
4058        }
4059        self.drop_without_shutdown();
4060        _result
4061    }
4062
4063    /// Similar to "send" but does not shutdown the channel if an error occurs.
4064    pub fn send_no_shutdown_on_err(
4065        self,
4066        mut result: Result<(), CapabilitiesError>,
4067    ) -> Result<(), fidl::Error> {
4068        let _result = self.send_raw(result);
4069        self.drop_without_shutdown();
4070        _result
4071    }
4072
4073    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4074        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4075            fidl::encoding::EmptyStruct,
4076            CapabilitiesError,
4077        >>(
4078            fidl::encoding::FlexibleResult::new(result),
4079            self.tx_id,
4080            0x24e471395b95088,
4081            fidl::encoding::DynamicFlags::FLEXIBLE,
4082        )
4083    }
4084}
4085
4086#[must_use = "FIDL methods require a response to be sent"]
4087#[derive(Debug)]
4088pub struct CapabilitiesInstanceTokenCreateResponder {
4089    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4090    tx_id: u32,
4091}
4092
4093/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4094/// if the responder is dropped without sending a response, so that the client
4095/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4096impl std::ops::Drop for CapabilitiesInstanceTokenCreateResponder {
4097    fn drop(&mut self) {
4098        self.control_handle.shutdown();
4099        // Safety: drops once, never accessed again
4100        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4101    }
4102}
4103
4104impl fidl::endpoints::Responder for CapabilitiesInstanceTokenCreateResponder {
4105    type ControlHandle = CapabilitiesControlHandle;
4106
4107    fn control_handle(&self) -> &CapabilitiesControlHandle {
4108        &self.control_handle
4109    }
4110
4111    fn drop_without_shutdown(mut self) {
4112        // Safety: drops once, never accessed again due to mem::forget
4113        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4114        // Prevent Drop from running (which would shut down the channel)
4115        std::mem::forget(self);
4116    }
4117}
4118
4119impl CapabilitiesInstanceTokenCreateResponder {
4120    /// Sends a response to the FIDL transaction.
4121    ///
4122    /// Sets the channel to shutdown if an error occurs.
4123    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4124        let _result = self.send_raw(result);
4125        if _result.is_err() {
4126            self.control_handle.shutdown();
4127        }
4128        self.drop_without_shutdown();
4129        _result
4130    }
4131
4132    /// Similar to "send" but does not shutdown the channel if an error occurs.
4133    pub fn send_no_shutdown_on_err(
4134        self,
4135        mut result: Result<(), CapabilitiesError>,
4136    ) -> Result<(), fidl::Error> {
4137        let _result = self.send_raw(result);
4138        self.drop_without_shutdown();
4139        _result
4140    }
4141
4142    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4143        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4144            fidl::encoding::EmptyStruct,
4145            CapabilitiesError,
4146        >>(
4147            fidl::encoding::FlexibleResult::new(result),
4148            self.tx_id,
4149            0x3576e31727c40813,
4150            fidl::encoding::DynamicFlags::FLEXIBLE,
4151        )
4152    }
4153}
4154
4155#[must_use = "FIDL methods require a response to be sent"]
4156#[derive(Debug)]
4157pub struct CapabilitiesConnectorOpenResponder {
4158    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4159    tx_id: u32,
4160}
4161
4162/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4163/// if the responder is dropped without sending a response, so that the client
4164/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4165impl std::ops::Drop for CapabilitiesConnectorOpenResponder {
4166    fn drop(&mut self) {
4167        self.control_handle.shutdown();
4168        // Safety: drops once, never accessed again
4169        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4170    }
4171}
4172
4173impl fidl::endpoints::Responder for CapabilitiesConnectorOpenResponder {
4174    type ControlHandle = CapabilitiesControlHandle;
4175
4176    fn control_handle(&self) -> &CapabilitiesControlHandle {
4177        &self.control_handle
4178    }
4179
4180    fn drop_without_shutdown(mut self) {
4181        // Safety: drops once, never accessed again due to mem::forget
4182        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4183        // Prevent Drop from running (which would shut down the channel)
4184        std::mem::forget(self);
4185    }
4186}
4187
4188impl CapabilitiesConnectorOpenResponder {
4189    /// Sends a response to the FIDL transaction.
4190    ///
4191    /// Sets the channel to shutdown if an error occurs.
4192    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4193        let _result = self.send_raw(result);
4194        if _result.is_err() {
4195            self.control_handle.shutdown();
4196        }
4197        self.drop_without_shutdown();
4198        _result
4199    }
4200
4201    /// Similar to "send" but does not shutdown the channel if an error occurs.
4202    pub fn send_no_shutdown_on_err(
4203        self,
4204        mut result: Result<(), CapabilitiesError>,
4205    ) -> Result<(), fidl::Error> {
4206        let _result = self.send_raw(result);
4207        self.drop_without_shutdown();
4208        _result
4209    }
4210
4211    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4212        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4213            fidl::encoding::EmptyStruct,
4214            CapabilitiesError,
4215        >>(
4216            fidl::encoding::FlexibleResult::new(result),
4217            self.tx_id,
4218            0xc0646965f1884eb,
4219            fidl::encoding::DynamicFlags::FLEXIBLE,
4220        )
4221    }
4222}
4223
4224#[must_use = "FIDL methods require a response to be sent"]
4225#[derive(Debug)]
4226pub struct CapabilitiesDirConnectorOpenResponder {
4227    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4228    tx_id: u32,
4229}
4230
4231/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4232/// if the responder is dropped without sending a response, so that the client
4233/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4234impl std::ops::Drop for CapabilitiesDirConnectorOpenResponder {
4235    fn drop(&mut self) {
4236        self.control_handle.shutdown();
4237        // Safety: drops once, never accessed again
4238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4239    }
4240}
4241
4242impl fidl::endpoints::Responder for CapabilitiesDirConnectorOpenResponder {
4243    type ControlHandle = CapabilitiesControlHandle;
4244
4245    fn control_handle(&self) -> &CapabilitiesControlHandle {
4246        &self.control_handle
4247    }
4248
4249    fn drop_without_shutdown(mut self) {
4250        // Safety: drops once, never accessed again due to mem::forget
4251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4252        // Prevent Drop from running (which would shut down the channel)
4253        std::mem::forget(self);
4254    }
4255}
4256
4257impl CapabilitiesDirConnectorOpenResponder {
4258    /// Sends a response to the FIDL transaction.
4259    ///
4260    /// Sets the channel to shutdown if an error occurs.
4261    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4262        let _result = self.send_raw(result);
4263        if _result.is_err() {
4264            self.control_handle.shutdown();
4265        }
4266        self.drop_without_shutdown();
4267        _result
4268    }
4269
4270    /// Similar to "send" but does not shutdown the channel if an error occurs.
4271    pub fn send_no_shutdown_on_err(
4272        self,
4273        mut result: Result<(), CapabilitiesError>,
4274    ) -> Result<(), fidl::Error> {
4275        let _result = self.send_raw(result);
4276        self.drop_without_shutdown();
4277        _result
4278    }
4279
4280    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4281        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4282            fidl::encoding::EmptyStruct,
4283            CapabilitiesError,
4284        >>(
4285            fidl::encoding::FlexibleResult::new(result),
4286            self.tx_id,
4287            0x1332bbf5debd6c20,
4288            fidl::encoding::DynamicFlags::FLEXIBLE,
4289        )
4290    }
4291}
4292
4293#[must_use = "FIDL methods require a response to be sent"]
4294#[derive(Debug)]
4295pub struct CapabilitiesDictionaryInsertResponder {
4296    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4297    tx_id: u32,
4298}
4299
4300/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4301/// if the responder is dropped without sending a response, so that the client
4302/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4303impl std::ops::Drop for CapabilitiesDictionaryInsertResponder {
4304    fn drop(&mut self) {
4305        self.control_handle.shutdown();
4306        // Safety: drops once, never accessed again
4307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4308    }
4309}
4310
4311impl fidl::endpoints::Responder for CapabilitiesDictionaryInsertResponder {
4312    type ControlHandle = CapabilitiesControlHandle;
4313
4314    fn control_handle(&self) -> &CapabilitiesControlHandle {
4315        &self.control_handle
4316    }
4317
4318    fn drop_without_shutdown(mut self) {
4319        // Safety: drops once, never accessed again due to mem::forget
4320        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4321        // Prevent Drop from running (which would shut down the channel)
4322        std::mem::forget(self);
4323    }
4324}
4325
4326impl CapabilitiesDictionaryInsertResponder {
4327    /// Sends a response to the FIDL transaction.
4328    ///
4329    /// Sets the channel to shutdown if an error occurs.
4330    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4331        let _result = self.send_raw(result);
4332        if _result.is_err() {
4333            self.control_handle.shutdown();
4334        }
4335        self.drop_without_shutdown();
4336        _result
4337    }
4338
4339    /// Similar to "send" but does not shutdown the channel if an error occurs.
4340    pub fn send_no_shutdown_on_err(
4341        self,
4342        mut result: Result<(), CapabilitiesError>,
4343    ) -> Result<(), fidl::Error> {
4344        let _result = self.send_raw(result);
4345        self.drop_without_shutdown();
4346        _result
4347    }
4348
4349    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4350        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4351            fidl::encoding::EmptyStruct,
4352            CapabilitiesError,
4353        >>(
4354            fidl::encoding::FlexibleResult::new(result),
4355            self.tx_id,
4356            0x5972e3061a760e7a,
4357            fidl::encoding::DynamicFlags::FLEXIBLE,
4358        )
4359    }
4360}
4361
4362#[must_use = "FIDL methods require a response to be sent"]
4363#[derive(Debug)]
4364pub struct CapabilitiesDictionaryGetResponder {
4365    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4366    tx_id: u32,
4367}
4368
4369/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4370/// if the responder is dropped without sending a response, so that the client
4371/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4372impl std::ops::Drop for CapabilitiesDictionaryGetResponder {
4373    fn drop(&mut self) {
4374        self.control_handle.shutdown();
4375        // Safety: drops once, never accessed again
4376        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4377    }
4378}
4379
4380impl fidl::endpoints::Responder for CapabilitiesDictionaryGetResponder {
4381    type ControlHandle = CapabilitiesControlHandle;
4382
4383    fn control_handle(&self) -> &CapabilitiesControlHandle {
4384        &self.control_handle
4385    }
4386
4387    fn drop_without_shutdown(mut self) {
4388        // Safety: drops once, never accessed again due to mem::forget
4389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4390        // Prevent Drop from running (which would shut down the channel)
4391        std::mem::forget(self);
4392    }
4393}
4394
4395impl CapabilitiesDictionaryGetResponder {
4396    /// Sends a response to the FIDL transaction.
4397    ///
4398    /// Sets the channel to shutdown if an error occurs.
4399    pub fn send(
4400        self,
4401        mut result: Result<CapabilityType, CapabilitiesError>,
4402    ) -> Result<(), fidl::Error> {
4403        let _result = self.send_raw(result);
4404        if _result.is_err() {
4405            self.control_handle.shutdown();
4406        }
4407        self.drop_without_shutdown();
4408        _result
4409    }
4410
4411    /// Similar to "send" but does not shutdown the channel if an error occurs.
4412    pub fn send_no_shutdown_on_err(
4413        self,
4414        mut result: Result<CapabilityType, CapabilitiesError>,
4415    ) -> Result<(), fidl::Error> {
4416        let _result = self.send_raw(result);
4417        self.drop_without_shutdown();
4418        _result
4419    }
4420
4421    fn send_raw(
4422        &self,
4423        mut result: Result<CapabilityType, CapabilitiesError>,
4424    ) -> Result<(), fidl::Error> {
4425        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4426            CapabilitiesDictionaryGetResponse,
4427            CapabilitiesError,
4428        >>(
4429            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4430            self.tx_id,
4431            0x31fafe2280a283d5,
4432            fidl::encoding::DynamicFlags::FLEXIBLE,
4433        )
4434    }
4435}
4436
4437#[must_use = "FIDL methods require a response to be sent"]
4438#[derive(Debug)]
4439pub struct CapabilitiesDictionaryRemoveResponder {
4440    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4441    tx_id: u32,
4442}
4443
4444/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4445/// if the responder is dropped without sending a response, so that the client
4446/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4447impl std::ops::Drop for CapabilitiesDictionaryRemoveResponder {
4448    fn drop(&mut self) {
4449        self.control_handle.shutdown();
4450        // Safety: drops once, never accessed again
4451        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4452    }
4453}
4454
4455impl fidl::endpoints::Responder for CapabilitiesDictionaryRemoveResponder {
4456    type ControlHandle = CapabilitiesControlHandle;
4457
4458    fn control_handle(&self) -> &CapabilitiesControlHandle {
4459        &self.control_handle
4460    }
4461
4462    fn drop_without_shutdown(mut self) {
4463        // Safety: drops once, never accessed again due to mem::forget
4464        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4465        // Prevent Drop from running (which would shut down the channel)
4466        std::mem::forget(self);
4467    }
4468}
4469
4470impl CapabilitiesDictionaryRemoveResponder {
4471    /// Sends a response to the FIDL transaction.
4472    ///
4473    /// Sets the channel to shutdown if an error occurs.
4474    pub fn send(
4475        self,
4476        mut result: Result<CapabilityType, CapabilitiesError>,
4477    ) -> Result<(), fidl::Error> {
4478        let _result = self.send_raw(result);
4479        if _result.is_err() {
4480            self.control_handle.shutdown();
4481        }
4482        self.drop_without_shutdown();
4483        _result
4484    }
4485
4486    /// Similar to "send" but does not shutdown the channel if an error occurs.
4487    pub fn send_no_shutdown_on_err(
4488        self,
4489        mut result: Result<CapabilityType, CapabilitiesError>,
4490    ) -> Result<(), fidl::Error> {
4491        let _result = self.send_raw(result);
4492        self.drop_without_shutdown();
4493        _result
4494    }
4495
4496    fn send_raw(
4497        &self,
4498        mut result: Result<CapabilityType, CapabilitiesError>,
4499    ) -> Result<(), fidl::Error> {
4500        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4501            CapabilitiesDictionaryRemoveResponse,
4502            CapabilitiesError,
4503        >>(
4504            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4505            self.tx_id,
4506            0x6827c83106ac5a2c,
4507            fidl::encoding::DynamicFlags::FLEXIBLE,
4508        )
4509    }
4510}
4511
4512#[must_use = "FIDL methods require a response to be sent"]
4513#[derive(Debug)]
4514pub struct CapabilitiesDictionaryIterateKeysResponder {
4515    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4516    tx_id: u32,
4517}
4518
4519/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4520/// if the responder is dropped without sending a response, so that the client
4521/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4522impl std::ops::Drop for CapabilitiesDictionaryIterateKeysResponder {
4523    fn drop(&mut self) {
4524        self.control_handle.shutdown();
4525        // Safety: drops once, never accessed again
4526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4527    }
4528}
4529
4530impl fidl::endpoints::Responder for CapabilitiesDictionaryIterateKeysResponder {
4531    type ControlHandle = CapabilitiesControlHandle;
4532
4533    fn control_handle(&self) -> &CapabilitiesControlHandle {
4534        &self.control_handle
4535    }
4536
4537    fn drop_without_shutdown(mut self) {
4538        // Safety: drops once, never accessed again due to mem::forget
4539        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4540        // Prevent Drop from running (which would shut down the channel)
4541        std::mem::forget(self);
4542    }
4543}
4544
4545impl CapabilitiesDictionaryIterateKeysResponder {
4546    /// Sends a response to the FIDL transaction.
4547    ///
4548    /// Sets the channel to shutdown if an error occurs.
4549    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4550        let _result = self.send_raw(result);
4551        if _result.is_err() {
4552            self.control_handle.shutdown();
4553        }
4554        self.drop_without_shutdown();
4555        _result
4556    }
4557
4558    /// Similar to "send" but does not shutdown the channel if an error occurs.
4559    pub fn send_no_shutdown_on_err(
4560        self,
4561        mut result: Result<(), CapabilitiesError>,
4562    ) -> Result<(), fidl::Error> {
4563        let _result = self.send_raw(result);
4564        self.drop_without_shutdown();
4565        _result
4566    }
4567
4568    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4569        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4570            fidl::encoding::EmptyStruct,
4571            CapabilitiesError,
4572        >>(
4573            fidl::encoding::FlexibleResult::new(result),
4574            self.tx_id,
4575            0x3d4ea59c80df9bb8,
4576            fidl::encoding::DynamicFlags::FLEXIBLE,
4577        )
4578    }
4579}
4580
4581#[must_use = "FIDL methods require a response to be sent"]
4582#[derive(Debug)]
4583pub struct CapabilitiesDataGetResponder {
4584    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4585    tx_id: u32,
4586}
4587
4588/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4589/// if the responder is dropped without sending a response, so that the client
4590/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4591impl std::ops::Drop for CapabilitiesDataGetResponder {
4592    fn drop(&mut self) {
4593        self.control_handle.shutdown();
4594        // Safety: drops once, never accessed again
4595        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4596    }
4597}
4598
4599impl fidl::endpoints::Responder for CapabilitiesDataGetResponder {
4600    type ControlHandle = CapabilitiesControlHandle;
4601
4602    fn control_handle(&self) -> &CapabilitiesControlHandle {
4603        &self.control_handle
4604    }
4605
4606    fn drop_without_shutdown(mut self) {
4607        // Safety: drops once, never accessed again due to mem::forget
4608        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4609        // Prevent Drop from running (which would shut down the channel)
4610        std::mem::forget(self);
4611    }
4612}
4613
4614impl CapabilitiesDataGetResponder {
4615    /// Sends a response to the FIDL transaction.
4616    ///
4617    /// Sets the channel to shutdown if an error occurs.
4618    pub fn send(self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4619        let _result = self.send_raw(result);
4620        if _result.is_err() {
4621            self.control_handle.shutdown();
4622        }
4623        self.drop_without_shutdown();
4624        _result
4625    }
4626
4627    /// Similar to "send" but does not shutdown the channel if an error occurs.
4628    pub fn send_no_shutdown_on_err(
4629        self,
4630        mut result: Result<&Data, CapabilitiesError>,
4631    ) -> Result<(), fidl::Error> {
4632        let _result = self.send_raw(result);
4633        self.drop_without_shutdown();
4634        _result
4635    }
4636
4637    fn send_raw(&self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4638        self.control_handle
4639            .inner
4640            .send::<fidl::encoding::FlexibleResultType<Data, CapabilitiesError>>(
4641                fidl::encoding::FlexibleResult::new(result),
4642                self.tx_id,
4643                0x65ae25b59f9e0daf,
4644                fidl::encoding::DynamicFlags::FLEXIBLE,
4645            )
4646    }
4647}
4648
4649#[must_use = "FIDL methods require a response to be sent"]
4650#[derive(Debug)]
4651pub struct CapabilitiesConnectorRouterRouteResponder {
4652    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4653    tx_id: u32,
4654}
4655
4656/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4657/// if the responder is dropped without sending a response, so that the client
4658/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4659impl std::ops::Drop for CapabilitiesConnectorRouterRouteResponder {
4660    fn drop(&mut self) {
4661        self.control_handle.shutdown();
4662        // Safety: drops once, never accessed again
4663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4664    }
4665}
4666
4667impl fidl::endpoints::Responder for CapabilitiesConnectorRouterRouteResponder {
4668    type ControlHandle = CapabilitiesControlHandle;
4669
4670    fn control_handle(&self) -> &CapabilitiesControlHandle {
4671        &self.control_handle
4672    }
4673
4674    fn drop_without_shutdown(mut self) {
4675        // Safety: drops once, never accessed again due to mem::forget
4676        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4677        // Prevent Drop from running (which would shut down the channel)
4678        std::mem::forget(self);
4679    }
4680}
4681
4682impl CapabilitiesConnectorRouterRouteResponder {
4683    /// Sends a response to the FIDL transaction.
4684    ///
4685    /// Sets the channel to shutdown if an error occurs.
4686    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4687        let _result = self.send_raw(result);
4688        if _result.is_err() {
4689            self.control_handle.shutdown();
4690        }
4691        self.drop_without_shutdown();
4692        _result
4693    }
4694
4695    /// Similar to "send" but does not shutdown the channel if an error occurs.
4696    pub fn send_no_shutdown_on_err(
4697        self,
4698        mut result: Result<RouterResponse, i32>,
4699    ) -> Result<(), fidl::Error> {
4700        let _result = self.send_raw(result);
4701        self.drop_without_shutdown();
4702        _result
4703    }
4704
4705    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4706        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4707            CapabilitiesConnectorRouterRouteResponse,
4708            i32,
4709        >>(
4710            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4711            self.tx_id,
4712            0x1bd9c6e7e3dd487e,
4713            fidl::encoding::DynamicFlags::FLEXIBLE,
4714        )
4715    }
4716}
4717
4718#[must_use = "FIDL methods require a response to be sent"]
4719#[derive(Debug)]
4720pub struct CapabilitiesDirConnectorRouterRouteResponder {
4721    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4722    tx_id: u32,
4723}
4724
4725/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4726/// if the responder is dropped without sending a response, so that the client
4727/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4728impl std::ops::Drop for CapabilitiesDirConnectorRouterRouteResponder {
4729    fn drop(&mut self) {
4730        self.control_handle.shutdown();
4731        // Safety: drops once, never accessed again
4732        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4733    }
4734}
4735
4736impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterRouteResponder {
4737    type ControlHandle = CapabilitiesControlHandle;
4738
4739    fn control_handle(&self) -> &CapabilitiesControlHandle {
4740        &self.control_handle
4741    }
4742
4743    fn drop_without_shutdown(mut self) {
4744        // Safety: drops once, never accessed again due to mem::forget
4745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4746        // Prevent Drop from running (which would shut down the channel)
4747        std::mem::forget(self);
4748    }
4749}
4750
4751impl CapabilitiesDirConnectorRouterRouteResponder {
4752    /// Sends a response to the FIDL transaction.
4753    ///
4754    /// Sets the channel to shutdown if an error occurs.
4755    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4756        let _result = self.send_raw(result);
4757        if _result.is_err() {
4758            self.control_handle.shutdown();
4759        }
4760        self.drop_without_shutdown();
4761        _result
4762    }
4763
4764    /// Similar to "send" but does not shutdown the channel if an error occurs.
4765    pub fn send_no_shutdown_on_err(
4766        self,
4767        mut result: Result<RouterResponse, i32>,
4768    ) -> Result<(), fidl::Error> {
4769        let _result = self.send_raw(result);
4770        self.drop_without_shutdown();
4771        _result
4772    }
4773
4774    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4775        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4776            CapabilitiesDirConnectorRouterRouteResponse,
4777            i32,
4778        >>(
4779            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4780            self.tx_id,
4781            0x3afdcc1b79e0799d,
4782            fidl::encoding::DynamicFlags::FLEXIBLE,
4783        )
4784    }
4785}
4786
4787#[must_use = "FIDL methods require a response to be sent"]
4788#[derive(Debug)]
4789pub struct CapabilitiesDictionaryRouterRouteResponder {
4790    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4791    tx_id: u32,
4792}
4793
4794/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4795/// if the responder is dropped without sending a response, so that the client
4796/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4797impl std::ops::Drop for CapabilitiesDictionaryRouterRouteResponder {
4798    fn drop(&mut self) {
4799        self.control_handle.shutdown();
4800        // Safety: drops once, never accessed again
4801        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4802    }
4803}
4804
4805impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterRouteResponder {
4806    type ControlHandle = CapabilitiesControlHandle;
4807
4808    fn control_handle(&self) -> &CapabilitiesControlHandle {
4809        &self.control_handle
4810    }
4811
4812    fn drop_without_shutdown(mut self) {
4813        // Safety: drops once, never accessed again due to mem::forget
4814        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4815        // Prevent Drop from running (which would shut down the channel)
4816        std::mem::forget(self);
4817    }
4818}
4819
4820impl CapabilitiesDictionaryRouterRouteResponder {
4821    /// Sends a response to the FIDL transaction.
4822    ///
4823    /// Sets the channel to shutdown if an error occurs.
4824    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4825        let _result = self.send_raw(result);
4826        if _result.is_err() {
4827            self.control_handle.shutdown();
4828        }
4829        self.drop_without_shutdown();
4830        _result
4831    }
4832
4833    /// Similar to "send" but does not shutdown the channel if an error occurs.
4834    pub fn send_no_shutdown_on_err(
4835        self,
4836        mut result: Result<RouterResponse, i32>,
4837    ) -> Result<(), fidl::Error> {
4838        let _result = self.send_raw(result);
4839        self.drop_without_shutdown();
4840        _result
4841    }
4842
4843    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4844        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4845            CapabilitiesDictionaryRouterRouteResponse,
4846            i32,
4847        >>(
4848            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4849            self.tx_id,
4850            0xcf72de10714a708,
4851            fidl::encoding::DynamicFlags::FLEXIBLE,
4852        )
4853    }
4854}
4855
4856#[must_use = "FIDL methods require a response to be sent"]
4857#[derive(Debug)]
4858pub struct CapabilitiesDataRouterRouteResponder {
4859    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4860    tx_id: u32,
4861}
4862
4863/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4864/// if the responder is dropped without sending a response, so that the client
4865/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4866impl std::ops::Drop for CapabilitiesDataRouterRouteResponder {
4867    fn drop(&mut self) {
4868        self.control_handle.shutdown();
4869        // Safety: drops once, never accessed again
4870        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4871    }
4872}
4873
4874impl fidl::endpoints::Responder for CapabilitiesDataRouterRouteResponder {
4875    type ControlHandle = CapabilitiesControlHandle;
4876
4877    fn control_handle(&self) -> &CapabilitiesControlHandle {
4878        &self.control_handle
4879    }
4880
4881    fn drop_without_shutdown(mut self) {
4882        // Safety: drops once, never accessed again due to mem::forget
4883        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4884        // Prevent Drop from running (which would shut down the channel)
4885        std::mem::forget(self);
4886    }
4887}
4888
4889impl CapabilitiesDataRouterRouteResponder {
4890    /// Sends a response to the FIDL transaction.
4891    ///
4892    /// Sets the channel to shutdown if an error occurs.
4893    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4894        let _result = self.send_raw(result);
4895        if _result.is_err() {
4896            self.control_handle.shutdown();
4897        }
4898        self.drop_without_shutdown();
4899        _result
4900    }
4901
4902    /// Similar to "send" but does not shutdown the channel if an error occurs.
4903    pub fn send_no_shutdown_on_err(
4904        self,
4905        mut result: Result<RouterResponse, i32>,
4906    ) -> Result<(), fidl::Error> {
4907        let _result = self.send_raw(result);
4908        self.drop_without_shutdown();
4909        _result
4910    }
4911
4912    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4913        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4914            CapabilitiesDataRouterRouteResponse,
4915            i32,
4916        >>(
4917            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4918            self.tx_id,
4919            0x61ab188455ed0643,
4920            fidl::encoding::DynamicFlags::FLEXIBLE,
4921        )
4922    }
4923}
4924
4925#[must_use = "FIDL methods require a response to be sent"]
4926#[derive(Debug)]
4927pub struct CapabilitiesCapabilityAssociateHandleResponder {
4928    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4929    tx_id: u32,
4930}
4931
4932/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4933/// if the responder is dropped without sending a response, so that the client
4934/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4935impl std::ops::Drop for CapabilitiesCapabilityAssociateHandleResponder {
4936    fn drop(&mut self) {
4937        self.control_handle.shutdown();
4938        // Safety: drops once, never accessed again
4939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4940    }
4941}
4942
4943impl fidl::endpoints::Responder for CapabilitiesCapabilityAssociateHandleResponder {
4944    type ControlHandle = CapabilitiesControlHandle;
4945
4946    fn control_handle(&self) -> &CapabilitiesControlHandle {
4947        &self.control_handle
4948    }
4949
4950    fn drop_without_shutdown(mut self) {
4951        // Safety: drops once, never accessed again due to mem::forget
4952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4953        // Prevent Drop from running (which would shut down the channel)
4954        std::mem::forget(self);
4955    }
4956}
4957
4958impl CapabilitiesCapabilityAssociateHandleResponder {
4959    /// Sends a response to the FIDL transaction.
4960    ///
4961    /// Sets the channel to shutdown if an error occurs.
4962    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4963        let _result = self.send_raw(result);
4964        if _result.is_err() {
4965            self.control_handle.shutdown();
4966        }
4967        self.drop_without_shutdown();
4968        _result
4969    }
4970
4971    /// Similar to "send" but does not shutdown the channel if an error occurs.
4972    pub fn send_no_shutdown_on_err(
4973        self,
4974        mut result: Result<(), CapabilitiesError>,
4975    ) -> Result<(), fidl::Error> {
4976        let _result = self.send_raw(result);
4977        self.drop_without_shutdown();
4978        _result
4979    }
4980
4981    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4982        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4983            fidl::encoding::EmptyStruct,
4984            CapabilitiesError,
4985        >>(
4986            fidl::encoding::FlexibleResult::new(result),
4987            self.tx_id,
4988            0x1d69bb61953d8e7,
4989            fidl::encoding::DynamicFlags::FLEXIBLE,
4990        )
4991    }
4992}
4993
4994#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4995pub struct ConnectorRouterMarker;
4996
4997impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4998    type Proxy = ConnectorRouterProxy;
4999    type RequestStream = ConnectorRouterRequestStream;
5000    #[cfg(target_os = "fuchsia")]
5001    type SynchronousProxy = ConnectorRouterSynchronousProxy;
5002
5003    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouter";
5004}
5005pub type ConnectorRouterRouteResult = Result<RouterResponse, i32>;
5006
5007pub trait ConnectorRouterProxyInterface: Send + Sync {
5008    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
5009        + Send;
5010    fn r#route(
5011        &self,
5012        request: RouteRequest,
5013        instance_token: fidl::EventPair,
5014        handle: fidl::EventPair,
5015    ) -> Self::RouteResponseFut;
5016}
5017#[derive(Debug)]
5018#[cfg(target_os = "fuchsia")]
5019pub struct ConnectorRouterSynchronousProxy {
5020    client: fidl::client::sync::Client,
5021}
5022
5023#[cfg(target_os = "fuchsia")]
5024impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
5025    type Proxy = ConnectorRouterProxy;
5026    type Protocol = ConnectorRouterMarker;
5027
5028    fn from_channel(inner: fidl::Channel) -> Self {
5029        Self::new(inner)
5030    }
5031
5032    fn into_channel(self) -> fidl::Channel {
5033        self.client.into_channel()
5034    }
5035
5036    fn as_channel(&self) -> &fidl::Channel {
5037        self.client.as_channel()
5038    }
5039}
5040
5041#[cfg(target_os = "fuchsia")]
5042impl ConnectorRouterSynchronousProxy {
5043    pub fn new(channel: fidl::Channel) -> Self {
5044        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5045        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5046    }
5047
5048    pub fn into_channel(self) -> fidl::Channel {
5049        self.client.into_channel()
5050    }
5051
5052    /// Waits until an event arrives and returns it. It is safe for other
5053    /// threads to make concurrent requests while waiting for an event.
5054    pub fn wait_for_event(
5055        &self,
5056        deadline: zx::MonotonicInstant,
5057    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5058        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
5059    }
5060
5061    /// Attempts to produce a `Connector` capability from this
5062    /// `ConnectorRouter`.
5063    ///
5064    /// `request` contains context for this route, and `instance_token`
5065    /// references the component that the routing operation is being performed
5066    /// for.
5067    ///
5068    /// This will return:
5069    ///
5070    /// - `SUCCESS` if `handle` has been associated with a connector.
5071    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5072    ///   will be closed.
5073    /// - An error, if the operation failed.
5074    pub fn r#route(
5075        &self,
5076        mut request: RouteRequest,
5077        mut instance_token: fidl::EventPair,
5078        mut handle: fidl::EventPair,
5079        ___deadline: zx::MonotonicInstant,
5080    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5081        let _response = self.client.send_query::<
5082            ConnectorRouterRouteRequest,
5083            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5084        >(
5085            (&mut request, instance_token, handle,),
5086            0x57a912c92a38f9f8,
5087            fidl::encoding::DynamicFlags::FLEXIBLE,
5088            ___deadline,
5089        )?
5090        .into_result::<ConnectorRouterMarker>("route")?;
5091        Ok(_response.map(|x| x.response))
5092    }
5093}
5094
5095#[cfg(target_os = "fuchsia")]
5096impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
5097    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
5098        value.into_channel().into()
5099    }
5100}
5101
5102#[cfg(target_os = "fuchsia")]
5103impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
5104    fn from(value: fidl::Channel) -> Self {
5105        Self::new(value)
5106    }
5107}
5108
5109#[cfg(target_os = "fuchsia")]
5110impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
5111    type Protocol = ConnectorRouterMarker;
5112
5113    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
5114        Self::new(value.into_channel())
5115    }
5116}
5117
5118#[derive(Debug, Clone)]
5119pub struct ConnectorRouterProxy {
5120    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5121}
5122
5123impl fidl::endpoints::Proxy for ConnectorRouterProxy {
5124    type Protocol = ConnectorRouterMarker;
5125
5126    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5127        Self::new(inner)
5128    }
5129
5130    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5131        self.client.into_channel().map_err(|client| Self { client })
5132    }
5133
5134    fn as_channel(&self) -> &::fidl::AsyncChannel {
5135        self.client.as_channel()
5136    }
5137}
5138
5139impl ConnectorRouterProxy {
5140    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouter.
5141    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5142        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5143        Self { client: fidl::client::Client::new(channel, protocol_name) }
5144    }
5145
5146    /// Get a Stream of events from the remote end of the protocol.
5147    ///
5148    /// # Panics
5149    ///
5150    /// Panics if the event stream was already taken.
5151    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
5152        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
5153    }
5154
5155    /// Attempts to produce a `Connector` capability from this
5156    /// `ConnectorRouter`.
5157    ///
5158    /// `request` contains context for this route, and `instance_token`
5159    /// references the component that the routing operation is being performed
5160    /// for.
5161    ///
5162    /// This will return:
5163    ///
5164    /// - `SUCCESS` if `handle` has been associated with a connector.
5165    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5166    ///   will be closed.
5167    /// - An error, if the operation failed.
5168    pub fn r#route(
5169        &self,
5170        mut request: RouteRequest,
5171        mut instance_token: fidl::EventPair,
5172        mut handle: fidl::EventPair,
5173    ) -> fidl::client::QueryResponseFut<
5174        ConnectorRouterRouteResult,
5175        fidl::encoding::DefaultFuchsiaResourceDialect,
5176    > {
5177        ConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
5178    }
5179}
5180
5181impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
5182    type RouteResponseFut = fidl::client::QueryResponseFut<
5183        ConnectorRouterRouteResult,
5184        fidl::encoding::DefaultFuchsiaResourceDialect,
5185    >;
5186    fn r#route(
5187        &self,
5188        mut request: RouteRequest,
5189        mut instance_token: fidl::EventPair,
5190        mut handle: fidl::EventPair,
5191    ) -> Self::RouteResponseFut {
5192        fn _decode(
5193            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5194        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5195            let _response = fidl::client::decode_transaction_body::<
5196                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5197                fidl::encoding::DefaultFuchsiaResourceDialect,
5198                0x57a912c92a38f9f8,
5199            >(_buf?)?
5200            .into_result::<ConnectorRouterMarker>("route")?;
5201            Ok(_response.map(|x| x.response))
5202        }
5203        self.client
5204            .send_query_and_decode::<ConnectorRouterRouteRequest, ConnectorRouterRouteResult>(
5205                (&mut request, instance_token, handle),
5206                0x57a912c92a38f9f8,
5207                fidl::encoding::DynamicFlags::FLEXIBLE,
5208                _decode,
5209            )
5210    }
5211}
5212
5213pub struct ConnectorRouterEventStream {
5214    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5215}
5216
5217impl std::marker::Unpin for ConnectorRouterEventStream {}
5218
5219impl futures::stream::FusedStream for ConnectorRouterEventStream {
5220    fn is_terminated(&self) -> bool {
5221        self.event_receiver.is_terminated()
5222    }
5223}
5224
5225impl futures::Stream for ConnectorRouterEventStream {
5226    type Item = Result<ConnectorRouterEvent, fidl::Error>;
5227
5228    fn poll_next(
5229        mut self: std::pin::Pin<&mut Self>,
5230        cx: &mut std::task::Context<'_>,
5231    ) -> std::task::Poll<Option<Self::Item>> {
5232        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5233            &mut self.event_receiver,
5234            cx
5235        )?) {
5236            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
5237            None => std::task::Poll::Ready(None),
5238        }
5239    }
5240}
5241
5242#[derive(Debug)]
5243pub enum ConnectorRouterEvent {
5244    #[non_exhaustive]
5245    _UnknownEvent {
5246        /// Ordinal of the event that was sent.
5247        ordinal: u64,
5248    },
5249}
5250
5251impl ConnectorRouterEvent {
5252    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
5253    fn decode(
5254        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5255    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5256        let (bytes, _handles) = buf.split_mut();
5257        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5258        debug_assert_eq!(tx_header.tx_id, 0);
5259        match tx_header.ordinal {
5260            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5261                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5262            }
5263            _ => Err(fidl::Error::UnknownOrdinal {
5264                ordinal: tx_header.ordinal,
5265                protocol_name:
5266                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5267            }),
5268        }
5269    }
5270}
5271
5272/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouter.
5273pub struct ConnectorRouterRequestStream {
5274    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5275    is_terminated: bool,
5276}
5277
5278impl std::marker::Unpin for ConnectorRouterRequestStream {}
5279
5280impl futures::stream::FusedStream for ConnectorRouterRequestStream {
5281    fn is_terminated(&self) -> bool {
5282        self.is_terminated
5283    }
5284}
5285
5286impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
5287    type Protocol = ConnectorRouterMarker;
5288    type ControlHandle = ConnectorRouterControlHandle;
5289
5290    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5291        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5292    }
5293
5294    fn control_handle(&self) -> Self::ControlHandle {
5295        ConnectorRouterControlHandle { inner: self.inner.clone() }
5296    }
5297
5298    fn into_inner(
5299        self,
5300    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5301    {
5302        (self.inner, self.is_terminated)
5303    }
5304
5305    fn from_inner(
5306        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5307        is_terminated: bool,
5308    ) -> Self {
5309        Self { inner, is_terminated }
5310    }
5311}
5312
5313impl futures::Stream for ConnectorRouterRequestStream {
5314    type Item = Result<ConnectorRouterRequest, fidl::Error>;
5315
5316    fn poll_next(
5317        mut self: std::pin::Pin<&mut Self>,
5318        cx: &mut std::task::Context<'_>,
5319    ) -> std::task::Poll<Option<Self::Item>> {
5320        let this = &mut *self;
5321        if this.inner.check_shutdown(cx) {
5322            this.is_terminated = true;
5323            return std::task::Poll::Ready(None);
5324        }
5325        if this.is_terminated {
5326            panic!("polled ConnectorRouterRequestStream after completion");
5327        }
5328        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5329            |bytes, handles| {
5330                match this.inner.channel().read_etc(cx, bytes, handles) {
5331                    std::task::Poll::Ready(Ok(())) => {}
5332                    std::task::Poll::Pending => return std::task::Poll::Pending,
5333                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5334                        this.is_terminated = true;
5335                        return std::task::Poll::Ready(None);
5336                    }
5337                    std::task::Poll::Ready(Err(e)) => {
5338                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5339                            e.into(),
5340                        ))));
5341                    }
5342                }
5343
5344                // A message has been received from the channel
5345                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5346
5347                std::task::Poll::Ready(Some(match header.ordinal {
5348                    0x57a912c92a38f9f8 => {
5349                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5350                        let mut req = fidl::new_empty!(
5351                            ConnectorRouterRouteRequest,
5352                            fidl::encoding::DefaultFuchsiaResourceDialect
5353                        );
5354                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5355                        let control_handle =
5356                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5357                        Ok(ConnectorRouterRequest::Route {
5358                            request: req.request,
5359                            instance_token: req.instance_token,
5360                            handle: req.handle,
5361
5362                            responder: ConnectorRouterRouteResponder {
5363                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5364                                tx_id: header.tx_id,
5365                            },
5366                        })
5367                    }
5368                    _ if header.tx_id == 0
5369                        && header
5370                            .dynamic_flags()
5371                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5372                    {
5373                        Ok(ConnectorRouterRequest::_UnknownMethod {
5374                            ordinal: header.ordinal,
5375                            control_handle: ConnectorRouterControlHandle {
5376                                inner: this.inner.clone(),
5377                            },
5378                            method_type: fidl::MethodType::OneWay,
5379                        })
5380                    }
5381                    _ if header
5382                        .dynamic_flags()
5383                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5384                    {
5385                        this.inner.send_framework_err(
5386                            fidl::encoding::FrameworkErr::UnknownMethod,
5387                            header.tx_id,
5388                            header.ordinal,
5389                            header.dynamic_flags(),
5390                            (bytes, handles),
5391                        )?;
5392                        Ok(ConnectorRouterRequest::_UnknownMethod {
5393                            ordinal: header.ordinal,
5394                            control_handle: ConnectorRouterControlHandle {
5395                                inner: this.inner.clone(),
5396                            },
5397                            method_type: fidl::MethodType::TwoWay,
5398                        })
5399                    }
5400                    _ => Err(fidl::Error::UnknownOrdinal {
5401                        ordinal: header.ordinal,
5402                        protocol_name:
5403                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5404                    }),
5405                }))
5406            },
5407        )
5408    }
5409}
5410
5411/// A factory for `Connector` capabilities.
5412#[derive(Debug)]
5413pub enum ConnectorRouterRequest {
5414    /// Attempts to produce a `Connector` capability from this
5415    /// `ConnectorRouter`.
5416    ///
5417    /// `request` contains context for this route, and `instance_token`
5418    /// references the component that the routing operation is being performed
5419    /// for.
5420    ///
5421    /// This will return:
5422    ///
5423    /// - `SUCCESS` if `handle` has been associated with a connector.
5424    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5425    ///   will be closed.
5426    /// - An error, if the operation failed.
5427    Route {
5428        request: RouteRequest,
5429        instance_token: fidl::EventPair,
5430        handle: fidl::EventPair,
5431        responder: ConnectorRouterRouteResponder,
5432    },
5433    /// An interaction was received which does not match any known method.
5434    #[non_exhaustive]
5435    _UnknownMethod {
5436        /// Ordinal of the method that was called.
5437        ordinal: u64,
5438        control_handle: ConnectorRouterControlHandle,
5439        method_type: fidl::MethodType,
5440    },
5441}
5442
5443impl ConnectorRouterRequest {
5444    #[allow(irrefutable_let_patterns)]
5445    pub fn into_route(
5446        self,
5447    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, ConnectorRouterRouteResponder)>
5448    {
5449        if let ConnectorRouterRequest::Route { request, instance_token, handle, responder } = self {
5450            Some((request, instance_token, handle, responder))
5451        } else {
5452            None
5453        }
5454    }
5455
5456    /// Name of the method defined in FIDL
5457    pub fn method_name(&self) -> &'static str {
5458        match *self {
5459            ConnectorRouterRequest::Route { .. } => "route",
5460            ConnectorRouterRequest::_UnknownMethod {
5461                method_type: fidl::MethodType::OneWay,
5462                ..
5463            } => "unknown one-way method",
5464            ConnectorRouterRequest::_UnknownMethod {
5465                method_type: fidl::MethodType::TwoWay,
5466                ..
5467            } => "unknown two-way method",
5468        }
5469    }
5470}
5471
5472#[derive(Debug, Clone)]
5473pub struct ConnectorRouterControlHandle {
5474    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5475}
5476
5477impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5478    fn shutdown(&self) {
5479        self.inner.shutdown()
5480    }
5481
5482    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5483        self.inner.shutdown_with_epitaph(status)
5484    }
5485
5486    fn is_closed(&self) -> bool {
5487        self.inner.channel().is_closed()
5488    }
5489    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5490        self.inner.channel().on_closed()
5491    }
5492
5493    #[cfg(target_os = "fuchsia")]
5494    fn signal_peer(
5495        &self,
5496        clear_mask: zx::Signals,
5497        set_mask: zx::Signals,
5498    ) -> Result<(), zx_status::Status> {
5499        use fidl::Peered;
5500        self.inner.channel().signal_peer(clear_mask, set_mask)
5501    }
5502}
5503
5504impl ConnectorRouterControlHandle {}
5505
5506#[must_use = "FIDL methods require a response to be sent"]
5507#[derive(Debug)]
5508pub struct ConnectorRouterRouteResponder {
5509    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5510    tx_id: u32,
5511}
5512
5513/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5514/// if the responder is dropped without sending a response, so that the client
5515/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5516impl std::ops::Drop for ConnectorRouterRouteResponder {
5517    fn drop(&mut self) {
5518        self.control_handle.shutdown();
5519        // Safety: drops once, never accessed again
5520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5521    }
5522}
5523
5524impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5525    type ControlHandle = ConnectorRouterControlHandle;
5526
5527    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5528        &self.control_handle
5529    }
5530
5531    fn drop_without_shutdown(mut self) {
5532        // Safety: drops once, never accessed again due to mem::forget
5533        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5534        // Prevent Drop from running (which would shut down the channel)
5535        std::mem::forget(self);
5536    }
5537}
5538
5539impl ConnectorRouterRouteResponder {
5540    /// Sends a response to the FIDL transaction.
5541    ///
5542    /// Sets the channel to shutdown if an error occurs.
5543    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5544        let _result = self.send_raw(result);
5545        if _result.is_err() {
5546            self.control_handle.shutdown();
5547        }
5548        self.drop_without_shutdown();
5549        _result
5550    }
5551
5552    /// Similar to "send" but does not shutdown the channel if an error occurs.
5553    pub fn send_no_shutdown_on_err(
5554        self,
5555        mut result: Result<RouterResponse, i32>,
5556    ) -> Result<(), fidl::Error> {
5557        let _result = self.send_raw(result);
5558        self.drop_without_shutdown();
5559        _result
5560    }
5561
5562    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5563        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5564            ConnectorRouterRouteResponse,
5565            i32,
5566        >>(
5567            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
5568            self.tx_id,
5569            0x57a912c92a38f9f8,
5570            fidl::encoding::DynamicFlags::FLEXIBLE,
5571        )
5572    }
5573}
5574
5575#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5576pub struct DataRouterMarker;
5577
5578impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5579    type Proxy = DataRouterProxy;
5580    type RequestStream = DataRouterRequestStream;
5581    #[cfg(target_os = "fuchsia")]
5582    type SynchronousProxy = DataRouterSynchronousProxy;
5583
5584    const DEBUG_NAME: &'static str = "(anonymous) DataRouter";
5585}
5586pub type DataRouterRouteResult = Result<RouterResponse, i32>;
5587
5588pub trait DataRouterProxyInterface: Send + Sync {
5589    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5590        + Send;
5591    fn r#route(
5592        &self,
5593        request: RouteRequest,
5594        instance_token: fidl::EventPair,
5595        handle: fidl::EventPair,
5596    ) -> Self::RouteResponseFut;
5597}
5598#[derive(Debug)]
5599#[cfg(target_os = "fuchsia")]
5600pub struct DataRouterSynchronousProxy {
5601    client: fidl::client::sync::Client,
5602}
5603
5604#[cfg(target_os = "fuchsia")]
5605impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5606    type Proxy = DataRouterProxy;
5607    type Protocol = DataRouterMarker;
5608
5609    fn from_channel(inner: fidl::Channel) -> Self {
5610        Self::new(inner)
5611    }
5612
5613    fn into_channel(self) -> fidl::Channel {
5614        self.client.into_channel()
5615    }
5616
5617    fn as_channel(&self) -> &fidl::Channel {
5618        self.client.as_channel()
5619    }
5620}
5621
5622#[cfg(target_os = "fuchsia")]
5623impl DataRouterSynchronousProxy {
5624    pub fn new(channel: fidl::Channel) -> Self {
5625        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5626        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5627    }
5628
5629    pub fn into_channel(self) -> fidl::Channel {
5630        self.client.into_channel()
5631    }
5632
5633    /// Waits until an event arrives and returns it. It is safe for other
5634    /// threads to make concurrent requests while waiting for an event.
5635    pub fn wait_for_event(
5636        &self,
5637        deadline: zx::MonotonicInstant,
5638    ) -> Result<DataRouterEvent, fidl::Error> {
5639        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5640    }
5641
5642    /// Attempts to produce a `Data` capability from this
5643    /// `DataRouter`.
5644    ///
5645    /// `request` contains context for this route, and `instance_token`
5646    /// references the component that the routing operation is being performed
5647    /// for.
5648    ///
5649    /// This will return:
5650    ///
5651    /// - `SUCCESS` if `handle` has been associated with a connector.
5652    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5653    ///   will be closed.
5654    /// - An error, if the operation failed.
5655    pub fn r#route(
5656        &self,
5657        mut request: RouteRequest,
5658        mut instance_token: fidl::EventPair,
5659        mut handle: fidl::EventPair,
5660        ___deadline: zx::MonotonicInstant,
5661    ) -> Result<DataRouterRouteResult, fidl::Error> {
5662        let _response = self.client.send_query::<
5663            DataRouterRouteRequest,
5664            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5665        >(
5666            (&mut request, instance_token, handle,),
5667            0x646885ba7e10ceeb,
5668            fidl::encoding::DynamicFlags::FLEXIBLE,
5669            ___deadline,
5670        )?
5671        .into_result::<DataRouterMarker>("route")?;
5672        Ok(_response.map(|x| x.response))
5673    }
5674}
5675
5676#[cfg(target_os = "fuchsia")]
5677impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5678    fn from(value: DataRouterSynchronousProxy) -> Self {
5679        value.into_channel().into()
5680    }
5681}
5682
5683#[cfg(target_os = "fuchsia")]
5684impl From<fidl::Channel> for DataRouterSynchronousProxy {
5685    fn from(value: fidl::Channel) -> Self {
5686        Self::new(value)
5687    }
5688}
5689
5690#[cfg(target_os = "fuchsia")]
5691impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5692    type Protocol = DataRouterMarker;
5693
5694    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5695        Self::new(value.into_channel())
5696    }
5697}
5698
5699#[derive(Debug, Clone)]
5700pub struct DataRouterProxy {
5701    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5702}
5703
5704impl fidl::endpoints::Proxy for DataRouterProxy {
5705    type Protocol = DataRouterMarker;
5706
5707    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5708        Self::new(inner)
5709    }
5710
5711    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5712        self.client.into_channel().map_err(|client| Self { client })
5713    }
5714
5715    fn as_channel(&self) -> &::fidl::AsyncChannel {
5716        self.client.as_channel()
5717    }
5718}
5719
5720impl DataRouterProxy {
5721    /// Create a new Proxy for fuchsia.component.runtime/DataRouter.
5722    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5723        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5724        Self { client: fidl::client::Client::new(channel, protocol_name) }
5725    }
5726
5727    /// Get a Stream of events from the remote end of the protocol.
5728    ///
5729    /// # Panics
5730    ///
5731    /// Panics if the event stream was already taken.
5732    pub fn take_event_stream(&self) -> DataRouterEventStream {
5733        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5734    }
5735
5736    /// Attempts to produce a `Data` capability from this
5737    /// `DataRouter`.
5738    ///
5739    /// `request` contains context for this route, and `instance_token`
5740    /// references the component that the routing operation is being performed
5741    /// for.
5742    ///
5743    /// This will return:
5744    ///
5745    /// - `SUCCESS` if `handle` has been associated with a connector.
5746    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5747    ///   will be closed.
5748    /// - An error, if the operation failed.
5749    pub fn r#route(
5750        &self,
5751        mut request: RouteRequest,
5752        mut instance_token: fidl::EventPair,
5753        mut handle: fidl::EventPair,
5754    ) -> fidl::client::QueryResponseFut<
5755        DataRouterRouteResult,
5756        fidl::encoding::DefaultFuchsiaResourceDialect,
5757    > {
5758        DataRouterProxyInterface::r#route(self, request, instance_token, handle)
5759    }
5760}
5761
5762impl DataRouterProxyInterface for DataRouterProxy {
5763    type RouteResponseFut = fidl::client::QueryResponseFut<
5764        DataRouterRouteResult,
5765        fidl::encoding::DefaultFuchsiaResourceDialect,
5766    >;
5767    fn r#route(
5768        &self,
5769        mut request: RouteRequest,
5770        mut instance_token: fidl::EventPair,
5771        mut handle: fidl::EventPair,
5772    ) -> Self::RouteResponseFut {
5773        fn _decode(
5774            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5775        ) -> Result<DataRouterRouteResult, fidl::Error> {
5776            let _response = fidl::client::decode_transaction_body::<
5777                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5778                fidl::encoding::DefaultFuchsiaResourceDialect,
5779                0x646885ba7e10ceeb,
5780            >(_buf?)?
5781            .into_result::<DataRouterMarker>("route")?;
5782            Ok(_response.map(|x| x.response))
5783        }
5784        self.client.send_query_and_decode::<DataRouterRouteRequest, DataRouterRouteResult>(
5785            (&mut request, instance_token, handle),
5786            0x646885ba7e10ceeb,
5787            fidl::encoding::DynamicFlags::FLEXIBLE,
5788            _decode,
5789        )
5790    }
5791}
5792
5793pub struct DataRouterEventStream {
5794    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5795}
5796
5797impl std::marker::Unpin for DataRouterEventStream {}
5798
5799impl futures::stream::FusedStream for DataRouterEventStream {
5800    fn is_terminated(&self) -> bool {
5801        self.event_receiver.is_terminated()
5802    }
5803}
5804
5805impl futures::Stream for DataRouterEventStream {
5806    type Item = Result<DataRouterEvent, fidl::Error>;
5807
5808    fn poll_next(
5809        mut self: std::pin::Pin<&mut Self>,
5810        cx: &mut std::task::Context<'_>,
5811    ) -> std::task::Poll<Option<Self::Item>> {
5812        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5813            &mut self.event_receiver,
5814            cx
5815        )?) {
5816            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5817            None => std::task::Poll::Ready(None),
5818        }
5819    }
5820}
5821
5822#[derive(Debug)]
5823pub enum DataRouterEvent {
5824    #[non_exhaustive]
5825    _UnknownEvent {
5826        /// Ordinal of the event that was sent.
5827        ordinal: u64,
5828    },
5829}
5830
5831impl DataRouterEvent {
5832    /// Decodes a message buffer as a [`DataRouterEvent`].
5833    fn decode(
5834        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5835    ) -> Result<DataRouterEvent, fidl::Error> {
5836        let (bytes, _handles) = buf.split_mut();
5837        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5838        debug_assert_eq!(tx_header.tx_id, 0);
5839        match tx_header.ordinal {
5840            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5841                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5842            }
5843            _ => Err(fidl::Error::UnknownOrdinal {
5844                ordinal: tx_header.ordinal,
5845                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5846            }),
5847        }
5848    }
5849}
5850
5851/// A Stream of incoming requests for fuchsia.component.runtime/DataRouter.
5852pub struct DataRouterRequestStream {
5853    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5854    is_terminated: bool,
5855}
5856
5857impl std::marker::Unpin for DataRouterRequestStream {}
5858
5859impl futures::stream::FusedStream for DataRouterRequestStream {
5860    fn is_terminated(&self) -> bool {
5861        self.is_terminated
5862    }
5863}
5864
5865impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5866    type Protocol = DataRouterMarker;
5867    type ControlHandle = DataRouterControlHandle;
5868
5869    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5870        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5871    }
5872
5873    fn control_handle(&self) -> Self::ControlHandle {
5874        DataRouterControlHandle { inner: self.inner.clone() }
5875    }
5876
5877    fn into_inner(
5878        self,
5879    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5880    {
5881        (self.inner, self.is_terminated)
5882    }
5883
5884    fn from_inner(
5885        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5886        is_terminated: bool,
5887    ) -> Self {
5888        Self { inner, is_terminated }
5889    }
5890}
5891
5892impl futures::Stream for DataRouterRequestStream {
5893    type Item = Result<DataRouterRequest, fidl::Error>;
5894
5895    fn poll_next(
5896        mut self: std::pin::Pin<&mut Self>,
5897        cx: &mut std::task::Context<'_>,
5898    ) -> std::task::Poll<Option<Self::Item>> {
5899        let this = &mut *self;
5900        if this.inner.check_shutdown(cx) {
5901            this.is_terminated = true;
5902            return std::task::Poll::Ready(None);
5903        }
5904        if this.is_terminated {
5905            panic!("polled DataRouterRequestStream after completion");
5906        }
5907        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5908            |bytes, handles| {
5909                match this.inner.channel().read_etc(cx, bytes, handles) {
5910                    std::task::Poll::Ready(Ok(())) => {}
5911                    std::task::Poll::Pending => return std::task::Poll::Pending,
5912                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5913                        this.is_terminated = true;
5914                        return std::task::Poll::Ready(None);
5915                    }
5916                    std::task::Poll::Ready(Err(e)) => {
5917                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5918                            e.into(),
5919                        ))));
5920                    }
5921                }
5922
5923                // A message has been received from the channel
5924                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5925
5926                std::task::Poll::Ready(Some(match header.ordinal {
5927                    0x646885ba7e10ceeb => {
5928                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5929                        let mut req = fidl::new_empty!(
5930                            DataRouterRouteRequest,
5931                            fidl::encoding::DefaultFuchsiaResourceDialect
5932                        );
5933                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5934                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5935                        Ok(DataRouterRequest::Route {
5936                            request: req.request,
5937                            instance_token: req.instance_token,
5938                            handle: req.handle,
5939
5940                            responder: DataRouterRouteResponder {
5941                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5942                                tx_id: header.tx_id,
5943                            },
5944                        })
5945                    }
5946                    _ if header.tx_id == 0
5947                        && header
5948                            .dynamic_flags()
5949                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5950                    {
5951                        Ok(DataRouterRequest::_UnknownMethod {
5952                            ordinal: header.ordinal,
5953                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5954                            method_type: fidl::MethodType::OneWay,
5955                        })
5956                    }
5957                    _ if header
5958                        .dynamic_flags()
5959                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5960                    {
5961                        this.inner.send_framework_err(
5962                            fidl::encoding::FrameworkErr::UnknownMethod,
5963                            header.tx_id,
5964                            header.ordinal,
5965                            header.dynamic_flags(),
5966                            (bytes, handles),
5967                        )?;
5968                        Ok(DataRouterRequest::_UnknownMethod {
5969                            ordinal: header.ordinal,
5970                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5971                            method_type: fidl::MethodType::TwoWay,
5972                        })
5973                    }
5974                    _ => Err(fidl::Error::UnknownOrdinal {
5975                        ordinal: header.ordinal,
5976                        protocol_name:
5977                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5978                    }),
5979                }))
5980            },
5981        )
5982    }
5983}
5984
5985/// A factory for `Data` capabilities.
5986#[derive(Debug)]
5987pub enum DataRouterRequest {
5988    /// Attempts to produce a `Data` capability from this
5989    /// `DataRouter`.
5990    ///
5991    /// `request` contains context for this route, and `instance_token`
5992    /// references the component that the routing operation is being performed
5993    /// for.
5994    ///
5995    /// This will return:
5996    ///
5997    /// - `SUCCESS` if `handle` has been associated with a connector.
5998    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5999    ///   will be closed.
6000    /// - An error, if the operation failed.
6001    Route {
6002        request: RouteRequest,
6003        instance_token: fidl::EventPair,
6004        handle: fidl::EventPair,
6005        responder: DataRouterRouteResponder,
6006    },
6007    /// An interaction was received which does not match any known method.
6008    #[non_exhaustive]
6009    _UnknownMethod {
6010        /// Ordinal of the method that was called.
6011        ordinal: u64,
6012        control_handle: DataRouterControlHandle,
6013        method_type: fidl::MethodType,
6014    },
6015}
6016
6017impl DataRouterRequest {
6018    #[allow(irrefutable_let_patterns)]
6019    pub fn into_route(
6020        self,
6021    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DataRouterRouteResponder)> {
6022        if let DataRouterRequest::Route { request, instance_token, handle, responder } = self {
6023            Some((request, instance_token, handle, responder))
6024        } else {
6025            None
6026        }
6027    }
6028
6029    /// Name of the method defined in FIDL
6030    pub fn method_name(&self) -> &'static str {
6031        match *self {
6032            DataRouterRequest::Route { .. } => "route",
6033            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6034                "unknown one-way method"
6035            }
6036            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6037                "unknown two-way method"
6038            }
6039        }
6040    }
6041}
6042
6043#[derive(Debug, Clone)]
6044pub struct DataRouterControlHandle {
6045    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6046}
6047
6048impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
6049    fn shutdown(&self) {
6050        self.inner.shutdown()
6051    }
6052
6053    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6054        self.inner.shutdown_with_epitaph(status)
6055    }
6056
6057    fn is_closed(&self) -> bool {
6058        self.inner.channel().is_closed()
6059    }
6060    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6061        self.inner.channel().on_closed()
6062    }
6063
6064    #[cfg(target_os = "fuchsia")]
6065    fn signal_peer(
6066        &self,
6067        clear_mask: zx::Signals,
6068        set_mask: zx::Signals,
6069    ) -> Result<(), zx_status::Status> {
6070        use fidl::Peered;
6071        self.inner.channel().signal_peer(clear_mask, set_mask)
6072    }
6073}
6074
6075impl DataRouterControlHandle {}
6076
6077#[must_use = "FIDL methods require a response to be sent"]
6078#[derive(Debug)]
6079pub struct DataRouterRouteResponder {
6080    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
6081    tx_id: u32,
6082}
6083
6084/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
6085/// if the responder is dropped without sending a response, so that the client
6086/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6087impl std::ops::Drop for DataRouterRouteResponder {
6088    fn drop(&mut self) {
6089        self.control_handle.shutdown();
6090        // Safety: drops once, never accessed again
6091        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6092    }
6093}
6094
6095impl fidl::endpoints::Responder for DataRouterRouteResponder {
6096    type ControlHandle = DataRouterControlHandle;
6097
6098    fn control_handle(&self) -> &DataRouterControlHandle {
6099        &self.control_handle
6100    }
6101
6102    fn drop_without_shutdown(mut self) {
6103        // Safety: drops once, never accessed again due to mem::forget
6104        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6105        // Prevent Drop from running (which would shut down the channel)
6106        std::mem::forget(self);
6107    }
6108}
6109
6110impl DataRouterRouteResponder {
6111    /// Sends a response to the FIDL transaction.
6112    ///
6113    /// Sets the channel to shutdown if an error occurs.
6114    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6115        let _result = self.send_raw(result);
6116        if _result.is_err() {
6117            self.control_handle.shutdown();
6118        }
6119        self.drop_without_shutdown();
6120        _result
6121    }
6122
6123    /// Similar to "send" but does not shutdown the channel if an error occurs.
6124    pub fn send_no_shutdown_on_err(
6125        self,
6126        mut result: Result<RouterResponse, i32>,
6127    ) -> Result<(), fidl::Error> {
6128        let _result = self.send_raw(result);
6129        self.drop_without_shutdown();
6130        _result
6131    }
6132
6133    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6134        self.control_handle
6135            .inner
6136            .send::<fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>>(
6137                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
6138                self.tx_id,
6139                0x646885ba7e10ceeb,
6140                fidl::encoding::DynamicFlags::FLEXIBLE,
6141            )
6142    }
6143}
6144
6145#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6146pub struct DictionaryKeyIteratorMarker;
6147
6148impl fidl::endpoints::ProtocolMarker for DictionaryKeyIteratorMarker {
6149    type Proxy = DictionaryKeyIteratorProxy;
6150    type RequestStream = DictionaryKeyIteratorRequestStream;
6151    #[cfg(target_os = "fuchsia")]
6152    type SynchronousProxy = DictionaryKeyIteratorSynchronousProxy;
6153
6154    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeyIterator";
6155}
6156
6157pub trait DictionaryKeyIteratorProxyInterface: Send + Sync {
6158    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6159    fn r#get_next(&self) -> Self::GetNextResponseFut;
6160}
6161#[derive(Debug)]
6162#[cfg(target_os = "fuchsia")]
6163pub struct DictionaryKeyIteratorSynchronousProxy {
6164    client: fidl::client::sync::Client,
6165}
6166
6167#[cfg(target_os = "fuchsia")]
6168impl fidl::endpoints::SynchronousProxy for DictionaryKeyIteratorSynchronousProxy {
6169    type Proxy = DictionaryKeyIteratorProxy;
6170    type Protocol = DictionaryKeyIteratorMarker;
6171
6172    fn from_channel(inner: fidl::Channel) -> Self {
6173        Self::new(inner)
6174    }
6175
6176    fn into_channel(self) -> fidl::Channel {
6177        self.client.into_channel()
6178    }
6179
6180    fn as_channel(&self) -> &fidl::Channel {
6181        self.client.as_channel()
6182    }
6183}
6184
6185#[cfg(target_os = "fuchsia")]
6186impl DictionaryKeyIteratorSynchronousProxy {
6187    pub fn new(channel: fidl::Channel) -> Self {
6188        let protocol_name =
6189            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6190        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6191    }
6192
6193    pub fn into_channel(self) -> fidl::Channel {
6194        self.client.into_channel()
6195    }
6196
6197    /// Waits until an event arrives and returns it. It is safe for other
6198    /// threads to make concurrent requests while waiting for an event.
6199    pub fn wait_for_event(
6200        &self,
6201        deadline: zx::MonotonicInstant,
6202    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6203        DictionaryKeyIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6204    }
6205
6206    /// Returns the next set of keys in this dictionary. Returns an empty vector
6207    /// when there are no more keys to iterate.
6208    pub fn r#get_next(
6209        &self,
6210        ___deadline: zx::MonotonicInstant,
6211    ) -> Result<Vec<String>, fidl::Error> {
6212        let _response = self
6213            .client
6214            .send_query::<fidl::encoding::EmptyPayload, DictionaryKeyIteratorGetNextResponse>(
6215                (),
6216                0x3806bda34433db54,
6217                fidl::encoding::DynamicFlags::empty(),
6218                ___deadline,
6219            )?;
6220        Ok(_response.keys)
6221    }
6222}
6223
6224#[cfg(target_os = "fuchsia")]
6225impl From<DictionaryKeyIteratorSynchronousProxy> for zx::NullableHandle {
6226    fn from(value: DictionaryKeyIteratorSynchronousProxy) -> Self {
6227        value.into_channel().into()
6228    }
6229}
6230
6231#[cfg(target_os = "fuchsia")]
6232impl From<fidl::Channel> for DictionaryKeyIteratorSynchronousProxy {
6233    fn from(value: fidl::Channel) -> Self {
6234        Self::new(value)
6235    }
6236}
6237
6238#[cfg(target_os = "fuchsia")]
6239impl fidl::endpoints::FromClient for DictionaryKeyIteratorSynchronousProxy {
6240    type Protocol = DictionaryKeyIteratorMarker;
6241
6242    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeyIteratorMarker>) -> Self {
6243        Self::new(value.into_channel())
6244    }
6245}
6246
6247#[derive(Debug, Clone)]
6248pub struct DictionaryKeyIteratorProxy {
6249    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6250}
6251
6252impl fidl::endpoints::Proxy for DictionaryKeyIteratorProxy {
6253    type Protocol = DictionaryKeyIteratorMarker;
6254
6255    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6256        Self::new(inner)
6257    }
6258
6259    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6260        self.client.into_channel().map_err(|client| Self { client })
6261    }
6262
6263    fn as_channel(&self) -> &::fidl::AsyncChannel {
6264        self.client.as_channel()
6265    }
6266}
6267
6268impl DictionaryKeyIteratorProxy {
6269    /// Create a new Proxy for fuchsia.component.runtime/DictionaryKeyIterator.
6270    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6271        let protocol_name =
6272            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6273        Self { client: fidl::client::Client::new(channel, protocol_name) }
6274    }
6275
6276    /// Get a Stream of events from the remote end of the protocol.
6277    ///
6278    /// # Panics
6279    ///
6280    /// Panics if the event stream was already taken.
6281    pub fn take_event_stream(&self) -> DictionaryKeyIteratorEventStream {
6282        DictionaryKeyIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6283    }
6284
6285    /// Returns the next set of keys in this dictionary. Returns an empty vector
6286    /// when there are no more keys to iterate.
6287    pub fn r#get_next(
6288        &self,
6289    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
6290    {
6291        DictionaryKeyIteratorProxyInterface::r#get_next(self)
6292    }
6293}
6294
6295impl DictionaryKeyIteratorProxyInterface for DictionaryKeyIteratorProxy {
6296    type GetNextResponseFut =
6297        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
6298    fn r#get_next(&self) -> Self::GetNextResponseFut {
6299        fn _decode(
6300            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6301        ) -> Result<Vec<String>, fidl::Error> {
6302            let _response = fidl::client::decode_transaction_body::<
6303                DictionaryKeyIteratorGetNextResponse,
6304                fidl::encoding::DefaultFuchsiaResourceDialect,
6305                0x3806bda34433db54,
6306            >(_buf?)?;
6307            Ok(_response.keys)
6308        }
6309        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6310            (),
6311            0x3806bda34433db54,
6312            fidl::encoding::DynamicFlags::empty(),
6313            _decode,
6314        )
6315    }
6316}
6317
6318pub struct DictionaryKeyIteratorEventStream {
6319    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6320}
6321
6322impl std::marker::Unpin for DictionaryKeyIteratorEventStream {}
6323
6324impl futures::stream::FusedStream for DictionaryKeyIteratorEventStream {
6325    fn is_terminated(&self) -> bool {
6326        self.event_receiver.is_terminated()
6327    }
6328}
6329
6330impl futures::Stream for DictionaryKeyIteratorEventStream {
6331    type Item = Result<DictionaryKeyIteratorEvent, fidl::Error>;
6332
6333    fn poll_next(
6334        mut self: std::pin::Pin<&mut Self>,
6335        cx: &mut std::task::Context<'_>,
6336    ) -> std::task::Poll<Option<Self::Item>> {
6337        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6338            &mut self.event_receiver,
6339            cx
6340        )?) {
6341            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeyIteratorEvent::decode(buf))),
6342            None => std::task::Poll::Ready(None),
6343        }
6344    }
6345}
6346
6347#[derive(Debug)]
6348pub enum DictionaryKeyIteratorEvent {}
6349
6350impl DictionaryKeyIteratorEvent {
6351    /// Decodes a message buffer as a [`DictionaryKeyIteratorEvent`].
6352    fn decode(
6353        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6354    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6355        let (bytes, _handles) = buf.split_mut();
6356        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6357        debug_assert_eq!(tx_header.tx_id, 0);
6358        match tx_header.ordinal {
6359            _ => Err(fidl::Error::UnknownOrdinal {
6360                ordinal: tx_header.ordinal,
6361                protocol_name:
6362                    <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6363            }),
6364        }
6365    }
6366}
6367
6368/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryKeyIterator.
6369pub struct DictionaryKeyIteratorRequestStream {
6370    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6371    is_terminated: bool,
6372}
6373
6374impl std::marker::Unpin for DictionaryKeyIteratorRequestStream {}
6375
6376impl futures::stream::FusedStream for DictionaryKeyIteratorRequestStream {
6377    fn is_terminated(&self) -> bool {
6378        self.is_terminated
6379    }
6380}
6381
6382impl fidl::endpoints::RequestStream for DictionaryKeyIteratorRequestStream {
6383    type Protocol = DictionaryKeyIteratorMarker;
6384    type ControlHandle = DictionaryKeyIteratorControlHandle;
6385
6386    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6387        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6388    }
6389
6390    fn control_handle(&self) -> Self::ControlHandle {
6391        DictionaryKeyIteratorControlHandle { inner: self.inner.clone() }
6392    }
6393
6394    fn into_inner(
6395        self,
6396    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6397    {
6398        (self.inner, self.is_terminated)
6399    }
6400
6401    fn from_inner(
6402        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6403        is_terminated: bool,
6404    ) -> Self {
6405        Self { inner, is_terminated }
6406    }
6407}
6408
6409impl futures::Stream for DictionaryKeyIteratorRequestStream {
6410    type Item = Result<DictionaryKeyIteratorRequest, fidl::Error>;
6411
6412    fn poll_next(
6413        mut self: std::pin::Pin<&mut Self>,
6414        cx: &mut std::task::Context<'_>,
6415    ) -> std::task::Poll<Option<Self::Item>> {
6416        let this = &mut *self;
6417        if this.inner.check_shutdown(cx) {
6418            this.is_terminated = true;
6419            return std::task::Poll::Ready(None);
6420        }
6421        if this.is_terminated {
6422            panic!("polled DictionaryKeyIteratorRequestStream after completion");
6423        }
6424        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6425            |bytes, handles| {
6426                match this.inner.channel().read_etc(cx, bytes, handles) {
6427                    std::task::Poll::Ready(Ok(())) => {}
6428                    std::task::Poll::Pending => return std::task::Poll::Pending,
6429                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6430                        this.is_terminated = true;
6431                        return std::task::Poll::Ready(None);
6432                    }
6433                    std::task::Poll::Ready(Err(e)) => {
6434                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6435                            e.into(),
6436                        ))));
6437                    }
6438                }
6439
6440                // A message has been received from the channel
6441                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6442
6443                std::task::Poll::Ready(Some(match header.ordinal {
6444                0x3806bda34433db54 => {
6445                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6446                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6447                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6448                    let control_handle = DictionaryKeyIteratorControlHandle {
6449                        inner: this.inner.clone(),
6450                    };
6451                    Ok(DictionaryKeyIteratorRequest::GetNext {
6452                        responder: DictionaryKeyIteratorGetNextResponder {
6453                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6454                            tx_id: header.tx_id,
6455                        },
6456                    })
6457                }
6458                _ => Err(fidl::Error::UnknownOrdinal {
6459                    ordinal: header.ordinal,
6460                    protocol_name: <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6461                }),
6462            }))
6463            },
6464        )
6465    }
6466}
6467
6468#[derive(Debug)]
6469pub enum DictionaryKeyIteratorRequest {
6470    /// Returns the next set of keys in this dictionary. Returns an empty vector
6471    /// when there are no more keys to iterate.
6472    GetNext { responder: DictionaryKeyIteratorGetNextResponder },
6473}
6474
6475impl DictionaryKeyIteratorRequest {
6476    #[allow(irrefutable_let_patterns)]
6477    pub fn into_get_next(self) -> Option<(DictionaryKeyIteratorGetNextResponder)> {
6478        if let DictionaryKeyIteratorRequest::GetNext { responder } = self {
6479            Some((responder))
6480        } else {
6481            None
6482        }
6483    }
6484
6485    /// Name of the method defined in FIDL
6486    pub fn method_name(&self) -> &'static str {
6487        match *self {
6488            DictionaryKeyIteratorRequest::GetNext { .. } => "get_next",
6489        }
6490    }
6491}
6492
6493#[derive(Debug, Clone)]
6494pub struct DictionaryKeyIteratorControlHandle {
6495    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6496}
6497
6498impl fidl::endpoints::ControlHandle for DictionaryKeyIteratorControlHandle {
6499    fn shutdown(&self) {
6500        self.inner.shutdown()
6501    }
6502
6503    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6504        self.inner.shutdown_with_epitaph(status)
6505    }
6506
6507    fn is_closed(&self) -> bool {
6508        self.inner.channel().is_closed()
6509    }
6510    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6511        self.inner.channel().on_closed()
6512    }
6513
6514    #[cfg(target_os = "fuchsia")]
6515    fn signal_peer(
6516        &self,
6517        clear_mask: zx::Signals,
6518        set_mask: zx::Signals,
6519    ) -> Result<(), zx_status::Status> {
6520        use fidl::Peered;
6521        self.inner.channel().signal_peer(clear_mask, set_mask)
6522    }
6523}
6524
6525impl DictionaryKeyIteratorControlHandle {}
6526
6527#[must_use = "FIDL methods require a response to be sent"]
6528#[derive(Debug)]
6529pub struct DictionaryKeyIteratorGetNextResponder {
6530    control_handle: std::mem::ManuallyDrop<DictionaryKeyIteratorControlHandle>,
6531    tx_id: u32,
6532}
6533
6534/// Set the the channel to be shutdown (see [`DictionaryKeyIteratorControlHandle::shutdown`])
6535/// if the responder is dropped without sending a response, so that the client
6536/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6537impl std::ops::Drop for DictionaryKeyIteratorGetNextResponder {
6538    fn drop(&mut self) {
6539        self.control_handle.shutdown();
6540        // Safety: drops once, never accessed again
6541        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6542    }
6543}
6544
6545impl fidl::endpoints::Responder for DictionaryKeyIteratorGetNextResponder {
6546    type ControlHandle = DictionaryKeyIteratorControlHandle;
6547
6548    fn control_handle(&self) -> &DictionaryKeyIteratorControlHandle {
6549        &self.control_handle
6550    }
6551
6552    fn drop_without_shutdown(mut self) {
6553        // Safety: drops once, never accessed again due to mem::forget
6554        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6555        // Prevent Drop from running (which would shut down the channel)
6556        std::mem::forget(self);
6557    }
6558}
6559
6560impl DictionaryKeyIteratorGetNextResponder {
6561    /// Sends a response to the FIDL transaction.
6562    ///
6563    /// Sets the channel to shutdown if an error occurs.
6564    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6565        let _result = self.send_raw(keys);
6566        if _result.is_err() {
6567            self.control_handle.shutdown();
6568        }
6569        self.drop_without_shutdown();
6570        _result
6571    }
6572
6573    /// Similar to "send" but does not shutdown the channel if an error occurs.
6574    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6575        let _result = self.send_raw(keys);
6576        self.drop_without_shutdown();
6577        _result
6578    }
6579
6580    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6581        self.control_handle.inner.send::<DictionaryKeyIteratorGetNextResponse>(
6582            (keys,),
6583            self.tx_id,
6584            0x3806bda34433db54,
6585            fidl::encoding::DynamicFlags::empty(),
6586        )
6587    }
6588}
6589
6590#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6591pub struct DictionaryRouterMarker;
6592
6593impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
6594    type Proxy = DictionaryRouterProxy;
6595    type RequestStream = DictionaryRouterRequestStream;
6596    #[cfg(target_os = "fuchsia")]
6597    type SynchronousProxy = DictionaryRouterSynchronousProxy;
6598
6599    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DictionaryRouter";
6600}
6601impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6602pub type DictionaryRouterRouteResult = Result<RouterResponse, i32>;
6603
6604pub trait DictionaryRouterProxyInterface: Send + Sync {
6605    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6606        + Send;
6607    fn r#route(
6608        &self,
6609        request: RouteRequest,
6610        instance_token: fidl::EventPair,
6611        handle: fidl::EventPair,
6612    ) -> Self::RouteResponseFut;
6613}
6614#[derive(Debug)]
6615#[cfg(target_os = "fuchsia")]
6616pub struct DictionaryRouterSynchronousProxy {
6617    client: fidl::client::sync::Client,
6618}
6619
6620#[cfg(target_os = "fuchsia")]
6621impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
6622    type Proxy = DictionaryRouterProxy;
6623    type Protocol = DictionaryRouterMarker;
6624
6625    fn from_channel(inner: fidl::Channel) -> Self {
6626        Self::new(inner)
6627    }
6628
6629    fn into_channel(self) -> fidl::Channel {
6630        self.client.into_channel()
6631    }
6632
6633    fn as_channel(&self) -> &fidl::Channel {
6634        self.client.as_channel()
6635    }
6636}
6637
6638#[cfg(target_os = "fuchsia")]
6639impl DictionaryRouterSynchronousProxy {
6640    pub fn new(channel: fidl::Channel) -> Self {
6641        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6642        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6643    }
6644
6645    pub fn into_channel(self) -> fidl::Channel {
6646        self.client.into_channel()
6647    }
6648
6649    /// Waits until an event arrives and returns it. It is safe for other
6650    /// threads to make concurrent requests while waiting for an event.
6651    pub fn wait_for_event(
6652        &self,
6653        deadline: zx::MonotonicInstant,
6654    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6655        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
6656    }
6657
6658    /// Attempts to produce a `Dictionary` capability from this
6659    /// `DictionaryRouter`.
6660    ///
6661    /// `request` contains context for this route, and `instance_token`
6662    /// references the component that the routing operation is being performed
6663    /// for.
6664    ///
6665    /// This will return:
6666    ///
6667    /// - `SUCCESS` if `handle` has been associated with a connector.
6668    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6669    ///   will be closed.
6670    /// - An error, if the operation failed.
6671    pub fn r#route(
6672        &self,
6673        mut request: RouteRequest,
6674        mut instance_token: fidl::EventPair,
6675        mut handle: fidl::EventPair,
6676        ___deadline: zx::MonotonicInstant,
6677    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6678        let _response = self.client.send_query::<
6679            DictionaryRouterRouteRequest,
6680            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6681        >(
6682            (&mut request, instance_token, handle,),
6683            0x199389f437b3937b,
6684            fidl::encoding::DynamicFlags::FLEXIBLE,
6685            ___deadline,
6686        )?
6687        .into_result::<DictionaryRouterMarker>("route")?;
6688        Ok(_response.map(|x| x.response))
6689    }
6690}
6691
6692#[cfg(target_os = "fuchsia")]
6693impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
6694    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
6695        value.into_channel().into()
6696    }
6697}
6698
6699#[cfg(target_os = "fuchsia")]
6700impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
6701    fn from(value: fidl::Channel) -> Self {
6702        Self::new(value)
6703    }
6704}
6705
6706#[cfg(target_os = "fuchsia")]
6707impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
6708    type Protocol = DictionaryRouterMarker;
6709
6710    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
6711        Self::new(value.into_channel())
6712    }
6713}
6714
6715#[derive(Debug, Clone)]
6716pub struct DictionaryRouterProxy {
6717    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6718}
6719
6720impl fidl::endpoints::Proxy for DictionaryRouterProxy {
6721    type Protocol = DictionaryRouterMarker;
6722
6723    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6724        Self::new(inner)
6725    }
6726
6727    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6728        self.client.into_channel().map_err(|client| Self { client })
6729    }
6730
6731    fn as_channel(&self) -> &::fidl::AsyncChannel {
6732        self.client.as_channel()
6733    }
6734}
6735
6736impl DictionaryRouterProxy {
6737    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouter.
6738    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6739        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6740        Self { client: fidl::client::Client::new(channel, protocol_name) }
6741    }
6742
6743    /// Get a Stream of events from the remote end of the protocol.
6744    ///
6745    /// # Panics
6746    ///
6747    /// Panics if the event stream was already taken.
6748    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6749        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6750    }
6751
6752    /// Attempts to produce a `Dictionary` capability from this
6753    /// `DictionaryRouter`.
6754    ///
6755    /// `request` contains context for this route, and `instance_token`
6756    /// references the component that the routing operation is being performed
6757    /// for.
6758    ///
6759    /// This will return:
6760    ///
6761    /// - `SUCCESS` if `handle` has been associated with a connector.
6762    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6763    ///   will be closed.
6764    /// - An error, if the operation failed.
6765    pub fn r#route(
6766        &self,
6767        mut request: RouteRequest,
6768        mut instance_token: fidl::EventPair,
6769        mut handle: fidl::EventPair,
6770    ) -> fidl::client::QueryResponseFut<
6771        DictionaryRouterRouteResult,
6772        fidl::encoding::DefaultFuchsiaResourceDialect,
6773    > {
6774        DictionaryRouterProxyInterface::r#route(self, request, instance_token, handle)
6775    }
6776}
6777
6778impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6779    type RouteResponseFut = fidl::client::QueryResponseFut<
6780        DictionaryRouterRouteResult,
6781        fidl::encoding::DefaultFuchsiaResourceDialect,
6782    >;
6783    fn r#route(
6784        &self,
6785        mut request: RouteRequest,
6786        mut instance_token: fidl::EventPair,
6787        mut handle: fidl::EventPair,
6788    ) -> Self::RouteResponseFut {
6789        fn _decode(
6790            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6791        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6792            let _response = fidl::client::decode_transaction_body::<
6793                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6794                fidl::encoding::DefaultFuchsiaResourceDialect,
6795                0x199389f437b3937b,
6796            >(_buf?)?
6797            .into_result::<DictionaryRouterMarker>("route")?;
6798            Ok(_response.map(|x| x.response))
6799        }
6800        self.client
6801            .send_query_and_decode::<DictionaryRouterRouteRequest, DictionaryRouterRouteResult>(
6802                (&mut request, instance_token, handle),
6803                0x199389f437b3937b,
6804                fidl::encoding::DynamicFlags::FLEXIBLE,
6805                _decode,
6806            )
6807    }
6808}
6809
6810pub struct DictionaryRouterEventStream {
6811    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6812}
6813
6814impl std::marker::Unpin for DictionaryRouterEventStream {}
6815
6816impl futures::stream::FusedStream for DictionaryRouterEventStream {
6817    fn is_terminated(&self) -> bool {
6818        self.event_receiver.is_terminated()
6819    }
6820}
6821
6822impl futures::Stream for DictionaryRouterEventStream {
6823    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6824
6825    fn poll_next(
6826        mut self: std::pin::Pin<&mut Self>,
6827        cx: &mut std::task::Context<'_>,
6828    ) -> std::task::Poll<Option<Self::Item>> {
6829        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6830            &mut self.event_receiver,
6831            cx
6832        )?) {
6833            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6834            None => std::task::Poll::Ready(None),
6835        }
6836    }
6837}
6838
6839#[derive(Debug)]
6840pub enum DictionaryRouterEvent {
6841    #[non_exhaustive]
6842    _UnknownEvent {
6843        /// Ordinal of the event that was sent.
6844        ordinal: u64,
6845    },
6846}
6847
6848impl DictionaryRouterEvent {
6849    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6850    fn decode(
6851        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6852    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6853        let (bytes, _handles) = buf.split_mut();
6854        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6855        debug_assert_eq!(tx_header.tx_id, 0);
6856        match tx_header.ordinal {
6857            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6858                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6859            }
6860            _ => Err(fidl::Error::UnknownOrdinal {
6861                ordinal: tx_header.ordinal,
6862                protocol_name:
6863                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6864            }),
6865        }
6866    }
6867}
6868
6869/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouter.
6870pub struct DictionaryRouterRequestStream {
6871    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6872    is_terminated: bool,
6873}
6874
6875impl std::marker::Unpin for DictionaryRouterRequestStream {}
6876
6877impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6878    fn is_terminated(&self) -> bool {
6879        self.is_terminated
6880    }
6881}
6882
6883impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
6884    type Protocol = DictionaryRouterMarker;
6885    type ControlHandle = DictionaryRouterControlHandle;
6886
6887    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6888        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6889    }
6890
6891    fn control_handle(&self) -> Self::ControlHandle {
6892        DictionaryRouterControlHandle { inner: self.inner.clone() }
6893    }
6894
6895    fn into_inner(
6896        self,
6897    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6898    {
6899        (self.inner, self.is_terminated)
6900    }
6901
6902    fn from_inner(
6903        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6904        is_terminated: bool,
6905    ) -> Self {
6906        Self { inner, is_terminated }
6907    }
6908}
6909
6910impl futures::Stream for DictionaryRouterRequestStream {
6911    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6912
6913    fn poll_next(
6914        mut self: std::pin::Pin<&mut Self>,
6915        cx: &mut std::task::Context<'_>,
6916    ) -> std::task::Poll<Option<Self::Item>> {
6917        let this = &mut *self;
6918        if this.inner.check_shutdown(cx) {
6919            this.is_terminated = true;
6920            return std::task::Poll::Ready(None);
6921        }
6922        if this.is_terminated {
6923            panic!("polled DictionaryRouterRequestStream after completion");
6924        }
6925        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6926            |bytes, handles| {
6927                match this.inner.channel().read_etc(cx, bytes, handles) {
6928                    std::task::Poll::Ready(Ok(())) => {}
6929                    std::task::Poll::Pending => return std::task::Poll::Pending,
6930                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6931                        this.is_terminated = true;
6932                        return std::task::Poll::Ready(None);
6933                    }
6934                    std::task::Poll::Ready(Err(e)) => {
6935                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6936                            e.into(),
6937                        ))));
6938                    }
6939                }
6940
6941                // A message has been received from the channel
6942                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6943
6944                std::task::Poll::Ready(Some(match header.ordinal {
6945                    0x199389f437b3937b => {
6946                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6947                        let mut req = fidl::new_empty!(
6948                            DictionaryRouterRouteRequest,
6949                            fidl::encoding::DefaultFuchsiaResourceDialect
6950                        );
6951                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6952                        let control_handle =
6953                            DictionaryRouterControlHandle { inner: this.inner.clone() };
6954                        Ok(DictionaryRouterRequest::Route {
6955                            request: req.request,
6956                            instance_token: req.instance_token,
6957                            handle: req.handle,
6958
6959                            responder: DictionaryRouterRouteResponder {
6960                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6961                                tx_id: header.tx_id,
6962                            },
6963                        })
6964                    }
6965                    _ if header.tx_id == 0
6966                        && header
6967                            .dynamic_flags()
6968                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6969                    {
6970                        Ok(DictionaryRouterRequest::_UnknownMethod {
6971                            ordinal: header.ordinal,
6972                            control_handle: DictionaryRouterControlHandle {
6973                                inner: this.inner.clone(),
6974                            },
6975                            method_type: fidl::MethodType::OneWay,
6976                        })
6977                    }
6978                    _ if header
6979                        .dynamic_flags()
6980                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6981                    {
6982                        this.inner.send_framework_err(
6983                            fidl::encoding::FrameworkErr::UnknownMethod,
6984                            header.tx_id,
6985                            header.ordinal,
6986                            header.dynamic_flags(),
6987                            (bytes, handles),
6988                        )?;
6989                        Ok(DictionaryRouterRequest::_UnknownMethod {
6990                            ordinal: header.ordinal,
6991                            control_handle: DictionaryRouterControlHandle {
6992                                inner: this.inner.clone(),
6993                            },
6994                            method_type: fidl::MethodType::TwoWay,
6995                        })
6996                    }
6997                    _ => Err(fidl::Error::UnknownOrdinal {
6998                        ordinal: header.ordinal,
6999                        protocol_name:
7000                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7001                    }),
7002                }))
7003            },
7004        )
7005    }
7006}
7007
7008/// A factory for `Dictionary` capabilities.
7009#[derive(Debug)]
7010pub enum DictionaryRouterRequest {
7011    /// Attempts to produce a `Dictionary` capability from this
7012    /// `DictionaryRouter`.
7013    ///
7014    /// `request` contains context for this route, and `instance_token`
7015    /// references the component that the routing operation is being performed
7016    /// for.
7017    ///
7018    /// This will return:
7019    ///
7020    /// - `SUCCESS` if `handle` has been associated with a connector.
7021    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7022    ///   will be closed.
7023    /// - An error, if the operation failed.
7024    Route {
7025        request: RouteRequest,
7026        instance_token: fidl::EventPair,
7027        handle: fidl::EventPair,
7028        responder: DictionaryRouterRouteResponder,
7029    },
7030    /// An interaction was received which does not match any known method.
7031    #[non_exhaustive]
7032    _UnknownMethod {
7033        /// Ordinal of the method that was called.
7034        ordinal: u64,
7035        control_handle: DictionaryRouterControlHandle,
7036        method_type: fidl::MethodType,
7037    },
7038}
7039
7040impl DictionaryRouterRequest {
7041    #[allow(irrefutable_let_patterns)]
7042    pub fn into_route(
7043        self,
7044    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DictionaryRouterRouteResponder)>
7045    {
7046        if let DictionaryRouterRequest::Route { request, instance_token, handle, responder } = self
7047        {
7048            Some((request, instance_token, handle, responder))
7049        } else {
7050            None
7051        }
7052    }
7053
7054    /// Name of the method defined in FIDL
7055    pub fn method_name(&self) -> &'static str {
7056        match *self {
7057            DictionaryRouterRequest::Route { .. } => "route",
7058            DictionaryRouterRequest::_UnknownMethod {
7059                method_type: fidl::MethodType::OneWay,
7060                ..
7061            } => "unknown one-way method",
7062            DictionaryRouterRequest::_UnknownMethod {
7063                method_type: fidl::MethodType::TwoWay,
7064                ..
7065            } => "unknown two-way method",
7066        }
7067    }
7068}
7069
7070#[derive(Debug, Clone)]
7071pub struct DictionaryRouterControlHandle {
7072    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7073}
7074
7075impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7076    fn shutdown(&self) {
7077        self.inner.shutdown()
7078    }
7079
7080    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7081        self.inner.shutdown_with_epitaph(status)
7082    }
7083
7084    fn is_closed(&self) -> bool {
7085        self.inner.channel().is_closed()
7086    }
7087    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7088        self.inner.channel().on_closed()
7089    }
7090
7091    #[cfg(target_os = "fuchsia")]
7092    fn signal_peer(
7093        &self,
7094        clear_mask: zx::Signals,
7095        set_mask: zx::Signals,
7096    ) -> Result<(), zx_status::Status> {
7097        use fidl::Peered;
7098        self.inner.channel().signal_peer(clear_mask, set_mask)
7099    }
7100}
7101
7102impl DictionaryRouterControlHandle {}
7103
7104#[must_use = "FIDL methods require a response to be sent"]
7105#[derive(Debug)]
7106pub struct DictionaryRouterRouteResponder {
7107    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7108    tx_id: u32,
7109}
7110
7111/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7112/// if the responder is dropped without sending a response, so that the client
7113/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7114impl std::ops::Drop for DictionaryRouterRouteResponder {
7115    fn drop(&mut self) {
7116        self.control_handle.shutdown();
7117        // Safety: drops once, never accessed again
7118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7119    }
7120}
7121
7122impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7123    type ControlHandle = DictionaryRouterControlHandle;
7124
7125    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7126        &self.control_handle
7127    }
7128
7129    fn drop_without_shutdown(mut self) {
7130        // Safety: drops once, never accessed again due to mem::forget
7131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7132        // Prevent Drop from running (which would shut down the channel)
7133        std::mem::forget(self);
7134    }
7135}
7136
7137impl DictionaryRouterRouteResponder {
7138    /// Sends a response to the FIDL transaction.
7139    ///
7140    /// Sets the channel to shutdown if an error occurs.
7141    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7142        let _result = self.send_raw(result);
7143        if _result.is_err() {
7144            self.control_handle.shutdown();
7145        }
7146        self.drop_without_shutdown();
7147        _result
7148    }
7149
7150    /// Similar to "send" but does not shutdown the channel if an error occurs.
7151    pub fn send_no_shutdown_on_err(
7152        self,
7153        mut result: Result<RouterResponse, i32>,
7154    ) -> Result<(), fidl::Error> {
7155        let _result = self.send_raw(result);
7156        self.drop_without_shutdown();
7157        _result
7158    }
7159
7160    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7161        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7162            DictionaryRouterRouteResponse,
7163            i32,
7164        >>(
7165            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7166            self.tx_id,
7167            0x199389f437b3937b,
7168            fidl::encoding::DynamicFlags::FLEXIBLE,
7169        )
7170    }
7171}
7172
7173#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7174pub struct DirConnectorRouterMarker;
7175
7176impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7177    type Proxy = DirConnectorRouterProxy;
7178    type RequestStream = DirConnectorRouterRequestStream;
7179    #[cfg(target_os = "fuchsia")]
7180    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7181
7182    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouter";
7183}
7184pub type DirConnectorRouterRouteResult = Result<RouterResponse, i32>;
7185
7186pub trait DirConnectorRouterProxyInterface: Send + Sync {
7187    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7188        + Send;
7189    fn r#route(
7190        &self,
7191        request: RouteRequest,
7192        instance_token: fidl::EventPair,
7193        handle: fidl::EventPair,
7194    ) -> Self::RouteResponseFut;
7195}
7196#[derive(Debug)]
7197#[cfg(target_os = "fuchsia")]
7198pub struct DirConnectorRouterSynchronousProxy {
7199    client: fidl::client::sync::Client,
7200}
7201
7202#[cfg(target_os = "fuchsia")]
7203impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7204    type Proxy = DirConnectorRouterProxy;
7205    type Protocol = DirConnectorRouterMarker;
7206
7207    fn from_channel(inner: fidl::Channel) -> Self {
7208        Self::new(inner)
7209    }
7210
7211    fn into_channel(self) -> fidl::Channel {
7212        self.client.into_channel()
7213    }
7214
7215    fn as_channel(&self) -> &fidl::Channel {
7216        self.client.as_channel()
7217    }
7218}
7219
7220#[cfg(target_os = "fuchsia")]
7221impl DirConnectorRouterSynchronousProxy {
7222    pub fn new(channel: fidl::Channel) -> Self {
7223        let protocol_name =
7224            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7225        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7226    }
7227
7228    pub fn into_channel(self) -> fidl::Channel {
7229        self.client.into_channel()
7230    }
7231
7232    /// Waits until an event arrives and returns it. It is safe for other
7233    /// threads to make concurrent requests while waiting for an event.
7234    pub fn wait_for_event(
7235        &self,
7236        deadline: zx::MonotonicInstant,
7237    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7238        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
7239    }
7240
7241    /// Attempts to produce a `DirConnector` capability from this
7242    /// `DirConnectorRouter`.
7243    ///
7244    /// `request` contains context for this route, and `instance_token`
7245    /// references the component that the routing operation is being performed
7246    /// for.
7247    ///
7248    /// This will return:
7249    ///
7250    /// - `SUCCESS` if `handle` has been associated with a connector.
7251    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7252    ///   will be closed.
7253    /// - An error, if the operation failed.
7254    pub fn r#route(
7255        &self,
7256        mut request: RouteRequest,
7257        mut instance_token: fidl::EventPair,
7258        mut handle: fidl::EventPair,
7259        ___deadline: zx::MonotonicInstant,
7260    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7261        let _response = self.client.send_query::<
7262            DirConnectorRouterRouteRequest,
7263            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7264        >(
7265            (&mut request, instance_token, handle,),
7266            0x233f2ac038127462,
7267            fidl::encoding::DynamicFlags::FLEXIBLE,
7268            ___deadline,
7269        )?
7270        .into_result::<DirConnectorRouterMarker>("route")?;
7271        Ok(_response.map(|x| x.response))
7272    }
7273}
7274
7275#[cfg(target_os = "fuchsia")]
7276impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
7277    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
7278        value.into_channel().into()
7279    }
7280}
7281
7282#[cfg(target_os = "fuchsia")]
7283impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
7284    fn from(value: fidl::Channel) -> Self {
7285        Self::new(value)
7286    }
7287}
7288
7289#[cfg(target_os = "fuchsia")]
7290impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
7291    type Protocol = DirConnectorRouterMarker;
7292
7293    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
7294        Self::new(value.into_channel())
7295    }
7296}
7297
7298#[derive(Debug, Clone)]
7299pub struct DirConnectorRouterProxy {
7300    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7301}
7302
7303impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
7304    type Protocol = DirConnectorRouterMarker;
7305
7306    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7307        Self::new(inner)
7308    }
7309
7310    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7311        self.client.into_channel().map_err(|client| Self { client })
7312    }
7313
7314    fn as_channel(&self) -> &::fidl::AsyncChannel {
7315        self.client.as_channel()
7316    }
7317}
7318
7319impl DirConnectorRouterProxy {
7320    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouter.
7321    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7322        let protocol_name =
7323            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7324        Self { client: fidl::client::Client::new(channel, protocol_name) }
7325    }
7326
7327    /// Get a Stream of events from the remote end of the protocol.
7328    ///
7329    /// # Panics
7330    ///
7331    /// Panics if the event stream was already taken.
7332    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
7333        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
7334    }
7335
7336    /// Attempts to produce a `DirConnector` capability from this
7337    /// `DirConnectorRouter`.
7338    ///
7339    /// `request` contains context for this route, and `instance_token`
7340    /// references the component that the routing operation is being performed
7341    /// for.
7342    ///
7343    /// This will return:
7344    ///
7345    /// - `SUCCESS` if `handle` has been associated with a connector.
7346    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7347    ///   will be closed.
7348    /// - An error, if the operation failed.
7349    pub fn r#route(
7350        &self,
7351        mut request: RouteRequest,
7352        mut instance_token: fidl::EventPair,
7353        mut handle: fidl::EventPair,
7354    ) -> fidl::client::QueryResponseFut<
7355        DirConnectorRouterRouteResult,
7356        fidl::encoding::DefaultFuchsiaResourceDialect,
7357    > {
7358        DirConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
7359    }
7360}
7361
7362impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
7363    type RouteResponseFut = fidl::client::QueryResponseFut<
7364        DirConnectorRouterRouteResult,
7365        fidl::encoding::DefaultFuchsiaResourceDialect,
7366    >;
7367    fn r#route(
7368        &self,
7369        mut request: RouteRequest,
7370        mut instance_token: fidl::EventPair,
7371        mut handle: fidl::EventPair,
7372    ) -> Self::RouteResponseFut {
7373        fn _decode(
7374            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7375        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7376            let _response = fidl::client::decode_transaction_body::<
7377                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7378                fidl::encoding::DefaultFuchsiaResourceDialect,
7379                0x233f2ac038127462,
7380            >(_buf?)?
7381            .into_result::<DirConnectorRouterMarker>("route")?;
7382            Ok(_response.map(|x| x.response))
7383        }
7384        self.client
7385            .send_query_and_decode::<DirConnectorRouterRouteRequest, DirConnectorRouterRouteResult>(
7386                (&mut request, instance_token, handle),
7387                0x233f2ac038127462,
7388                fidl::encoding::DynamicFlags::FLEXIBLE,
7389                _decode,
7390            )
7391    }
7392}
7393
7394pub struct DirConnectorRouterEventStream {
7395    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7396}
7397
7398impl std::marker::Unpin for DirConnectorRouterEventStream {}
7399
7400impl futures::stream::FusedStream for DirConnectorRouterEventStream {
7401    fn is_terminated(&self) -> bool {
7402        self.event_receiver.is_terminated()
7403    }
7404}
7405
7406impl futures::Stream for DirConnectorRouterEventStream {
7407    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
7408
7409    fn poll_next(
7410        mut self: std::pin::Pin<&mut Self>,
7411        cx: &mut std::task::Context<'_>,
7412    ) -> std::task::Poll<Option<Self::Item>> {
7413        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7414            &mut self.event_receiver,
7415            cx
7416        )?) {
7417            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
7418            None => std::task::Poll::Ready(None),
7419        }
7420    }
7421}
7422
7423#[derive(Debug)]
7424pub enum DirConnectorRouterEvent {
7425    #[non_exhaustive]
7426    _UnknownEvent {
7427        /// Ordinal of the event that was sent.
7428        ordinal: u64,
7429    },
7430}
7431
7432impl DirConnectorRouterEvent {
7433    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
7434    fn decode(
7435        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7436    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7437        let (bytes, _handles) = buf.split_mut();
7438        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7439        debug_assert_eq!(tx_header.tx_id, 0);
7440        match tx_header.ordinal {
7441            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7442                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7443            }
7444            _ => Err(fidl::Error::UnknownOrdinal {
7445                ordinal: tx_header.ordinal,
7446                protocol_name:
7447                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7448            }),
7449        }
7450    }
7451}
7452
7453/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouter.
7454pub struct DirConnectorRouterRequestStream {
7455    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7456    is_terminated: bool,
7457}
7458
7459impl std::marker::Unpin for DirConnectorRouterRequestStream {}
7460
7461impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
7462    fn is_terminated(&self) -> bool {
7463        self.is_terminated
7464    }
7465}
7466
7467impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
7468    type Protocol = DirConnectorRouterMarker;
7469    type ControlHandle = DirConnectorRouterControlHandle;
7470
7471    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7472        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7473    }
7474
7475    fn control_handle(&self) -> Self::ControlHandle {
7476        DirConnectorRouterControlHandle { inner: self.inner.clone() }
7477    }
7478
7479    fn into_inner(
7480        self,
7481    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7482    {
7483        (self.inner, self.is_terminated)
7484    }
7485
7486    fn from_inner(
7487        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7488        is_terminated: bool,
7489    ) -> Self {
7490        Self { inner, is_terminated }
7491    }
7492}
7493
7494impl futures::Stream for DirConnectorRouterRequestStream {
7495    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
7496
7497    fn poll_next(
7498        mut self: std::pin::Pin<&mut Self>,
7499        cx: &mut std::task::Context<'_>,
7500    ) -> std::task::Poll<Option<Self::Item>> {
7501        let this = &mut *self;
7502        if this.inner.check_shutdown(cx) {
7503            this.is_terminated = true;
7504            return std::task::Poll::Ready(None);
7505        }
7506        if this.is_terminated {
7507            panic!("polled DirConnectorRouterRequestStream after completion");
7508        }
7509        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7510            |bytes, handles| {
7511                match this.inner.channel().read_etc(cx, bytes, handles) {
7512                    std::task::Poll::Ready(Ok(())) => {}
7513                    std::task::Poll::Pending => return std::task::Poll::Pending,
7514                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7515                        this.is_terminated = true;
7516                        return std::task::Poll::Ready(None);
7517                    }
7518                    std::task::Poll::Ready(Err(e)) => {
7519                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7520                            e.into(),
7521                        ))));
7522                    }
7523                }
7524
7525                // A message has been received from the channel
7526                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7527
7528                std::task::Poll::Ready(Some(match header.ordinal {
7529                0x233f2ac038127462 => {
7530                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7531                    let mut req = fidl::new_empty!(DirConnectorRouterRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7532                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7533                    let control_handle = DirConnectorRouterControlHandle {
7534                        inner: this.inner.clone(),
7535                    };
7536                    Ok(DirConnectorRouterRequest::Route {request: req.request,
7537instance_token: req.instance_token,
7538handle: req.handle,
7539
7540                        responder: DirConnectorRouterRouteResponder {
7541                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7542                            tx_id: header.tx_id,
7543                        },
7544                    })
7545                }
7546                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7547                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7548                        ordinal: header.ordinal,
7549                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7550                        method_type: fidl::MethodType::OneWay,
7551                    })
7552                }
7553                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7554                    this.inner.send_framework_err(
7555                        fidl::encoding::FrameworkErr::UnknownMethod,
7556                        header.tx_id,
7557                        header.ordinal,
7558                        header.dynamic_flags(),
7559                        (bytes, handles),
7560                    )?;
7561                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7562                        ordinal: header.ordinal,
7563                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7564                        method_type: fidl::MethodType::TwoWay,
7565                    })
7566                }
7567                _ => Err(fidl::Error::UnknownOrdinal {
7568                    ordinal: header.ordinal,
7569                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7570                }),
7571            }))
7572            },
7573        )
7574    }
7575}
7576
7577/// A factory for `DirConnector` capabilities.
7578#[derive(Debug)]
7579pub enum DirConnectorRouterRequest {
7580    /// Attempts to produce a `DirConnector` capability from this
7581    /// `DirConnectorRouter`.
7582    ///
7583    /// `request` contains context for this route, and `instance_token`
7584    /// references the component that the routing operation is being performed
7585    /// for.
7586    ///
7587    /// This will return:
7588    ///
7589    /// - `SUCCESS` if `handle` has been associated with a connector.
7590    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7591    ///   will be closed.
7592    /// - An error, if the operation failed.
7593    Route {
7594        request: RouteRequest,
7595        instance_token: fidl::EventPair,
7596        handle: fidl::EventPair,
7597        responder: DirConnectorRouterRouteResponder,
7598    },
7599    /// An interaction was received which does not match any known method.
7600    #[non_exhaustive]
7601    _UnknownMethod {
7602        /// Ordinal of the method that was called.
7603        ordinal: u64,
7604        control_handle: DirConnectorRouterControlHandle,
7605        method_type: fidl::MethodType,
7606    },
7607}
7608
7609impl DirConnectorRouterRequest {
7610    #[allow(irrefutable_let_patterns)]
7611    pub fn into_route(
7612        self,
7613    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DirConnectorRouterRouteResponder)>
7614    {
7615        if let DirConnectorRouterRequest::Route { request, instance_token, handle, responder } =
7616            self
7617        {
7618            Some((request, instance_token, handle, responder))
7619        } else {
7620            None
7621        }
7622    }
7623
7624    /// Name of the method defined in FIDL
7625    pub fn method_name(&self) -> &'static str {
7626        match *self {
7627            DirConnectorRouterRequest::Route { .. } => "route",
7628            DirConnectorRouterRequest::_UnknownMethod {
7629                method_type: fidl::MethodType::OneWay,
7630                ..
7631            } => "unknown one-way method",
7632            DirConnectorRouterRequest::_UnknownMethod {
7633                method_type: fidl::MethodType::TwoWay,
7634                ..
7635            } => "unknown two-way method",
7636        }
7637    }
7638}
7639
7640#[derive(Debug, Clone)]
7641pub struct DirConnectorRouterControlHandle {
7642    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7643}
7644
7645impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
7646    fn shutdown(&self) {
7647        self.inner.shutdown()
7648    }
7649
7650    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7651        self.inner.shutdown_with_epitaph(status)
7652    }
7653
7654    fn is_closed(&self) -> bool {
7655        self.inner.channel().is_closed()
7656    }
7657    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7658        self.inner.channel().on_closed()
7659    }
7660
7661    #[cfg(target_os = "fuchsia")]
7662    fn signal_peer(
7663        &self,
7664        clear_mask: zx::Signals,
7665        set_mask: zx::Signals,
7666    ) -> Result<(), zx_status::Status> {
7667        use fidl::Peered;
7668        self.inner.channel().signal_peer(clear_mask, set_mask)
7669    }
7670}
7671
7672impl DirConnectorRouterControlHandle {}
7673
7674#[must_use = "FIDL methods require a response to be sent"]
7675#[derive(Debug)]
7676pub struct DirConnectorRouterRouteResponder {
7677    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
7678    tx_id: u32,
7679}
7680
7681/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
7682/// if the responder is dropped without sending a response, so that the client
7683/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7684impl std::ops::Drop for DirConnectorRouterRouteResponder {
7685    fn drop(&mut self) {
7686        self.control_handle.shutdown();
7687        // Safety: drops once, never accessed again
7688        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7689    }
7690}
7691
7692impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
7693    type ControlHandle = DirConnectorRouterControlHandle;
7694
7695    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
7696        &self.control_handle
7697    }
7698
7699    fn drop_without_shutdown(mut self) {
7700        // Safety: drops once, never accessed again due to mem::forget
7701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7702        // Prevent Drop from running (which would shut down the channel)
7703        std::mem::forget(self);
7704    }
7705}
7706
7707impl DirConnectorRouterRouteResponder {
7708    /// Sends a response to the FIDL transaction.
7709    ///
7710    /// Sets the channel to shutdown if an error occurs.
7711    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7712        let _result = self.send_raw(result);
7713        if _result.is_err() {
7714            self.control_handle.shutdown();
7715        }
7716        self.drop_without_shutdown();
7717        _result
7718    }
7719
7720    /// Similar to "send" but does not shutdown the channel if an error occurs.
7721    pub fn send_no_shutdown_on_err(
7722        self,
7723        mut result: Result<RouterResponse, i32>,
7724    ) -> Result<(), fidl::Error> {
7725        let _result = self.send_raw(result);
7726        self.drop_without_shutdown();
7727        _result
7728    }
7729
7730    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7731        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7732            DirConnectorRouterRouteResponse,
7733            i32,
7734        >>(
7735            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7736            self.tx_id,
7737            0x233f2ac038127462,
7738            fidl::encoding::DynamicFlags::FLEXIBLE,
7739        )
7740    }
7741}
7742
7743#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7744pub struct DirReceiverMarker;
7745
7746impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
7747    type Proxy = DirReceiverProxy;
7748    type RequestStream = DirReceiverRequestStream;
7749    #[cfg(target_os = "fuchsia")]
7750    type SynchronousProxy = DirReceiverSynchronousProxy;
7751
7752    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DirReceiver";
7753}
7754impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
7755
7756pub trait DirReceiverProxyInterface: Send + Sync {
7757    fn r#receive(
7758        &self,
7759        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7760        path: &str,
7761        rights: fidl_fuchsia_io::Flags,
7762    ) -> Result<(), fidl::Error>;
7763}
7764#[derive(Debug)]
7765#[cfg(target_os = "fuchsia")]
7766pub struct DirReceiverSynchronousProxy {
7767    client: fidl::client::sync::Client,
7768}
7769
7770#[cfg(target_os = "fuchsia")]
7771impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
7772    type Proxy = DirReceiverProxy;
7773    type Protocol = DirReceiverMarker;
7774
7775    fn from_channel(inner: fidl::Channel) -> Self {
7776        Self::new(inner)
7777    }
7778
7779    fn into_channel(self) -> fidl::Channel {
7780        self.client.into_channel()
7781    }
7782
7783    fn as_channel(&self) -> &fidl::Channel {
7784        self.client.as_channel()
7785    }
7786}
7787
7788#[cfg(target_os = "fuchsia")]
7789impl DirReceiverSynchronousProxy {
7790    pub fn new(channel: fidl::Channel) -> Self {
7791        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7792        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7793    }
7794
7795    pub fn into_channel(self) -> fidl::Channel {
7796        self.client.into_channel()
7797    }
7798
7799    /// Waits until an event arrives and returns it. It is safe for other
7800    /// threads to make concurrent requests while waiting for an event.
7801    pub fn wait_for_event(
7802        &self,
7803        deadline: zx::MonotonicInstant,
7804    ) -> Result<DirReceiverEvent, fidl::Error> {
7805        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
7806    }
7807
7808    /// `Receive` will be called by component manager whenever a new handle has
7809    /// been given to any `DirConnector` associated with this `DirReceiver`.
7810    pub fn r#receive(
7811        &self,
7812        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7813        mut path: &str,
7814        mut rights: fidl_fuchsia_io::Flags,
7815    ) -> Result<(), fidl::Error> {
7816        self.client.send::<DirReceiverReceiveRequest>(
7817            (channel, path, rights),
7818            0x4ac564d726bb325e,
7819            fidl::encoding::DynamicFlags::empty(),
7820        )
7821    }
7822}
7823
7824#[cfg(target_os = "fuchsia")]
7825impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
7826    fn from(value: DirReceiverSynchronousProxy) -> Self {
7827        value.into_channel().into()
7828    }
7829}
7830
7831#[cfg(target_os = "fuchsia")]
7832impl From<fidl::Channel> for DirReceiverSynchronousProxy {
7833    fn from(value: fidl::Channel) -> Self {
7834        Self::new(value)
7835    }
7836}
7837
7838#[cfg(target_os = "fuchsia")]
7839impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
7840    type Protocol = DirReceiverMarker;
7841
7842    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
7843        Self::new(value.into_channel())
7844    }
7845}
7846
7847#[derive(Debug, Clone)]
7848pub struct DirReceiverProxy {
7849    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7850}
7851
7852impl fidl::endpoints::Proxy for DirReceiverProxy {
7853    type Protocol = DirReceiverMarker;
7854
7855    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7856        Self::new(inner)
7857    }
7858
7859    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7860        self.client.into_channel().map_err(|client| Self { client })
7861    }
7862
7863    fn as_channel(&self) -> &::fidl::AsyncChannel {
7864        self.client.as_channel()
7865    }
7866}
7867
7868impl DirReceiverProxy {
7869    /// Create a new Proxy for fuchsia.component.runtime/DirReceiver.
7870    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7871        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7872        Self { client: fidl::client::Client::new(channel, protocol_name) }
7873    }
7874
7875    /// Get a Stream of events from the remote end of the protocol.
7876    ///
7877    /// # Panics
7878    ///
7879    /// Panics if the event stream was already taken.
7880    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7881        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7882    }
7883
7884    /// `Receive` will be called by component manager whenever a new handle has
7885    /// been given to any `DirConnector` associated with this `DirReceiver`.
7886    pub fn r#receive(
7887        &self,
7888        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7889        mut path: &str,
7890        mut rights: fidl_fuchsia_io::Flags,
7891    ) -> Result<(), fidl::Error> {
7892        DirReceiverProxyInterface::r#receive(self, channel, path, rights)
7893    }
7894}
7895
7896impl DirReceiverProxyInterface for DirReceiverProxy {
7897    fn r#receive(
7898        &self,
7899        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7900        mut path: &str,
7901        mut rights: fidl_fuchsia_io::Flags,
7902    ) -> Result<(), fidl::Error> {
7903        self.client.send::<DirReceiverReceiveRequest>(
7904            (channel, path, rights),
7905            0x4ac564d726bb325e,
7906            fidl::encoding::DynamicFlags::empty(),
7907        )
7908    }
7909}
7910
7911pub struct DirReceiverEventStream {
7912    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7913}
7914
7915impl std::marker::Unpin for DirReceiverEventStream {}
7916
7917impl futures::stream::FusedStream for DirReceiverEventStream {
7918    fn is_terminated(&self) -> bool {
7919        self.event_receiver.is_terminated()
7920    }
7921}
7922
7923impl futures::Stream for DirReceiverEventStream {
7924    type Item = Result<DirReceiverEvent, fidl::Error>;
7925
7926    fn poll_next(
7927        mut self: std::pin::Pin<&mut Self>,
7928        cx: &mut std::task::Context<'_>,
7929    ) -> std::task::Poll<Option<Self::Item>> {
7930        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7931            &mut self.event_receiver,
7932            cx
7933        )?) {
7934            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7935            None => std::task::Poll::Ready(None),
7936        }
7937    }
7938}
7939
7940#[derive(Debug)]
7941pub enum DirReceiverEvent {}
7942
7943impl DirReceiverEvent {
7944    /// Decodes a message buffer as a [`DirReceiverEvent`].
7945    fn decode(
7946        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7947    ) -> Result<DirReceiverEvent, fidl::Error> {
7948        let (bytes, _handles) = buf.split_mut();
7949        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7950        debug_assert_eq!(tx_header.tx_id, 0);
7951        match tx_header.ordinal {
7952            _ => Err(fidl::Error::UnknownOrdinal {
7953                ordinal: tx_header.ordinal,
7954                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7955            }),
7956        }
7957    }
7958}
7959
7960/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiver.
7961pub struct DirReceiverRequestStream {
7962    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7963    is_terminated: bool,
7964}
7965
7966impl std::marker::Unpin for DirReceiverRequestStream {}
7967
7968impl futures::stream::FusedStream for DirReceiverRequestStream {
7969    fn is_terminated(&self) -> bool {
7970        self.is_terminated
7971    }
7972}
7973
7974impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
7975    type Protocol = DirReceiverMarker;
7976    type ControlHandle = DirReceiverControlHandle;
7977
7978    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7979        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7980    }
7981
7982    fn control_handle(&self) -> Self::ControlHandle {
7983        DirReceiverControlHandle { inner: self.inner.clone() }
7984    }
7985
7986    fn into_inner(
7987        self,
7988    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7989    {
7990        (self.inner, self.is_terminated)
7991    }
7992
7993    fn from_inner(
7994        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7995        is_terminated: bool,
7996    ) -> Self {
7997        Self { inner, is_terminated }
7998    }
7999}
8000
8001impl futures::Stream for DirReceiverRequestStream {
8002    type Item = Result<DirReceiverRequest, fidl::Error>;
8003
8004    fn poll_next(
8005        mut self: std::pin::Pin<&mut Self>,
8006        cx: &mut std::task::Context<'_>,
8007    ) -> std::task::Poll<Option<Self::Item>> {
8008        let this = &mut *self;
8009        if this.inner.check_shutdown(cx) {
8010            this.is_terminated = true;
8011            return std::task::Poll::Ready(None);
8012        }
8013        if this.is_terminated {
8014            panic!("polled DirReceiverRequestStream after completion");
8015        }
8016        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8017            |bytes, handles| {
8018                match this.inner.channel().read_etc(cx, bytes, handles) {
8019                    std::task::Poll::Ready(Ok(())) => {}
8020                    std::task::Poll::Pending => return std::task::Poll::Pending,
8021                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8022                        this.is_terminated = true;
8023                        return std::task::Poll::Ready(None);
8024                    }
8025                    std::task::Poll::Ready(Err(e)) => {
8026                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8027                            e.into(),
8028                        ))));
8029                    }
8030                }
8031
8032                // A message has been received from the channel
8033                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8034
8035                std::task::Poll::Ready(Some(match header.ordinal {
8036                    0x4ac564d726bb325e => {
8037                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8038                        let mut req = fidl::new_empty!(
8039                            DirReceiverReceiveRequest,
8040                            fidl::encoding::DefaultFuchsiaResourceDialect
8041                        );
8042                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8043                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
8044                        Ok(DirReceiverRequest::Receive {
8045                            channel: req.channel,
8046                            path: req.path,
8047                            rights: req.rights,
8048
8049                            control_handle,
8050                        })
8051                    }
8052                    _ => Err(fidl::Error::UnknownOrdinal {
8053                        ordinal: header.ordinal,
8054                        protocol_name:
8055                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8056                    }),
8057                }))
8058            },
8059        )
8060    }
8061}
8062
8063/// A `DirReceiver` represents the receiving end of a `DirConnector`.
8064#[derive(Debug)]
8065pub enum DirReceiverRequest {
8066    /// `Receive` will be called by component manager whenever a new handle has
8067    /// been given to any `DirConnector` associated with this `DirReceiver`.
8068    Receive {
8069        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8070        path: String,
8071        rights: fidl_fuchsia_io::Flags,
8072        control_handle: DirReceiverControlHandle,
8073    },
8074}
8075
8076impl DirReceiverRequest {
8077    #[allow(irrefutable_let_patterns)]
8078    pub fn into_receive(
8079        self,
8080    ) -> Option<(
8081        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8082        String,
8083        fidl_fuchsia_io::Flags,
8084        DirReceiverControlHandle,
8085    )> {
8086        if let DirReceiverRequest::Receive { channel, path, rights, control_handle } = self {
8087            Some((channel, path, rights, control_handle))
8088        } else {
8089            None
8090        }
8091    }
8092
8093    /// Name of the method defined in FIDL
8094    pub fn method_name(&self) -> &'static str {
8095        match *self {
8096            DirReceiverRequest::Receive { .. } => "receive",
8097        }
8098    }
8099}
8100
8101#[derive(Debug, Clone)]
8102pub struct DirReceiverControlHandle {
8103    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8104}
8105
8106impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
8107    fn shutdown(&self) {
8108        self.inner.shutdown()
8109    }
8110
8111    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8112        self.inner.shutdown_with_epitaph(status)
8113    }
8114
8115    fn is_closed(&self) -> bool {
8116        self.inner.channel().is_closed()
8117    }
8118    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8119        self.inner.channel().on_closed()
8120    }
8121
8122    #[cfg(target_os = "fuchsia")]
8123    fn signal_peer(
8124        &self,
8125        clear_mask: zx::Signals,
8126        set_mask: zx::Signals,
8127    ) -> Result<(), zx_status::Status> {
8128        use fidl::Peered;
8129        self.inner.channel().signal_peer(clear_mask, set_mask)
8130    }
8131}
8132
8133impl DirReceiverControlHandle {}
8134
8135#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8136pub struct ReceiverMarker;
8137
8138impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
8139    type Proxy = ReceiverProxy;
8140    type RequestStream = ReceiverRequestStream;
8141    #[cfg(target_os = "fuchsia")]
8142    type SynchronousProxy = ReceiverSynchronousProxy;
8143
8144    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Receiver";
8145}
8146impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
8147
8148pub trait ReceiverProxyInterface: Send + Sync {
8149    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
8150}
8151#[derive(Debug)]
8152#[cfg(target_os = "fuchsia")]
8153pub struct ReceiverSynchronousProxy {
8154    client: fidl::client::sync::Client,
8155}
8156
8157#[cfg(target_os = "fuchsia")]
8158impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
8159    type Proxy = ReceiverProxy;
8160    type Protocol = ReceiverMarker;
8161
8162    fn from_channel(inner: fidl::Channel) -> Self {
8163        Self::new(inner)
8164    }
8165
8166    fn into_channel(self) -> fidl::Channel {
8167        self.client.into_channel()
8168    }
8169
8170    fn as_channel(&self) -> &fidl::Channel {
8171        self.client.as_channel()
8172    }
8173}
8174
8175#[cfg(target_os = "fuchsia")]
8176impl ReceiverSynchronousProxy {
8177    pub fn new(channel: fidl::Channel) -> Self {
8178        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8179        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8180    }
8181
8182    pub fn into_channel(self) -> fidl::Channel {
8183        self.client.into_channel()
8184    }
8185
8186    /// Waits until an event arrives and returns it. It is safe for other
8187    /// threads to make concurrent requests while waiting for an event.
8188    pub fn wait_for_event(
8189        &self,
8190        deadline: zx::MonotonicInstant,
8191    ) -> Result<ReceiverEvent, fidl::Error> {
8192        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
8193    }
8194
8195    /// `Receive` will be called by component manager whenever an new handle has
8196    /// been given to any `Connector` associated with this `Receiver`.
8197    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8198        self.client.send::<ReceiverReceiveRequest>(
8199            (channel,),
8200            0x609ca5c7943b58d0,
8201            fidl::encoding::DynamicFlags::empty(),
8202        )
8203    }
8204}
8205
8206#[cfg(target_os = "fuchsia")]
8207impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
8208    fn from(value: ReceiverSynchronousProxy) -> Self {
8209        value.into_channel().into()
8210    }
8211}
8212
8213#[cfg(target_os = "fuchsia")]
8214impl From<fidl::Channel> for ReceiverSynchronousProxy {
8215    fn from(value: fidl::Channel) -> Self {
8216        Self::new(value)
8217    }
8218}
8219
8220#[cfg(target_os = "fuchsia")]
8221impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
8222    type Protocol = ReceiverMarker;
8223
8224    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
8225        Self::new(value.into_channel())
8226    }
8227}
8228
8229#[derive(Debug, Clone)]
8230pub struct ReceiverProxy {
8231    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8232}
8233
8234impl fidl::endpoints::Proxy for ReceiverProxy {
8235    type Protocol = ReceiverMarker;
8236
8237    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8238        Self::new(inner)
8239    }
8240
8241    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8242        self.client.into_channel().map_err(|client| Self { client })
8243    }
8244
8245    fn as_channel(&self) -> &::fidl::AsyncChannel {
8246        self.client.as_channel()
8247    }
8248}
8249
8250impl ReceiverProxy {
8251    /// Create a new Proxy for fuchsia.component.runtime/Receiver.
8252    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8253        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8254        Self { client: fidl::client::Client::new(channel, protocol_name) }
8255    }
8256
8257    /// Get a Stream of events from the remote end of the protocol.
8258    ///
8259    /// # Panics
8260    ///
8261    /// Panics if the event stream was already taken.
8262    pub fn take_event_stream(&self) -> ReceiverEventStream {
8263        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8264    }
8265
8266    /// `Receive` will be called by component manager whenever an new handle has
8267    /// been given to any `Connector` associated with this `Receiver`.
8268    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8269        ReceiverProxyInterface::r#receive(self, channel)
8270    }
8271}
8272
8273impl ReceiverProxyInterface for ReceiverProxy {
8274    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8275        self.client.send::<ReceiverReceiveRequest>(
8276            (channel,),
8277            0x609ca5c7943b58d0,
8278            fidl::encoding::DynamicFlags::empty(),
8279        )
8280    }
8281}
8282
8283pub struct ReceiverEventStream {
8284    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8285}
8286
8287impl std::marker::Unpin for ReceiverEventStream {}
8288
8289impl futures::stream::FusedStream for ReceiverEventStream {
8290    fn is_terminated(&self) -> bool {
8291        self.event_receiver.is_terminated()
8292    }
8293}
8294
8295impl futures::Stream for ReceiverEventStream {
8296    type Item = Result<ReceiverEvent, fidl::Error>;
8297
8298    fn poll_next(
8299        mut self: std::pin::Pin<&mut Self>,
8300        cx: &mut std::task::Context<'_>,
8301    ) -> std::task::Poll<Option<Self::Item>> {
8302        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8303            &mut self.event_receiver,
8304            cx
8305        )?) {
8306            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8307            None => std::task::Poll::Ready(None),
8308        }
8309    }
8310}
8311
8312#[derive(Debug)]
8313pub enum ReceiverEvent {}
8314
8315impl ReceiverEvent {
8316    /// Decodes a message buffer as a [`ReceiverEvent`].
8317    fn decode(
8318        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8319    ) -> Result<ReceiverEvent, fidl::Error> {
8320        let (bytes, _handles) = buf.split_mut();
8321        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8322        debug_assert_eq!(tx_header.tx_id, 0);
8323        match tx_header.ordinal {
8324            _ => Err(fidl::Error::UnknownOrdinal {
8325                ordinal: tx_header.ordinal,
8326                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8327            }),
8328        }
8329    }
8330}
8331
8332/// A Stream of incoming requests for fuchsia.component.runtime/Receiver.
8333pub struct ReceiverRequestStream {
8334    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8335    is_terminated: bool,
8336}
8337
8338impl std::marker::Unpin for ReceiverRequestStream {}
8339
8340impl futures::stream::FusedStream for ReceiverRequestStream {
8341    fn is_terminated(&self) -> bool {
8342        self.is_terminated
8343    }
8344}
8345
8346impl fidl::endpoints::RequestStream for ReceiverRequestStream {
8347    type Protocol = ReceiverMarker;
8348    type ControlHandle = ReceiverControlHandle;
8349
8350    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8351        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8352    }
8353
8354    fn control_handle(&self) -> Self::ControlHandle {
8355        ReceiverControlHandle { inner: self.inner.clone() }
8356    }
8357
8358    fn into_inner(
8359        self,
8360    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8361    {
8362        (self.inner, self.is_terminated)
8363    }
8364
8365    fn from_inner(
8366        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8367        is_terminated: bool,
8368    ) -> Self {
8369        Self { inner, is_terminated }
8370    }
8371}
8372
8373impl futures::Stream for ReceiverRequestStream {
8374    type Item = Result<ReceiverRequest, fidl::Error>;
8375
8376    fn poll_next(
8377        mut self: std::pin::Pin<&mut Self>,
8378        cx: &mut std::task::Context<'_>,
8379    ) -> std::task::Poll<Option<Self::Item>> {
8380        let this = &mut *self;
8381        if this.inner.check_shutdown(cx) {
8382            this.is_terminated = true;
8383            return std::task::Poll::Ready(None);
8384        }
8385        if this.is_terminated {
8386            panic!("polled ReceiverRequestStream after completion");
8387        }
8388        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8389            |bytes, handles| {
8390                match this.inner.channel().read_etc(cx, bytes, handles) {
8391                    std::task::Poll::Ready(Ok(())) => {}
8392                    std::task::Poll::Pending => return std::task::Poll::Pending,
8393                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8394                        this.is_terminated = true;
8395                        return std::task::Poll::Ready(None);
8396                    }
8397                    std::task::Poll::Ready(Err(e)) => {
8398                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8399                            e.into(),
8400                        ))));
8401                    }
8402                }
8403
8404                // A message has been received from the channel
8405                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8406
8407                std::task::Poll::Ready(Some(match header.ordinal {
8408                    0x609ca5c7943b58d0 => {
8409                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8410                        let mut req = fidl::new_empty!(
8411                            ReceiverReceiveRequest,
8412                            fidl::encoding::DefaultFuchsiaResourceDialect
8413                        );
8414                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8415                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8416                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8417                    }
8418                    _ => Err(fidl::Error::UnknownOrdinal {
8419                        ordinal: header.ordinal,
8420                        protocol_name:
8421                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8422                    }),
8423                }))
8424            },
8425        )
8426    }
8427}
8428
8429/// A `Receiver` represents the receiving end of a `Connector`.
8430#[derive(Debug)]
8431pub enum ReceiverRequest {
8432    /// `Receive` will be called by component manager whenever an new handle has
8433    /// been given to any `Connector` associated with this `Receiver`.
8434    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
8435}
8436
8437impl ReceiverRequest {
8438    #[allow(irrefutable_let_patterns)]
8439    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
8440        if let ReceiverRequest::Receive { channel, control_handle } = self {
8441            Some((channel, control_handle))
8442        } else {
8443            None
8444        }
8445    }
8446
8447    /// Name of the method defined in FIDL
8448    pub fn method_name(&self) -> &'static str {
8449        match *self {
8450            ReceiverRequest::Receive { .. } => "receive",
8451        }
8452    }
8453}
8454
8455#[derive(Debug, Clone)]
8456pub struct ReceiverControlHandle {
8457    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8458}
8459
8460impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
8461    fn shutdown(&self) {
8462        self.inner.shutdown()
8463    }
8464
8465    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8466        self.inner.shutdown_with_epitaph(status)
8467    }
8468
8469    fn is_closed(&self) -> bool {
8470        self.inner.channel().is_closed()
8471    }
8472    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8473        self.inner.channel().on_closed()
8474    }
8475
8476    #[cfg(target_os = "fuchsia")]
8477    fn signal_peer(
8478        &self,
8479        clear_mask: zx::Signals,
8480        set_mask: zx::Signals,
8481    ) -> Result<(), zx_status::Status> {
8482        use fidl::Peered;
8483        self.inner.channel().signal_peer(clear_mask, set_mask)
8484    }
8485}
8486
8487impl ReceiverControlHandle {}
8488
8489mod internal {
8490    use super::*;
8491
8492    impl fidl::encoding::ResourceTypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8493        type Borrowed<'a> = &'a mut Self;
8494        fn take_or_borrow<'a>(
8495            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8496        ) -> Self::Borrowed<'a> {
8497            value
8498        }
8499    }
8500
8501    unsafe impl fidl::encoding::TypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8502        type Owned = Self;
8503
8504        #[inline(always)]
8505        fn inline_align(_context: fidl::encoding::Context) -> usize {
8506            4
8507        }
8508
8509        #[inline(always)]
8510        fn inline_size(_context: fidl::encoding::Context) -> usize {
8511            8
8512        }
8513    }
8514
8515    unsafe impl
8516        fidl::encoding::Encode<
8517            CapabilitiesCapabilityAssociateHandleRequest,
8518            fidl::encoding::DefaultFuchsiaResourceDialect,
8519        > for &mut CapabilitiesCapabilityAssociateHandleRequest
8520    {
8521        #[inline]
8522        unsafe fn encode(
8523            self,
8524            encoder: &mut fidl::encoding::Encoder<
8525                '_,
8526                fidl::encoding::DefaultFuchsiaResourceDialect,
8527            >,
8528            offset: usize,
8529            _depth: fidl::encoding::Depth,
8530        ) -> fidl::Result<()> {
8531            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8532            // Delegate to tuple encoding.
8533            fidl::encoding::Encode::<
8534                CapabilitiesCapabilityAssociateHandleRequest,
8535                fidl::encoding::DefaultFuchsiaResourceDialect,
8536            >::encode(
8537                (
8538                    <fidl::encoding::HandleType<
8539                        fidl::EventPair,
8540                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8541                        2147483648,
8542                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8543                        &mut self.capability_handle,
8544                    ),
8545                    <fidl::encoding::HandleType<
8546                        fidl::EventPair,
8547                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8548                        2147483648,
8549                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8550                        &mut self.other_handle,
8551                    ),
8552                ),
8553                encoder,
8554                offset,
8555                _depth,
8556            )
8557        }
8558    }
8559    unsafe impl<
8560        T0: fidl::encoding::Encode<
8561                fidl::encoding::HandleType<
8562                    fidl::EventPair,
8563                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8564                    2147483648,
8565                >,
8566                fidl::encoding::DefaultFuchsiaResourceDialect,
8567            >,
8568        T1: fidl::encoding::Encode<
8569                fidl::encoding::HandleType<
8570                    fidl::EventPair,
8571                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8572                    2147483648,
8573                >,
8574                fidl::encoding::DefaultFuchsiaResourceDialect,
8575            >,
8576    >
8577        fidl::encoding::Encode<
8578            CapabilitiesCapabilityAssociateHandleRequest,
8579            fidl::encoding::DefaultFuchsiaResourceDialect,
8580        > for (T0, T1)
8581    {
8582        #[inline]
8583        unsafe fn encode(
8584            self,
8585            encoder: &mut fidl::encoding::Encoder<
8586                '_,
8587                fidl::encoding::DefaultFuchsiaResourceDialect,
8588            >,
8589            offset: usize,
8590            depth: fidl::encoding::Depth,
8591        ) -> fidl::Result<()> {
8592            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8593            // Zero out padding regions. There's no need to apply masks
8594            // because the unmasked parts will be overwritten by fields.
8595            // Write the fields.
8596            self.0.encode(encoder, offset + 0, depth)?;
8597            self.1.encode(encoder, offset + 4, depth)?;
8598            Ok(())
8599        }
8600    }
8601
8602    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8603        for CapabilitiesCapabilityAssociateHandleRequest
8604    {
8605        #[inline(always)]
8606        fn new_empty() -> Self {
8607            Self {
8608                capability_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8609                other_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8610            }
8611        }
8612
8613        #[inline]
8614        unsafe fn decode(
8615            &mut self,
8616            decoder: &mut fidl::encoding::Decoder<
8617                '_,
8618                fidl::encoding::DefaultFuchsiaResourceDialect,
8619            >,
8620            offset: usize,
8621            _depth: fidl::encoding::Depth,
8622        ) -> fidl::Result<()> {
8623            decoder.debug_check_bounds::<Self>(offset);
8624            // Verify that padding bytes are zero.
8625            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.capability_handle, decoder, offset + 0, _depth)?;
8626            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.other_handle, decoder, offset + 4, _depth)?;
8627            Ok(())
8628        }
8629    }
8630
8631    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorCreateRequest {
8632        type Borrowed<'a> = &'a mut Self;
8633        fn take_or_borrow<'a>(
8634            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8635        ) -> Self::Borrowed<'a> {
8636            value
8637        }
8638    }
8639
8640    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorCreateRequest {
8641        type Owned = Self;
8642
8643        #[inline(always)]
8644        fn inline_align(_context: fidl::encoding::Context) -> usize {
8645            4
8646        }
8647
8648        #[inline(always)]
8649        fn inline_size(_context: fidl::encoding::Context) -> usize {
8650            8
8651        }
8652    }
8653
8654    unsafe impl
8655        fidl::encoding::Encode<
8656            CapabilitiesConnectorCreateRequest,
8657            fidl::encoding::DefaultFuchsiaResourceDialect,
8658        > for &mut CapabilitiesConnectorCreateRequest
8659    {
8660        #[inline]
8661        unsafe fn encode(
8662            self,
8663            encoder: &mut fidl::encoding::Encoder<
8664                '_,
8665                fidl::encoding::DefaultFuchsiaResourceDialect,
8666            >,
8667            offset: usize,
8668            _depth: fidl::encoding::Depth,
8669        ) -> fidl::Result<()> {
8670            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8671            // Delegate to tuple encoding.
8672            fidl::encoding::Encode::<CapabilitiesConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8673                (
8674                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector),
8675                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
8676                ),
8677                encoder, offset, _depth
8678            )
8679        }
8680    }
8681    unsafe impl<
8682        T0: fidl::encoding::Encode<
8683                fidl::encoding::HandleType<
8684                    fidl::EventPair,
8685                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8686                    2147483648,
8687                >,
8688                fidl::encoding::DefaultFuchsiaResourceDialect,
8689            >,
8690        T1: fidl::encoding::Encode<
8691                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8692                fidl::encoding::DefaultFuchsiaResourceDialect,
8693            >,
8694    >
8695        fidl::encoding::Encode<
8696            CapabilitiesConnectorCreateRequest,
8697            fidl::encoding::DefaultFuchsiaResourceDialect,
8698        > for (T0, T1)
8699    {
8700        #[inline]
8701        unsafe fn encode(
8702            self,
8703            encoder: &mut fidl::encoding::Encoder<
8704                '_,
8705                fidl::encoding::DefaultFuchsiaResourceDialect,
8706            >,
8707            offset: usize,
8708            depth: fidl::encoding::Depth,
8709        ) -> fidl::Result<()> {
8710            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8711            // Zero out padding regions. There's no need to apply masks
8712            // because the unmasked parts will be overwritten by fields.
8713            // Write the fields.
8714            self.0.encode(encoder, offset + 0, depth)?;
8715            self.1.encode(encoder, offset + 4, depth)?;
8716            Ok(())
8717        }
8718    }
8719
8720    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8721        for CapabilitiesConnectorCreateRequest
8722    {
8723        #[inline(always)]
8724        fn new_empty() -> Self {
8725            Self {
8726                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8727                receiver_client_end: fidl::new_empty!(
8728                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8729                    fidl::encoding::DefaultFuchsiaResourceDialect
8730                ),
8731            }
8732        }
8733
8734        #[inline]
8735        unsafe fn decode(
8736            &mut self,
8737            decoder: &mut fidl::encoding::Decoder<
8738                '_,
8739                fidl::encoding::DefaultFuchsiaResourceDialect,
8740            >,
8741            offset: usize,
8742            _depth: fidl::encoding::Depth,
8743        ) -> fidl::Result<()> {
8744            decoder.debug_check_bounds::<Self>(offset);
8745            // Verify that padding bytes are zero.
8746            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8747            fidl::decode!(
8748                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8749                fidl::encoding::DefaultFuchsiaResourceDialect,
8750                &mut self.receiver_client_end,
8751                decoder,
8752                offset + 4,
8753                _depth
8754            )?;
8755            Ok(())
8756        }
8757    }
8758
8759    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorOpenRequest {
8760        type Borrowed<'a> = &'a mut Self;
8761        fn take_or_borrow<'a>(
8762            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8763        ) -> Self::Borrowed<'a> {
8764            value
8765        }
8766    }
8767
8768    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorOpenRequest {
8769        type Owned = Self;
8770
8771        #[inline(always)]
8772        fn inline_align(_context: fidl::encoding::Context) -> usize {
8773            4
8774        }
8775
8776        #[inline(always)]
8777        fn inline_size(_context: fidl::encoding::Context) -> usize {
8778            8
8779        }
8780    }
8781
8782    unsafe impl
8783        fidl::encoding::Encode<
8784            CapabilitiesConnectorOpenRequest,
8785            fidl::encoding::DefaultFuchsiaResourceDialect,
8786        > for &mut CapabilitiesConnectorOpenRequest
8787    {
8788        #[inline]
8789        unsafe fn encode(
8790            self,
8791            encoder: &mut fidl::encoding::Encoder<
8792                '_,
8793                fidl::encoding::DefaultFuchsiaResourceDialect,
8794            >,
8795            offset: usize,
8796            _depth: fidl::encoding::Depth,
8797        ) -> fidl::Result<()> {
8798            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8799            // Delegate to tuple encoding.
8800            fidl::encoding::Encode::<
8801                CapabilitiesConnectorOpenRequest,
8802                fidl::encoding::DefaultFuchsiaResourceDialect,
8803            >::encode(
8804                (
8805                    <fidl::encoding::HandleType<
8806                        fidl::EventPair,
8807                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8808                        2147483648,
8809                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8810                        &mut self.connector
8811                    ),
8812                    <fidl::encoding::HandleType<
8813                        fidl::Channel,
8814                        { fidl::ObjectType::CHANNEL.into_raw() },
8815                        2147483648,
8816                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8817                        &mut self.channel
8818                    ),
8819                ),
8820                encoder,
8821                offset,
8822                _depth,
8823            )
8824        }
8825    }
8826    unsafe impl<
8827        T0: fidl::encoding::Encode<
8828                fidl::encoding::HandleType<
8829                    fidl::EventPair,
8830                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8831                    2147483648,
8832                >,
8833                fidl::encoding::DefaultFuchsiaResourceDialect,
8834            >,
8835        T1: fidl::encoding::Encode<
8836                fidl::encoding::HandleType<
8837                    fidl::Channel,
8838                    { fidl::ObjectType::CHANNEL.into_raw() },
8839                    2147483648,
8840                >,
8841                fidl::encoding::DefaultFuchsiaResourceDialect,
8842            >,
8843    >
8844        fidl::encoding::Encode<
8845            CapabilitiesConnectorOpenRequest,
8846            fidl::encoding::DefaultFuchsiaResourceDialect,
8847        > for (T0, T1)
8848    {
8849        #[inline]
8850        unsafe fn encode(
8851            self,
8852            encoder: &mut fidl::encoding::Encoder<
8853                '_,
8854                fidl::encoding::DefaultFuchsiaResourceDialect,
8855            >,
8856            offset: usize,
8857            depth: fidl::encoding::Depth,
8858        ) -> fidl::Result<()> {
8859            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8860            // Zero out padding regions. There's no need to apply masks
8861            // because the unmasked parts will be overwritten by fields.
8862            // Write the fields.
8863            self.0.encode(encoder, offset + 0, depth)?;
8864            self.1.encode(encoder, offset + 4, depth)?;
8865            Ok(())
8866        }
8867    }
8868
8869    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8870        for CapabilitiesConnectorOpenRequest
8871    {
8872        #[inline(always)]
8873        fn new_empty() -> Self {
8874            Self {
8875                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8876                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8877            }
8878        }
8879
8880        #[inline]
8881        unsafe fn decode(
8882            &mut self,
8883            decoder: &mut fidl::encoding::Decoder<
8884                '_,
8885                fidl::encoding::DefaultFuchsiaResourceDialect,
8886            >,
8887            offset: usize,
8888            _depth: fidl::encoding::Depth,
8889        ) -> fidl::Result<()> {
8890            decoder.debug_check_bounds::<Self>(offset);
8891            // Verify that padding bytes are zero.
8892            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8893            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
8894            Ok(())
8895        }
8896    }
8897
8898    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterCreateRequest {
8899        type Borrowed<'a> = &'a mut Self;
8900        fn take_or_borrow<'a>(
8901            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8902        ) -> Self::Borrowed<'a> {
8903            value
8904        }
8905    }
8906
8907    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterCreateRequest {
8908        type Owned = Self;
8909
8910        #[inline(always)]
8911        fn inline_align(_context: fidl::encoding::Context) -> usize {
8912            4
8913        }
8914
8915        #[inline(always)]
8916        fn inline_size(_context: fidl::encoding::Context) -> usize {
8917            8
8918        }
8919    }
8920
8921    unsafe impl
8922        fidl::encoding::Encode<
8923            CapabilitiesConnectorRouterCreateRequest,
8924            fidl::encoding::DefaultFuchsiaResourceDialect,
8925        > for &mut CapabilitiesConnectorRouterCreateRequest
8926    {
8927        #[inline]
8928        unsafe fn encode(
8929            self,
8930            encoder: &mut fidl::encoding::Encoder<
8931                '_,
8932                fidl::encoding::DefaultFuchsiaResourceDialect,
8933            >,
8934            offset: usize,
8935            _depth: fidl::encoding::Depth,
8936        ) -> fidl::Result<()> {
8937            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8938            // Delegate to tuple encoding.
8939            fidl::encoding::Encode::<CapabilitiesConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8940                (
8941                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
8942                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
8943                ),
8944                encoder, offset, _depth
8945            )
8946        }
8947    }
8948    unsafe impl<
8949        T0: fidl::encoding::Encode<
8950                fidl::encoding::HandleType<
8951                    fidl::EventPair,
8952                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8953                    2147483648,
8954                >,
8955                fidl::encoding::DefaultFuchsiaResourceDialect,
8956            >,
8957        T1: fidl::encoding::Encode<
8958                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
8959                fidl::encoding::DefaultFuchsiaResourceDialect,
8960            >,
8961    >
8962        fidl::encoding::Encode<
8963            CapabilitiesConnectorRouterCreateRequest,
8964            fidl::encoding::DefaultFuchsiaResourceDialect,
8965        > for (T0, T1)
8966    {
8967        #[inline]
8968        unsafe fn encode(
8969            self,
8970            encoder: &mut fidl::encoding::Encoder<
8971                '_,
8972                fidl::encoding::DefaultFuchsiaResourceDialect,
8973            >,
8974            offset: usize,
8975            depth: fidl::encoding::Depth,
8976        ) -> fidl::Result<()> {
8977            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8978            // Zero out padding regions. There's no need to apply masks
8979            // because the unmasked parts will be overwritten by fields.
8980            // Write the fields.
8981            self.0.encode(encoder, offset + 0, depth)?;
8982            self.1.encode(encoder, offset + 4, depth)?;
8983            Ok(())
8984        }
8985    }
8986
8987    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8988        for CapabilitiesConnectorRouterCreateRequest
8989    {
8990        #[inline(always)]
8991        fn new_empty() -> Self {
8992            Self {
8993                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8994                router_client_end: fidl::new_empty!(
8995                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
8996                    fidl::encoding::DefaultFuchsiaResourceDialect
8997                ),
8998            }
8999        }
9000
9001        #[inline]
9002        unsafe fn decode(
9003            &mut self,
9004            decoder: &mut fidl::encoding::Decoder<
9005                '_,
9006                fidl::encoding::DefaultFuchsiaResourceDialect,
9007            >,
9008            offset: usize,
9009            _depth: fidl::encoding::Depth,
9010        ) -> fidl::Result<()> {
9011            decoder.debug_check_bounds::<Self>(offset);
9012            // Verify that padding bytes are zero.
9013            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9014            fidl::decode!(
9015                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9016                fidl::encoding::DefaultFuchsiaResourceDialect,
9017                &mut self.router_client_end,
9018                decoder,
9019                offset + 4,
9020                _depth
9021            )?;
9022            Ok(())
9023        }
9024    }
9025
9026    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterRouteRequest {
9027        type Borrowed<'a> = &'a mut Self;
9028        fn take_or_borrow<'a>(
9029            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9030        ) -> Self::Borrowed<'a> {
9031            value
9032        }
9033    }
9034
9035    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteRequest {
9036        type Owned = Self;
9037
9038        #[inline(always)]
9039        fn inline_align(_context: fidl::encoding::Context) -> usize {
9040            8
9041        }
9042
9043        #[inline(always)]
9044        fn inline_size(_context: fidl::encoding::Context) -> usize {
9045            32
9046        }
9047    }
9048
9049    unsafe impl
9050        fidl::encoding::Encode<
9051            CapabilitiesConnectorRouterRouteRequest,
9052            fidl::encoding::DefaultFuchsiaResourceDialect,
9053        > for &mut CapabilitiesConnectorRouterRouteRequest
9054    {
9055        #[inline]
9056        unsafe fn encode(
9057            self,
9058            encoder: &mut fidl::encoding::Encoder<
9059                '_,
9060                fidl::encoding::DefaultFuchsiaResourceDialect,
9061            >,
9062            offset: usize,
9063            _depth: fidl::encoding::Depth,
9064        ) -> fidl::Result<()> {
9065            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9066            // Delegate to tuple encoding.
9067            fidl::encoding::Encode::<
9068                CapabilitiesConnectorRouterRouteRequest,
9069                fidl::encoding::DefaultFuchsiaResourceDialect,
9070            >::encode(
9071                (
9072                    <fidl::encoding::HandleType<
9073                        fidl::EventPair,
9074                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9075                        2147483648,
9076                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9077                        &mut self.router
9078                    ),
9079                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9080                        &mut self.request,
9081                    ),
9082                    <fidl::encoding::HandleType<
9083                        fidl::EventPair,
9084                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9085                        2147483648,
9086                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9087                        &mut self.instance_token,
9088                    ),
9089                    <fidl::encoding::HandleType<
9090                        fidl::EventPair,
9091                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9092                        2147483648,
9093                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9094                        &mut self.connector
9095                    ),
9096                ),
9097                encoder,
9098                offset,
9099                _depth,
9100            )
9101        }
9102    }
9103    unsafe impl<
9104        T0: fidl::encoding::Encode<
9105                fidl::encoding::HandleType<
9106                    fidl::EventPair,
9107                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9108                    2147483648,
9109                >,
9110                fidl::encoding::DefaultFuchsiaResourceDialect,
9111            >,
9112        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9113        T2: fidl::encoding::Encode<
9114                fidl::encoding::HandleType<
9115                    fidl::EventPair,
9116                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9117                    2147483648,
9118                >,
9119                fidl::encoding::DefaultFuchsiaResourceDialect,
9120            >,
9121        T3: fidl::encoding::Encode<
9122                fidl::encoding::HandleType<
9123                    fidl::EventPair,
9124                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9125                    2147483648,
9126                >,
9127                fidl::encoding::DefaultFuchsiaResourceDialect,
9128            >,
9129    >
9130        fidl::encoding::Encode<
9131            CapabilitiesConnectorRouterRouteRequest,
9132            fidl::encoding::DefaultFuchsiaResourceDialect,
9133        > for (T0, T1, T2, T3)
9134    {
9135        #[inline]
9136        unsafe fn encode(
9137            self,
9138            encoder: &mut fidl::encoding::Encoder<
9139                '_,
9140                fidl::encoding::DefaultFuchsiaResourceDialect,
9141            >,
9142            offset: usize,
9143            depth: fidl::encoding::Depth,
9144        ) -> fidl::Result<()> {
9145            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9146            // Zero out padding regions. There's no need to apply masks
9147            // because the unmasked parts will be overwritten by fields.
9148            unsafe {
9149                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9150                (ptr as *mut u64).write_unaligned(0);
9151            }
9152            // Write the fields.
9153            self.0.encode(encoder, offset + 0, depth)?;
9154            self.1.encode(encoder, offset + 8, depth)?;
9155            self.2.encode(encoder, offset + 24, depth)?;
9156            self.3.encode(encoder, offset + 28, depth)?;
9157            Ok(())
9158        }
9159    }
9160
9161    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9162        for CapabilitiesConnectorRouterRouteRequest
9163    {
9164        #[inline(always)]
9165        fn new_empty() -> Self {
9166            Self {
9167                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9168                request: fidl::new_empty!(
9169                    RouteRequest,
9170                    fidl::encoding::DefaultFuchsiaResourceDialect
9171                ),
9172                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9173                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9174            }
9175        }
9176
9177        #[inline]
9178        unsafe fn decode(
9179            &mut self,
9180            decoder: &mut fidl::encoding::Decoder<
9181                '_,
9182                fidl::encoding::DefaultFuchsiaResourceDialect,
9183            >,
9184            offset: usize,
9185            _depth: fidl::encoding::Depth,
9186        ) -> fidl::Result<()> {
9187            decoder.debug_check_bounds::<Self>(offset);
9188            // Verify that padding bytes are zero.
9189            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9190            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9191            let mask = 0xffffffff00000000u64;
9192            let maskedval = padval & mask;
9193            if maskedval != 0 {
9194                return Err(fidl::Error::NonZeroPadding {
9195                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9196                });
9197            }
9198            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9199            fidl::decode!(
9200                RouteRequest,
9201                fidl::encoding::DefaultFuchsiaResourceDialect,
9202                &mut self.request,
9203                decoder,
9204                offset + 8,
9205                _depth
9206            )?;
9207            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9208            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 28, _depth)?;
9209            Ok(())
9210        }
9211    }
9212
9213    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataCreateRequest {
9214        type Borrowed<'a> = &'a mut Self;
9215        fn take_or_borrow<'a>(
9216            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9217        ) -> Self::Borrowed<'a> {
9218            value
9219        }
9220    }
9221
9222    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataCreateRequest {
9223        type Owned = Self;
9224
9225        #[inline(always)]
9226        fn inline_align(_context: fidl::encoding::Context) -> usize {
9227            8
9228        }
9229
9230        #[inline(always)]
9231        fn inline_size(_context: fidl::encoding::Context) -> usize {
9232            24
9233        }
9234    }
9235
9236    unsafe impl
9237        fidl::encoding::Encode<
9238            CapabilitiesDataCreateRequest,
9239            fidl::encoding::DefaultFuchsiaResourceDialect,
9240        > for &mut CapabilitiesDataCreateRequest
9241    {
9242        #[inline]
9243        unsafe fn encode(
9244            self,
9245            encoder: &mut fidl::encoding::Encoder<
9246                '_,
9247                fidl::encoding::DefaultFuchsiaResourceDialect,
9248            >,
9249            offset: usize,
9250            _depth: fidl::encoding::Depth,
9251        ) -> fidl::Result<()> {
9252            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
9253            // Delegate to tuple encoding.
9254            fidl::encoding::Encode::<
9255                CapabilitiesDataCreateRequest,
9256                fidl::encoding::DefaultFuchsiaResourceDialect,
9257            >::encode(
9258                (
9259                    <fidl::encoding::HandleType<
9260                        fidl::EventPair,
9261                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9262                        2147483648,
9263                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9264                        &mut self.data_handle
9265                    ),
9266                    <Data as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
9267                ),
9268                encoder,
9269                offset,
9270                _depth,
9271            )
9272        }
9273    }
9274    unsafe impl<
9275        T0: fidl::encoding::Encode<
9276                fidl::encoding::HandleType<
9277                    fidl::EventPair,
9278                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9279                    2147483648,
9280                >,
9281                fidl::encoding::DefaultFuchsiaResourceDialect,
9282            >,
9283        T1: fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>,
9284    >
9285        fidl::encoding::Encode<
9286            CapabilitiesDataCreateRequest,
9287            fidl::encoding::DefaultFuchsiaResourceDialect,
9288        > for (T0, T1)
9289    {
9290        #[inline]
9291        unsafe fn encode(
9292            self,
9293            encoder: &mut fidl::encoding::Encoder<
9294                '_,
9295                fidl::encoding::DefaultFuchsiaResourceDialect,
9296            >,
9297            offset: usize,
9298            depth: fidl::encoding::Depth,
9299        ) -> fidl::Result<()> {
9300            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
9301            // Zero out padding regions. There's no need to apply masks
9302            // because the unmasked parts will be overwritten by fields.
9303            unsafe {
9304                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9305                (ptr as *mut u64).write_unaligned(0);
9306            }
9307            // Write the fields.
9308            self.0.encode(encoder, offset + 0, depth)?;
9309            self.1.encode(encoder, offset + 8, depth)?;
9310            Ok(())
9311        }
9312    }
9313
9314    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9315        for CapabilitiesDataCreateRequest
9316    {
9317        #[inline(always)]
9318        fn new_empty() -> Self {
9319            Self {
9320                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9321                data: fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect),
9322            }
9323        }
9324
9325        #[inline]
9326        unsafe fn decode(
9327            &mut self,
9328            decoder: &mut fidl::encoding::Decoder<
9329                '_,
9330                fidl::encoding::DefaultFuchsiaResourceDialect,
9331            >,
9332            offset: usize,
9333            _depth: fidl::encoding::Depth,
9334        ) -> fidl::Result<()> {
9335            decoder.debug_check_bounds::<Self>(offset);
9336            // Verify that padding bytes are zero.
9337            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9338            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9339            let mask = 0xffffffff00000000u64;
9340            let maskedval = padval & mask;
9341            if maskedval != 0 {
9342                return Err(fidl::Error::NonZeroPadding {
9343                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9344                });
9345            }
9346            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9347            fidl::decode!(
9348                Data,
9349                fidl::encoding::DefaultFuchsiaResourceDialect,
9350                &mut self.data,
9351                decoder,
9352                offset + 8,
9353                _depth
9354            )?;
9355            Ok(())
9356        }
9357    }
9358
9359    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataGetRequest {
9360        type Borrowed<'a> = &'a mut Self;
9361        fn take_or_borrow<'a>(
9362            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9363        ) -> Self::Borrowed<'a> {
9364            value
9365        }
9366    }
9367
9368    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataGetRequest {
9369        type Owned = Self;
9370
9371        #[inline(always)]
9372        fn inline_align(_context: fidl::encoding::Context) -> usize {
9373            4
9374        }
9375
9376        #[inline(always)]
9377        fn inline_size(_context: fidl::encoding::Context) -> usize {
9378            4
9379        }
9380    }
9381
9382    unsafe impl
9383        fidl::encoding::Encode<
9384            CapabilitiesDataGetRequest,
9385            fidl::encoding::DefaultFuchsiaResourceDialect,
9386        > for &mut CapabilitiesDataGetRequest
9387    {
9388        #[inline]
9389        unsafe fn encode(
9390            self,
9391            encoder: &mut fidl::encoding::Encoder<
9392                '_,
9393                fidl::encoding::DefaultFuchsiaResourceDialect,
9394            >,
9395            offset: usize,
9396            _depth: fidl::encoding::Depth,
9397        ) -> fidl::Result<()> {
9398            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9399            // Delegate to tuple encoding.
9400            fidl::encoding::Encode::<
9401                CapabilitiesDataGetRequest,
9402                fidl::encoding::DefaultFuchsiaResourceDialect,
9403            >::encode(
9404                (<fidl::encoding::HandleType<
9405                    fidl::EventPair,
9406                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9407                    2147483648,
9408                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9409                    &mut self.data_handle
9410                ),),
9411                encoder,
9412                offset,
9413                _depth,
9414            )
9415        }
9416    }
9417    unsafe impl<
9418        T0: fidl::encoding::Encode<
9419                fidl::encoding::HandleType<
9420                    fidl::EventPair,
9421                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9422                    2147483648,
9423                >,
9424                fidl::encoding::DefaultFuchsiaResourceDialect,
9425            >,
9426    >
9427        fidl::encoding::Encode<
9428            CapabilitiesDataGetRequest,
9429            fidl::encoding::DefaultFuchsiaResourceDialect,
9430        > for (T0,)
9431    {
9432        #[inline]
9433        unsafe fn encode(
9434            self,
9435            encoder: &mut fidl::encoding::Encoder<
9436                '_,
9437                fidl::encoding::DefaultFuchsiaResourceDialect,
9438            >,
9439            offset: usize,
9440            depth: fidl::encoding::Depth,
9441        ) -> fidl::Result<()> {
9442            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9443            // Zero out padding regions. There's no need to apply masks
9444            // because the unmasked parts will be overwritten by fields.
9445            // Write the fields.
9446            self.0.encode(encoder, offset + 0, depth)?;
9447            Ok(())
9448        }
9449    }
9450
9451    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9452        for CapabilitiesDataGetRequest
9453    {
9454        #[inline(always)]
9455        fn new_empty() -> Self {
9456            Self {
9457                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9458            }
9459        }
9460
9461        #[inline]
9462        unsafe fn decode(
9463            &mut self,
9464            decoder: &mut fidl::encoding::Decoder<
9465                '_,
9466                fidl::encoding::DefaultFuchsiaResourceDialect,
9467            >,
9468            offset: usize,
9469            _depth: fidl::encoding::Depth,
9470        ) -> fidl::Result<()> {
9471            decoder.debug_check_bounds::<Self>(offset);
9472            // Verify that padding bytes are zero.
9473            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9474            Ok(())
9475        }
9476    }
9477
9478    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterCreateRequest {
9479        type Borrowed<'a> = &'a mut Self;
9480        fn take_or_borrow<'a>(
9481            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9482        ) -> Self::Borrowed<'a> {
9483            value
9484        }
9485    }
9486
9487    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterCreateRequest {
9488        type Owned = Self;
9489
9490        #[inline(always)]
9491        fn inline_align(_context: fidl::encoding::Context) -> usize {
9492            4
9493        }
9494
9495        #[inline(always)]
9496        fn inline_size(_context: fidl::encoding::Context) -> usize {
9497            8
9498        }
9499    }
9500
9501    unsafe impl
9502        fidl::encoding::Encode<
9503            CapabilitiesDataRouterCreateRequest,
9504            fidl::encoding::DefaultFuchsiaResourceDialect,
9505        > for &mut CapabilitiesDataRouterCreateRequest
9506    {
9507        #[inline]
9508        unsafe fn encode(
9509            self,
9510            encoder: &mut fidl::encoding::Encoder<
9511                '_,
9512                fidl::encoding::DefaultFuchsiaResourceDialect,
9513            >,
9514            offset: usize,
9515            _depth: fidl::encoding::Depth,
9516        ) -> fidl::Result<()> {
9517            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9518            // Delegate to tuple encoding.
9519            fidl::encoding::Encode::<CapabilitiesDataRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9520                (
9521                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
9522                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
9523                ),
9524                encoder, offset, _depth
9525            )
9526        }
9527    }
9528    unsafe impl<
9529        T0: fidl::encoding::Encode<
9530                fidl::encoding::HandleType<
9531                    fidl::EventPair,
9532                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9533                    2147483648,
9534                >,
9535                fidl::encoding::DefaultFuchsiaResourceDialect,
9536            >,
9537        T1: fidl::encoding::Encode<
9538                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9539                fidl::encoding::DefaultFuchsiaResourceDialect,
9540            >,
9541    >
9542        fidl::encoding::Encode<
9543            CapabilitiesDataRouterCreateRequest,
9544            fidl::encoding::DefaultFuchsiaResourceDialect,
9545        > for (T0, T1)
9546    {
9547        #[inline]
9548        unsafe fn encode(
9549            self,
9550            encoder: &mut fidl::encoding::Encoder<
9551                '_,
9552                fidl::encoding::DefaultFuchsiaResourceDialect,
9553            >,
9554            offset: usize,
9555            depth: fidl::encoding::Depth,
9556        ) -> fidl::Result<()> {
9557            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9558            // Zero out padding regions. There's no need to apply masks
9559            // because the unmasked parts will be overwritten by fields.
9560            // Write the fields.
9561            self.0.encode(encoder, offset + 0, depth)?;
9562            self.1.encode(encoder, offset + 4, depth)?;
9563            Ok(())
9564        }
9565    }
9566
9567    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9568        for CapabilitiesDataRouterCreateRequest
9569    {
9570        #[inline(always)]
9571        fn new_empty() -> Self {
9572            Self {
9573                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9574                router_client_end: fidl::new_empty!(
9575                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9576                    fidl::encoding::DefaultFuchsiaResourceDialect
9577                ),
9578            }
9579        }
9580
9581        #[inline]
9582        unsafe fn decode(
9583            &mut self,
9584            decoder: &mut fidl::encoding::Decoder<
9585                '_,
9586                fidl::encoding::DefaultFuchsiaResourceDialect,
9587            >,
9588            offset: usize,
9589            _depth: fidl::encoding::Depth,
9590        ) -> fidl::Result<()> {
9591            decoder.debug_check_bounds::<Self>(offset);
9592            // Verify that padding bytes are zero.
9593            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9594            fidl::decode!(
9595                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9596                fidl::encoding::DefaultFuchsiaResourceDialect,
9597                &mut self.router_client_end,
9598                decoder,
9599                offset + 4,
9600                _depth
9601            )?;
9602            Ok(())
9603        }
9604    }
9605
9606    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterRouteRequest {
9607        type Borrowed<'a> = &'a mut Self;
9608        fn take_or_borrow<'a>(
9609            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9610        ) -> Self::Borrowed<'a> {
9611            value
9612        }
9613    }
9614
9615    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteRequest {
9616        type Owned = Self;
9617
9618        #[inline(always)]
9619        fn inline_align(_context: fidl::encoding::Context) -> usize {
9620            8
9621        }
9622
9623        #[inline(always)]
9624        fn inline_size(_context: fidl::encoding::Context) -> usize {
9625            32
9626        }
9627    }
9628
9629    unsafe impl
9630        fidl::encoding::Encode<
9631            CapabilitiesDataRouterRouteRequest,
9632            fidl::encoding::DefaultFuchsiaResourceDialect,
9633        > for &mut CapabilitiesDataRouterRouteRequest
9634    {
9635        #[inline]
9636        unsafe fn encode(
9637            self,
9638            encoder: &mut fidl::encoding::Encoder<
9639                '_,
9640                fidl::encoding::DefaultFuchsiaResourceDialect,
9641            >,
9642            offset: usize,
9643            _depth: fidl::encoding::Depth,
9644        ) -> fidl::Result<()> {
9645            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9646            // Delegate to tuple encoding.
9647            fidl::encoding::Encode::<
9648                CapabilitiesDataRouterRouteRequest,
9649                fidl::encoding::DefaultFuchsiaResourceDialect,
9650            >::encode(
9651                (
9652                    <fidl::encoding::HandleType<
9653                        fidl::EventPair,
9654                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9655                        2147483648,
9656                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9657                        &mut self.router
9658                    ),
9659                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9660                        &mut self.request,
9661                    ),
9662                    <fidl::encoding::HandleType<
9663                        fidl::EventPair,
9664                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9665                        2147483648,
9666                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9667                        &mut self.instance_token,
9668                    ),
9669                    <fidl::encoding::HandleType<
9670                        fidl::EventPair,
9671                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9672                        2147483648,
9673                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9674                        &mut self.data
9675                    ),
9676                ),
9677                encoder,
9678                offset,
9679                _depth,
9680            )
9681        }
9682    }
9683    unsafe impl<
9684        T0: fidl::encoding::Encode<
9685                fidl::encoding::HandleType<
9686                    fidl::EventPair,
9687                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9688                    2147483648,
9689                >,
9690                fidl::encoding::DefaultFuchsiaResourceDialect,
9691            >,
9692        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9693        T2: fidl::encoding::Encode<
9694                fidl::encoding::HandleType<
9695                    fidl::EventPair,
9696                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9697                    2147483648,
9698                >,
9699                fidl::encoding::DefaultFuchsiaResourceDialect,
9700            >,
9701        T3: fidl::encoding::Encode<
9702                fidl::encoding::HandleType<
9703                    fidl::EventPair,
9704                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9705                    2147483648,
9706                >,
9707                fidl::encoding::DefaultFuchsiaResourceDialect,
9708            >,
9709    >
9710        fidl::encoding::Encode<
9711            CapabilitiesDataRouterRouteRequest,
9712            fidl::encoding::DefaultFuchsiaResourceDialect,
9713        > for (T0, T1, T2, T3)
9714    {
9715        #[inline]
9716        unsafe fn encode(
9717            self,
9718            encoder: &mut fidl::encoding::Encoder<
9719                '_,
9720                fidl::encoding::DefaultFuchsiaResourceDialect,
9721            >,
9722            offset: usize,
9723            depth: fidl::encoding::Depth,
9724        ) -> fidl::Result<()> {
9725            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9726            // Zero out padding regions. There's no need to apply masks
9727            // because the unmasked parts will be overwritten by fields.
9728            unsafe {
9729                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9730                (ptr as *mut u64).write_unaligned(0);
9731            }
9732            // Write the fields.
9733            self.0.encode(encoder, offset + 0, depth)?;
9734            self.1.encode(encoder, offset + 8, depth)?;
9735            self.2.encode(encoder, offset + 24, depth)?;
9736            self.3.encode(encoder, offset + 28, depth)?;
9737            Ok(())
9738        }
9739    }
9740
9741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9742        for CapabilitiesDataRouterRouteRequest
9743    {
9744        #[inline(always)]
9745        fn new_empty() -> Self {
9746            Self {
9747                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9748                request: fidl::new_empty!(
9749                    RouteRequest,
9750                    fidl::encoding::DefaultFuchsiaResourceDialect
9751                ),
9752                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9753                data: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9754            }
9755        }
9756
9757        #[inline]
9758        unsafe fn decode(
9759            &mut self,
9760            decoder: &mut fidl::encoding::Decoder<
9761                '_,
9762                fidl::encoding::DefaultFuchsiaResourceDialect,
9763            >,
9764            offset: usize,
9765            _depth: fidl::encoding::Depth,
9766        ) -> fidl::Result<()> {
9767            decoder.debug_check_bounds::<Self>(offset);
9768            // Verify that padding bytes are zero.
9769            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9770            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9771            let mask = 0xffffffff00000000u64;
9772            let maskedval = padval & mask;
9773            if maskedval != 0 {
9774                return Err(fidl::Error::NonZeroPadding {
9775                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9776                });
9777            }
9778            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9779            fidl::decode!(
9780                RouteRequest,
9781                fidl::encoding::DefaultFuchsiaResourceDialect,
9782                &mut self.request,
9783                decoder,
9784                offset + 8,
9785                _depth
9786            )?;
9787            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9788            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data, decoder, offset + 28, _depth)?;
9789            Ok(())
9790        }
9791    }
9792
9793    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryCreateRequest {
9794        type Borrowed<'a> = &'a mut Self;
9795        fn take_or_borrow<'a>(
9796            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9797        ) -> Self::Borrowed<'a> {
9798            value
9799        }
9800    }
9801
9802    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryCreateRequest {
9803        type Owned = Self;
9804
9805        #[inline(always)]
9806        fn inline_align(_context: fidl::encoding::Context) -> usize {
9807            4
9808        }
9809
9810        #[inline(always)]
9811        fn inline_size(_context: fidl::encoding::Context) -> usize {
9812            4
9813        }
9814    }
9815
9816    unsafe impl
9817        fidl::encoding::Encode<
9818            CapabilitiesDictionaryCreateRequest,
9819            fidl::encoding::DefaultFuchsiaResourceDialect,
9820        > for &mut CapabilitiesDictionaryCreateRequest
9821    {
9822        #[inline]
9823        unsafe fn encode(
9824            self,
9825            encoder: &mut fidl::encoding::Encoder<
9826                '_,
9827                fidl::encoding::DefaultFuchsiaResourceDialect,
9828            >,
9829            offset: usize,
9830            _depth: fidl::encoding::Depth,
9831        ) -> fidl::Result<()> {
9832            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9833            // Delegate to tuple encoding.
9834            fidl::encoding::Encode::<
9835                CapabilitiesDictionaryCreateRequest,
9836                fidl::encoding::DefaultFuchsiaResourceDialect,
9837            >::encode(
9838                (<fidl::encoding::HandleType<
9839                    fidl::EventPair,
9840                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9841                    2147483648,
9842                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9843                    &mut self.dictionary
9844                ),),
9845                encoder,
9846                offset,
9847                _depth,
9848            )
9849        }
9850    }
9851    unsafe impl<
9852        T0: fidl::encoding::Encode<
9853                fidl::encoding::HandleType<
9854                    fidl::EventPair,
9855                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9856                    2147483648,
9857                >,
9858                fidl::encoding::DefaultFuchsiaResourceDialect,
9859            >,
9860    >
9861        fidl::encoding::Encode<
9862            CapabilitiesDictionaryCreateRequest,
9863            fidl::encoding::DefaultFuchsiaResourceDialect,
9864        > for (T0,)
9865    {
9866        #[inline]
9867        unsafe fn encode(
9868            self,
9869            encoder: &mut fidl::encoding::Encoder<
9870                '_,
9871                fidl::encoding::DefaultFuchsiaResourceDialect,
9872            >,
9873            offset: usize,
9874            depth: fidl::encoding::Depth,
9875        ) -> fidl::Result<()> {
9876            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9877            // Zero out padding regions. There's no need to apply masks
9878            // because the unmasked parts will be overwritten by fields.
9879            // Write the fields.
9880            self.0.encode(encoder, offset + 0, depth)?;
9881            Ok(())
9882        }
9883    }
9884
9885    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9886        for CapabilitiesDictionaryCreateRequest
9887    {
9888        #[inline(always)]
9889        fn new_empty() -> Self {
9890            Self {
9891                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9892            }
9893        }
9894
9895        #[inline]
9896        unsafe fn decode(
9897            &mut self,
9898            decoder: &mut fidl::encoding::Decoder<
9899                '_,
9900                fidl::encoding::DefaultFuchsiaResourceDialect,
9901            >,
9902            offset: usize,
9903            _depth: fidl::encoding::Depth,
9904        ) -> fidl::Result<()> {
9905            decoder.debug_check_bounds::<Self>(offset);
9906            // Verify that padding bytes are zero.
9907            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9908            Ok(())
9909        }
9910    }
9911
9912    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetRequest {
9913        type Borrowed<'a> = &'a mut Self;
9914        fn take_or_borrow<'a>(
9915            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9916        ) -> Self::Borrowed<'a> {
9917            value
9918        }
9919    }
9920
9921    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetRequest {
9922        type Owned = Self;
9923
9924        #[inline(always)]
9925        fn inline_align(_context: fidl::encoding::Context) -> usize {
9926            8
9927        }
9928
9929        #[inline(always)]
9930        fn inline_size(_context: fidl::encoding::Context) -> usize {
9931            32
9932        }
9933    }
9934
9935    unsafe impl
9936        fidl::encoding::Encode<
9937            CapabilitiesDictionaryGetRequest,
9938            fidl::encoding::DefaultFuchsiaResourceDialect,
9939        > for &mut CapabilitiesDictionaryGetRequest
9940    {
9941        #[inline]
9942        unsafe fn encode(
9943            self,
9944            encoder: &mut fidl::encoding::Encoder<
9945                '_,
9946                fidl::encoding::DefaultFuchsiaResourceDialect,
9947            >,
9948            offset: usize,
9949            _depth: fidl::encoding::Depth,
9950        ) -> fidl::Result<()> {
9951            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
9952            // Delegate to tuple encoding.
9953            fidl::encoding::Encode::<
9954                CapabilitiesDictionaryGetRequest,
9955                fidl::encoding::DefaultFuchsiaResourceDialect,
9956            >::encode(
9957                (
9958                    <fidl::encoding::HandleType<
9959                        fidl::EventPair,
9960                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9961                        2147483648,
9962                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9963                        &mut self.dictionary
9964                    ),
9965                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
9966                        &self.key,
9967                    ),
9968                    <fidl::encoding::HandleType<
9969                        fidl::EventPair,
9970                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9971                        2147483648,
9972                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9973                        &mut self.value
9974                    ),
9975                ),
9976                encoder,
9977                offset,
9978                _depth,
9979            )
9980        }
9981    }
9982    unsafe impl<
9983        T0: fidl::encoding::Encode<
9984                fidl::encoding::HandleType<
9985                    fidl::EventPair,
9986                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9987                    2147483648,
9988                >,
9989                fidl::encoding::DefaultFuchsiaResourceDialect,
9990            >,
9991        T1: fidl::encoding::Encode<
9992                fidl::encoding::BoundedString<100>,
9993                fidl::encoding::DefaultFuchsiaResourceDialect,
9994            >,
9995        T2: fidl::encoding::Encode<
9996                fidl::encoding::HandleType<
9997                    fidl::EventPair,
9998                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9999                    2147483648,
10000                >,
10001                fidl::encoding::DefaultFuchsiaResourceDialect,
10002            >,
10003    >
10004        fidl::encoding::Encode<
10005            CapabilitiesDictionaryGetRequest,
10006            fidl::encoding::DefaultFuchsiaResourceDialect,
10007        > for (T0, T1, T2)
10008    {
10009        #[inline]
10010        unsafe fn encode(
10011            self,
10012            encoder: &mut fidl::encoding::Encoder<
10013                '_,
10014                fidl::encoding::DefaultFuchsiaResourceDialect,
10015            >,
10016            offset: usize,
10017            depth: fidl::encoding::Depth,
10018        ) -> fidl::Result<()> {
10019            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
10020            // Zero out padding regions. There's no need to apply masks
10021            // because the unmasked parts will be overwritten by fields.
10022            unsafe {
10023                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10024                (ptr as *mut u64).write_unaligned(0);
10025            }
10026            unsafe {
10027                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10028                (ptr as *mut u64).write_unaligned(0);
10029            }
10030            // Write the fields.
10031            self.0.encode(encoder, offset + 0, depth)?;
10032            self.1.encode(encoder, offset + 8, depth)?;
10033            self.2.encode(encoder, offset + 24, depth)?;
10034            Ok(())
10035        }
10036    }
10037
10038    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10039        for CapabilitiesDictionaryGetRequest
10040    {
10041        #[inline(always)]
10042        fn new_empty() -> Self {
10043            Self {
10044                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10045                key: fidl::new_empty!(
10046                    fidl::encoding::BoundedString<100>,
10047                    fidl::encoding::DefaultFuchsiaResourceDialect
10048                ),
10049                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10050            }
10051        }
10052
10053        #[inline]
10054        unsafe fn decode(
10055            &mut self,
10056            decoder: &mut fidl::encoding::Decoder<
10057                '_,
10058                fidl::encoding::DefaultFuchsiaResourceDialect,
10059            >,
10060            offset: usize,
10061            _depth: fidl::encoding::Depth,
10062        ) -> fidl::Result<()> {
10063            decoder.debug_check_bounds::<Self>(offset);
10064            // Verify that padding bytes are zero.
10065            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10066            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10067            let mask = 0xffffffff00000000u64;
10068            let maskedval = padval & mask;
10069            if maskedval != 0 {
10070                return Err(fidl::Error::NonZeroPadding {
10071                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10072                });
10073            }
10074            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10075            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10076            let mask = 0xffffffff00000000u64;
10077            let maskedval = padval & mask;
10078            if maskedval != 0 {
10079                return Err(fidl::Error::NonZeroPadding {
10080                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10081                });
10082            }
10083            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10084            fidl::decode!(
10085                fidl::encoding::BoundedString<100>,
10086                fidl::encoding::DefaultFuchsiaResourceDialect,
10087                &mut self.key,
10088                decoder,
10089                offset + 8,
10090                _depth
10091            )?;
10092            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10093            Ok(())
10094        }
10095    }
10096
10097    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryInsertRequest {
10098        type Borrowed<'a> = &'a mut Self;
10099        fn take_or_borrow<'a>(
10100            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10101        ) -> Self::Borrowed<'a> {
10102            value
10103        }
10104    }
10105
10106    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryInsertRequest {
10107        type Owned = Self;
10108
10109        #[inline(always)]
10110        fn inline_align(_context: fidl::encoding::Context) -> usize {
10111            8
10112        }
10113
10114        #[inline(always)]
10115        fn inline_size(_context: fidl::encoding::Context) -> usize {
10116            32
10117        }
10118    }
10119
10120    unsafe impl
10121        fidl::encoding::Encode<
10122            CapabilitiesDictionaryInsertRequest,
10123            fidl::encoding::DefaultFuchsiaResourceDialect,
10124        > for &mut CapabilitiesDictionaryInsertRequest
10125    {
10126        #[inline]
10127        unsafe fn encode(
10128            self,
10129            encoder: &mut fidl::encoding::Encoder<
10130                '_,
10131                fidl::encoding::DefaultFuchsiaResourceDialect,
10132            >,
10133            offset: usize,
10134            _depth: fidl::encoding::Depth,
10135        ) -> fidl::Result<()> {
10136            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10137            // Delegate to tuple encoding.
10138            fidl::encoding::Encode::<
10139                CapabilitiesDictionaryInsertRequest,
10140                fidl::encoding::DefaultFuchsiaResourceDialect,
10141            >::encode(
10142                (
10143                    <fidl::encoding::HandleType<
10144                        fidl::EventPair,
10145                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10146                        2147483648,
10147                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10148                        &mut self.dictionary
10149                    ),
10150                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10151                        &self.key,
10152                    ),
10153                    <fidl::encoding::HandleType<
10154                        fidl::EventPair,
10155                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10156                        2147483648,
10157                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10158                        &mut self.value
10159                    ),
10160                ),
10161                encoder,
10162                offset,
10163                _depth,
10164            )
10165        }
10166    }
10167    unsafe impl<
10168        T0: fidl::encoding::Encode<
10169                fidl::encoding::HandleType<
10170                    fidl::EventPair,
10171                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10172                    2147483648,
10173                >,
10174                fidl::encoding::DefaultFuchsiaResourceDialect,
10175            >,
10176        T1: fidl::encoding::Encode<
10177                fidl::encoding::BoundedString<100>,
10178                fidl::encoding::DefaultFuchsiaResourceDialect,
10179            >,
10180        T2: fidl::encoding::Encode<
10181                fidl::encoding::HandleType<
10182                    fidl::EventPair,
10183                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10184                    2147483648,
10185                >,
10186                fidl::encoding::DefaultFuchsiaResourceDialect,
10187            >,
10188    >
10189        fidl::encoding::Encode<
10190            CapabilitiesDictionaryInsertRequest,
10191            fidl::encoding::DefaultFuchsiaResourceDialect,
10192        > for (T0, T1, T2)
10193    {
10194        #[inline]
10195        unsafe fn encode(
10196            self,
10197            encoder: &mut fidl::encoding::Encoder<
10198                '_,
10199                fidl::encoding::DefaultFuchsiaResourceDialect,
10200            >,
10201            offset: usize,
10202            depth: fidl::encoding::Depth,
10203        ) -> fidl::Result<()> {
10204            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10205            // Zero out padding regions. There's no need to apply masks
10206            // because the unmasked parts will be overwritten by fields.
10207            unsafe {
10208                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10209                (ptr as *mut u64).write_unaligned(0);
10210            }
10211            unsafe {
10212                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10213                (ptr as *mut u64).write_unaligned(0);
10214            }
10215            // Write the fields.
10216            self.0.encode(encoder, offset + 0, depth)?;
10217            self.1.encode(encoder, offset + 8, depth)?;
10218            self.2.encode(encoder, offset + 24, depth)?;
10219            Ok(())
10220        }
10221    }
10222
10223    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10224        for CapabilitiesDictionaryInsertRequest
10225    {
10226        #[inline(always)]
10227        fn new_empty() -> Self {
10228            Self {
10229                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10230                key: fidl::new_empty!(
10231                    fidl::encoding::BoundedString<100>,
10232                    fidl::encoding::DefaultFuchsiaResourceDialect
10233                ),
10234                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10235            }
10236        }
10237
10238        #[inline]
10239        unsafe fn decode(
10240            &mut self,
10241            decoder: &mut fidl::encoding::Decoder<
10242                '_,
10243                fidl::encoding::DefaultFuchsiaResourceDialect,
10244            >,
10245            offset: usize,
10246            _depth: fidl::encoding::Depth,
10247        ) -> fidl::Result<()> {
10248            decoder.debug_check_bounds::<Self>(offset);
10249            // Verify that padding bytes are zero.
10250            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10251            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10252            let mask = 0xffffffff00000000u64;
10253            let maskedval = padval & mask;
10254            if maskedval != 0 {
10255                return Err(fidl::Error::NonZeroPadding {
10256                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10257                });
10258            }
10259            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10260            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10261            let mask = 0xffffffff00000000u64;
10262            let maskedval = padval & mask;
10263            if maskedval != 0 {
10264                return Err(fidl::Error::NonZeroPadding {
10265                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10266                });
10267            }
10268            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10269            fidl::decode!(
10270                fidl::encoding::BoundedString<100>,
10271                fidl::encoding::DefaultFuchsiaResourceDialect,
10272                &mut self.key,
10273                decoder,
10274                offset + 8,
10275                _depth
10276            )?;
10277            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10278            Ok(())
10279        }
10280    }
10281
10282    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10283        type Borrowed<'a> = &'a mut Self;
10284        fn take_or_borrow<'a>(
10285            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10286        ) -> Self::Borrowed<'a> {
10287            value
10288        }
10289    }
10290
10291    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10292        type Owned = Self;
10293
10294        #[inline(always)]
10295        fn inline_align(_context: fidl::encoding::Context) -> usize {
10296            4
10297        }
10298
10299        #[inline(always)]
10300        fn inline_size(_context: fidl::encoding::Context) -> usize {
10301            8
10302        }
10303    }
10304
10305    unsafe impl
10306        fidl::encoding::Encode<
10307            CapabilitiesDictionaryIterateKeysRequest,
10308            fidl::encoding::DefaultFuchsiaResourceDialect,
10309        > for &mut CapabilitiesDictionaryIterateKeysRequest
10310    {
10311        #[inline]
10312        unsafe fn encode(
10313            self,
10314            encoder: &mut fidl::encoding::Encoder<
10315                '_,
10316                fidl::encoding::DefaultFuchsiaResourceDialect,
10317            >,
10318            offset: usize,
10319            _depth: fidl::encoding::Depth,
10320        ) -> fidl::Result<()> {
10321            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10322            // Delegate to tuple encoding.
10323            fidl::encoding::Encode::<
10324                CapabilitiesDictionaryIterateKeysRequest,
10325                fidl::encoding::DefaultFuchsiaResourceDialect,
10326            >::encode(
10327                (
10328                    <fidl::encoding::HandleType<
10329                        fidl::EventPair,
10330                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10331                        2147483648,
10332                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10333                        &mut self.dictionary
10334                    ),
10335                    <fidl::encoding::Endpoint<
10336                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10337                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10338                        &mut self.key_iterator,
10339                    ),
10340                ),
10341                encoder,
10342                offset,
10343                _depth,
10344            )
10345        }
10346    }
10347    unsafe impl<
10348        T0: fidl::encoding::Encode<
10349                fidl::encoding::HandleType<
10350                    fidl::EventPair,
10351                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10352                    2147483648,
10353                >,
10354                fidl::encoding::DefaultFuchsiaResourceDialect,
10355            >,
10356        T1: fidl::encoding::Encode<
10357                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10358                fidl::encoding::DefaultFuchsiaResourceDialect,
10359            >,
10360    >
10361        fidl::encoding::Encode<
10362            CapabilitiesDictionaryIterateKeysRequest,
10363            fidl::encoding::DefaultFuchsiaResourceDialect,
10364        > for (T0, T1)
10365    {
10366        #[inline]
10367        unsafe fn encode(
10368            self,
10369            encoder: &mut fidl::encoding::Encoder<
10370                '_,
10371                fidl::encoding::DefaultFuchsiaResourceDialect,
10372            >,
10373            offset: usize,
10374            depth: fidl::encoding::Depth,
10375        ) -> fidl::Result<()> {
10376            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10377            // Zero out padding regions. There's no need to apply masks
10378            // because the unmasked parts will be overwritten by fields.
10379            // Write the fields.
10380            self.0.encode(encoder, offset + 0, depth)?;
10381            self.1.encode(encoder, offset + 4, depth)?;
10382            Ok(())
10383        }
10384    }
10385
10386    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10387        for CapabilitiesDictionaryIterateKeysRequest
10388    {
10389        #[inline(always)]
10390        fn new_empty() -> Self {
10391            Self {
10392                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10393                key_iterator: fidl::new_empty!(
10394                    fidl::encoding::Endpoint<
10395                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10396                    >,
10397                    fidl::encoding::DefaultFuchsiaResourceDialect
10398                ),
10399            }
10400        }
10401
10402        #[inline]
10403        unsafe fn decode(
10404            &mut self,
10405            decoder: &mut fidl::encoding::Decoder<
10406                '_,
10407                fidl::encoding::DefaultFuchsiaResourceDialect,
10408            >,
10409            offset: usize,
10410            _depth: fidl::encoding::Depth,
10411        ) -> fidl::Result<()> {
10412            decoder.debug_check_bounds::<Self>(offset);
10413            // Verify that padding bytes are zero.
10414            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10415            fidl::decode!(
10416                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10417                fidl::encoding::DefaultFuchsiaResourceDialect,
10418                &mut self.key_iterator,
10419                decoder,
10420                offset + 4,
10421                _depth
10422            )?;
10423            Ok(())
10424        }
10425    }
10426
10427    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10428        type Borrowed<'a> = &'a mut Self;
10429        fn take_or_borrow<'a>(
10430            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10431        ) -> Self::Borrowed<'a> {
10432            value
10433        }
10434    }
10435
10436    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10437        type Owned = Self;
10438
10439        #[inline(always)]
10440        fn inline_align(_context: fidl::encoding::Context) -> usize {
10441            4
10442        }
10443
10444        #[inline(always)]
10445        fn inline_size(_context: fidl::encoding::Context) -> usize {
10446            8
10447        }
10448    }
10449
10450    unsafe impl
10451        fidl::encoding::Encode<
10452            CapabilitiesDictionaryRouterCreateRequest,
10453            fidl::encoding::DefaultFuchsiaResourceDialect,
10454        > for &mut CapabilitiesDictionaryRouterCreateRequest
10455    {
10456        #[inline]
10457        unsafe fn encode(
10458            self,
10459            encoder: &mut fidl::encoding::Encoder<
10460                '_,
10461                fidl::encoding::DefaultFuchsiaResourceDialect,
10462            >,
10463            offset: usize,
10464            _depth: fidl::encoding::Depth,
10465        ) -> fidl::Result<()> {
10466            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10467            // Delegate to tuple encoding.
10468            fidl::encoding::Encode::<CapabilitiesDictionaryRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10469                (
10470                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10471                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10472                ),
10473                encoder, offset, _depth
10474            )
10475        }
10476    }
10477    unsafe impl<
10478        T0: fidl::encoding::Encode<
10479                fidl::encoding::HandleType<
10480                    fidl::EventPair,
10481                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10482                    2147483648,
10483                >,
10484                fidl::encoding::DefaultFuchsiaResourceDialect,
10485            >,
10486        T1: fidl::encoding::Encode<
10487                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10488                fidl::encoding::DefaultFuchsiaResourceDialect,
10489            >,
10490    >
10491        fidl::encoding::Encode<
10492            CapabilitiesDictionaryRouterCreateRequest,
10493            fidl::encoding::DefaultFuchsiaResourceDialect,
10494        > for (T0, T1)
10495    {
10496        #[inline]
10497        unsafe fn encode(
10498            self,
10499            encoder: &mut fidl::encoding::Encoder<
10500                '_,
10501                fidl::encoding::DefaultFuchsiaResourceDialect,
10502            >,
10503            offset: usize,
10504            depth: fidl::encoding::Depth,
10505        ) -> fidl::Result<()> {
10506            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10507            // Zero out padding regions. There's no need to apply masks
10508            // because the unmasked parts will be overwritten by fields.
10509            // Write the fields.
10510            self.0.encode(encoder, offset + 0, depth)?;
10511            self.1.encode(encoder, offset + 4, depth)?;
10512            Ok(())
10513        }
10514    }
10515
10516    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10517        for CapabilitiesDictionaryRouterCreateRequest
10518    {
10519        #[inline(always)]
10520        fn new_empty() -> Self {
10521            Self {
10522                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10523                router_client_end: fidl::new_empty!(
10524                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10525                    fidl::encoding::DefaultFuchsiaResourceDialect
10526                ),
10527            }
10528        }
10529
10530        #[inline]
10531        unsafe fn decode(
10532            &mut self,
10533            decoder: &mut fidl::encoding::Decoder<
10534                '_,
10535                fidl::encoding::DefaultFuchsiaResourceDialect,
10536            >,
10537            offset: usize,
10538            _depth: fidl::encoding::Depth,
10539        ) -> fidl::Result<()> {
10540            decoder.debug_check_bounds::<Self>(offset);
10541            // Verify that padding bytes are zero.
10542            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10543            fidl::decode!(
10544                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10545                fidl::encoding::DefaultFuchsiaResourceDialect,
10546                &mut self.router_client_end,
10547                decoder,
10548                offset + 4,
10549                _depth
10550            )?;
10551            Ok(())
10552        }
10553    }
10554
10555    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10556        type Borrowed<'a> = &'a mut Self;
10557        fn take_or_borrow<'a>(
10558            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10559        ) -> Self::Borrowed<'a> {
10560            value
10561        }
10562    }
10563
10564    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10565        type Owned = Self;
10566
10567        #[inline(always)]
10568        fn inline_align(_context: fidl::encoding::Context) -> usize {
10569            8
10570        }
10571
10572        #[inline(always)]
10573        fn inline_size(_context: fidl::encoding::Context) -> usize {
10574            32
10575        }
10576    }
10577
10578    unsafe impl
10579        fidl::encoding::Encode<
10580            CapabilitiesDictionaryRouterRouteRequest,
10581            fidl::encoding::DefaultFuchsiaResourceDialect,
10582        > for &mut CapabilitiesDictionaryRouterRouteRequest
10583    {
10584        #[inline]
10585        unsafe fn encode(
10586            self,
10587            encoder: &mut fidl::encoding::Encoder<
10588                '_,
10589                fidl::encoding::DefaultFuchsiaResourceDialect,
10590            >,
10591            offset: usize,
10592            _depth: fidl::encoding::Depth,
10593        ) -> fidl::Result<()> {
10594            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10595            // Delegate to tuple encoding.
10596            fidl::encoding::Encode::<
10597                CapabilitiesDictionaryRouterRouteRequest,
10598                fidl::encoding::DefaultFuchsiaResourceDialect,
10599            >::encode(
10600                (
10601                    <fidl::encoding::HandleType<
10602                        fidl::EventPair,
10603                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10604                        2147483648,
10605                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10606                        &mut self.router
10607                    ),
10608                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10609                        &mut self.request,
10610                    ),
10611                    <fidl::encoding::HandleType<
10612                        fidl::EventPair,
10613                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10614                        2147483648,
10615                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10616                        &mut self.instance_token,
10617                    ),
10618                    <fidl::encoding::HandleType<
10619                        fidl::EventPair,
10620                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10621                        2147483648,
10622                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10623                        &mut self.dictionary
10624                    ),
10625                ),
10626                encoder,
10627                offset,
10628                _depth,
10629            )
10630        }
10631    }
10632    unsafe impl<
10633        T0: fidl::encoding::Encode<
10634                fidl::encoding::HandleType<
10635                    fidl::EventPair,
10636                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10637                    2147483648,
10638                >,
10639                fidl::encoding::DefaultFuchsiaResourceDialect,
10640            >,
10641        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
10642        T2: fidl::encoding::Encode<
10643                fidl::encoding::HandleType<
10644                    fidl::EventPair,
10645                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10646                    2147483648,
10647                >,
10648                fidl::encoding::DefaultFuchsiaResourceDialect,
10649            >,
10650        T3: fidl::encoding::Encode<
10651                fidl::encoding::HandleType<
10652                    fidl::EventPair,
10653                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10654                    2147483648,
10655                >,
10656                fidl::encoding::DefaultFuchsiaResourceDialect,
10657            >,
10658    >
10659        fidl::encoding::Encode<
10660            CapabilitiesDictionaryRouterRouteRequest,
10661            fidl::encoding::DefaultFuchsiaResourceDialect,
10662        > for (T0, T1, T2, T3)
10663    {
10664        #[inline]
10665        unsafe fn encode(
10666            self,
10667            encoder: &mut fidl::encoding::Encoder<
10668                '_,
10669                fidl::encoding::DefaultFuchsiaResourceDialect,
10670            >,
10671            offset: usize,
10672            depth: fidl::encoding::Depth,
10673        ) -> fidl::Result<()> {
10674            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10675            // Zero out padding regions. There's no need to apply masks
10676            // because the unmasked parts will be overwritten by fields.
10677            unsafe {
10678                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10679                (ptr as *mut u64).write_unaligned(0);
10680            }
10681            // Write the fields.
10682            self.0.encode(encoder, offset + 0, depth)?;
10683            self.1.encode(encoder, offset + 8, depth)?;
10684            self.2.encode(encoder, offset + 24, depth)?;
10685            self.3.encode(encoder, offset + 28, depth)?;
10686            Ok(())
10687        }
10688    }
10689
10690    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10691        for CapabilitiesDictionaryRouterRouteRequest
10692    {
10693        #[inline(always)]
10694        fn new_empty() -> Self {
10695            Self {
10696                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10697                request: fidl::new_empty!(
10698                    RouteRequest,
10699                    fidl::encoding::DefaultFuchsiaResourceDialect
10700                ),
10701                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10702                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10703            }
10704        }
10705
10706        #[inline]
10707        unsafe fn decode(
10708            &mut self,
10709            decoder: &mut fidl::encoding::Decoder<
10710                '_,
10711                fidl::encoding::DefaultFuchsiaResourceDialect,
10712            >,
10713            offset: usize,
10714            _depth: fidl::encoding::Depth,
10715        ) -> fidl::Result<()> {
10716            decoder.debug_check_bounds::<Self>(offset);
10717            // Verify that padding bytes are zero.
10718            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10719            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10720            let mask = 0xffffffff00000000u64;
10721            let maskedval = padval & mask;
10722            if maskedval != 0 {
10723                return Err(fidl::Error::NonZeroPadding {
10724                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10725                });
10726            }
10727            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10728            fidl::decode!(
10729                RouteRequest,
10730                fidl::encoding::DefaultFuchsiaResourceDialect,
10731                &mut self.request,
10732                decoder,
10733                offset + 8,
10734                _depth
10735            )?;
10736            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
10737            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 28, _depth)?;
10738            Ok(())
10739        }
10740    }
10741
10742    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorCreateRequest {
10743        type Borrowed<'a> = &'a mut Self;
10744        fn take_or_borrow<'a>(
10745            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10746        ) -> Self::Borrowed<'a> {
10747            value
10748        }
10749    }
10750
10751    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorCreateRequest {
10752        type Owned = Self;
10753
10754        #[inline(always)]
10755        fn inline_align(_context: fidl::encoding::Context) -> usize {
10756            4
10757        }
10758
10759        #[inline(always)]
10760        fn inline_size(_context: fidl::encoding::Context) -> usize {
10761            8
10762        }
10763    }
10764
10765    unsafe impl
10766        fidl::encoding::Encode<
10767            CapabilitiesDirConnectorCreateRequest,
10768            fidl::encoding::DefaultFuchsiaResourceDialect,
10769        > for &mut CapabilitiesDirConnectorCreateRequest
10770    {
10771        #[inline]
10772        unsafe fn encode(
10773            self,
10774            encoder: &mut fidl::encoding::Encoder<
10775                '_,
10776                fidl::encoding::DefaultFuchsiaResourceDialect,
10777            >,
10778            offset: usize,
10779            _depth: fidl::encoding::Depth,
10780        ) -> fidl::Result<()> {
10781            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10782            // Delegate to tuple encoding.
10783            fidl::encoding::Encode::<CapabilitiesDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10784                (
10785                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector),
10786                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
10787                ),
10788                encoder, offset, _depth
10789            )
10790        }
10791    }
10792    unsafe impl<
10793        T0: fidl::encoding::Encode<
10794                fidl::encoding::HandleType<
10795                    fidl::EventPair,
10796                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10797                    2147483648,
10798                >,
10799                fidl::encoding::DefaultFuchsiaResourceDialect,
10800            >,
10801        T1: fidl::encoding::Encode<
10802                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10803                fidl::encoding::DefaultFuchsiaResourceDialect,
10804            >,
10805    >
10806        fidl::encoding::Encode<
10807            CapabilitiesDirConnectorCreateRequest,
10808            fidl::encoding::DefaultFuchsiaResourceDialect,
10809        > for (T0, T1)
10810    {
10811        #[inline]
10812        unsafe fn encode(
10813            self,
10814            encoder: &mut fidl::encoding::Encoder<
10815                '_,
10816                fidl::encoding::DefaultFuchsiaResourceDialect,
10817            >,
10818            offset: usize,
10819            depth: fidl::encoding::Depth,
10820        ) -> fidl::Result<()> {
10821            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10822            // Zero out padding regions. There's no need to apply masks
10823            // because the unmasked parts will be overwritten by fields.
10824            // Write the fields.
10825            self.0.encode(encoder, offset + 0, depth)?;
10826            self.1.encode(encoder, offset + 4, depth)?;
10827            Ok(())
10828        }
10829    }
10830
10831    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10832        for CapabilitiesDirConnectorCreateRequest
10833    {
10834        #[inline(always)]
10835        fn new_empty() -> Self {
10836            Self {
10837                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10838                receiver_client_end: fidl::new_empty!(
10839                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10840                    fidl::encoding::DefaultFuchsiaResourceDialect
10841                ),
10842            }
10843        }
10844
10845        #[inline]
10846        unsafe fn decode(
10847            &mut self,
10848            decoder: &mut fidl::encoding::Decoder<
10849                '_,
10850                fidl::encoding::DefaultFuchsiaResourceDialect,
10851            >,
10852            offset: usize,
10853            _depth: fidl::encoding::Depth,
10854        ) -> fidl::Result<()> {
10855            decoder.debug_check_bounds::<Self>(offset);
10856            // Verify that padding bytes are zero.
10857            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 0, _depth)?;
10858            fidl::decode!(
10859                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10860                fidl::encoding::DefaultFuchsiaResourceDialect,
10861                &mut self.receiver_client_end,
10862                decoder,
10863                offset + 4,
10864                _depth
10865            )?;
10866            Ok(())
10867        }
10868    }
10869
10870    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10871        type Borrowed<'a> = &'a mut Self;
10872        fn take_or_borrow<'a>(
10873            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10874        ) -> Self::Borrowed<'a> {
10875            value
10876        }
10877    }
10878
10879    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10880        type Owned = Self;
10881
10882        #[inline(always)]
10883        fn inline_align(_context: fidl::encoding::Context) -> usize {
10884            4
10885        }
10886
10887        #[inline(always)]
10888        fn inline_size(_context: fidl::encoding::Context) -> usize {
10889            8
10890        }
10891    }
10892
10893    unsafe impl
10894        fidl::encoding::Encode<
10895            CapabilitiesDirConnectorRouterCreateRequest,
10896            fidl::encoding::DefaultFuchsiaResourceDialect,
10897        > for &mut CapabilitiesDirConnectorRouterCreateRequest
10898    {
10899        #[inline]
10900        unsafe fn encode(
10901            self,
10902            encoder: &mut fidl::encoding::Encoder<
10903                '_,
10904                fidl::encoding::DefaultFuchsiaResourceDialect,
10905            >,
10906            offset: usize,
10907            _depth: fidl::encoding::Depth,
10908        ) -> fidl::Result<()> {
10909            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10910            // Delegate to tuple encoding.
10911            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10912                (
10913                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10914                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10915                ),
10916                encoder, offset, _depth
10917            )
10918        }
10919    }
10920    unsafe impl<
10921        T0: fidl::encoding::Encode<
10922                fidl::encoding::HandleType<
10923                    fidl::EventPair,
10924                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10925                    2147483648,
10926                >,
10927                fidl::encoding::DefaultFuchsiaResourceDialect,
10928            >,
10929        T1: fidl::encoding::Encode<
10930                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10931                fidl::encoding::DefaultFuchsiaResourceDialect,
10932            >,
10933    >
10934        fidl::encoding::Encode<
10935            CapabilitiesDirConnectorRouterCreateRequest,
10936            fidl::encoding::DefaultFuchsiaResourceDialect,
10937        > for (T0, T1)
10938    {
10939        #[inline]
10940        unsafe fn encode(
10941            self,
10942            encoder: &mut fidl::encoding::Encoder<
10943                '_,
10944                fidl::encoding::DefaultFuchsiaResourceDialect,
10945            >,
10946            offset: usize,
10947            depth: fidl::encoding::Depth,
10948        ) -> fidl::Result<()> {
10949            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10950            // Zero out padding regions. There's no need to apply masks
10951            // because the unmasked parts will be overwritten by fields.
10952            // Write the fields.
10953            self.0.encode(encoder, offset + 0, depth)?;
10954            self.1.encode(encoder, offset + 4, depth)?;
10955            Ok(())
10956        }
10957    }
10958
10959    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10960        for CapabilitiesDirConnectorRouterCreateRequest
10961    {
10962        #[inline(always)]
10963        fn new_empty() -> Self {
10964            Self {
10965                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10966                router_client_end: fidl::new_empty!(
10967                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10968                    fidl::encoding::DefaultFuchsiaResourceDialect
10969                ),
10970            }
10971        }
10972
10973        #[inline]
10974        unsafe fn decode(
10975            &mut self,
10976            decoder: &mut fidl::encoding::Decoder<
10977                '_,
10978                fidl::encoding::DefaultFuchsiaResourceDialect,
10979            >,
10980            offset: usize,
10981            _depth: fidl::encoding::Depth,
10982        ) -> fidl::Result<()> {
10983            decoder.debug_check_bounds::<Self>(offset);
10984            // Verify that padding bytes are zero.
10985            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10986            fidl::decode!(
10987                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10988                fidl::encoding::DefaultFuchsiaResourceDialect,
10989                &mut self.router_client_end,
10990                decoder,
10991                offset + 4,
10992                _depth
10993            )?;
10994            Ok(())
10995        }
10996    }
10997
10998    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
10999        type Borrowed<'a> = &'a mut Self;
11000        fn take_or_borrow<'a>(
11001            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11002        ) -> Self::Borrowed<'a> {
11003            value
11004        }
11005    }
11006
11007    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11008        type Owned = Self;
11009
11010        #[inline(always)]
11011        fn inline_align(_context: fidl::encoding::Context) -> usize {
11012            8
11013        }
11014
11015        #[inline(always)]
11016        fn inline_size(_context: fidl::encoding::Context) -> usize {
11017            32
11018        }
11019    }
11020
11021    unsafe impl
11022        fidl::encoding::Encode<
11023            CapabilitiesDirConnectorRouterRouteRequest,
11024            fidl::encoding::DefaultFuchsiaResourceDialect,
11025        > for &mut CapabilitiesDirConnectorRouterRouteRequest
11026    {
11027        #[inline]
11028        unsafe fn encode(
11029            self,
11030            encoder: &mut fidl::encoding::Encoder<
11031                '_,
11032                fidl::encoding::DefaultFuchsiaResourceDialect,
11033            >,
11034            offset: usize,
11035            _depth: fidl::encoding::Depth,
11036        ) -> fidl::Result<()> {
11037            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11038            // Delegate to tuple encoding.
11039            fidl::encoding::Encode::<
11040                CapabilitiesDirConnectorRouterRouteRequest,
11041                fidl::encoding::DefaultFuchsiaResourceDialect,
11042            >::encode(
11043                (
11044                    <fidl::encoding::HandleType<
11045                        fidl::EventPair,
11046                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11047                        2147483648,
11048                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11049                        &mut self.router
11050                    ),
11051                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11052                        &mut self.request,
11053                    ),
11054                    <fidl::encoding::HandleType<
11055                        fidl::EventPair,
11056                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11057                        2147483648,
11058                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11059                        &mut self.instance_token,
11060                    ),
11061                    <fidl::encoding::HandleType<
11062                        fidl::EventPair,
11063                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11064                        2147483648,
11065                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11066                        &mut self.dir_connector,
11067                    ),
11068                ),
11069                encoder,
11070                offset,
11071                _depth,
11072            )
11073        }
11074    }
11075    unsafe impl<
11076        T0: fidl::encoding::Encode<
11077                fidl::encoding::HandleType<
11078                    fidl::EventPair,
11079                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11080                    2147483648,
11081                >,
11082                fidl::encoding::DefaultFuchsiaResourceDialect,
11083            >,
11084        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11085        T2: fidl::encoding::Encode<
11086                fidl::encoding::HandleType<
11087                    fidl::EventPair,
11088                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11089                    2147483648,
11090                >,
11091                fidl::encoding::DefaultFuchsiaResourceDialect,
11092            >,
11093        T3: fidl::encoding::Encode<
11094                fidl::encoding::HandleType<
11095                    fidl::EventPair,
11096                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11097                    2147483648,
11098                >,
11099                fidl::encoding::DefaultFuchsiaResourceDialect,
11100            >,
11101    >
11102        fidl::encoding::Encode<
11103            CapabilitiesDirConnectorRouterRouteRequest,
11104            fidl::encoding::DefaultFuchsiaResourceDialect,
11105        > for (T0, T1, T2, T3)
11106    {
11107        #[inline]
11108        unsafe fn encode(
11109            self,
11110            encoder: &mut fidl::encoding::Encoder<
11111                '_,
11112                fidl::encoding::DefaultFuchsiaResourceDialect,
11113            >,
11114            offset: usize,
11115            depth: fidl::encoding::Depth,
11116        ) -> fidl::Result<()> {
11117            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11118            // Zero out padding regions. There's no need to apply masks
11119            // because the unmasked parts will be overwritten by fields.
11120            unsafe {
11121                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11122                (ptr as *mut u64).write_unaligned(0);
11123            }
11124            // Write the fields.
11125            self.0.encode(encoder, offset + 0, depth)?;
11126            self.1.encode(encoder, offset + 8, depth)?;
11127            self.2.encode(encoder, offset + 24, depth)?;
11128            self.3.encode(encoder, offset + 28, depth)?;
11129            Ok(())
11130        }
11131    }
11132
11133    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11134        for CapabilitiesDirConnectorRouterRouteRequest
11135    {
11136        #[inline(always)]
11137        fn new_empty() -> Self {
11138            Self {
11139                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11140                request: fidl::new_empty!(
11141                    RouteRequest,
11142                    fidl::encoding::DefaultFuchsiaResourceDialect
11143                ),
11144                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11145                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11146            }
11147        }
11148
11149        #[inline]
11150        unsafe fn decode(
11151            &mut self,
11152            decoder: &mut fidl::encoding::Decoder<
11153                '_,
11154                fidl::encoding::DefaultFuchsiaResourceDialect,
11155            >,
11156            offset: usize,
11157            _depth: fidl::encoding::Depth,
11158        ) -> fidl::Result<()> {
11159            decoder.debug_check_bounds::<Self>(offset);
11160            // Verify that padding bytes are zero.
11161            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11162            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11163            let mask = 0xffffffff00000000u64;
11164            let maskedval = padval & mask;
11165            if maskedval != 0 {
11166                return Err(fidl::Error::NonZeroPadding {
11167                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11168                });
11169            }
11170            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11171            fidl::decode!(
11172                RouteRequest,
11173                fidl::encoding::DefaultFuchsiaResourceDialect,
11174                &mut self.request,
11175                decoder,
11176                offset + 8,
11177                _depth
11178            )?;
11179            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
11180            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 28, _depth)?;
11181            Ok(())
11182        }
11183    }
11184
11185    impl fidl::encoding::ResourceTypeMarker for CapabilitiesInstanceTokenCreateRequest {
11186        type Borrowed<'a> = &'a mut Self;
11187        fn take_or_borrow<'a>(
11188            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11189        ) -> Self::Borrowed<'a> {
11190            value
11191        }
11192    }
11193
11194    unsafe impl fidl::encoding::TypeMarker for CapabilitiesInstanceTokenCreateRequest {
11195        type Owned = Self;
11196
11197        #[inline(always)]
11198        fn inline_align(_context: fidl::encoding::Context) -> usize {
11199            4
11200        }
11201
11202        #[inline(always)]
11203        fn inline_size(_context: fidl::encoding::Context) -> usize {
11204            4
11205        }
11206    }
11207
11208    unsafe impl
11209        fidl::encoding::Encode<
11210            CapabilitiesInstanceTokenCreateRequest,
11211            fidl::encoding::DefaultFuchsiaResourceDialect,
11212        > for &mut CapabilitiesInstanceTokenCreateRequest
11213    {
11214        #[inline]
11215        unsafe fn encode(
11216            self,
11217            encoder: &mut fidl::encoding::Encoder<
11218                '_,
11219                fidl::encoding::DefaultFuchsiaResourceDialect,
11220            >,
11221            offset: usize,
11222            _depth: fidl::encoding::Depth,
11223        ) -> fidl::Result<()> {
11224            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11225            // Delegate to tuple encoding.
11226            fidl::encoding::Encode::<
11227                CapabilitiesInstanceTokenCreateRequest,
11228                fidl::encoding::DefaultFuchsiaResourceDialect,
11229            >::encode(
11230                (<fidl::encoding::HandleType<
11231                    fidl::EventPair,
11232                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11233                    2147483648,
11234                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11235                    &mut self.instance_token
11236                ),),
11237                encoder,
11238                offset,
11239                _depth,
11240            )
11241        }
11242    }
11243    unsafe impl<
11244        T0: fidl::encoding::Encode<
11245                fidl::encoding::HandleType<
11246                    fidl::EventPair,
11247                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11248                    2147483648,
11249                >,
11250                fidl::encoding::DefaultFuchsiaResourceDialect,
11251            >,
11252    >
11253        fidl::encoding::Encode<
11254            CapabilitiesInstanceTokenCreateRequest,
11255            fidl::encoding::DefaultFuchsiaResourceDialect,
11256        > for (T0,)
11257    {
11258        #[inline]
11259        unsafe fn encode(
11260            self,
11261            encoder: &mut fidl::encoding::Encoder<
11262                '_,
11263                fidl::encoding::DefaultFuchsiaResourceDialect,
11264            >,
11265            offset: usize,
11266            depth: fidl::encoding::Depth,
11267        ) -> fidl::Result<()> {
11268            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11269            // Zero out padding regions. There's no need to apply masks
11270            // because the unmasked parts will be overwritten by fields.
11271            // Write the fields.
11272            self.0.encode(encoder, offset + 0, depth)?;
11273            Ok(())
11274        }
11275    }
11276
11277    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11278        for CapabilitiesInstanceTokenCreateRequest
11279    {
11280        #[inline(always)]
11281        fn new_empty() -> Self {
11282            Self {
11283                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11284            }
11285        }
11286
11287        #[inline]
11288        unsafe fn decode(
11289            &mut self,
11290            decoder: &mut fidl::encoding::Decoder<
11291                '_,
11292                fidl::encoding::DefaultFuchsiaResourceDialect,
11293            >,
11294            offset: usize,
11295            _depth: fidl::encoding::Depth,
11296        ) -> fidl::Result<()> {
11297            decoder.debug_check_bounds::<Self>(offset);
11298            // Verify that padding bytes are zero.
11299            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 0, _depth)?;
11300            Ok(())
11301        }
11302    }
11303
11304    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetResponse {
11305        type Borrowed<'a> = &'a mut Self;
11306        fn take_or_borrow<'a>(
11307            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11308        ) -> Self::Borrowed<'a> {
11309            value
11310        }
11311    }
11312
11313    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetResponse {
11314        type Owned = Self;
11315
11316        #[inline(always)]
11317        fn inline_align(_context: fidl::encoding::Context) -> usize {
11318            4
11319        }
11320
11321        #[inline(always)]
11322        fn inline_size(_context: fidl::encoding::Context) -> usize {
11323            4
11324        }
11325    }
11326
11327    unsafe impl
11328        fidl::encoding::Encode<
11329            CapabilitiesDictionaryGetResponse,
11330            fidl::encoding::DefaultFuchsiaResourceDialect,
11331        > for &mut CapabilitiesDictionaryGetResponse
11332    {
11333        #[inline]
11334        unsafe fn encode(
11335            self,
11336            encoder: &mut fidl::encoding::Encoder<
11337                '_,
11338                fidl::encoding::DefaultFuchsiaResourceDialect,
11339            >,
11340            offset: usize,
11341            _depth: fidl::encoding::Depth,
11342        ) -> fidl::Result<()> {
11343            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11344            // Delegate to tuple encoding.
11345            fidl::encoding::Encode::<
11346                CapabilitiesDictionaryGetResponse,
11347                fidl::encoding::DefaultFuchsiaResourceDialect,
11348            >::encode(
11349                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11350                    &self.capability_type,
11351                ),),
11352                encoder,
11353                offset,
11354                _depth,
11355            )
11356        }
11357    }
11358    unsafe impl<
11359        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11360    >
11361        fidl::encoding::Encode<
11362            CapabilitiesDictionaryGetResponse,
11363            fidl::encoding::DefaultFuchsiaResourceDialect,
11364        > for (T0,)
11365    {
11366        #[inline]
11367        unsafe fn encode(
11368            self,
11369            encoder: &mut fidl::encoding::Encoder<
11370                '_,
11371                fidl::encoding::DefaultFuchsiaResourceDialect,
11372            >,
11373            offset: usize,
11374            depth: fidl::encoding::Depth,
11375        ) -> fidl::Result<()> {
11376            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11377            // Zero out padding regions. There's no need to apply masks
11378            // because the unmasked parts will be overwritten by fields.
11379            // Write the fields.
11380            self.0.encode(encoder, offset + 0, depth)?;
11381            Ok(())
11382        }
11383    }
11384
11385    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11386        for CapabilitiesDictionaryGetResponse
11387    {
11388        #[inline(always)]
11389        fn new_empty() -> Self {
11390            Self {
11391                capability_type: fidl::new_empty!(
11392                    CapabilityType,
11393                    fidl::encoding::DefaultFuchsiaResourceDialect
11394                ),
11395            }
11396        }
11397
11398        #[inline]
11399        unsafe fn decode(
11400            &mut self,
11401            decoder: &mut fidl::encoding::Decoder<
11402                '_,
11403                fidl::encoding::DefaultFuchsiaResourceDialect,
11404            >,
11405            offset: usize,
11406            _depth: fidl::encoding::Depth,
11407        ) -> fidl::Result<()> {
11408            decoder.debug_check_bounds::<Self>(offset);
11409            // Verify that padding bytes are zero.
11410            fidl::decode!(
11411                CapabilityType,
11412                fidl::encoding::DefaultFuchsiaResourceDialect,
11413                &mut self.capability_type,
11414                decoder,
11415                offset + 0,
11416                _depth
11417            )?;
11418            Ok(())
11419        }
11420    }
11421
11422    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveResponse {
11423        type Borrowed<'a> = &'a mut Self;
11424        fn take_or_borrow<'a>(
11425            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11426        ) -> Self::Borrowed<'a> {
11427            value
11428        }
11429    }
11430
11431    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveResponse {
11432        type Owned = Self;
11433
11434        #[inline(always)]
11435        fn inline_align(_context: fidl::encoding::Context) -> usize {
11436            4
11437        }
11438
11439        #[inline(always)]
11440        fn inline_size(_context: fidl::encoding::Context) -> usize {
11441            4
11442        }
11443    }
11444
11445    unsafe impl
11446        fidl::encoding::Encode<
11447            CapabilitiesDictionaryRemoveResponse,
11448            fidl::encoding::DefaultFuchsiaResourceDialect,
11449        > for &mut CapabilitiesDictionaryRemoveResponse
11450    {
11451        #[inline]
11452        unsafe fn encode(
11453            self,
11454            encoder: &mut fidl::encoding::Encoder<
11455                '_,
11456                fidl::encoding::DefaultFuchsiaResourceDialect,
11457            >,
11458            offset: usize,
11459            _depth: fidl::encoding::Depth,
11460        ) -> fidl::Result<()> {
11461            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11462            // Delegate to tuple encoding.
11463            fidl::encoding::Encode::<
11464                CapabilitiesDictionaryRemoveResponse,
11465                fidl::encoding::DefaultFuchsiaResourceDialect,
11466            >::encode(
11467                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11468                    &self.capability_type,
11469                ),),
11470                encoder,
11471                offset,
11472                _depth,
11473            )
11474        }
11475    }
11476    unsafe impl<
11477        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11478    >
11479        fidl::encoding::Encode<
11480            CapabilitiesDictionaryRemoveResponse,
11481            fidl::encoding::DefaultFuchsiaResourceDialect,
11482        > for (T0,)
11483    {
11484        #[inline]
11485        unsafe fn encode(
11486            self,
11487            encoder: &mut fidl::encoding::Encoder<
11488                '_,
11489                fidl::encoding::DefaultFuchsiaResourceDialect,
11490            >,
11491            offset: usize,
11492            depth: fidl::encoding::Depth,
11493        ) -> fidl::Result<()> {
11494            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11495            // Zero out padding regions. There's no need to apply masks
11496            // because the unmasked parts will be overwritten by fields.
11497            // Write the fields.
11498            self.0.encode(encoder, offset + 0, depth)?;
11499            Ok(())
11500        }
11501    }
11502
11503    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11504        for CapabilitiesDictionaryRemoveResponse
11505    {
11506        #[inline(always)]
11507        fn new_empty() -> Self {
11508            Self {
11509                capability_type: fidl::new_empty!(
11510                    CapabilityType,
11511                    fidl::encoding::DefaultFuchsiaResourceDialect
11512                ),
11513            }
11514        }
11515
11516        #[inline]
11517        unsafe fn decode(
11518            &mut self,
11519            decoder: &mut fidl::encoding::Decoder<
11520                '_,
11521                fidl::encoding::DefaultFuchsiaResourceDialect,
11522            >,
11523            offset: usize,
11524            _depth: fidl::encoding::Depth,
11525        ) -> fidl::Result<()> {
11526            decoder.debug_check_bounds::<Self>(offset);
11527            // Verify that padding bytes are zero.
11528            fidl::decode!(
11529                CapabilityType,
11530                fidl::encoding::DefaultFuchsiaResourceDialect,
11531                &mut self.capability_type,
11532                decoder,
11533                offset + 0,
11534                _depth
11535            )?;
11536            Ok(())
11537        }
11538    }
11539
11540    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteRequest {
11541        type Borrowed<'a> = &'a mut Self;
11542        fn take_or_borrow<'a>(
11543            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11544        ) -> Self::Borrowed<'a> {
11545            value
11546        }
11547    }
11548
11549    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteRequest {
11550        type Owned = Self;
11551
11552        #[inline(always)]
11553        fn inline_align(_context: fidl::encoding::Context) -> usize {
11554            8
11555        }
11556
11557        #[inline(always)]
11558        fn inline_size(_context: fidl::encoding::Context) -> usize {
11559            24
11560        }
11561    }
11562
11563    unsafe impl
11564        fidl::encoding::Encode<
11565            ConnectorRouterRouteRequest,
11566            fidl::encoding::DefaultFuchsiaResourceDialect,
11567        > for &mut ConnectorRouterRouteRequest
11568    {
11569        #[inline]
11570        unsafe fn encode(
11571            self,
11572            encoder: &mut fidl::encoding::Encoder<
11573                '_,
11574                fidl::encoding::DefaultFuchsiaResourceDialect,
11575            >,
11576            offset: usize,
11577            _depth: fidl::encoding::Depth,
11578        ) -> fidl::Result<()> {
11579            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11580            // Delegate to tuple encoding.
11581            fidl::encoding::Encode::<
11582                ConnectorRouterRouteRequest,
11583                fidl::encoding::DefaultFuchsiaResourceDialect,
11584            >::encode(
11585                (
11586                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11587                        &mut self.request,
11588                    ),
11589                    <fidl::encoding::HandleType<
11590                        fidl::EventPair,
11591                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11592                        2147483648,
11593                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11594                        &mut self.instance_token,
11595                    ),
11596                    <fidl::encoding::HandleType<
11597                        fidl::EventPair,
11598                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11599                        2147483648,
11600                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11601                        &mut self.handle
11602                    ),
11603                ),
11604                encoder,
11605                offset,
11606                _depth,
11607            )
11608        }
11609    }
11610    unsafe impl<
11611        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11612        T1: fidl::encoding::Encode<
11613                fidl::encoding::HandleType<
11614                    fidl::EventPair,
11615                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11616                    2147483648,
11617                >,
11618                fidl::encoding::DefaultFuchsiaResourceDialect,
11619            >,
11620        T2: fidl::encoding::Encode<
11621                fidl::encoding::HandleType<
11622                    fidl::EventPair,
11623                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11624                    2147483648,
11625                >,
11626                fidl::encoding::DefaultFuchsiaResourceDialect,
11627            >,
11628    >
11629        fidl::encoding::Encode<
11630            ConnectorRouterRouteRequest,
11631            fidl::encoding::DefaultFuchsiaResourceDialect,
11632        > for (T0, T1, T2)
11633    {
11634        #[inline]
11635        unsafe fn encode(
11636            self,
11637            encoder: &mut fidl::encoding::Encoder<
11638                '_,
11639                fidl::encoding::DefaultFuchsiaResourceDialect,
11640            >,
11641            offset: usize,
11642            depth: fidl::encoding::Depth,
11643        ) -> fidl::Result<()> {
11644            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11645            // Zero out padding regions. There's no need to apply masks
11646            // because the unmasked parts will be overwritten by fields.
11647            // Write the fields.
11648            self.0.encode(encoder, offset + 0, depth)?;
11649            self.1.encode(encoder, offset + 16, depth)?;
11650            self.2.encode(encoder, offset + 20, depth)?;
11651            Ok(())
11652        }
11653    }
11654
11655    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11656        for ConnectorRouterRouteRequest
11657    {
11658        #[inline(always)]
11659        fn new_empty() -> Self {
11660            Self {
11661                request: fidl::new_empty!(
11662                    RouteRequest,
11663                    fidl::encoding::DefaultFuchsiaResourceDialect
11664                ),
11665                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11666                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11667            }
11668        }
11669
11670        #[inline]
11671        unsafe fn decode(
11672            &mut self,
11673            decoder: &mut fidl::encoding::Decoder<
11674                '_,
11675                fidl::encoding::DefaultFuchsiaResourceDialect,
11676            >,
11677            offset: usize,
11678            _depth: fidl::encoding::Depth,
11679        ) -> fidl::Result<()> {
11680            decoder.debug_check_bounds::<Self>(offset);
11681            // Verify that padding bytes are zero.
11682            fidl::decode!(
11683                RouteRequest,
11684                fidl::encoding::DefaultFuchsiaResourceDialect,
11685                &mut self.request,
11686                decoder,
11687                offset + 0,
11688                _depth
11689            )?;
11690            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11691            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11692            Ok(())
11693        }
11694    }
11695
11696    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteRequest {
11697        type Borrowed<'a> = &'a mut Self;
11698        fn take_or_borrow<'a>(
11699            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11700        ) -> Self::Borrowed<'a> {
11701            value
11702        }
11703    }
11704
11705    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteRequest {
11706        type Owned = Self;
11707
11708        #[inline(always)]
11709        fn inline_align(_context: fidl::encoding::Context) -> usize {
11710            8
11711        }
11712
11713        #[inline(always)]
11714        fn inline_size(_context: fidl::encoding::Context) -> usize {
11715            24
11716        }
11717    }
11718
11719    unsafe impl
11720        fidl::encoding::Encode<
11721            DataRouterRouteRequest,
11722            fidl::encoding::DefaultFuchsiaResourceDialect,
11723        > for &mut DataRouterRouteRequest
11724    {
11725        #[inline]
11726        unsafe fn encode(
11727            self,
11728            encoder: &mut fidl::encoding::Encoder<
11729                '_,
11730                fidl::encoding::DefaultFuchsiaResourceDialect,
11731            >,
11732            offset: usize,
11733            _depth: fidl::encoding::Depth,
11734        ) -> fidl::Result<()> {
11735            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11736            // Delegate to tuple encoding.
11737            fidl::encoding::Encode::<
11738                DataRouterRouteRequest,
11739                fidl::encoding::DefaultFuchsiaResourceDialect,
11740            >::encode(
11741                (
11742                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11743                        &mut self.request,
11744                    ),
11745                    <fidl::encoding::HandleType<
11746                        fidl::EventPair,
11747                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11748                        2147483648,
11749                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11750                        &mut self.instance_token,
11751                    ),
11752                    <fidl::encoding::HandleType<
11753                        fidl::EventPair,
11754                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11755                        2147483648,
11756                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11757                        &mut self.handle
11758                    ),
11759                ),
11760                encoder,
11761                offset,
11762                _depth,
11763            )
11764        }
11765    }
11766    unsafe impl<
11767        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11768        T1: fidl::encoding::Encode<
11769                fidl::encoding::HandleType<
11770                    fidl::EventPair,
11771                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11772                    2147483648,
11773                >,
11774                fidl::encoding::DefaultFuchsiaResourceDialect,
11775            >,
11776        T2: fidl::encoding::Encode<
11777                fidl::encoding::HandleType<
11778                    fidl::EventPair,
11779                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11780                    2147483648,
11781                >,
11782                fidl::encoding::DefaultFuchsiaResourceDialect,
11783            >,
11784    >
11785        fidl::encoding::Encode<
11786            DataRouterRouteRequest,
11787            fidl::encoding::DefaultFuchsiaResourceDialect,
11788        > for (T0, T1, T2)
11789    {
11790        #[inline]
11791        unsafe fn encode(
11792            self,
11793            encoder: &mut fidl::encoding::Encoder<
11794                '_,
11795                fidl::encoding::DefaultFuchsiaResourceDialect,
11796            >,
11797            offset: usize,
11798            depth: fidl::encoding::Depth,
11799        ) -> fidl::Result<()> {
11800            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11801            // Zero out padding regions. There's no need to apply masks
11802            // because the unmasked parts will be overwritten by fields.
11803            // Write the fields.
11804            self.0.encode(encoder, offset + 0, depth)?;
11805            self.1.encode(encoder, offset + 16, depth)?;
11806            self.2.encode(encoder, offset + 20, depth)?;
11807            Ok(())
11808        }
11809    }
11810
11811    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11812        for DataRouterRouteRequest
11813    {
11814        #[inline(always)]
11815        fn new_empty() -> Self {
11816            Self {
11817                request: fidl::new_empty!(
11818                    RouteRequest,
11819                    fidl::encoding::DefaultFuchsiaResourceDialect
11820                ),
11821                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11822                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11823            }
11824        }
11825
11826        #[inline]
11827        unsafe fn decode(
11828            &mut self,
11829            decoder: &mut fidl::encoding::Decoder<
11830                '_,
11831                fidl::encoding::DefaultFuchsiaResourceDialect,
11832            >,
11833            offset: usize,
11834            _depth: fidl::encoding::Depth,
11835        ) -> fidl::Result<()> {
11836            decoder.debug_check_bounds::<Self>(offset);
11837            // Verify that padding bytes are zero.
11838            fidl::decode!(
11839                RouteRequest,
11840                fidl::encoding::DefaultFuchsiaResourceDialect,
11841                &mut self.request,
11842                decoder,
11843                offset + 0,
11844                _depth
11845            )?;
11846            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11847            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11848            Ok(())
11849        }
11850    }
11851
11852    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteRequest {
11853        type Borrowed<'a> = &'a mut Self;
11854        fn take_or_borrow<'a>(
11855            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11856        ) -> Self::Borrowed<'a> {
11857            value
11858        }
11859    }
11860
11861    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteRequest {
11862        type Owned = Self;
11863
11864        #[inline(always)]
11865        fn inline_align(_context: fidl::encoding::Context) -> usize {
11866            8
11867        }
11868
11869        #[inline(always)]
11870        fn inline_size(_context: fidl::encoding::Context) -> usize {
11871            24
11872        }
11873    }
11874
11875    unsafe impl
11876        fidl::encoding::Encode<
11877            DictionaryRouterRouteRequest,
11878            fidl::encoding::DefaultFuchsiaResourceDialect,
11879        > for &mut DictionaryRouterRouteRequest
11880    {
11881        #[inline]
11882        unsafe fn encode(
11883            self,
11884            encoder: &mut fidl::encoding::Encoder<
11885                '_,
11886                fidl::encoding::DefaultFuchsiaResourceDialect,
11887            >,
11888            offset: usize,
11889            _depth: fidl::encoding::Depth,
11890        ) -> fidl::Result<()> {
11891            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11892            // Delegate to tuple encoding.
11893            fidl::encoding::Encode::<
11894                DictionaryRouterRouteRequest,
11895                fidl::encoding::DefaultFuchsiaResourceDialect,
11896            >::encode(
11897                (
11898                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11899                        &mut self.request,
11900                    ),
11901                    <fidl::encoding::HandleType<
11902                        fidl::EventPair,
11903                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11904                        2147483648,
11905                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11906                        &mut self.instance_token,
11907                    ),
11908                    <fidl::encoding::HandleType<
11909                        fidl::EventPair,
11910                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11911                        2147483648,
11912                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11913                        &mut self.handle
11914                    ),
11915                ),
11916                encoder,
11917                offset,
11918                _depth,
11919            )
11920        }
11921    }
11922    unsafe impl<
11923        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11924        T1: fidl::encoding::Encode<
11925                fidl::encoding::HandleType<
11926                    fidl::EventPair,
11927                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11928                    2147483648,
11929                >,
11930                fidl::encoding::DefaultFuchsiaResourceDialect,
11931            >,
11932        T2: fidl::encoding::Encode<
11933                fidl::encoding::HandleType<
11934                    fidl::EventPair,
11935                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11936                    2147483648,
11937                >,
11938                fidl::encoding::DefaultFuchsiaResourceDialect,
11939            >,
11940    >
11941        fidl::encoding::Encode<
11942            DictionaryRouterRouteRequest,
11943            fidl::encoding::DefaultFuchsiaResourceDialect,
11944        > for (T0, T1, T2)
11945    {
11946        #[inline]
11947        unsafe fn encode(
11948            self,
11949            encoder: &mut fidl::encoding::Encoder<
11950                '_,
11951                fidl::encoding::DefaultFuchsiaResourceDialect,
11952            >,
11953            offset: usize,
11954            depth: fidl::encoding::Depth,
11955        ) -> fidl::Result<()> {
11956            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11957            // Zero out padding regions. There's no need to apply masks
11958            // because the unmasked parts will be overwritten by fields.
11959            // Write the fields.
11960            self.0.encode(encoder, offset + 0, depth)?;
11961            self.1.encode(encoder, offset + 16, depth)?;
11962            self.2.encode(encoder, offset + 20, depth)?;
11963            Ok(())
11964        }
11965    }
11966
11967    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11968        for DictionaryRouterRouteRequest
11969    {
11970        #[inline(always)]
11971        fn new_empty() -> Self {
11972            Self {
11973                request: fidl::new_empty!(
11974                    RouteRequest,
11975                    fidl::encoding::DefaultFuchsiaResourceDialect
11976                ),
11977                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11978                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11979            }
11980        }
11981
11982        #[inline]
11983        unsafe fn decode(
11984            &mut self,
11985            decoder: &mut fidl::encoding::Decoder<
11986                '_,
11987                fidl::encoding::DefaultFuchsiaResourceDialect,
11988            >,
11989            offset: usize,
11990            _depth: fidl::encoding::Depth,
11991        ) -> fidl::Result<()> {
11992            decoder.debug_check_bounds::<Self>(offset);
11993            // Verify that padding bytes are zero.
11994            fidl::decode!(
11995                RouteRequest,
11996                fidl::encoding::DefaultFuchsiaResourceDialect,
11997                &mut self.request,
11998                decoder,
11999                offset + 0,
12000                _depth
12001            )?;
12002            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12003            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12004            Ok(())
12005        }
12006    }
12007
12008    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteRequest {
12009        type Borrowed<'a> = &'a mut Self;
12010        fn take_or_borrow<'a>(
12011            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12012        ) -> Self::Borrowed<'a> {
12013            value
12014        }
12015    }
12016
12017    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteRequest {
12018        type Owned = Self;
12019
12020        #[inline(always)]
12021        fn inline_align(_context: fidl::encoding::Context) -> usize {
12022            8
12023        }
12024
12025        #[inline(always)]
12026        fn inline_size(_context: fidl::encoding::Context) -> usize {
12027            24
12028        }
12029    }
12030
12031    unsafe impl
12032        fidl::encoding::Encode<
12033            DirConnectorRouterRouteRequest,
12034            fidl::encoding::DefaultFuchsiaResourceDialect,
12035        > for &mut DirConnectorRouterRouteRequest
12036    {
12037        #[inline]
12038        unsafe fn encode(
12039            self,
12040            encoder: &mut fidl::encoding::Encoder<
12041                '_,
12042                fidl::encoding::DefaultFuchsiaResourceDialect,
12043            >,
12044            offset: usize,
12045            _depth: fidl::encoding::Depth,
12046        ) -> fidl::Result<()> {
12047            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12048            // Delegate to tuple encoding.
12049            fidl::encoding::Encode::<
12050                DirConnectorRouterRouteRequest,
12051                fidl::encoding::DefaultFuchsiaResourceDialect,
12052            >::encode(
12053                (
12054                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12055                        &mut self.request,
12056                    ),
12057                    <fidl::encoding::HandleType<
12058                        fidl::EventPair,
12059                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12060                        2147483648,
12061                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12062                        &mut self.instance_token,
12063                    ),
12064                    <fidl::encoding::HandleType<
12065                        fidl::EventPair,
12066                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12067                        2147483648,
12068                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12069                        &mut self.handle
12070                    ),
12071                ),
12072                encoder,
12073                offset,
12074                _depth,
12075            )
12076        }
12077    }
12078    unsafe impl<
12079        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
12080        T1: fidl::encoding::Encode<
12081                fidl::encoding::HandleType<
12082                    fidl::EventPair,
12083                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12084                    2147483648,
12085                >,
12086                fidl::encoding::DefaultFuchsiaResourceDialect,
12087            >,
12088        T2: fidl::encoding::Encode<
12089                fidl::encoding::HandleType<
12090                    fidl::EventPair,
12091                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12092                    2147483648,
12093                >,
12094                fidl::encoding::DefaultFuchsiaResourceDialect,
12095            >,
12096    >
12097        fidl::encoding::Encode<
12098            DirConnectorRouterRouteRequest,
12099            fidl::encoding::DefaultFuchsiaResourceDialect,
12100        > for (T0, T1, T2)
12101    {
12102        #[inline]
12103        unsafe fn encode(
12104            self,
12105            encoder: &mut fidl::encoding::Encoder<
12106                '_,
12107                fidl::encoding::DefaultFuchsiaResourceDialect,
12108            >,
12109            offset: usize,
12110            depth: fidl::encoding::Depth,
12111        ) -> fidl::Result<()> {
12112            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12113            // Zero out padding regions. There's no need to apply masks
12114            // because the unmasked parts will be overwritten by fields.
12115            // Write the fields.
12116            self.0.encode(encoder, offset + 0, depth)?;
12117            self.1.encode(encoder, offset + 16, depth)?;
12118            self.2.encode(encoder, offset + 20, depth)?;
12119            Ok(())
12120        }
12121    }
12122
12123    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12124        for DirConnectorRouterRouteRequest
12125    {
12126        #[inline(always)]
12127        fn new_empty() -> Self {
12128            Self {
12129                request: fidl::new_empty!(
12130                    RouteRequest,
12131                    fidl::encoding::DefaultFuchsiaResourceDialect
12132                ),
12133                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12134                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12135            }
12136        }
12137
12138        #[inline]
12139        unsafe fn decode(
12140            &mut self,
12141            decoder: &mut fidl::encoding::Decoder<
12142                '_,
12143                fidl::encoding::DefaultFuchsiaResourceDialect,
12144            >,
12145            offset: usize,
12146            _depth: fidl::encoding::Depth,
12147        ) -> fidl::Result<()> {
12148            decoder.debug_check_bounds::<Self>(offset);
12149            // Verify that padding bytes are zero.
12150            fidl::decode!(
12151                RouteRequest,
12152                fidl::encoding::DefaultFuchsiaResourceDialect,
12153                &mut self.request,
12154                decoder,
12155                offset + 0,
12156                _depth
12157            )?;
12158            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12159            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12160            Ok(())
12161        }
12162    }
12163
12164    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12165        type Borrowed<'a> = &'a mut Self;
12166        fn take_or_borrow<'a>(
12167            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12168        ) -> Self::Borrowed<'a> {
12169            value
12170        }
12171    }
12172
12173    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12174        type Owned = Self;
12175
12176        #[inline(always)]
12177        fn inline_align(_context: fidl::encoding::Context) -> usize {
12178            8
12179        }
12180
12181        #[inline(always)]
12182        fn inline_size(_context: fidl::encoding::Context) -> usize {
12183            32
12184        }
12185    }
12186
12187    unsafe impl
12188        fidl::encoding::Encode<
12189            DirReceiverReceiveRequest,
12190            fidl::encoding::DefaultFuchsiaResourceDialect,
12191        > for &mut DirReceiverReceiveRequest
12192    {
12193        #[inline]
12194        unsafe fn encode(
12195            self,
12196            encoder: &mut fidl::encoding::Encoder<
12197                '_,
12198                fidl::encoding::DefaultFuchsiaResourceDialect,
12199            >,
12200            offset: usize,
12201            _depth: fidl::encoding::Depth,
12202        ) -> fidl::Result<()> {
12203            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12204            // Delegate to tuple encoding.
12205            fidl::encoding::Encode::<DirReceiverReceiveRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12206                (
12207                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12208                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
12209                    <fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
12210                ),
12211                encoder, offset, _depth
12212            )
12213        }
12214    }
12215    unsafe impl<
12216        T0: fidl::encoding::Encode<
12217                fidl::encoding::Endpoint<
12218                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12219                >,
12220                fidl::encoding::DefaultFuchsiaResourceDialect,
12221            >,
12222        T1: fidl::encoding::Encode<
12223                fidl::encoding::BoundedString<4095>,
12224                fidl::encoding::DefaultFuchsiaResourceDialect,
12225            >,
12226        T2: fidl::encoding::Encode<
12227                fidl_fuchsia_io::Flags,
12228                fidl::encoding::DefaultFuchsiaResourceDialect,
12229            >,
12230    >
12231        fidl::encoding::Encode<
12232            DirReceiverReceiveRequest,
12233            fidl::encoding::DefaultFuchsiaResourceDialect,
12234        > for (T0, T1, T2)
12235    {
12236        #[inline]
12237        unsafe fn encode(
12238            self,
12239            encoder: &mut fidl::encoding::Encoder<
12240                '_,
12241                fidl::encoding::DefaultFuchsiaResourceDialect,
12242            >,
12243            offset: usize,
12244            depth: fidl::encoding::Depth,
12245        ) -> fidl::Result<()> {
12246            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12247            // Zero out padding regions. There's no need to apply masks
12248            // because the unmasked parts will be overwritten by fields.
12249            unsafe {
12250                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12251                (ptr as *mut u64).write_unaligned(0);
12252            }
12253            // Write the fields.
12254            self.0.encode(encoder, offset + 0, depth)?;
12255            self.1.encode(encoder, offset + 8, depth)?;
12256            self.2.encode(encoder, offset + 24, depth)?;
12257            Ok(())
12258        }
12259    }
12260
12261    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12262        for DirReceiverReceiveRequest
12263    {
12264        #[inline(always)]
12265        fn new_empty() -> Self {
12266            Self {
12267                channel: fidl::new_empty!(
12268                    fidl::encoding::Endpoint<
12269                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12270                    >,
12271                    fidl::encoding::DefaultFuchsiaResourceDialect
12272                ),
12273                path: fidl::new_empty!(
12274                    fidl::encoding::BoundedString<4095>,
12275                    fidl::encoding::DefaultFuchsiaResourceDialect
12276                ),
12277                rights: fidl::new_empty!(
12278                    fidl_fuchsia_io::Flags,
12279                    fidl::encoding::DefaultFuchsiaResourceDialect
12280                ),
12281            }
12282        }
12283
12284        #[inline]
12285        unsafe fn decode(
12286            &mut self,
12287            decoder: &mut fidl::encoding::Decoder<
12288                '_,
12289                fidl::encoding::DefaultFuchsiaResourceDialect,
12290            >,
12291            offset: usize,
12292            _depth: fidl::encoding::Depth,
12293        ) -> fidl::Result<()> {
12294            decoder.debug_check_bounds::<Self>(offset);
12295            // Verify that padding bytes are zero.
12296            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12297            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12298            let mask = 0xffffffff00000000u64;
12299            let maskedval = padval & mask;
12300            if maskedval != 0 {
12301                return Err(fidl::Error::NonZeroPadding {
12302                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12303                });
12304            }
12305            fidl::decode!(
12306                fidl::encoding::Endpoint<
12307                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12308                >,
12309                fidl::encoding::DefaultFuchsiaResourceDialect,
12310                &mut self.channel,
12311                decoder,
12312                offset + 0,
12313                _depth
12314            )?;
12315            fidl::decode!(
12316                fidl::encoding::BoundedString<4095>,
12317                fidl::encoding::DefaultFuchsiaResourceDialect,
12318                &mut self.path,
12319                decoder,
12320                offset + 8,
12321                _depth
12322            )?;
12323            fidl::decode!(
12324                fidl_fuchsia_io::Flags,
12325                fidl::encoding::DefaultFuchsiaResourceDialect,
12326                &mut self.rights,
12327                decoder,
12328                offset + 24,
12329                _depth
12330            )?;
12331            Ok(())
12332        }
12333    }
12334
12335    impl fidl::encoding::ResourceTypeMarker for ReceiverReceiveRequest {
12336        type Borrowed<'a> = &'a mut Self;
12337        fn take_or_borrow<'a>(
12338            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12339        ) -> Self::Borrowed<'a> {
12340            value
12341        }
12342    }
12343
12344    unsafe impl fidl::encoding::TypeMarker for ReceiverReceiveRequest {
12345        type Owned = Self;
12346
12347        #[inline(always)]
12348        fn inline_align(_context: fidl::encoding::Context) -> usize {
12349            4
12350        }
12351
12352        #[inline(always)]
12353        fn inline_size(_context: fidl::encoding::Context) -> usize {
12354            4
12355        }
12356    }
12357
12358    unsafe impl
12359        fidl::encoding::Encode<
12360            ReceiverReceiveRequest,
12361            fidl::encoding::DefaultFuchsiaResourceDialect,
12362        > for &mut ReceiverReceiveRequest
12363    {
12364        #[inline]
12365        unsafe fn encode(
12366            self,
12367            encoder: &mut fidl::encoding::Encoder<
12368                '_,
12369                fidl::encoding::DefaultFuchsiaResourceDialect,
12370            >,
12371            offset: usize,
12372            _depth: fidl::encoding::Depth,
12373        ) -> fidl::Result<()> {
12374            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12375            // Delegate to tuple encoding.
12376            fidl::encoding::Encode::<
12377                ReceiverReceiveRequest,
12378                fidl::encoding::DefaultFuchsiaResourceDialect,
12379            >::encode(
12380                (<fidl::encoding::HandleType<
12381                    fidl::Channel,
12382                    { fidl::ObjectType::CHANNEL.into_raw() },
12383                    2147483648,
12384                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12385                    &mut self.channel
12386                ),),
12387                encoder,
12388                offset,
12389                _depth,
12390            )
12391        }
12392    }
12393    unsafe impl<
12394        T0: fidl::encoding::Encode<
12395                fidl::encoding::HandleType<
12396                    fidl::Channel,
12397                    { fidl::ObjectType::CHANNEL.into_raw() },
12398                    2147483648,
12399                >,
12400                fidl::encoding::DefaultFuchsiaResourceDialect,
12401            >,
12402    >
12403        fidl::encoding::Encode<
12404            ReceiverReceiveRequest,
12405            fidl::encoding::DefaultFuchsiaResourceDialect,
12406        > for (T0,)
12407    {
12408        #[inline]
12409        unsafe fn encode(
12410            self,
12411            encoder: &mut fidl::encoding::Encoder<
12412                '_,
12413                fidl::encoding::DefaultFuchsiaResourceDialect,
12414            >,
12415            offset: usize,
12416            depth: fidl::encoding::Depth,
12417        ) -> fidl::Result<()> {
12418            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12419            // Zero out padding regions. There's no need to apply masks
12420            // because the unmasked parts will be overwritten by fields.
12421            // Write the fields.
12422            self.0.encode(encoder, offset + 0, depth)?;
12423            Ok(())
12424        }
12425    }
12426
12427    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12428        for ReceiverReceiveRequest
12429    {
12430        #[inline(always)]
12431        fn new_empty() -> Self {
12432            Self {
12433                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12434            }
12435        }
12436
12437        #[inline]
12438        unsafe fn decode(
12439            &mut self,
12440            decoder: &mut fidl::encoding::Decoder<
12441                '_,
12442                fidl::encoding::DefaultFuchsiaResourceDialect,
12443            >,
12444            offset: usize,
12445            _depth: fidl::encoding::Depth,
12446        ) -> fidl::Result<()> {
12447            decoder.debug_check_bounds::<Self>(offset);
12448            // Verify that padding bytes are zero.
12449            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12450            Ok(())
12451        }
12452    }
12453
12454    impl CapabilitiesDictionaryRemoveRequest {
12455        #[inline(always)]
12456        fn max_ordinal_present(&self) -> u64 {
12457            if let Some(_) = self.value {
12458                return 3;
12459            }
12460            if let Some(_) = self.key {
12461                return 2;
12462            }
12463            if let Some(_) = self.dictionary {
12464                return 1;
12465            }
12466            0
12467        }
12468    }
12469
12470    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveRequest {
12471        type Borrowed<'a> = &'a mut Self;
12472        fn take_or_borrow<'a>(
12473            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12474        ) -> Self::Borrowed<'a> {
12475            value
12476        }
12477    }
12478
12479    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveRequest {
12480        type Owned = Self;
12481
12482        #[inline(always)]
12483        fn inline_align(_context: fidl::encoding::Context) -> usize {
12484            8
12485        }
12486
12487        #[inline(always)]
12488        fn inline_size(_context: fidl::encoding::Context) -> usize {
12489            16
12490        }
12491    }
12492
12493    unsafe impl
12494        fidl::encoding::Encode<
12495            CapabilitiesDictionaryRemoveRequest,
12496            fidl::encoding::DefaultFuchsiaResourceDialect,
12497        > for &mut CapabilitiesDictionaryRemoveRequest
12498    {
12499        unsafe fn encode(
12500            self,
12501            encoder: &mut fidl::encoding::Encoder<
12502                '_,
12503                fidl::encoding::DefaultFuchsiaResourceDialect,
12504            >,
12505            offset: usize,
12506            mut depth: fidl::encoding::Depth,
12507        ) -> fidl::Result<()> {
12508            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveRequest>(offset);
12509            // Vector header
12510            let max_ordinal: u64 = self.max_ordinal_present();
12511            encoder.write_num(max_ordinal, offset);
12512            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12513            // Calling encoder.out_of_line_offset(0) is not allowed.
12514            if max_ordinal == 0 {
12515                return Ok(());
12516            }
12517            depth.increment()?;
12518            let envelope_size = 8;
12519            let bytes_len = max_ordinal as usize * envelope_size;
12520            #[allow(unused_variables)]
12521            let offset = encoder.out_of_line_offset(bytes_len);
12522            let mut _prev_end_offset: usize = 0;
12523            if 1 > max_ordinal {
12524                return Ok(());
12525            }
12526
12527            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12528            // are envelope_size bytes.
12529            let cur_offset: usize = (1 - 1) * envelope_size;
12530
12531            // Zero reserved fields.
12532            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12533
12534            // Safety:
12535            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12536            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12537            //   envelope_size bytes, there is always sufficient room.
12538            fidl::encoding::encode_in_envelope_optional::<
12539                fidl::encoding::HandleType<
12540                    fidl::EventPair,
12541                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12542                    2147483648,
12543                >,
12544                fidl::encoding::DefaultFuchsiaResourceDialect,
12545            >(
12546                self.dictionary.as_mut().map(
12547                    <fidl::encoding::HandleType<
12548                        fidl::EventPair,
12549                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12550                        2147483648,
12551                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12552                ),
12553                encoder,
12554                offset + cur_offset,
12555                depth,
12556            )?;
12557
12558            _prev_end_offset = cur_offset + envelope_size;
12559            if 2 > max_ordinal {
12560                return Ok(());
12561            }
12562
12563            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12564            // are envelope_size bytes.
12565            let cur_offset: usize = (2 - 1) * envelope_size;
12566
12567            // Zero reserved fields.
12568            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12569
12570            // Safety:
12571            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12572            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12573            //   envelope_size bytes, there is always sufficient room.
12574            fidl::encoding::encode_in_envelope_optional::<
12575                fidl::encoding::BoundedString<100>,
12576                fidl::encoding::DefaultFuchsiaResourceDialect,
12577            >(
12578                self.key.as_ref().map(
12579                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12580                ),
12581                encoder,
12582                offset + cur_offset,
12583                depth,
12584            )?;
12585
12586            _prev_end_offset = cur_offset + envelope_size;
12587            if 3 > max_ordinal {
12588                return Ok(());
12589            }
12590
12591            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12592            // are envelope_size bytes.
12593            let cur_offset: usize = (3 - 1) * envelope_size;
12594
12595            // Zero reserved fields.
12596            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12597
12598            // Safety:
12599            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12600            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12601            //   envelope_size bytes, there is always sufficient room.
12602            fidl::encoding::encode_in_envelope_optional::<
12603                fidl::encoding::HandleType<
12604                    fidl::EventPair,
12605                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12606                    2147483648,
12607                >,
12608                fidl::encoding::DefaultFuchsiaResourceDialect,
12609            >(
12610                self.value.as_mut().map(
12611                    <fidl::encoding::HandleType<
12612                        fidl::EventPair,
12613                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12614                        2147483648,
12615                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12616                ),
12617                encoder,
12618                offset + cur_offset,
12619                depth,
12620            )?;
12621
12622            _prev_end_offset = cur_offset + envelope_size;
12623
12624            Ok(())
12625        }
12626    }
12627
12628    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12629        for CapabilitiesDictionaryRemoveRequest
12630    {
12631        #[inline(always)]
12632        fn new_empty() -> Self {
12633            Self::default()
12634        }
12635
12636        unsafe fn decode(
12637            &mut self,
12638            decoder: &mut fidl::encoding::Decoder<
12639                '_,
12640                fidl::encoding::DefaultFuchsiaResourceDialect,
12641            >,
12642            offset: usize,
12643            mut depth: fidl::encoding::Depth,
12644        ) -> fidl::Result<()> {
12645            decoder.debug_check_bounds::<Self>(offset);
12646            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12647                None => return Err(fidl::Error::NotNullable),
12648                Some(len) => len,
12649            };
12650            // Calling decoder.out_of_line_offset(0) is not allowed.
12651            if len == 0 {
12652                return Ok(());
12653            };
12654            depth.increment()?;
12655            let envelope_size = 8;
12656            let bytes_len = len * envelope_size;
12657            let offset = decoder.out_of_line_offset(bytes_len)?;
12658            // Decode the envelope for each type.
12659            let mut _next_ordinal_to_read = 0;
12660            let mut next_offset = offset;
12661            let end_offset = offset + bytes_len;
12662            _next_ordinal_to_read += 1;
12663            if next_offset >= end_offset {
12664                return Ok(());
12665            }
12666
12667            // Decode unknown envelopes for gaps in ordinals.
12668            while _next_ordinal_to_read < 1 {
12669                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12670                _next_ordinal_to_read += 1;
12671                next_offset += envelope_size;
12672            }
12673
12674            let next_out_of_line = decoder.next_out_of_line();
12675            let handles_before = decoder.remaining_handles();
12676            if let Some((inlined, num_bytes, num_handles)) =
12677                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12678            {
12679                let member_inline_size = <fidl::encoding::HandleType<
12680                    fidl::EventPair,
12681                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12682                    2147483648,
12683                > as fidl::encoding::TypeMarker>::inline_size(
12684                    decoder.context
12685                );
12686                if inlined != (member_inline_size <= 4) {
12687                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12688                }
12689                let inner_offset;
12690                let mut inner_depth = depth.clone();
12691                if inlined {
12692                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12693                    inner_offset = next_offset;
12694                } else {
12695                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12696                    inner_depth.increment()?;
12697                }
12698                let val_ref =
12699                self.dictionary.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12700                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12701                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12702                {
12703                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12704                }
12705                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12706                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12707                }
12708            }
12709
12710            next_offset += envelope_size;
12711            _next_ordinal_to_read += 1;
12712            if next_offset >= end_offset {
12713                return Ok(());
12714            }
12715
12716            // Decode unknown envelopes for gaps in ordinals.
12717            while _next_ordinal_to_read < 2 {
12718                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12719                _next_ordinal_to_read += 1;
12720                next_offset += envelope_size;
12721            }
12722
12723            let next_out_of_line = decoder.next_out_of_line();
12724            let handles_before = decoder.remaining_handles();
12725            if let Some((inlined, num_bytes, num_handles)) =
12726                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12727            {
12728                let member_inline_size =
12729                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12730                        decoder.context,
12731                    );
12732                if inlined != (member_inline_size <= 4) {
12733                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12734                }
12735                let inner_offset;
12736                let mut inner_depth = depth.clone();
12737                if inlined {
12738                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12739                    inner_offset = next_offset;
12740                } else {
12741                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12742                    inner_depth.increment()?;
12743                }
12744                let val_ref = self.key.get_or_insert_with(|| {
12745                    fidl::new_empty!(
12746                        fidl::encoding::BoundedString<100>,
12747                        fidl::encoding::DefaultFuchsiaResourceDialect
12748                    )
12749                });
12750                fidl::decode!(
12751                    fidl::encoding::BoundedString<100>,
12752                    fidl::encoding::DefaultFuchsiaResourceDialect,
12753                    val_ref,
12754                    decoder,
12755                    inner_offset,
12756                    inner_depth
12757                )?;
12758                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12759                {
12760                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12761                }
12762                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12763                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12764                }
12765            }
12766
12767            next_offset += envelope_size;
12768            _next_ordinal_to_read += 1;
12769            if next_offset >= end_offset {
12770                return Ok(());
12771            }
12772
12773            // Decode unknown envelopes for gaps in ordinals.
12774            while _next_ordinal_to_read < 3 {
12775                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12776                _next_ordinal_to_read += 1;
12777                next_offset += envelope_size;
12778            }
12779
12780            let next_out_of_line = decoder.next_out_of_line();
12781            let handles_before = decoder.remaining_handles();
12782            if let Some((inlined, num_bytes, num_handles)) =
12783                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12784            {
12785                let member_inline_size = <fidl::encoding::HandleType<
12786                    fidl::EventPair,
12787                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12788                    2147483648,
12789                > as fidl::encoding::TypeMarker>::inline_size(
12790                    decoder.context
12791                );
12792                if inlined != (member_inline_size <= 4) {
12793                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12794                }
12795                let inner_offset;
12796                let mut inner_depth = depth.clone();
12797                if inlined {
12798                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12799                    inner_offset = next_offset;
12800                } else {
12801                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12802                    inner_depth.increment()?;
12803                }
12804                let val_ref =
12805                self.value.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12806                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12807                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12808                {
12809                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12810                }
12811                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12812                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12813                }
12814            }
12815
12816            next_offset += envelope_size;
12817
12818            // Decode the remaining unknown envelopes.
12819            while next_offset < end_offset {
12820                _next_ordinal_to_read += 1;
12821                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12822                next_offset += envelope_size;
12823            }
12824
12825            Ok(())
12826        }
12827    }
12828
12829    impl CapabilitiesDirConnectorOpenRequest {
12830        #[inline(always)]
12831        fn max_ordinal_present(&self) -> u64 {
12832            if let Some(_) = self.path {
12833                return 4;
12834            }
12835            if let Some(_) = self.flags {
12836                return 3;
12837            }
12838            if let Some(_) = self.channel {
12839                return 2;
12840            }
12841            if let Some(_) = self.dir_connector {
12842                return 1;
12843            }
12844            0
12845        }
12846    }
12847
12848    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorOpenRequest {
12849        type Borrowed<'a> = &'a mut Self;
12850        fn take_or_borrow<'a>(
12851            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12852        ) -> Self::Borrowed<'a> {
12853            value
12854        }
12855    }
12856
12857    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorOpenRequest {
12858        type Owned = Self;
12859
12860        #[inline(always)]
12861        fn inline_align(_context: fidl::encoding::Context) -> usize {
12862            8
12863        }
12864
12865        #[inline(always)]
12866        fn inline_size(_context: fidl::encoding::Context) -> usize {
12867            16
12868        }
12869    }
12870
12871    unsafe impl
12872        fidl::encoding::Encode<
12873            CapabilitiesDirConnectorOpenRequest,
12874            fidl::encoding::DefaultFuchsiaResourceDialect,
12875        > for &mut CapabilitiesDirConnectorOpenRequest
12876    {
12877        unsafe fn encode(
12878            self,
12879            encoder: &mut fidl::encoding::Encoder<
12880                '_,
12881                fidl::encoding::DefaultFuchsiaResourceDialect,
12882            >,
12883            offset: usize,
12884            mut depth: fidl::encoding::Depth,
12885        ) -> fidl::Result<()> {
12886            encoder.debug_check_bounds::<CapabilitiesDirConnectorOpenRequest>(offset);
12887            // Vector header
12888            let max_ordinal: u64 = self.max_ordinal_present();
12889            encoder.write_num(max_ordinal, offset);
12890            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12891            // Calling encoder.out_of_line_offset(0) is not allowed.
12892            if max_ordinal == 0 {
12893                return Ok(());
12894            }
12895            depth.increment()?;
12896            let envelope_size = 8;
12897            let bytes_len = max_ordinal as usize * envelope_size;
12898            #[allow(unused_variables)]
12899            let offset = encoder.out_of_line_offset(bytes_len);
12900            let mut _prev_end_offset: usize = 0;
12901            if 1 > max_ordinal {
12902                return Ok(());
12903            }
12904
12905            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12906            // are envelope_size bytes.
12907            let cur_offset: usize = (1 - 1) * envelope_size;
12908
12909            // Zero reserved fields.
12910            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12911
12912            // Safety:
12913            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12914            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12915            //   envelope_size bytes, there is always sufficient room.
12916            fidl::encoding::encode_in_envelope_optional::<
12917                fidl::encoding::HandleType<
12918                    fidl::EventPair,
12919                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12920                    2147483648,
12921                >,
12922                fidl::encoding::DefaultFuchsiaResourceDialect,
12923            >(
12924                self.dir_connector.as_mut().map(
12925                    <fidl::encoding::HandleType<
12926                        fidl::EventPair,
12927                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12928                        2147483648,
12929                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12930                ),
12931                encoder,
12932                offset + cur_offset,
12933                depth,
12934            )?;
12935
12936            _prev_end_offset = cur_offset + envelope_size;
12937            if 2 > max_ordinal {
12938                return Ok(());
12939            }
12940
12941            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12942            // are envelope_size bytes.
12943            let cur_offset: usize = (2 - 1) * envelope_size;
12944
12945            // Zero reserved fields.
12946            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12947
12948            // Safety:
12949            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12950            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12951            //   envelope_size bytes, there is always sufficient room.
12952            fidl::encoding::encode_in_envelope_optional::<
12953                fidl::encoding::Endpoint<
12954                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12955                >,
12956                fidl::encoding::DefaultFuchsiaResourceDialect,
12957            >(
12958                self.channel.as_mut().map(
12959                    <fidl::encoding::Endpoint<
12960                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12961                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12962                ),
12963                encoder,
12964                offset + cur_offset,
12965                depth,
12966            )?;
12967
12968            _prev_end_offset = cur_offset + envelope_size;
12969            if 3 > max_ordinal {
12970                return Ok(());
12971            }
12972
12973            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12974            // are envelope_size bytes.
12975            let cur_offset: usize = (3 - 1) * envelope_size;
12976
12977            // Zero reserved fields.
12978            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12979
12980            // Safety:
12981            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12982            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12983            //   envelope_size bytes, there is always sufficient room.
12984            fidl::encoding::encode_in_envelope_optional::<
12985                fidl_fuchsia_io::Flags,
12986                fidl::encoding::DefaultFuchsiaResourceDialect,
12987            >(
12988                self.flags
12989                    .as_ref()
12990                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
12991                encoder,
12992                offset + cur_offset,
12993                depth,
12994            )?;
12995
12996            _prev_end_offset = cur_offset + envelope_size;
12997            if 4 > max_ordinal {
12998                return Ok(());
12999            }
13000
13001            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13002            // are envelope_size bytes.
13003            let cur_offset: usize = (4 - 1) * envelope_size;
13004
13005            // Zero reserved fields.
13006            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13007
13008            // Safety:
13009            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13010            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13011            //   envelope_size bytes, there is always sufficient room.
13012            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13013            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13014            encoder, offset + cur_offset, depth
13015        )?;
13016
13017            _prev_end_offset = cur_offset + envelope_size;
13018
13019            Ok(())
13020        }
13021    }
13022
13023    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13024        for CapabilitiesDirConnectorOpenRequest
13025    {
13026        #[inline(always)]
13027        fn new_empty() -> Self {
13028            Self::default()
13029        }
13030
13031        unsafe fn decode(
13032            &mut self,
13033            decoder: &mut fidl::encoding::Decoder<
13034                '_,
13035                fidl::encoding::DefaultFuchsiaResourceDialect,
13036            >,
13037            offset: usize,
13038            mut depth: fidl::encoding::Depth,
13039        ) -> fidl::Result<()> {
13040            decoder.debug_check_bounds::<Self>(offset);
13041            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13042                None => return Err(fidl::Error::NotNullable),
13043                Some(len) => len,
13044            };
13045            // Calling decoder.out_of_line_offset(0) is not allowed.
13046            if len == 0 {
13047                return Ok(());
13048            };
13049            depth.increment()?;
13050            let envelope_size = 8;
13051            let bytes_len = len * envelope_size;
13052            let offset = decoder.out_of_line_offset(bytes_len)?;
13053            // Decode the envelope for each type.
13054            let mut _next_ordinal_to_read = 0;
13055            let mut next_offset = offset;
13056            let end_offset = offset + bytes_len;
13057            _next_ordinal_to_read += 1;
13058            if next_offset >= end_offset {
13059                return Ok(());
13060            }
13061
13062            // Decode unknown envelopes for gaps in ordinals.
13063            while _next_ordinal_to_read < 1 {
13064                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13065                _next_ordinal_to_read += 1;
13066                next_offset += envelope_size;
13067            }
13068
13069            let next_out_of_line = decoder.next_out_of_line();
13070            let handles_before = decoder.remaining_handles();
13071            if let Some((inlined, num_bytes, num_handles)) =
13072                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13073            {
13074                let member_inline_size = <fidl::encoding::HandleType<
13075                    fidl::EventPair,
13076                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13077                    2147483648,
13078                > as fidl::encoding::TypeMarker>::inline_size(
13079                    decoder.context
13080                );
13081                if inlined != (member_inline_size <= 4) {
13082                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13083                }
13084                let inner_offset;
13085                let mut inner_depth = depth.clone();
13086                if inlined {
13087                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13088                    inner_offset = next_offset;
13089                } else {
13090                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13091                    inner_depth.increment()?;
13092                }
13093                let val_ref =
13094                self.dir_connector.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13095                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13096                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13097                {
13098                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13099                }
13100                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13101                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13102                }
13103            }
13104
13105            next_offset += envelope_size;
13106            _next_ordinal_to_read += 1;
13107            if next_offset >= end_offset {
13108                return Ok(());
13109            }
13110
13111            // Decode unknown envelopes for gaps in ordinals.
13112            while _next_ordinal_to_read < 2 {
13113                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13114                _next_ordinal_to_read += 1;
13115                next_offset += envelope_size;
13116            }
13117
13118            let next_out_of_line = decoder.next_out_of_line();
13119            let handles_before = decoder.remaining_handles();
13120            if let Some((inlined, num_bytes, num_handles)) =
13121                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13122            {
13123                let member_inline_size = <fidl::encoding::Endpoint<
13124                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13125                > as fidl::encoding::TypeMarker>::inline_size(
13126                    decoder.context
13127                );
13128                if inlined != (member_inline_size <= 4) {
13129                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13130                }
13131                let inner_offset;
13132                let mut inner_depth = depth.clone();
13133                if inlined {
13134                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13135                    inner_offset = next_offset;
13136                } else {
13137                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13138                    inner_depth.increment()?;
13139                }
13140                let val_ref = self.channel.get_or_insert_with(|| {
13141                    fidl::new_empty!(
13142                        fidl::encoding::Endpoint<
13143                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13144                        >,
13145                        fidl::encoding::DefaultFuchsiaResourceDialect
13146                    )
13147                });
13148                fidl::decode!(
13149                    fidl::encoding::Endpoint<
13150                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13151                    >,
13152                    fidl::encoding::DefaultFuchsiaResourceDialect,
13153                    val_ref,
13154                    decoder,
13155                    inner_offset,
13156                    inner_depth
13157                )?;
13158                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13159                {
13160                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13161                }
13162                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13163                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13164                }
13165            }
13166
13167            next_offset += envelope_size;
13168            _next_ordinal_to_read += 1;
13169            if next_offset >= end_offset {
13170                return Ok(());
13171            }
13172
13173            // Decode unknown envelopes for gaps in ordinals.
13174            while _next_ordinal_to_read < 3 {
13175                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13176                _next_ordinal_to_read += 1;
13177                next_offset += envelope_size;
13178            }
13179
13180            let next_out_of_line = decoder.next_out_of_line();
13181            let handles_before = decoder.remaining_handles();
13182            if let Some((inlined, num_bytes, num_handles)) =
13183                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13184            {
13185                let member_inline_size =
13186                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13187                        decoder.context,
13188                    );
13189                if inlined != (member_inline_size <= 4) {
13190                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13191                }
13192                let inner_offset;
13193                let mut inner_depth = depth.clone();
13194                if inlined {
13195                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13196                    inner_offset = next_offset;
13197                } else {
13198                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13199                    inner_depth.increment()?;
13200                }
13201                let val_ref = self.flags.get_or_insert_with(|| {
13202                    fidl::new_empty!(
13203                        fidl_fuchsia_io::Flags,
13204                        fidl::encoding::DefaultFuchsiaResourceDialect
13205                    )
13206                });
13207                fidl::decode!(
13208                    fidl_fuchsia_io::Flags,
13209                    fidl::encoding::DefaultFuchsiaResourceDialect,
13210                    val_ref,
13211                    decoder,
13212                    inner_offset,
13213                    inner_depth
13214                )?;
13215                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13216                {
13217                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13218                }
13219                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13220                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13221                }
13222            }
13223
13224            next_offset += envelope_size;
13225            _next_ordinal_to_read += 1;
13226            if next_offset >= end_offset {
13227                return Ok(());
13228            }
13229
13230            // Decode unknown envelopes for gaps in ordinals.
13231            while _next_ordinal_to_read < 4 {
13232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13233                _next_ordinal_to_read += 1;
13234                next_offset += envelope_size;
13235            }
13236
13237            let next_out_of_line = decoder.next_out_of_line();
13238            let handles_before = decoder.remaining_handles();
13239            if let Some((inlined, num_bytes, num_handles)) =
13240                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13241            {
13242                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13243                if inlined != (member_inline_size <= 4) {
13244                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13245                }
13246                let inner_offset;
13247                let mut inner_depth = depth.clone();
13248                if inlined {
13249                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13250                    inner_offset = next_offset;
13251                } else {
13252                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13253                    inner_depth.increment()?;
13254                }
13255                let val_ref = self.path.get_or_insert_with(|| {
13256                    fidl::new_empty!(
13257                        fidl::encoding::BoundedString<4095>,
13258                        fidl::encoding::DefaultFuchsiaResourceDialect
13259                    )
13260                });
13261                fidl::decode!(
13262                    fidl::encoding::BoundedString<4095>,
13263                    fidl::encoding::DefaultFuchsiaResourceDialect,
13264                    val_ref,
13265                    decoder,
13266                    inner_offset,
13267                    inner_depth
13268                )?;
13269                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13270                {
13271                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13272                }
13273                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13274                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13275                }
13276            }
13277
13278            next_offset += envelope_size;
13279
13280            // Decode the remaining unknown envelopes.
13281            while next_offset < end_offset {
13282                _next_ordinal_to_read += 1;
13283                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13284                next_offset += envelope_size;
13285            }
13286
13287            Ok(())
13288        }
13289    }
13290
13291    impl RouteRequest {
13292        #[inline(always)]
13293        fn max_ordinal_present(&self) -> u64 {
13294            if let Some(_) = self.metadata {
13295                return 1;
13296            }
13297            0
13298        }
13299    }
13300
13301    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13302        type Borrowed<'a> = &'a mut Self;
13303        fn take_or_borrow<'a>(
13304            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13305        ) -> Self::Borrowed<'a> {
13306            value
13307        }
13308    }
13309
13310    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13311        type Owned = Self;
13312
13313        #[inline(always)]
13314        fn inline_align(_context: fidl::encoding::Context) -> usize {
13315            8
13316        }
13317
13318        #[inline(always)]
13319        fn inline_size(_context: fidl::encoding::Context) -> usize {
13320            16
13321        }
13322    }
13323
13324    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13325        for &mut RouteRequest
13326    {
13327        unsafe fn encode(
13328            self,
13329            encoder: &mut fidl::encoding::Encoder<
13330                '_,
13331                fidl::encoding::DefaultFuchsiaResourceDialect,
13332            >,
13333            offset: usize,
13334            mut depth: fidl::encoding::Depth,
13335        ) -> fidl::Result<()> {
13336            encoder.debug_check_bounds::<RouteRequest>(offset);
13337            // Vector header
13338            let max_ordinal: u64 = self.max_ordinal_present();
13339            encoder.write_num(max_ordinal, offset);
13340            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13341            // Calling encoder.out_of_line_offset(0) is not allowed.
13342            if max_ordinal == 0 {
13343                return Ok(());
13344            }
13345            depth.increment()?;
13346            let envelope_size = 8;
13347            let bytes_len = max_ordinal as usize * envelope_size;
13348            #[allow(unused_variables)]
13349            let offset = encoder.out_of_line_offset(bytes_len);
13350            let mut _prev_end_offset: usize = 0;
13351            if 1 > max_ordinal {
13352                return Ok(());
13353            }
13354
13355            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13356            // are envelope_size bytes.
13357            let cur_offset: usize = (1 - 1) * envelope_size;
13358
13359            // Zero reserved fields.
13360            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13361
13362            // Safety:
13363            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13364            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13365            //   envelope_size bytes, there is always sufficient room.
13366            fidl::encoding::encode_in_envelope_optional::<
13367                fidl::encoding::HandleType<
13368                    fidl::EventPair,
13369                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13370                    2147483648,
13371                >,
13372                fidl::encoding::DefaultFuchsiaResourceDialect,
13373            >(
13374                self.metadata.as_mut().map(
13375                    <fidl::encoding::HandleType<
13376                        fidl::EventPair,
13377                        { fidl::ObjectType::EVENTPAIR.into_raw() },
13378                        2147483648,
13379                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13380                ),
13381                encoder,
13382                offset + cur_offset,
13383                depth,
13384            )?;
13385
13386            _prev_end_offset = cur_offset + envelope_size;
13387
13388            Ok(())
13389        }
13390    }
13391
13392    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13393        #[inline(always)]
13394        fn new_empty() -> Self {
13395            Self::default()
13396        }
13397
13398        unsafe fn decode(
13399            &mut self,
13400            decoder: &mut fidl::encoding::Decoder<
13401                '_,
13402                fidl::encoding::DefaultFuchsiaResourceDialect,
13403            >,
13404            offset: usize,
13405            mut depth: fidl::encoding::Depth,
13406        ) -> fidl::Result<()> {
13407            decoder.debug_check_bounds::<Self>(offset);
13408            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13409                None => return Err(fidl::Error::NotNullable),
13410                Some(len) => len,
13411            };
13412            // Calling decoder.out_of_line_offset(0) is not allowed.
13413            if len == 0 {
13414                return Ok(());
13415            };
13416            depth.increment()?;
13417            let envelope_size = 8;
13418            let bytes_len = len * envelope_size;
13419            let offset = decoder.out_of_line_offset(bytes_len)?;
13420            // Decode the envelope for each type.
13421            let mut _next_ordinal_to_read = 0;
13422            let mut next_offset = offset;
13423            let end_offset = offset + bytes_len;
13424            _next_ordinal_to_read += 1;
13425            if next_offset >= end_offset {
13426                return Ok(());
13427            }
13428
13429            // Decode unknown envelopes for gaps in ordinals.
13430            while _next_ordinal_to_read < 1 {
13431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13432                _next_ordinal_to_read += 1;
13433                next_offset += envelope_size;
13434            }
13435
13436            let next_out_of_line = decoder.next_out_of_line();
13437            let handles_before = decoder.remaining_handles();
13438            if let Some((inlined, num_bytes, num_handles)) =
13439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13440            {
13441                let member_inline_size = <fidl::encoding::HandleType<
13442                    fidl::EventPair,
13443                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13444                    2147483648,
13445                > as fidl::encoding::TypeMarker>::inline_size(
13446                    decoder.context
13447                );
13448                if inlined != (member_inline_size <= 4) {
13449                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13450                }
13451                let inner_offset;
13452                let mut inner_depth = depth.clone();
13453                if inlined {
13454                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13455                    inner_offset = next_offset;
13456                } else {
13457                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13458                    inner_depth.increment()?;
13459                }
13460                let val_ref =
13461                self.metadata.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13462                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13463                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13464                {
13465                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13466                }
13467                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13468                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13469                }
13470            }
13471
13472            next_offset += envelope_size;
13473
13474            // Decode the remaining unknown envelopes.
13475            while next_offset < end_offset {
13476                _next_ordinal_to_read += 1;
13477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13478                next_offset += envelope_size;
13479            }
13480
13481            Ok(())
13482        }
13483    }
13484}