Skip to main content

fidl_fuchsia_component_runtime/
fidl_fuchsia_component_runtime.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_component_runtime__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct CapabilitiesCapabilityAssociateHandleRequest {
16    pub capability_handle: fidl::EventPair,
17    pub other_handle: fidl::EventPair,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for CapabilitiesCapabilityAssociateHandleRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct CapabilitiesConnectorCreateRequest {
27    pub connector: fidl::EventPair,
28    pub receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32    for CapabilitiesConnectorCreateRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct CapabilitiesConnectorOpenRequest {
38    pub connector: fidl::EventPair,
39    pub channel: fidl::Channel,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43    for CapabilitiesConnectorOpenRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct CapabilitiesConnectorRouterCreateRequest {
49    pub router: fidl::EventPair,
50    pub router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54    for CapabilitiesConnectorRouterCreateRequest
55{
56}
57
58#[derive(Debug, PartialEq)]
59pub struct CapabilitiesConnectorRouterRouteRequest {
60    pub router: fidl::EventPair,
61    pub request: RouteRequest,
62    pub instance_token: fidl::EventPair,
63    pub connector: fidl::EventPair,
64}
65
66impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
67    for CapabilitiesConnectorRouterRouteRequest
68{
69}
70
71#[derive(Debug, PartialEq)]
72pub struct CapabilitiesDataCreateRequest {
73    pub data_handle: fidl::EventPair,
74    pub data: Data,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
78    for CapabilitiesDataCreateRequest
79{
80}
81
82#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct CapabilitiesDataGetRequest {
84    pub data_handle: fidl::EventPair,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
88    for CapabilitiesDataGetRequest
89{
90}
91
92#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct CapabilitiesDataRouterCreateRequest {
94    pub router: fidl::EventPair,
95    pub router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
96}
97
98impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
99    for CapabilitiesDataRouterCreateRequest
100{
101}
102
103#[derive(Debug, PartialEq)]
104pub struct CapabilitiesDataRouterRouteRequest {
105    pub router: fidl::EventPair,
106    pub request: RouteRequest,
107    pub instance_token: fidl::EventPair,
108    pub data: fidl::EventPair,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
112    for CapabilitiesDataRouterRouteRequest
113{
114}
115
116#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct CapabilitiesDictionaryCreateRequest {
118    pub dictionary: fidl::EventPair,
119}
120
121impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
122    for CapabilitiesDictionaryCreateRequest
123{
124}
125
126#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct CapabilitiesDictionaryGetRequest {
128    pub dictionary: fidl::EventPair,
129    pub key: String,
130    pub value: fidl::EventPair,
131}
132
133impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
134    for CapabilitiesDictionaryGetRequest
135{
136}
137
138#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
139pub struct CapabilitiesDictionaryInsertRequest {
140    pub dictionary: fidl::EventPair,
141    pub key: String,
142    pub value: fidl::EventPair,
143}
144
145impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
146    for CapabilitiesDictionaryInsertRequest
147{
148}
149
150#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151pub struct CapabilitiesDictionaryIterateKeysRequest {
152    pub dictionary: fidl::EventPair,
153    pub key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
154}
155
156impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
157    for CapabilitiesDictionaryIterateKeysRequest
158{
159}
160
161#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
162pub struct CapabilitiesDictionaryRouterCreateRequest {
163    pub router: fidl::EventPair,
164    pub router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
165}
166
167impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
168    for CapabilitiesDictionaryRouterCreateRequest
169{
170}
171
172#[derive(Debug, PartialEq)]
173pub struct CapabilitiesDictionaryRouterRouteRequest {
174    pub router: fidl::EventPair,
175    pub request: RouteRequest,
176    pub instance_token: fidl::EventPair,
177    pub dictionary: fidl::EventPair,
178}
179
180impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
181    for CapabilitiesDictionaryRouterRouteRequest
182{
183}
184
185#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186pub struct CapabilitiesDirConnectorCreateRequest {
187    pub dir_connector: fidl::EventPair,
188    pub receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
189}
190
191impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
192    for CapabilitiesDirConnectorCreateRequest
193{
194}
195
196#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
197pub struct CapabilitiesDirConnectorRouterCreateRequest {
198    pub router: fidl::EventPair,
199    pub router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
200}
201
202impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
203    for CapabilitiesDirConnectorRouterCreateRequest
204{
205}
206
207#[derive(Debug, PartialEq)]
208pub struct CapabilitiesDirConnectorRouterRouteRequest {
209    pub router: fidl::EventPair,
210    pub request: RouteRequest,
211    pub instance_token: fidl::EventPair,
212    pub dir_connector: fidl::EventPair,
213}
214
215impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
216    for CapabilitiesDirConnectorRouterRouteRequest
217{
218}
219
220#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct CapabilitiesInstanceTokenCreateRequest {
222    pub instance_token: fidl::EventPair,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
226    for CapabilitiesInstanceTokenCreateRequest
227{
228}
229
230#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
231pub struct CapabilitiesDictionaryGetResponse {
232    pub capability_type: CapabilityType,
233}
234
235impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
236    for CapabilitiesDictionaryGetResponse
237{
238}
239
240#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
241pub struct CapabilitiesDictionaryRemoveResponse {
242    pub capability_type: CapabilityType,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
246    for CapabilitiesDictionaryRemoveResponse
247{
248}
249
250#[derive(Debug, PartialEq)]
251pub struct ConnectorRouterRouteRequest {
252    pub request: RouteRequest,
253    pub instance_token: fidl::EventPair,
254    pub handle: fidl::EventPair,
255}
256
257impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
258    for ConnectorRouterRouteRequest
259{
260}
261
262#[derive(Debug, PartialEq)]
263pub struct DataRouterRouteRequest {
264    pub request: RouteRequest,
265    pub instance_token: fidl::EventPair,
266    pub handle: fidl::EventPair,
267}
268
269impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteRequest {}
270
271#[derive(Debug, PartialEq)]
272pub struct DictionaryRouterRouteRequest {
273    pub request: RouteRequest,
274    pub instance_token: fidl::EventPair,
275    pub handle: fidl::EventPair,
276}
277
278impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
279    for DictionaryRouterRouteRequest
280{
281}
282
283#[derive(Debug, PartialEq)]
284pub struct DirConnectorRouterRouteRequest {
285    pub request: RouteRequest,
286    pub instance_token: fidl::EventPair,
287    pub handle: fidl::EventPair,
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
291    for DirConnectorRouterRouteRequest
292{
293}
294
295#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
296pub struct DirReceiverReceiveRequest {
297    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
298    pub path: String,
299    pub rights: fidl_fuchsia_io::Flags,
300}
301
302impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
303
304#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
305pub struct ReceiverReceiveRequest {
306    pub channel: fidl::Channel,
307}
308
309impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ReceiverReceiveRequest {}
310
311#[derive(Debug, Default, PartialEq)]
312pub struct CapabilitiesDictionaryRemoveRequest {
313    pub dictionary: Option<fidl::EventPair>,
314    pub key: Option<String>,
315    pub value: Option<fidl::EventPair>,
316    #[doc(hidden)]
317    pub __source_breaking: fidl::marker::SourceBreaking,
318}
319
320impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
321    for CapabilitiesDictionaryRemoveRequest
322{
323}
324
325#[derive(Debug, Default, PartialEq)]
326pub struct CapabilitiesDirConnectorOpenRequest {
327    pub dir_connector: Option<fidl::EventPair>,
328    pub channel: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
329    pub flags: Option<fidl_fuchsia_io::Flags>,
330    pub path: Option<String>,
331    #[doc(hidden)]
332    pub __source_breaking: fidl::marker::SourceBreaking,
333}
334
335impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
336    for CapabilitiesDirConnectorOpenRequest
337{
338}
339
340#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
341pub struct CapabilitiesMarker;
342
343impl fidl::endpoints::ProtocolMarker for CapabilitiesMarker {
344    type Proxy = CapabilitiesProxy;
345    type RequestStream = CapabilitiesRequestStream;
346    #[cfg(target_os = "fuchsia")]
347    type SynchronousProxy = CapabilitiesSynchronousProxy;
348
349    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Capabilities";
350}
351impl fidl::endpoints::DiscoverableProtocolMarker for CapabilitiesMarker {}
352pub type CapabilitiesConnectorCreateResult = Result<(), CapabilitiesError>;
353pub type CapabilitiesDirConnectorCreateResult = Result<(), CapabilitiesError>;
354pub type CapabilitiesDictionaryCreateResult = Result<(), CapabilitiesError>;
355pub type CapabilitiesDataCreateResult = Result<(), CapabilitiesError>;
356pub type CapabilitiesConnectorRouterCreateResult = Result<(), CapabilitiesError>;
357pub type CapabilitiesDirConnectorRouterCreateResult = Result<(), CapabilitiesError>;
358pub type CapabilitiesDictionaryRouterCreateResult = Result<(), CapabilitiesError>;
359pub type CapabilitiesDataRouterCreateResult = Result<(), CapabilitiesError>;
360pub type CapabilitiesInstanceTokenCreateResult = Result<(), CapabilitiesError>;
361pub type CapabilitiesConnectorOpenResult = Result<(), CapabilitiesError>;
362pub type CapabilitiesDirConnectorOpenResult = Result<(), CapabilitiesError>;
363pub type CapabilitiesDictionaryInsertResult = Result<(), CapabilitiesError>;
364pub type CapabilitiesDictionaryGetResult = Result<CapabilityType, CapabilitiesError>;
365pub type CapabilitiesDictionaryRemoveResult = Result<CapabilityType, CapabilitiesError>;
366pub type CapabilitiesDictionaryIterateKeysResult = Result<(), CapabilitiesError>;
367pub type CapabilitiesDataGetResult = Result<Data, CapabilitiesError>;
368pub type CapabilitiesConnectorRouterRouteResult = Result<RouterResponse, i32>;
369pub type CapabilitiesDirConnectorRouterRouteResult = Result<RouterResponse, i32>;
370pub type CapabilitiesDictionaryRouterRouteResult = Result<RouterResponse, i32>;
371pub type CapabilitiesDataRouterRouteResult = Result<RouterResponse, i32>;
372pub type CapabilitiesCapabilityAssociateHandleResult = Result<(), CapabilitiesError>;
373
374pub trait CapabilitiesProxyInterface: Send + Sync {
375    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorCreateResult, fidl::Error>>
376        + Send;
377    fn r#connector_create(
378        &self,
379        connector: fidl::EventPair,
380        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
381    ) -> Self::ConnectorCreateResponseFut;
382    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorCreateResult, fidl::Error>>
383        + Send;
384    fn r#dir_connector_create(
385        &self,
386        dir_connector: fidl::EventPair,
387        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
388    ) -> Self::DirConnectorCreateResponseFut;
389    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryCreateResult, fidl::Error>>
390        + Send;
391    fn r#dictionary_create(&self, dictionary: fidl::EventPair)
392    -> Self::DictionaryCreateResponseFut;
393    type DataCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataCreateResult, fidl::Error>>
394        + Send;
395    fn r#data_create(
396        &self,
397        data_handle: fidl::EventPair,
398        data: &Data,
399    ) -> Self::DataCreateResponseFut;
400    type ConnectorRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterCreateResult, fidl::Error>>
401        + Send;
402    fn r#connector_router_create(
403        &self,
404        router: fidl::EventPair,
405        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
406    ) -> Self::ConnectorRouterCreateResponseFut;
407    type DirConnectorRouterCreateResponseFut: std::future::Future<
408            Output = Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error>,
409        > + Send;
410    fn r#dir_connector_router_create(
411        &self,
412        router: fidl::EventPair,
413        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
414    ) -> Self::DirConnectorRouterCreateResponseFut;
415    type DictionaryRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error>>
416        + Send;
417    fn r#dictionary_router_create(
418        &self,
419        router: fidl::EventPair,
420        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
421    ) -> Self::DictionaryRouterCreateResponseFut;
422    type DataRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterCreateResult, fidl::Error>>
423        + Send;
424    fn r#data_router_create(
425        &self,
426        router: fidl::EventPair,
427        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
428    ) -> Self::DataRouterCreateResponseFut;
429    type InstanceTokenCreateResponseFut: std::future::Future<Output = Result<CapabilitiesInstanceTokenCreateResult, fidl::Error>>
430        + Send;
431    fn r#instance_token_create(
432        &self,
433        instance_token: fidl::EventPair,
434    ) -> Self::InstanceTokenCreateResponseFut;
435    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorOpenResult, fidl::Error>>
436        + Send;
437    fn r#connector_open(
438        &self,
439        connector: fidl::EventPair,
440        channel: fidl::Channel,
441    ) -> Self::ConnectorOpenResponseFut;
442    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorOpenResult, fidl::Error>>
443        + Send;
444    fn r#dir_connector_open(
445        &self,
446        payload: CapabilitiesDirConnectorOpenRequest,
447    ) -> Self::DirConnectorOpenResponseFut;
448    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryInsertResult, fidl::Error>>
449        + Send;
450    fn r#dictionary_insert(
451        &self,
452        dictionary: fidl::EventPair,
453        key: &str,
454        value: fidl::EventPair,
455    ) -> Self::DictionaryInsertResponseFut;
456    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryGetResult, fidl::Error>>
457        + Send;
458    fn r#dictionary_get(
459        &self,
460        dictionary: fidl::EventPair,
461        key: &str,
462        value: fidl::EventPair,
463    ) -> Self::DictionaryGetResponseFut;
464    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRemoveResult, fidl::Error>>
465        + Send;
466    fn r#dictionary_remove(
467        &self,
468        payload: CapabilitiesDictionaryRemoveRequest,
469    ) -> Self::DictionaryRemoveResponseFut;
470    type DictionaryIterateKeysResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error>>
471        + Send;
472    fn r#dictionary_iterate_keys(
473        &self,
474        dictionary: fidl::EventPair,
475        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
476    ) -> Self::DictionaryIterateKeysResponseFut;
477    type DataGetResponseFut: std::future::Future<Output = Result<CapabilitiesDataGetResult, fidl::Error>>
478        + Send;
479    fn r#data_get(&self, data_handle: fidl::EventPair) -> Self::DataGetResponseFut;
480    type ConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterRouteResult, fidl::Error>>
481        + Send;
482    fn r#connector_router_route(
483        &self,
484        router: fidl::EventPair,
485        request: &RouteRequest,
486        instance_token: fidl::EventPair,
487        connector: fidl::EventPair,
488    ) -> Self::ConnectorRouterRouteResponseFut;
489    type DirConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error>>
490        + Send;
491    fn r#dir_connector_router_route(
492        &self,
493        router: fidl::EventPair,
494        request: &RouteRequest,
495        instance_token: fidl::EventPair,
496        dir_connector: fidl::EventPair,
497    ) -> Self::DirConnectorRouterRouteResponseFut;
498    type DictionaryRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error>>
499        + Send;
500    fn r#dictionary_router_route(
501        &self,
502        router: fidl::EventPair,
503        request: &RouteRequest,
504        instance_token: fidl::EventPair,
505        dictionary: fidl::EventPair,
506    ) -> Self::DictionaryRouterRouteResponseFut;
507    type DataRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterRouteResult, fidl::Error>>
508        + Send;
509    fn r#data_router_route(
510        &self,
511        router: fidl::EventPair,
512        request: &RouteRequest,
513        instance_token: fidl::EventPair,
514        data: fidl::EventPair,
515    ) -> Self::DataRouterRouteResponseFut;
516    type CapabilityAssociateHandleResponseFut: std::future::Future<
517            Output = Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error>,
518        > + Send;
519    fn r#capability_associate_handle(
520        &self,
521        capability_handle: fidl::EventPair,
522        other_handle: fidl::EventPair,
523    ) -> Self::CapabilityAssociateHandleResponseFut;
524}
525#[derive(Debug)]
526#[cfg(target_os = "fuchsia")]
527pub struct CapabilitiesSynchronousProxy {
528    client: fidl::client::sync::Client,
529}
530
531#[cfg(target_os = "fuchsia")]
532impl fidl::endpoints::SynchronousProxy for CapabilitiesSynchronousProxy {
533    type Proxy = CapabilitiesProxy;
534    type Protocol = CapabilitiesMarker;
535
536    fn from_channel(inner: fidl::Channel) -> Self {
537        Self::new(inner)
538    }
539
540    fn into_channel(self) -> fidl::Channel {
541        self.client.into_channel()
542    }
543
544    fn as_channel(&self) -> &fidl::Channel {
545        self.client.as_channel()
546    }
547}
548
549#[cfg(target_os = "fuchsia")]
550impl CapabilitiesSynchronousProxy {
551    pub fn new(channel: fidl::Channel) -> Self {
552        Self { client: fidl::client::sync::Client::new(channel) }
553    }
554
555    pub fn into_channel(self) -> fidl::Channel {
556        self.client.into_channel()
557    }
558
559    /// Waits until an event arrives and returns it. It is safe for other
560    /// threads to make concurrent requests while waiting for an event.
561    pub fn wait_for_event(
562        &self,
563        deadline: zx::MonotonicInstant,
564    ) -> Result<CapabilitiesEvent, fidl::Error> {
565        CapabilitiesEvent::decode(self.client.wait_for_event::<CapabilitiesMarker>(deadline)?)
566    }
567
568    /// Creates a reference to a new connector capability. When the connector is
569    /// opened, the channel given to the open call will be sent over
570    /// `receiver_client_end`.
571    ///
572    /// Make sure this method returns before passing the handle's peer to other
573    /// methods in this API. The creation may not be complete before then.
574    pub fn r#connector_create(
575        &self,
576        mut connector: fidl::EventPair,
577        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
578        ___deadline: zx::MonotonicInstant,
579    ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
580        let _response = self.client.send_query::<
581            CapabilitiesConnectorCreateRequest,
582            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
583            CapabilitiesMarker,
584        >(
585            (connector, receiver_client_end,),
586            0xac2bc2dbd7033d1,
587            fidl::encoding::DynamicFlags::FLEXIBLE,
588            ___deadline,
589        )?
590        .into_result::<CapabilitiesMarker>("connector_create")?;
591        Ok(_response.map(|x| x))
592    }
593
594    /// Creates a reference to a new directory connector capability. When the
595    /// directory connector is opened, the channel given to the open call will
596    /// be sent over `receiver_client_end`.
597    ///
598    /// Make sure this method returns before passing the handle's peer to other
599    /// methods in this API. The creation may not be complete before then.
600    pub fn r#dir_connector_create(
601        &self,
602        mut dir_connector: fidl::EventPair,
603        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
604        ___deadline: zx::MonotonicInstant,
605    ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
606        let _response = self.client.send_query::<
607            CapabilitiesDirConnectorCreateRequest,
608            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
609            CapabilitiesMarker,
610        >(
611            (dir_connector, receiver_client_end,),
612            0x721911e05da2a3bf,
613            fidl::encoding::DynamicFlags::FLEXIBLE,
614            ___deadline,
615        )?
616        .into_result::<CapabilitiesMarker>("dir_connector_create")?;
617        Ok(_response.map(|x| x))
618    }
619
620    /// Creates a reference to a new dictionary capability.
621    ///
622    /// Make sure this method returns before passing the handle's peer to other
623    /// methods in this API. The creation may not be complete before then.
624    pub fn r#dictionary_create(
625        &self,
626        mut dictionary: fidl::EventPair,
627        ___deadline: zx::MonotonicInstant,
628    ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
629        let _response = self.client.send_query::<
630            CapabilitiesDictionaryCreateRequest,
631            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
632            CapabilitiesMarker,
633        >(
634            (dictionary,),
635            0x7f8bd91f0942a36e,
636            fidl::encoding::DynamicFlags::FLEXIBLE,
637            ___deadline,
638        )?
639        .into_result::<CapabilitiesMarker>("dictionary_create")?;
640        Ok(_response.map(|x| x))
641    }
642
643    /// Creates a reference to a new data capability with the given value.
644    ///
645    /// Make sure this method returns before passing the handle's peer to other
646    /// methods in this API. The creation may not be complete before then.
647    pub fn r#data_create(
648        &self,
649        mut data_handle: fidl::EventPair,
650        mut data: &Data,
651        ___deadline: zx::MonotonicInstant,
652    ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
653        let _response = self.client.send_query::<
654            CapabilitiesDataCreateRequest,
655            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
656            CapabilitiesMarker,
657        >(
658            (data_handle, data,),
659            0x40ef43e45372ee6a,
660            fidl::encoding::DynamicFlags::FLEXIBLE,
661            ___deadline,
662        )?
663        .into_result::<CapabilitiesMarker>("data_create")?;
664        Ok(_response.map(|x| x))
665    }
666
667    /// Creates a reference to a new router capability that will return a
668    /// connector capability when used.
669    ///
670    /// Make sure this method returns before passing the handle's peer to other
671    /// methods in this API. The creation may not be complete before then.
672    pub fn r#connector_router_create(
673        &self,
674        mut router: fidl::EventPair,
675        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
676        ___deadline: zx::MonotonicInstant,
677    ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
678        let _response = self.client.send_query::<
679            CapabilitiesConnectorRouterCreateRequest,
680            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
681            CapabilitiesMarker,
682        >(
683            (router, router_client_end,),
684            0x7f7e7fbafcdf1761,
685            fidl::encoding::DynamicFlags::FLEXIBLE,
686            ___deadline,
687        )?
688        .into_result::<CapabilitiesMarker>("connector_router_create")?;
689        Ok(_response.map(|x| x))
690    }
691
692    /// Creates a reference to a new router capability that will return a
693    /// directory connector capability when used.
694    ///
695    /// Make sure this method returns before passing the handle's peer to other
696    /// methods in this API. The creation may not be complete before then.
697    pub fn r#dir_connector_router_create(
698        &self,
699        mut router: fidl::EventPair,
700        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
701        ___deadline: zx::MonotonicInstant,
702    ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
703        let _response = self.client.send_query::<
704            CapabilitiesDirConnectorRouterCreateRequest,
705            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
706            CapabilitiesMarker,
707        >(
708            (router, router_client_end,),
709            0x56520da453fad19f,
710            fidl::encoding::DynamicFlags::FLEXIBLE,
711            ___deadline,
712        )?
713        .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
714        Ok(_response.map(|x| x))
715    }
716
717    /// Creates a reference to a new router capability that will return a
718    /// dictionary capability when used.
719    ///
720    /// Make sure this method returns before passing the handle's peer to other
721    /// methods in this API. The creation may not be complete before then.
722    pub fn r#dictionary_router_create(
723        &self,
724        mut router: fidl::EventPair,
725        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
726        ___deadline: zx::MonotonicInstant,
727    ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
728        let _response = self.client.send_query::<
729            CapabilitiesDictionaryRouterCreateRequest,
730            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
731            CapabilitiesMarker,
732        >(
733            (router, router_client_end,),
734            0x37acef18cd423d42,
735            fidl::encoding::DynamicFlags::FLEXIBLE,
736            ___deadline,
737        )?
738        .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
739        Ok(_response.map(|x| x))
740    }
741
742    /// Creates a reference to a new router capability that will return a data
743    /// value when used.
744    ///
745    /// Make sure this method returns before passing the handle's peer to other
746    /// methods in this API. The creation may not be complete before then.
747    pub fn r#data_router_create(
748        &self,
749        mut router: fidl::EventPair,
750        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
751        ___deadline: zx::MonotonicInstant,
752    ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
753        let _response = self.client.send_query::<
754            CapabilitiesDataRouterCreateRequest,
755            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
756            CapabilitiesMarker,
757        >(
758            (router, router_client_end,),
759            0x24e471395b95088,
760            fidl::encoding::DynamicFlags::FLEXIBLE,
761            ___deadline,
762        )?
763        .into_result::<CapabilitiesMarker>("data_router_create")?;
764        Ok(_response.map(|x| x))
765    }
766
767    /// Creates a new instance token, which is an opaque identifier associated
768    /// with a specific component. This instance token will be associated with
769    /// the component this connection is opened from.
770    ///
771    /// Make sure this method returns before passing the handle's peer to other
772    /// methods in this API. The creation may not be complete before then.
773    pub fn r#instance_token_create(
774        &self,
775        mut instance_token: fidl::EventPair,
776        ___deadline: zx::MonotonicInstant,
777    ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
778        let _response = self.client.send_query::<
779            CapabilitiesInstanceTokenCreateRequest,
780            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
781            CapabilitiesMarker,
782        >(
783            (instance_token,),
784            0x3576e31727c40813,
785            fidl::encoding::DynamicFlags::FLEXIBLE,
786            ___deadline,
787        )?
788        .into_result::<CapabilitiesMarker>("instance_token_create")?;
789        Ok(_response.map(|x| x))
790    }
791
792    /// Uses the provided `connector` to open a new connection by delivering
793    /// this channel to whoever created the connector.
794    ///
795    /// If there is an error, it will be reported as a zx.Status epitaph on
796    /// `channel`.
797    ///
798    /// If the `connector` event pair handle is not correlated with a handle
799    /// given to `ConnectorCreate`, this connection will be closed.
800    pub fn r#connector_open(
801        &self,
802        mut connector: fidl::EventPair,
803        mut channel: fidl::Channel,
804        ___deadline: zx::MonotonicInstant,
805    ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
806        let _response = self.client.send_query::<
807            CapabilitiesConnectorOpenRequest,
808            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
809            CapabilitiesMarker,
810        >(
811            (connector, channel,),
812            0xc0646965f1884eb,
813            fidl::encoding::DynamicFlags::FLEXIBLE,
814            ___deadline,
815        )?
816        .into_result::<CapabilitiesMarker>("connector_open")?;
817        Ok(_response.map(|x| x))
818    }
819
820    /// Uses the provided `dir_connector` to open a new directory connection by
821    /// delivering this channel to whoever created the directory connector.
822    ///
823    /// If there is an error, it will be reported as a zx.Status epitaph on
824    /// `channel`.
825    ///
826    /// If the `dir_connector` event pair handle is not correlated with a handle
827    /// given to `DirConnectorCreate`, this connection will be closed.
828    ///
829    /// `dir_connector` and `channel` are both required. `flags` and `path`
830    /// may be omitted.
831    pub fn r#dir_connector_open(
832        &self,
833        mut payload: CapabilitiesDirConnectorOpenRequest,
834        ___deadline: zx::MonotonicInstant,
835    ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
836        let _response = self.client.send_query::<
837            CapabilitiesDirConnectorOpenRequest,
838            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
839            CapabilitiesMarker,
840        >(
841            &mut payload,
842            0x1332bbf5debd6c20,
843            fidl::encoding::DynamicFlags::FLEXIBLE,
844            ___deadline,
845        )?
846        .into_result::<CapabilitiesMarker>("dir_connector_open")?;
847        Ok(_response.map(|x| x))
848    }
849
850    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
851    /// Overwrites any existing entry.
852    pub fn r#dictionary_insert(
853        &self,
854        mut dictionary: fidl::EventPair,
855        mut key: &str,
856        mut value: fidl::EventPair,
857        ___deadline: zx::MonotonicInstant,
858    ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
859        let _response = self.client.send_query::<
860            CapabilitiesDictionaryInsertRequest,
861            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
862            CapabilitiesMarker,
863        >(
864            (dictionary, key, value,),
865            0x5972e3061a760e7a,
866            fidl::encoding::DynamicFlags::FLEXIBLE,
867            ___deadline,
868        )?
869        .into_result::<CapabilitiesMarker>("dictionary_insert")?;
870        Ok(_response.map(|x| x))
871    }
872
873    /// Creates a new reference to the `capability` named `key` in this
874    /// dictionary, if that capability exists. That capability will remain in
875    /// the dictionary. To take a capability out of the dictionary, use
876    /// `DictionaryRemove`.
877    ///
878    /// If `key` does not exist, `value` will not reference any capability and
879    /// the `NO_SUCH_CAPABILITY` error value will be returned.
880    ///
881    /// Make sure this method returns before passing the handle's peer to other
882    /// methods in this API. The creation may not be complete before then.
883    pub fn r#dictionary_get(
884        &self,
885        mut dictionary: fidl::EventPair,
886        mut key: &str,
887        mut value: fidl::EventPair,
888        ___deadline: zx::MonotonicInstant,
889    ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
890        let _response = self
891            .client
892            .send_query::<CapabilitiesDictionaryGetRequest, fidl::encoding::FlexibleResultType<
893                CapabilitiesDictionaryGetResponse,
894                CapabilitiesError,
895            >, CapabilitiesMarker>(
896                (dictionary, key, value),
897                0x31fafe2280a283d5,
898                fidl::encoding::DynamicFlags::FLEXIBLE,
899                ___deadline,
900            )?
901            .into_result::<CapabilitiesMarker>("dictionary_get")?;
902        Ok(_response.map(|x| x.capability_type))
903    }
904
905    /// Removes the `capability` named `key` from this dictionary and returns a
906    /// reference to it, if that capability exists.
907    ///
908    /// `dictionary` and `key` are required. `capability` is optional, and when
909    /// set will become associated with the capability that was removed from the
910    /// dictionary.
911    ///
912    /// If `key` does not exist, `value` will not reference any capability and
913    /// the `NO_SUCH_CAPABILITY` error value will be returned.
914    ///
915    /// Make sure this method returns before passing the peer of `capability` to
916    /// other methods in this API. The creation may not be complete before then.
917    pub fn r#dictionary_remove(
918        &self,
919        mut payload: CapabilitiesDictionaryRemoveRequest,
920        ___deadline: zx::MonotonicInstant,
921    ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
922        let _response = self
923            .client
924            .send_query::<CapabilitiesDictionaryRemoveRequest, fidl::encoding::FlexibleResultType<
925                CapabilitiesDictionaryRemoveResponse,
926                CapabilitiesError,
927            >, CapabilitiesMarker>(
928                &mut payload,
929                0x6827c83106ac5a2c,
930                fidl::encoding::DynamicFlags::FLEXIBLE,
931                ___deadline,
932            )?
933            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
934        Ok(_response.map(|x| x.capability_type))
935    }
936
937    /// Opens an iterator which can be used to iterate over the keys of this
938    /// dictionary.
939    pub fn r#dictionary_iterate_keys(
940        &self,
941        mut dictionary: fidl::EventPair,
942        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
943        ___deadline: zx::MonotonicInstant,
944    ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
945        let _response = self.client.send_query::<
946            CapabilitiesDictionaryIterateKeysRequest,
947            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
948            CapabilitiesMarker,
949        >(
950            (dictionary, key_iterator,),
951            0x3d4ea59c80df9bb8,
952            fidl::encoding::DynamicFlags::FLEXIBLE,
953            ___deadline,
954        )?
955        .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
956        Ok(_response.map(|x| x))
957    }
958
959    /// Returns the `Data` value that was provided to the `DataCreate` call used
960    /// with `data_handle`.
961    pub fn r#data_get(
962        &self,
963        mut data_handle: fidl::EventPair,
964        ___deadline: zx::MonotonicInstant,
965    ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
966        let _response = self.client.send_query::<
967            CapabilitiesDataGetRequest,
968            fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
969            CapabilitiesMarker,
970        >(
971            (data_handle,),
972            0x65ae25b59f9e0daf,
973            fidl::encoding::DynamicFlags::FLEXIBLE,
974            ___deadline,
975        )?
976        .into_result::<CapabilitiesMarker>("data_get")?;
977        Ok(_response.map(|x| x))
978    }
979
980    /// Attempts to produce a `Connector` capability from this
981    /// `ConnectorRouter`.
982    ///
983    /// `request` contains context for this route, and `instance_token`
984    /// references the component that the routing operation is being performed
985    /// for.
986    ///
987    /// This will return:
988    ///
989    /// - `SUCCESS` if `connector` has been associated with a connector.
990    /// - `UNAVAILABLE` if the capability is unavailable, in which case
991    ///   `connector` will be closed.
992    /// - An error, if the operation failed.
993    pub fn r#connector_router_route(
994        &self,
995        mut router: fidl::EventPair,
996        mut request: &RouteRequest,
997        mut instance_token: fidl::EventPair,
998        mut connector: fidl::EventPair,
999        ___deadline: zx::MonotonicInstant,
1000    ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
1001        let _response = self.client.send_query::<
1002            CapabilitiesConnectorRouterRouteRequest,
1003            fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
1004            CapabilitiesMarker,
1005        >(
1006            (router, request, instance_token, connector,),
1007            0x1bd9c6e7e3dd487e,
1008            fidl::encoding::DynamicFlags::FLEXIBLE,
1009            ___deadline,
1010        )?
1011        .into_result::<CapabilitiesMarker>("connector_router_route")?;
1012        Ok(_response.map(|x| x.response))
1013    }
1014
1015    /// Attempts to produce a `DirConnector` capability from this
1016    /// `DirConnectorRouter`.
1017    ///
1018    /// `request` contains context for this route, and `instance_token`
1019    /// references the component that the routing operation is being performed
1020    /// for.
1021    ///
1022    /// This will return:
1023    ///
1024    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1025    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1026    ///   `dir_connector` will be closed.
1027    /// - An error, if the operation failed.
1028    pub fn r#dir_connector_router_route(
1029        &self,
1030        mut router: fidl::EventPair,
1031        mut request: &RouteRequest,
1032        mut instance_token: fidl::EventPair,
1033        mut dir_connector: fidl::EventPair,
1034        ___deadline: zx::MonotonicInstant,
1035    ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
1036        let _response = self.client.send_query::<
1037            CapabilitiesDirConnectorRouterRouteRequest,
1038            fidl::encoding::FlexibleResultType<CapabilitiesDirConnectorRouterRouteResponse, i32>,
1039            CapabilitiesMarker,
1040        >(
1041            (router, request, instance_token, dir_connector,),
1042            0x3afdcc1b79e0799d,
1043            fidl::encoding::DynamicFlags::FLEXIBLE,
1044            ___deadline,
1045        )?
1046        .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
1047        Ok(_response.map(|x| x.response))
1048    }
1049
1050    /// Attempts to produce a `Dictionary` capability from this
1051    /// `DictionaryRouter`.
1052    ///
1053    /// `request` contains context for this route, and `instance_token`
1054    /// references the component that the routing operation is being performed
1055    /// for.
1056    ///
1057    /// This will return:
1058    ///
1059    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1060    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1061    ///   `dictionary` will be closed.
1062    /// - An error, if the operation failed.
1063    pub fn r#dictionary_router_route(
1064        &self,
1065        mut router: fidl::EventPair,
1066        mut request: &RouteRequest,
1067        mut instance_token: fidl::EventPair,
1068        mut dictionary: fidl::EventPair,
1069        ___deadline: zx::MonotonicInstant,
1070    ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
1071        let _response = self.client.send_query::<
1072            CapabilitiesDictionaryRouterRouteRequest,
1073            fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
1074            CapabilitiesMarker,
1075        >(
1076            (router, request, instance_token, dictionary,),
1077            0xcf72de10714a708,
1078            fidl::encoding::DynamicFlags::FLEXIBLE,
1079            ___deadline,
1080        )?
1081        .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
1082        Ok(_response.map(|x| x.response))
1083    }
1084
1085    /// Attempts to produce a `Data` capability from this `DataRouter`.
1086    ///
1087    /// `request` contains context for this route, and `instance_token`
1088    /// references the component that the routing operation is being performed
1089    /// for.
1090    ///
1091    /// This will return:
1092    ///
1093    /// - `SUCCESS` if `data` has been associated with a connector.
1094    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1095    ///   will be closed.
1096    /// - An error, if the operation failed.
1097    pub fn r#data_router_route(
1098        &self,
1099        mut router: fidl::EventPair,
1100        mut request: &RouteRequest,
1101        mut instance_token: fidl::EventPair,
1102        mut data: fidl::EventPair,
1103        ___deadline: zx::MonotonicInstant,
1104    ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
1105        let _response = self.client.send_query::<
1106            CapabilitiesDataRouterRouteRequest,
1107            fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
1108            CapabilitiesMarker,
1109        >(
1110            (router, request, instance_token, data,),
1111            0x61ab188455ed0643,
1112            fidl::encoding::DynamicFlags::FLEXIBLE,
1113            ___deadline,
1114        )?
1115        .into_result::<CapabilitiesMarker>("data_router_route")?;
1116        Ok(_response.map(|x| x.response))
1117    }
1118
1119    /// Associates `other_handle` with the same capability referenced by
1120    /// `capability_handle`.
1121    ///
1122    /// Typically if one already has `capability_handle` the handle can be
1123    /// duplicated to make a new handle that references the same object, but
1124    /// this doesn't work when someone else has provided a handle that should be
1125    /// associated with an existing object.
1126    pub fn r#capability_associate_handle(
1127        &self,
1128        mut capability_handle: fidl::EventPair,
1129        mut other_handle: fidl::EventPair,
1130        ___deadline: zx::MonotonicInstant,
1131    ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
1132        let _response = self.client.send_query::<
1133            CapabilitiesCapabilityAssociateHandleRequest,
1134            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1135            CapabilitiesMarker,
1136        >(
1137            (capability_handle, other_handle,),
1138            0x1d69bb61953d8e7,
1139            fidl::encoding::DynamicFlags::FLEXIBLE,
1140            ___deadline,
1141        )?
1142        .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
1143        Ok(_response.map(|x| x))
1144    }
1145}
1146
1147#[cfg(target_os = "fuchsia")]
1148impl From<CapabilitiesSynchronousProxy> for zx::NullableHandle {
1149    fn from(value: CapabilitiesSynchronousProxy) -> Self {
1150        value.into_channel().into()
1151    }
1152}
1153
1154#[cfg(target_os = "fuchsia")]
1155impl From<fidl::Channel> for CapabilitiesSynchronousProxy {
1156    fn from(value: fidl::Channel) -> Self {
1157        Self::new(value)
1158    }
1159}
1160
1161#[cfg(target_os = "fuchsia")]
1162impl fidl::endpoints::FromClient for CapabilitiesSynchronousProxy {
1163    type Protocol = CapabilitiesMarker;
1164
1165    fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesMarker>) -> Self {
1166        Self::new(value.into_channel())
1167    }
1168}
1169
1170#[derive(Debug, Clone)]
1171pub struct CapabilitiesProxy {
1172    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1173}
1174
1175impl fidl::endpoints::Proxy for CapabilitiesProxy {
1176    type Protocol = CapabilitiesMarker;
1177
1178    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1179        Self::new(inner)
1180    }
1181
1182    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1183        self.client.into_channel().map_err(|client| Self { client })
1184    }
1185
1186    fn as_channel(&self) -> &::fidl::AsyncChannel {
1187        self.client.as_channel()
1188    }
1189}
1190
1191impl CapabilitiesProxy {
1192    /// Create a new Proxy for fuchsia.component.runtime/Capabilities.
1193    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1194        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1195        Self { client: fidl::client::Client::new(channel, protocol_name) }
1196    }
1197
1198    /// Get a Stream of events from the remote end of the protocol.
1199    ///
1200    /// # Panics
1201    ///
1202    /// Panics if the event stream was already taken.
1203    pub fn take_event_stream(&self) -> CapabilitiesEventStream {
1204        CapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
1205    }
1206
1207    /// Creates a reference to a new connector capability. When the connector is
1208    /// opened, the channel given to the open call will be sent over
1209    /// `receiver_client_end`.
1210    ///
1211    /// Make sure this method returns before passing the handle's peer to other
1212    /// methods in this API. The creation may not be complete before then.
1213    pub fn r#connector_create(
1214        &self,
1215        mut connector: fidl::EventPair,
1216        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1217    ) -> fidl::client::QueryResponseFut<
1218        CapabilitiesConnectorCreateResult,
1219        fidl::encoding::DefaultFuchsiaResourceDialect,
1220    > {
1221        CapabilitiesProxyInterface::r#connector_create(self, connector, receiver_client_end)
1222    }
1223
1224    /// Creates a reference to a new directory connector capability. When the
1225    /// directory connector is opened, the channel given to the open call will
1226    /// be sent over `receiver_client_end`.
1227    ///
1228    /// Make sure this method returns before passing the handle's peer to other
1229    /// methods in this API. The creation may not be complete before then.
1230    pub fn r#dir_connector_create(
1231        &self,
1232        mut dir_connector: fidl::EventPair,
1233        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1234    ) -> fidl::client::QueryResponseFut<
1235        CapabilitiesDirConnectorCreateResult,
1236        fidl::encoding::DefaultFuchsiaResourceDialect,
1237    > {
1238        CapabilitiesProxyInterface::r#dir_connector_create(self, dir_connector, receiver_client_end)
1239    }
1240
1241    /// Creates a reference to a new dictionary capability.
1242    ///
1243    /// Make sure this method returns before passing the handle's peer to other
1244    /// methods in this API. The creation may not be complete before then.
1245    pub fn r#dictionary_create(
1246        &self,
1247        mut dictionary: fidl::EventPair,
1248    ) -> fidl::client::QueryResponseFut<
1249        CapabilitiesDictionaryCreateResult,
1250        fidl::encoding::DefaultFuchsiaResourceDialect,
1251    > {
1252        CapabilitiesProxyInterface::r#dictionary_create(self, dictionary)
1253    }
1254
1255    /// Creates a reference to a new data capability with the given value.
1256    ///
1257    /// Make sure this method returns before passing the handle's peer to other
1258    /// methods in this API. The creation may not be complete before then.
1259    pub fn r#data_create(
1260        &self,
1261        mut data_handle: fidl::EventPair,
1262        mut data: &Data,
1263    ) -> fidl::client::QueryResponseFut<
1264        CapabilitiesDataCreateResult,
1265        fidl::encoding::DefaultFuchsiaResourceDialect,
1266    > {
1267        CapabilitiesProxyInterface::r#data_create(self, data_handle, data)
1268    }
1269
1270    /// Creates a reference to a new router capability that will return a
1271    /// connector capability when used.
1272    ///
1273    /// Make sure this method returns before passing the handle's peer to other
1274    /// methods in this API. The creation may not be complete before then.
1275    pub fn r#connector_router_create(
1276        &self,
1277        mut router: fidl::EventPair,
1278        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1279    ) -> fidl::client::QueryResponseFut<
1280        CapabilitiesConnectorRouterCreateResult,
1281        fidl::encoding::DefaultFuchsiaResourceDialect,
1282    > {
1283        CapabilitiesProxyInterface::r#connector_router_create(self, router, router_client_end)
1284    }
1285
1286    /// Creates a reference to a new router capability that will return a
1287    /// directory connector capability when used.
1288    ///
1289    /// Make sure this method returns before passing the handle's peer to other
1290    /// methods in this API. The creation may not be complete before then.
1291    pub fn r#dir_connector_router_create(
1292        &self,
1293        mut router: fidl::EventPair,
1294        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1295    ) -> fidl::client::QueryResponseFut<
1296        CapabilitiesDirConnectorRouterCreateResult,
1297        fidl::encoding::DefaultFuchsiaResourceDialect,
1298    > {
1299        CapabilitiesProxyInterface::r#dir_connector_router_create(self, router, router_client_end)
1300    }
1301
1302    /// Creates a reference to a new router capability that will return a
1303    /// dictionary capability when used.
1304    ///
1305    /// Make sure this method returns before passing the handle's peer to other
1306    /// methods in this API. The creation may not be complete before then.
1307    pub fn r#dictionary_router_create(
1308        &self,
1309        mut router: fidl::EventPair,
1310        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1311    ) -> fidl::client::QueryResponseFut<
1312        CapabilitiesDictionaryRouterCreateResult,
1313        fidl::encoding::DefaultFuchsiaResourceDialect,
1314    > {
1315        CapabilitiesProxyInterface::r#dictionary_router_create(self, router, router_client_end)
1316    }
1317
1318    /// Creates a reference to a new router capability that will return a data
1319    /// value when used.
1320    ///
1321    /// Make sure this method returns before passing the handle's peer to other
1322    /// methods in this API. The creation may not be complete before then.
1323    pub fn r#data_router_create(
1324        &self,
1325        mut router: fidl::EventPair,
1326        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1327    ) -> fidl::client::QueryResponseFut<
1328        CapabilitiesDataRouterCreateResult,
1329        fidl::encoding::DefaultFuchsiaResourceDialect,
1330    > {
1331        CapabilitiesProxyInterface::r#data_router_create(self, router, router_client_end)
1332    }
1333
1334    /// Creates a new instance token, which is an opaque identifier associated
1335    /// with a specific component. This instance token will be associated with
1336    /// the component this connection is opened from.
1337    ///
1338    /// Make sure this method returns before passing the handle's peer to other
1339    /// methods in this API. The creation may not be complete before then.
1340    pub fn r#instance_token_create(
1341        &self,
1342        mut instance_token: fidl::EventPair,
1343    ) -> fidl::client::QueryResponseFut<
1344        CapabilitiesInstanceTokenCreateResult,
1345        fidl::encoding::DefaultFuchsiaResourceDialect,
1346    > {
1347        CapabilitiesProxyInterface::r#instance_token_create(self, instance_token)
1348    }
1349
1350    /// Uses the provided `connector` to open a new connection by delivering
1351    /// this channel to whoever created the connector.
1352    ///
1353    /// If there is an error, it will be reported as a zx.Status epitaph on
1354    /// `channel`.
1355    ///
1356    /// If the `connector` event pair handle is not correlated with a handle
1357    /// given to `ConnectorCreate`, this connection will be closed.
1358    pub fn r#connector_open(
1359        &self,
1360        mut connector: fidl::EventPair,
1361        mut channel: fidl::Channel,
1362    ) -> fidl::client::QueryResponseFut<
1363        CapabilitiesConnectorOpenResult,
1364        fidl::encoding::DefaultFuchsiaResourceDialect,
1365    > {
1366        CapabilitiesProxyInterface::r#connector_open(self, connector, channel)
1367    }
1368
1369    /// Uses the provided `dir_connector` to open a new directory connection by
1370    /// delivering this channel to whoever created the directory connector.
1371    ///
1372    /// If there is an error, it will be reported as a zx.Status epitaph on
1373    /// `channel`.
1374    ///
1375    /// If the `dir_connector` event pair handle is not correlated with a handle
1376    /// given to `DirConnectorCreate`, this connection will be closed.
1377    ///
1378    /// `dir_connector` and `channel` are both required. `flags` and `path`
1379    /// may be omitted.
1380    pub fn r#dir_connector_open(
1381        &self,
1382        mut payload: CapabilitiesDirConnectorOpenRequest,
1383    ) -> fidl::client::QueryResponseFut<
1384        CapabilitiesDirConnectorOpenResult,
1385        fidl::encoding::DefaultFuchsiaResourceDialect,
1386    > {
1387        CapabilitiesProxyInterface::r#dir_connector_open(self, payload)
1388    }
1389
1390    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
1391    /// Overwrites any existing entry.
1392    pub fn r#dictionary_insert(
1393        &self,
1394        mut dictionary: fidl::EventPair,
1395        mut key: &str,
1396        mut value: fidl::EventPair,
1397    ) -> fidl::client::QueryResponseFut<
1398        CapabilitiesDictionaryInsertResult,
1399        fidl::encoding::DefaultFuchsiaResourceDialect,
1400    > {
1401        CapabilitiesProxyInterface::r#dictionary_insert(self, dictionary, key, value)
1402    }
1403
1404    /// Creates a new reference to the `capability` named `key` in this
1405    /// dictionary, if that capability exists. That capability will remain in
1406    /// the dictionary. To take a capability out of the dictionary, use
1407    /// `DictionaryRemove`.
1408    ///
1409    /// If `key` does not exist, `value` will not reference any capability and
1410    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1411    ///
1412    /// Make sure this method returns before passing the handle's peer to other
1413    /// methods in this API. The creation may not be complete before then.
1414    pub fn r#dictionary_get(
1415        &self,
1416        mut dictionary: fidl::EventPair,
1417        mut key: &str,
1418        mut value: fidl::EventPair,
1419    ) -> fidl::client::QueryResponseFut<
1420        CapabilitiesDictionaryGetResult,
1421        fidl::encoding::DefaultFuchsiaResourceDialect,
1422    > {
1423        CapabilitiesProxyInterface::r#dictionary_get(self, dictionary, key, value)
1424    }
1425
1426    /// Removes the `capability` named `key` from this dictionary and returns a
1427    /// reference to it, if that capability exists.
1428    ///
1429    /// `dictionary` and `key` are required. `capability` is optional, and when
1430    /// set will become associated with the capability that was removed from the
1431    /// dictionary.
1432    ///
1433    /// If `key` does not exist, `value` will not reference any capability and
1434    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1435    ///
1436    /// Make sure this method returns before passing the peer of `capability` to
1437    /// other methods in this API. The creation may not be complete before then.
1438    pub fn r#dictionary_remove(
1439        &self,
1440        mut payload: CapabilitiesDictionaryRemoveRequest,
1441    ) -> fidl::client::QueryResponseFut<
1442        CapabilitiesDictionaryRemoveResult,
1443        fidl::encoding::DefaultFuchsiaResourceDialect,
1444    > {
1445        CapabilitiesProxyInterface::r#dictionary_remove(self, payload)
1446    }
1447
1448    /// Opens an iterator which can be used to iterate over the keys of this
1449    /// dictionary.
1450    pub fn r#dictionary_iterate_keys(
1451        &self,
1452        mut dictionary: fidl::EventPair,
1453        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
1454    ) -> fidl::client::QueryResponseFut<
1455        CapabilitiesDictionaryIterateKeysResult,
1456        fidl::encoding::DefaultFuchsiaResourceDialect,
1457    > {
1458        CapabilitiesProxyInterface::r#dictionary_iterate_keys(self, dictionary, key_iterator)
1459    }
1460
1461    /// Returns the `Data` value that was provided to the `DataCreate` call used
1462    /// with `data_handle`.
1463    pub fn r#data_get(
1464        &self,
1465        mut data_handle: fidl::EventPair,
1466    ) -> fidl::client::QueryResponseFut<
1467        CapabilitiesDataGetResult,
1468        fidl::encoding::DefaultFuchsiaResourceDialect,
1469    > {
1470        CapabilitiesProxyInterface::r#data_get(self, data_handle)
1471    }
1472
1473    /// Attempts to produce a `Connector` capability from this
1474    /// `ConnectorRouter`.
1475    ///
1476    /// `request` contains context for this route, and `instance_token`
1477    /// references the component that the routing operation is being performed
1478    /// for.
1479    ///
1480    /// This will return:
1481    ///
1482    /// - `SUCCESS` if `connector` has been associated with a connector.
1483    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1484    ///   `connector` will be closed.
1485    /// - An error, if the operation failed.
1486    pub fn r#connector_router_route(
1487        &self,
1488        mut router: fidl::EventPair,
1489        mut request: &RouteRequest,
1490        mut instance_token: fidl::EventPair,
1491        mut connector: fidl::EventPair,
1492    ) -> fidl::client::QueryResponseFut<
1493        CapabilitiesConnectorRouterRouteResult,
1494        fidl::encoding::DefaultFuchsiaResourceDialect,
1495    > {
1496        CapabilitiesProxyInterface::r#connector_router_route(
1497            self,
1498            router,
1499            request,
1500            instance_token,
1501            connector,
1502        )
1503    }
1504
1505    /// Attempts to produce a `DirConnector` capability from this
1506    /// `DirConnectorRouter`.
1507    ///
1508    /// `request` contains context for this route, and `instance_token`
1509    /// references the component that the routing operation is being performed
1510    /// for.
1511    ///
1512    /// This will return:
1513    ///
1514    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
1515    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1516    ///   `dir_connector` will be closed.
1517    /// - An error, if the operation failed.
1518    pub fn r#dir_connector_router_route(
1519        &self,
1520        mut router: fidl::EventPair,
1521        mut request: &RouteRequest,
1522        mut instance_token: fidl::EventPair,
1523        mut dir_connector: fidl::EventPair,
1524    ) -> fidl::client::QueryResponseFut<
1525        CapabilitiesDirConnectorRouterRouteResult,
1526        fidl::encoding::DefaultFuchsiaResourceDialect,
1527    > {
1528        CapabilitiesProxyInterface::r#dir_connector_router_route(
1529            self,
1530            router,
1531            request,
1532            instance_token,
1533            dir_connector,
1534        )
1535    }
1536
1537    /// Attempts to produce a `Dictionary` capability from this
1538    /// `DictionaryRouter`.
1539    ///
1540    /// `request` contains context for this route, and `instance_token`
1541    /// references the component that the routing operation is being performed
1542    /// for.
1543    ///
1544    /// This will return:
1545    ///
1546    /// - `SUCCESS` if `dictionary` has been associated with a connector.
1547    /// - `UNAVAILABLE` if the capability is unavailable, in which case
1548    ///   `dictionary` will be closed.
1549    /// - An error, if the operation failed.
1550    pub fn r#dictionary_router_route(
1551        &self,
1552        mut router: fidl::EventPair,
1553        mut request: &RouteRequest,
1554        mut instance_token: fidl::EventPair,
1555        mut dictionary: fidl::EventPair,
1556    ) -> fidl::client::QueryResponseFut<
1557        CapabilitiesDictionaryRouterRouteResult,
1558        fidl::encoding::DefaultFuchsiaResourceDialect,
1559    > {
1560        CapabilitiesProxyInterface::r#dictionary_router_route(
1561            self,
1562            router,
1563            request,
1564            instance_token,
1565            dictionary,
1566        )
1567    }
1568
1569    /// Attempts to produce a `Data` capability from this `DataRouter`.
1570    ///
1571    /// `request` contains context for this route, and `instance_token`
1572    /// references the component that the routing operation is being performed
1573    /// for.
1574    ///
1575    /// This will return:
1576    ///
1577    /// - `SUCCESS` if `data` has been associated with a connector.
1578    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
1579    ///   will be closed.
1580    /// - An error, if the operation failed.
1581    pub fn r#data_router_route(
1582        &self,
1583        mut router: fidl::EventPair,
1584        mut request: &RouteRequest,
1585        mut instance_token: fidl::EventPair,
1586        mut data: fidl::EventPair,
1587    ) -> fidl::client::QueryResponseFut<
1588        CapabilitiesDataRouterRouteResult,
1589        fidl::encoding::DefaultFuchsiaResourceDialect,
1590    > {
1591        CapabilitiesProxyInterface::r#data_router_route(self, router, request, instance_token, data)
1592    }
1593
1594    /// Associates `other_handle` with the same capability referenced by
1595    /// `capability_handle`.
1596    ///
1597    /// Typically if one already has `capability_handle` the handle can be
1598    /// duplicated to make a new handle that references the same object, but
1599    /// this doesn't work when someone else has provided a handle that should be
1600    /// associated with an existing object.
1601    pub fn r#capability_associate_handle(
1602        &self,
1603        mut capability_handle: fidl::EventPair,
1604        mut other_handle: fidl::EventPair,
1605    ) -> fidl::client::QueryResponseFut<
1606        CapabilitiesCapabilityAssociateHandleResult,
1607        fidl::encoding::DefaultFuchsiaResourceDialect,
1608    > {
1609        CapabilitiesProxyInterface::r#capability_associate_handle(
1610            self,
1611            capability_handle,
1612            other_handle,
1613        )
1614    }
1615}
1616
1617impl CapabilitiesProxyInterface for CapabilitiesProxy {
1618    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1619        CapabilitiesConnectorCreateResult,
1620        fidl::encoding::DefaultFuchsiaResourceDialect,
1621    >;
1622    fn r#connector_create(
1623        &self,
1624        mut connector: fidl::EventPair,
1625        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1626    ) -> Self::ConnectorCreateResponseFut {
1627        fn _decode(
1628            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1629        ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
1630            let _response = fidl::client::decode_transaction_body::<
1631                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1632                fidl::encoding::DefaultFuchsiaResourceDialect,
1633                0xac2bc2dbd7033d1,
1634            >(_buf?)?
1635            .into_result::<CapabilitiesMarker>("connector_create")?;
1636            Ok(_response.map(|x| x))
1637        }
1638        self.client.send_query_and_decode::<
1639            CapabilitiesConnectorCreateRequest,
1640            CapabilitiesConnectorCreateResult,
1641        >(
1642            (connector, receiver_client_end,),
1643            0xac2bc2dbd7033d1,
1644            fidl::encoding::DynamicFlags::FLEXIBLE,
1645            _decode,
1646        )
1647    }
1648
1649    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1650        CapabilitiesDirConnectorCreateResult,
1651        fidl::encoding::DefaultFuchsiaResourceDialect,
1652    >;
1653    fn r#dir_connector_create(
1654        &self,
1655        mut dir_connector: fidl::EventPair,
1656        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1657    ) -> Self::DirConnectorCreateResponseFut {
1658        fn _decode(
1659            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1660        ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
1661            let _response = fidl::client::decode_transaction_body::<
1662                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1663                fidl::encoding::DefaultFuchsiaResourceDialect,
1664                0x721911e05da2a3bf,
1665            >(_buf?)?
1666            .into_result::<CapabilitiesMarker>("dir_connector_create")?;
1667            Ok(_response.map(|x| x))
1668        }
1669        self.client.send_query_and_decode::<
1670            CapabilitiesDirConnectorCreateRequest,
1671            CapabilitiesDirConnectorCreateResult,
1672        >(
1673            (dir_connector, receiver_client_end,),
1674            0x721911e05da2a3bf,
1675            fidl::encoding::DynamicFlags::FLEXIBLE,
1676            _decode,
1677        )
1678    }
1679
1680    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1681        CapabilitiesDictionaryCreateResult,
1682        fidl::encoding::DefaultFuchsiaResourceDialect,
1683    >;
1684    fn r#dictionary_create(
1685        &self,
1686        mut dictionary: fidl::EventPair,
1687    ) -> Self::DictionaryCreateResponseFut {
1688        fn _decode(
1689            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1690        ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
1691            let _response = fidl::client::decode_transaction_body::<
1692                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1693                fidl::encoding::DefaultFuchsiaResourceDialect,
1694                0x7f8bd91f0942a36e,
1695            >(_buf?)?
1696            .into_result::<CapabilitiesMarker>("dictionary_create")?;
1697            Ok(_response.map(|x| x))
1698        }
1699        self.client.send_query_and_decode::<
1700            CapabilitiesDictionaryCreateRequest,
1701            CapabilitiesDictionaryCreateResult,
1702        >(
1703            (dictionary,),
1704            0x7f8bd91f0942a36e,
1705            fidl::encoding::DynamicFlags::FLEXIBLE,
1706            _decode,
1707        )
1708    }
1709
1710    type DataCreateResponseFut = fidl::client::QueryResponseFut<
1711        CapabilitiesDataCreateResult,
1712        fidl::encoding::DefaultFuchsiaResourceDialect,
1713    >;
1714    fn r#data_create(
1715        &self,
1716        mut data_handle: fidl::EventPair,
1717        mut data: &Data,
1718    ) -> Self::DataCreateResponseFut {
1719        fn _decode(
1720            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1721        ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
1722            let _response = fidl::client::decode_transaction_body::<
1723                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1724                fidl::encoding::DefaultFuchsiaResourceDialect,
1725                0x40ef43e45372ee6a,
1726            >(_buf?)?
1727            .into_result::<CapabilitiesMarker>("data_create")?;
1728            Ok(_response.map(|x| x))
1729        }
1730        self.client
1731            .send_query_and_decode::<CapabilitiesDataCreateRequest, CapabilitiesDataCreateResult>(
1732                (data_handle, data),
1733                0x40ef43e45372ee6a,
1734                fidl::encoding::DynamicFlags::FLEXIBLE,
1735                _decode,
1736            )
1737    }
1738
1739    type ConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1740        CapabilitiesConnectorRouterCreateResult,
1741        fidl::encoding::DefaultFuchsiaResourceDialect,
1742    >;
1743    fn r#connector_router_create(
1744        &self,
1745        mut router: fidl::EventPair,
1746        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1747    ) -> Self::ConnectorRouterCreateResponseFut {
1748        fn _decode(
1749            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1750        ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
1751            let _response = fidl::client::decode_transaction_body::<
1752                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1753                fidl::encoding::DefaultFuchsiaResourceDialect,
1754                0x7f7e7fbafcdf1761,
1755            >(_buf?)?
1756            .into_result::<CapabilitiesMarker>("connector_router_create")?;
1757            Ok(_response.map(|x| x))
1758        }
1759        self.client.send_query_and_decode::<
1760            CapabilitiesConnectorRouterCreateRequest,
1761            CapabilitiesConnectorRouterCreateResult,
1762        >(
1763            (router, router_client_end,),
1764            0x7f7e7fbafcdf1761,
1765            fidl::encoding::DynamicFlags::FLEXIBLE,
1766            _decode,
1767        )
1768    }
1769
1770    type DirConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1771        CapabilitiesDirConnectorRouterCreateResult,
1772        fidl::encoding::DefaultFuchsiaResourceDialect,
1773    >;
1774    fn r#dir_connector_router_create(
1775        &self,
1776        mut router: fidl::EventPair,
1777        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1778    ) -> Self::DirConnectorRouterCreateResponseFut {
1779        fn _decode(
1780            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1781        ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
1782            let _response = fidl::client::decode_transaction_body::<
1783                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1784                fidl::encoding::DefaultFuchsiaResourceDialect,
1785                0x56520da453fad19f,
1786            >(_buf?)?
1787            .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
1788            Ok(_response.map(|x| x))
1789        }
1790        self.client.send_query_and_decode::<
1791            CapabilitiesDirConnectorRouterCreateRequest,
1792            CapabilitiesDirConnectorRouterCreateResult,
1793        >(
1794            (router, router_client_end,),
1795            0x56520da453fad19f,
1796            fidl::encoding::DynamicFlags::FLEXIBLE,
1797            _decode,
1798        )
1799    }
1800
1801    type DictionaryRouterCreateResponseFut = fidl::client::QueryResponseFut<
1802        CapabilitiesDictionaryRouterCreateResult,
1803        fidl::encoding::DefaultFuchsiaResourceDialect,
1804    >;
1805    fn r#dictionary_router_create(
1806        &self,
1807        mut router: fidl::EventPair,
1808        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1809    ) -> Self::DictionaryRouterCreateResponseFut {
1810        fn _decode(
1811            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1812        ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
1813            let _response = fidl::client::decode_transaction_body::<
1814                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1815                fidl::encoding::DefaultFuchsiaResourceDialect,
1816                0x37acef18cd423d42,
1817            >(_buf?)?
1818            .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
1819            Ok(_response.map(|x| x))
1820        }
1821        self.client.send_query_and_decode::<
1822            CapabilitiesDictionaryRouterCreateRequest,
1823            CapabilitiesDictionaryRouterCreateResult,
1824        >(
1825            (router, router_client_end,),
1826            0x37acef18cd423d42,
1827            fidl::encoding::DynamicFlags::FLEXIBLE,
1828            _decode,
1829        )
1830    }
1831
1832    type DataRouterCreateResponseFut = fidl::client::QueryResponseFut<
1833        CapabilitiesDataRouterCreateResult,
1834        fidl::encoding::DefaultFuchsiaResourceDialect,
1835    >;
1836    fn r#data_router_create(
1837        &self,
1838        mut router: fidl::EventPair,
1839        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1840    ) -> Self::DataRouterCreateResponseFut {
1841        fn _decode(
1842            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1843        ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
1844            let _response = fidl::client::decode_transaction_body::<
1845                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1846                fidl::encoding::DefaultFuchsiaResourceDialect,
1847                0x24e471395b95088,
1848            >(_buf?)?
1849            .into_result::<CapabilitiesMarker>("data_router_create")?;
1850            Ok(_response.map(|x| x))
1851        }
1852        self.client.send_query_and_decode::<
1853            CapabilitiesDataRouterCreateRequest,
1854            CapabilitiesDataRouterCreateResult,
1855        >(
1856            (router, router_client_end,),
1857            0x24e471395b95088,
1858            fidl::encoding::DynamicFlags::FLEXIBLE,
1859            _decode,
1860        )
1861    }
1862
1863    type InstanceTokenCreateResponseFut = fidl::client::QueryResponseFut<
1864        CapabilitiesInstanceTokenCreateResult,
1865        fidl::encoding::DefaultFuchsiaResourceDialect,
1866    >;
1867    fn r#instance_token_create(
1868        &self,
1869        mut instance_token: fidl::EventPair,
1870    ) -> Self::InstanceTokenCreateResponseFut {
1871        fn _decode(
1872            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1873        ) -> Result<CapabilitiesInstanceTokenCreateResult, fidl::Error> {
1874            let _response = fidl::client::decode_transaction_body::<
1875                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1876                fidl::encoding::DefaultFuchsiaResourceDialect,
1877                0x3576e31727c40813,
1878            >(_buf?)?
1879            .into_result::<CapabilitiesMarker>("instance_token_create")?;
1880            Ok(_response.map(|x| x))
1881        }
1882        self.client.send_query_and_decode::<
1883            CapabilitiesInstanceTokenCreateRequest,
1884            CapabilitiesInstanceTokenCreateResult,
1885        >(
1886            (instance_token,),
1887            0x3576e31727c40813,
1888            fidl::encoding::DynamicFlags::FLEXIBLE,
1889            _decode,
1890        )
1891    }
1892
1893    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1894        CapabilitiesConnectorOpenResult,
1895        fidl::encoding::DefaultFuchsiaResourceDialect,
1896    >;
1897    fn r#connector_open(
1898        &self,
1899        mut connector: fidl::EventPair,
1900        mut channel: fidl::Channel,
1901    ) -> Self::ConnectorOpenResponseFut {
1902        fn _decode(
1903            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1904        ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
1905            let _response = fidl::client::decode_transaction_body::<
1906                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1907                fidl::encoding::DefaultFuchsiaResourceDialect,
1908                0xc0646965f1884eb,
1909            >(_buf?)?
1910            .into_result::<CapabilitiesMarker>("connector_open")?;
1911            Ok(_response.map(|x| x))
1912        }
1913        self.client.send_query_and_decode::<
1914            CapabilitiesConnectorOpenRequest,
1915            CapabilitiesConnectorOpenResult,
1916        >(
1917            (connector, channel,),
1918            0xc0646965f1884eb,
1919            fidl::encoding::DynamicFlags::FLEXIBLE,
1920            _decode,
1921        )
1922    }
1923
1924    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1925        CapabilitiesDirConnectorOpenResult,
1926        fidl::encoding::DefaultFuchsiaResourceDialect,
1927    >;
1928    fn r#dir_connector_open(
1929        &self,
1930        mut payload: CapabilitiesDirConnectorOpenRequest,
1931    ) -> Self::DirConnectorOpenResponseFut {
1932        fn _decode(
1933            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1934        ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
1935            let _response = fidl::client::decode_transaction_body::<
1936                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1937                fidl::encoding::DefaultFuchsiaResourceDialect,
1938                0x1332bbf5debd6c20,
1939            >(_buf?)?
1940            .into_result::<CapabilitiesMarker>("dir_connector_open")?;
1941            Ok(_response.map(|x| x))
1942        }
1943        self.client.send_query_and_decode::<
1944            CapabilitiesDirConnectorOpenRequest,
1945            CapabilitiesDirConnectorOpenResult,
1946        >(
1947            &mut payload,
1948            0x1332bbf5debd6c20,
1949            fidl::encoding::DynamicFlags::FLEXIBLE,
1950            _decode,
1951        )
1952    }
1953
1954    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1955        CapabilitiesDictionaryInsertResult,
1956        fidl::encoding::DefaultFuchsiaResourceDialect,
1957    >;
1958    fn r#dictionary_insert(
1959        &self,
1960        mut dictionary: fidl::EventPair,
1961        mut key: &str,
1962        mut value: fidl::EventPair,
1963    ) -> Self::DictionaryInsertResponseFut {
1964        fn _decode(
1965            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1966        ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
1967            let _response = fidl::client::decode_transaction_body::<
1968                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1969                fidl::encoding::DefaultFuchsiaResourceDialect,
1970                0x5972e3061a760e7a,
1971            >(_buf?)?
1972            .into_result::<CapabilitiesMarker>("dictionary_insert")?;
1973            Ok(_response.map(|x| x))
1974        }
1975        self.client.send_query_and_decode::<
1976            CapabilitiesDictionaryInsertRequest,
1977            CapabilitiesDictionaryInsertResult,
1978        >(
1979            (dictionary, key, value,),
1980            0x5972e3061a760e7a,
1981            fidl::encoding::DynamicFlags::FLEXIBLE,
1982            _decode,
1983        )
1984    }
1985
1986    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1987        CapabilitiesDictionaryGetResult,
1988        fidl::encoding::DefaultFuchsiaResourceDialect,
1989    >;
1990    fn r#dictionary_get(
1991        &self,
1992        mut dictionary: fidl::EventPair,
1993        mut key: &str,
1994        mut value: fidl::EventPair,
1995    ) -> Self::DictionaryGetResponseFut {
1996        fn _decode(
1997            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1998        ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
1999            let _response = fidl::client::decode_transaction_body::<
2000                fidl::encoding::FlexibleResultType<
2001                    CapabilitiesDictionaryGetResponse,
2002                    CapabilitiesError,
2003                >,
2004                fidl::encoding::DefaultFuchsiaResourceDialect,
2005                0x31fafe2280a283d5,
2006            >(_buf?)?
2007            .into_result::<CapabilitiesMarker>("dictionary_get")?;
2008            Ok(_response.map(|x| x.capability_type))
2009        }
2010        self.client.send_query_and_decode::<
2011            CapabilitiesDictionaryGetRequest,
2012            CapabilitiesDictionaryGetResult,
2013        >(
2014            (dictionary, key, value,),
2015            0x31fafe2280a283d5,
2016            fidl::encoding::DynamicFlags::FLEXIBLE,
2017            _decode,
2018        )
2019    }
2020
2021    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
2022        CapabilitiesDictionaryRemoveResult,
2023        fidl::encoding::DefaultFuchsiaResourceDialect,
2024    >;
2025    fn r#dictionary_remove(
2026        &self,
2027        mut payload: CapabilitiesDictionaryRemoveRequest,
2028    ) -> Self::DictionaryRemoveResponseFut {
2029        fn _decode(
2030            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2031        ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
2032            let _response = fidl::client::decode_transaction_body::<
2033                fidl::encoding::FlexibleResultType<
2034                    CapabilitiesDictionaryRemoveResponse,
2035                    CapabilitiesError,
2036                >,
2037                fidl::encoding::DefaultFuchsiaResourceDialect,
2038                0x6827c83106ac5a2c,
2039            >(_buf?)?
2040            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
2041            Ok(_response.map(|x| x.capability_type))
2042        }
2043        self.client.send_query_and_decode::<
2044            CapabilitiesDictionaryRemoveRequest,
2045            CapabilitiesDictionaryRemoveResult,
2046        >(
2047            &mut payload,
2048            0x6827c83106ac5a2c,
2049            fidl::encoding::DynamicFlags::FLEXIBLE,
2050            _decode,
2051        )
2052    }
2053
2054    type DictionaryIterateKeysResponseFut = fidl::client::QueryResponseFut<
2055        CapabilitiesDictionaryIterateKeysResult,
2056        fidl::encoding::DefaultFuchsiaResourceDialect,
2057    >;
2058    fn r#dictionary_iterate_keys(
2059        &self,
2060        mut dictionary: fidl::EventPair,
2061        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
2062    ) -> Self::DictionaryIterateKeysResponseFut {
2063        fn _decode(
2064            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2065        ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
2066            let _response = fidl::client::decode_transaction_body::<
2067                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2068                fidl::encoding::DefaultFuchsiaResourceDialect,
2069                0x3d4ea59c80df9bb8,
2070            >(_buf?)?
2071            .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
2072            Ok(_response.map(|x| x))
2073        }
2074        self.client.send_query_and_decode::<
2075            CapabilitiesDictionaryIterateKeysRequest,
2076            CapabilitiesDictionaryIterateKeysResult,
2077        >(
2078            (dictionary, key_iterator,),
2079            0x3d4ea59c80df9bb8,
2080            fidl::encoding::DynamicFlags::FLEXIBLE,
2081            _decode,
2082        )
2083    }
2084
2085    type DataGetResponseFut = fidl::client::QueryResponseFut<
2086        CapabilitiesDataGetResult,
2087        fidl::encoding::DefaultFuchsiaResourceDialect,
2088    >;
2089    fn r#data_get(&self, mut data_handle: fidl::EventPair) -> Self::DataGetResponseFut {
2090        fn _decode(
2091            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2092        ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
2093            let _response = fidl::client::decode_transaction_body::<
2094                fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
2095                fidl::encoding::DefaultFuchsiaResourceDialect,
2096                0x65ae25b59f9e0daf,
2097            >(_buf?)?
2098            .into_result::<CapabilitiesMarker>("data_get")?;
2099            Ok(_response.map(|x| x))
2100        }
2101        self.client.send_query_and_decode::<CapabilitiesDataGetRequest, CapabilitiesDataGetResult>(
2102            (data_handle,),
2103            0x65ae25b59f9e0daf,
2104            fidl::encoding::DynamicFlags::FLEXIBLE,
2105            _decode,
2106        )
2107    }
2108
2109    type ConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2110        CapabilitiesConnectorRouterRouteResult,
2111        fidl::encoding::DefaultFuchsiaResourceDialect,
2112    >;
2113    fn r#connector_router_route(
2114        &self,
2115        mut router: fidl::EventPair,
2116        mut request: &RouteRequest,
2117        mut instance_token: fidl::EventPair,
2118        mut connector: fidl::EventPair,
2119    ) -> Self::ConnectorRouterRouteResponseFut {
2120        fn _decode(
2121            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2122        ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
2123            let _response = fidl::client::decode_transaction_body::<
2124                fidl::encoding::FlexibleResultType<CapabilitiesConnectorRouterRouteResponse, i32>,
2125                fidl::encoding::DefaultFuchsiaResourceDialect,
2126                0x1bd9c6e7e3dd487e,
2127            >(_buf?)?
2128            .into_result::<CapabilitiesMarker>("connector_router_route")?;
2129            Ok(_response.map(|x| x.response))
2130        }
2131        self.client.send_query_and_decode::<
2132            CapabilitiesConnectorRouterRouteRequest,
2133            CapabilitiesConnectorRouterRouteResult,
2134        >(
2135            (router, request, instance_token, connector,),
2136            0x1bd9c6e7e3dd487e,
2137            fidl::encoding::DynamicFlags::FLEXIBLE,
2138            _decode,
2139        )
2140    }
2141
2142    type DirConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2143        CapabilitiesDirConnectorRouterRouteResult,
2144        fidl::encoding::DefaultFuchsiaResourceDialect,
2145    >;
2146    fn r#dir_connector_router_route(
2147        &self,
2148        mut router: fidl::EventPair,
2149        mut request: &RouteRequest,
2150        mut instance_token: fidl::EventPair,
2151        mut dir_connector: fidl::EventPair,
2152    ) -> Self::DirConnectorRouterRouteResponseFut {
2153        fn _decode(
2154            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2155        ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
2156            let _response = fidl::client::decode_transaction_body::<
2157                fidl::encoding::FlexibleResultType<
2158                    CapabilitiesDirConnectorRouterRouteResponse,
2159                    i32,
2160                >,
2161                fidl::encoding::DefaultFuchsiaResourceDialect,
2162                0x3afdcc1b79e0799d,
2163            >(_buf?)?
2164            .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
2165            Ok(_response.map(|x| x.response))
2166        }
2167        self.client.send_query_and_decode::<
2168            CapabilitiesDirConnectorRouterRouteRequest,
2169            CapabilitiesDirConnectorRouterRouteResult,
2170        >(
2171            (router, request, instance_token, dir_connector,),
2172            0x3afdcc1b79e0799d,
2173            fidl::encoding::DynamicFlags::FLEXIBLE,
2174            _decode,
2175        )
2176    }
2177
2178    type DictionaryRouterRouteResponseFut = fidl::client::QueryResponseFut<
2179        CapabilitiesDictionaryRouterRouteResult,
2180        fidl::encoding::DefaultFuchsiaResourceDialect,
2181    >;
2182    fn r#dictionary_router_route(
2183        &self,
2184        mut router: fidl::EventPair,
2185        mut request: &RouteRequest,
2186        mut instance_token: fidl::EventPair,
2187        mut dictionary: fidl::EventPair,
2188    ) -> Self::DictionaryRouterRouteResponseFut {
2189        fn _decode(
2190            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2191        ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
2192            let _response = fidl::client::decode_transaction_body::<
2193                fidl::encoding::FlexibleResultType<CapabilitiesDictionaryRouterRouteResponse, i32>,
2194                fidl::encoding::DefaultFuchsiaResourceDialect,
2195                0xcf72de10714a708,
2196            >(_buf?)?
2197            .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
2198            Ok(_response.map(|x| x.response))
2199        }
2200        self.client.send_query_and_decode::<
2201            CapabilitiesDictionaryRouterRouteRequest,
2202            CapabilitiesDictionaryRouterRouteResult,
2203        >(
2204            (router, request, instance_token, dictionary,),
2205            0xcf72de10714a708,
2206            fidl::encoding::DynamicFlags::FLEXIBLE,
2207            _decode,
2208        )
2209    }
2210
2211    type DataRouterRouteResponseFut = fidl::client::QueryResponseFut<
2212        CapabilitiesDataRouterRouteResult,
2213        fidl::encoding::DefaultFuchsiaResourceDialect,
2214    >;
2215    fn r#data_router_route(
2216        &self,
2217        mut router: fidl::EventPair,
2218        mut request: &RouteRequest,
2219        mut instance_token: fidl::EventPair,
2220        mut data: fidl::EventPair,
2221    ) -> Self::DataRouterRouteResponseFut {
2222        fn _decode(
2223            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2224        ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
2225            let _response = fidl::client::decode_transaction_body::<
2226                fidl::encoding::FlexibleResultType<CapabilitiesDataRouterRouteResponse, i32>,
2227                fidl::encoding::DefaultFuchsiaResourceDialect,
2228                0x61ab188455ed0643,
2229            >(_buf?)?
2230            .into_result::<CapabilitiesMarker>("data_router_route")?;
2231            Ok(_response.map(|x| x.response))
2232        }
2233        self.client.send_query_and_decode::<
2234            CapabilitiesDataRouterRouteRequest,
2235            CapabilitiesDataRouterRouteResult,
2236        >(
2237            (router, request, instance_token, data,),
2238            0x61ab188455ed0643,
2239            fidl::encoding::DynamicFlags::FLEXIBLE,
2240            _decode,
2241        )
2242    }
2243
2244    type CapabilityAssociateHandleResponseFut = fidl::client::QueryResponseFut<
2245        CapabilitiesCapabilityAssociateHandleResult,
2246        fidl::encoding::DefaultFuchsiaResourceDialect,
2247    >;
2248    fn r#capability_associate_handle(
2249        &self,
2250        mut capability_handle: fidl::EventPair,
2251        mut other_handle: fidl::EventPair,
2252    ) -> Self::CapabilityAssociateHandleResponseFut {
2253        fn _decode(
2254            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2255        ) -> Result<CapabilitiesCapabilityAssociateHandleResult, fidl::Error> {
2256            let _response = fidl::client::decode_transaction_body::<
2257                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2258                fidl::encoding::DefaultFuchsiaResourceDialect,
2259                0x1d69bb61953d8e7,
2260            >(_buf?)?
2261            .into_result::<CapabilitiesMarker>("capability_associate_handle")?;
2262            Ok(_response.map(|x| x))
2263        }
2264        self.client.send_query_and_decode::<
2265            CapabilitiesCapabilityAssociateHandleRequest,
2266            CapabilitiesCapabilityAssociateHandleResult,
2267        >(
2268            (capability_handle, other_handle,),
2269            0x1d69bb61953d8e7,
2270            fidl::encoding::DynamicFlags::FLEXIBLE,
2271            _decode,
2272        )
2273    }
2274}
2275
2276pub struct CapabilitiesEventStream {
2277    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2278}
2279
2280impl std::marker::Unpin for CapabilitiesEventStream {}
2281
2282impl futures::stream::FusedStream for CapabilitiesEventStream {
2283    fn is_terminated(&self) -> bool {
2284        self.event_receiver.is_terminated()
2285    }
2286}
2287
2288impl futures::Stream for CapabilitiesEventStream {
2289    type Item = Result<CapabilitiesEvent, fidl::Error>;
2290
2291    fn poll_next(
2292        mut self: std::pin::Pin<&mut Self>,
2293        cx: &mut std::task::Context<'_>,
2294    ) -> std::task::Poll<Option<Self::Item>> {
2295        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2296            &mut self.event_receiver,
2297            cx
2298        )?) {
2299            Some(buf) => std::task::Poll::Ready(Some(CapabilitiesEvent::decode(buf))),
2300            None => std::task::Poll::Ready(None),
2301        }
2302    }
2303}
2304
2305#[derive(Debug)]
2306pub enum CapabilitiesEvent {
2307    #[non_exhaustive]
2308    _UnknownEvent {
2309        /// Ordinal of the event that was sent.
2310        ordinal: u64,
2311    },
2312}
2313
2314impl CapabilitiesEvent {
2315    /// Decodes a message buffer as a [`CapabilitiesEvent`].
2316    fn decode(
2317        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2318    ) -> Result<CapabilitiesEvent, fidl::Error> {
2319        let (bytes, _handles) = buf.split_mut();
2320        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2321        debug_assert_eq!(tx_header.tx_id, 0);
2322        match tx_header.ordinal {
2323            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2324                Ok(CapabilitiesEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2325            }
2326            _ => Err(fidl::Error::UnknownOrdinal {
2327                ordinal: tx_header.ordinal,
2328                protocol_name: <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2329            }),
2330        }
2331    }
2332}
2333
2334/// A Stream of incoming requests for fuchsia.component.runtime/Capabilities.
2335pub struct CapabilitiesRequestStream {
2336    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2337    is_terminated: bool,
2338}
2339
2340impl std::marker::Unpin for CapabilitiesRequestStream {}
2341
2342impl futures::stream::FusedStream for CapabilitiesRequestStream {
2343    fn is_terminated(&self) -> bool {
2344        self.is_terminated
2345    }
2346}
2347
2348impl fidl::endpoints::RequestStream for CapabilitiesRequestStream {
2349    type Protocol = CapabilitiesMarker;
2350    type ControlHandle = CapabilitiesControlHandle;
2351
2352    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2353        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2354    }
2355
2356    fn control_handle(&self) -> Self::ControlHandle {
2357        CapabilitiesControlHandle { inner: self.inner.clone() }
2358    }
2359
2360    fn into_inner(
2361        self,
2362    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2363    {
2364        (self.inner, self.is_terminated)
2365    }
2366
2367    fn from_inner(
2368        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2369        is_terminated: bool,
2370    ) -> Self {
2371        Self { inner, is_terminated }
2372    }
2373}
2374
2375impl futures::Stream for CapabilitiesRequestStream {
2376    type Item = Result<CapabilitiesRequest, fidl::Error>;
2377
2378    fn poll_next(
2379        mut self: std::pin::Pin<&mut Self>,
2380        cx: &mut std::task::Context<'_>,
2381    ) -> std::task::Poll<Option<Self::Item>> {
2382        let this = &mut *self;
2383        if this.inner.check_shutdown(cx) {
2384            this.is_terminated = true;
2385            return std::task::Poll::Ready(None);
2386        }
2387        if this.is_terminated {
2388            panic!("polled CapabilitiesRequestStream after completion");
2389        }
2390        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2391            |bytes, handles| {
2392                match this.inner.channel().read_etc(cx, bytes, handles) {
2393                    std::task::Poll::Ready(Ok(())) => {}
2394                    std::task::Poll::Pending => return std::task::Poll::Pending,
2395                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2396                        this.is_terminated = true;
2397                        return std::task::Poll::Ready(None);
2398                    }
2399                    std::task::Poll::Ready(Err(e)) => {
2400                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2401                            e.into(),
2402                        ))));
2403                    }
2404                }
2405
2406                // A message has been received from the channel
2407                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2408
2409                std::task::Poll::Ready(Some(match header.ordinal {
2410                    0xac2bc2dbd7033d1 => {
2411                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2412                        let mut req = fidl::new_empty!(
2413                            CapabilitiesConnectorCreateRequest,
2414                            fidl::encoding::DefaultFuchsiaResourceDialect
2415                        );
2416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2417                        let control_handle =
2418                            CapabilitiesControlHandle { inner: this.inner.clone() };
2419                        Ok(CapabilitiesRequest::ConnectorCreate {
2420                            connector: req.connector,
2421                            receiver_client_end: req.receiver_client_end,
2422
2423                            responder: CapabilitiesConnectorCreateResponder {
2424                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2425                                tx_id: header.tx_id,
2426                            },
2427                        })
2428                    }
2429                    0x721911e05da2a3bf => {
2430                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2431                        let mut req = fidl::new_empty!(
2432                            CapabilitiesDirConnectorCreateRequest,
2433                            fidl::encoding::DefaultFuchsiaResourceDialect
2434                        );
2435                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2436                        let control_handle =
2437                            CapabilitiesControlHandle { inner: this.inner.clone() };
2438                        Ok(CapabilitiesRequest::DirConnectorCreate {
2439                            dir_connector: req.dir_connector,
2440                            receiver_client_end: req.receiver_client_end,
2441
2442                            responder: CapabilitiesDirConnectorCreateResponder {
2443                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2444                                tx_id: header.tx_id,
2445                            },
2446                        })
2447                    }
2448                    0x7f8bd91f0942a36e => {
2449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2450                        let mut req = fidl::new_empty!(
2451                            CapabilitiesDictionaryCreateRequest,
2452                            fidl::encoding::DefaultFuchsiaResourceDialect
2453                        );
2454                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2455                        let control_handle =
2456                            CapabilitiesControlHandle { inner: this.inner.clone() };
2457                        Ok(CapabilitiesRequest::DictionaryCreate {
2458                            dictionary: req.dictionary,
2459
2460                            responder: CapabilitiesDictionaryCreateResponder {
2461                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2462                                tx_id: header.tx_id,
2463                            },
2464                        })
2465                    }
2466                    0x40ef43e45372ee6a => {
2467                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2468                        let mut req = fidl::new_empty!(
2469                            CapabilitiesDataCreateRequest,
2470                            fidl::encoding::DefaultFuchsiaResourceDialect
2471                        );
2472                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2473                        let control_handle =
2474                            CapabilitiesControlHandle { inner: this.inner.clone() };
2475                        Ok(CapabilitiesRequest::DataCreate {
2476                            data_handle: req.data_handle,
2477                            data: req.data,
2478
2479                            responder: CapabilitiesDataCreateResponder {
2480                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2481                                tx_id: header.tx_id,
2482                            },
2483                        })
2484                    }
2485                    0x7f7e7fbafcdf1761 => {
2486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2487                        let mut req = fidl::new_empty!(
2488                            CapabilitiesConnectorRouterCreateRequest,
2489                            fidl::encoding::DefaultFuchsiaResourceDialect
2490                        );
2491                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2492                        let control_handle =
2493                            CapabilitiesControlHandle { inner: this.inner.clone() };
2494                        Ok(CapabilitiesRequest::ConnectorRouterCreate {
2495                            router: req.router,
2496                            router_client_end: req.router_client_end,
2497
2498                            responder: CapabilitiesConnectorRouterCreateResponder {
2499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2500                                tx_id: header.tx_id,
2501                            },
2502                        })
2503                    }
2504                    0x56520da453fad19f => {
2505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2506                        let mut req = fidl::new_empty!(
2507                            CapabilitiesDirConnectorRouterCreateRequest,
2508                            fidl::encoding::DefaultFuchsiaResourceDialect
2509                        );
2510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2511                        let control_handle =
2512                            CapabilitiesControlHandle { inner: this.inner.clone() };
2513                        Ok(CapabilitiesRequest::DirConnectorRouterCreate {
2514                            router: req.router,
2515                            router_client_end: req.router_client_end,
2516
2517                            responder: CapabilitiesDirConnectorRouterCreateResponder {
2518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2519                                tx_id: header.tx_id,
2520                            },
2521                        })
2522                    }
2523                    0x37acef18cd423d42 => {
2524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2525                        let mut req = fidl::new_empty!(
2526                            CapabilitiesDictionaryRouterCreateRequest,
2527                            fidl::encoding::DefaultFuchsiaResourceDialect
2528                        );
2529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2530                        let control_handle =
2531                            CapabilitiesControlHandle { inner: this.inner.clone() };
2532                        Ok(CapabilitiesRequest::DictionaryRouterCreate {
2533                            router: req.router,
2534                            router_client_end: req.router_client_end,
2535
2536                            responder: CapabilitiesDictionaryRouterCreateResponder {
2537                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2538                                tx_id: header.tx_id,
2539                            },
2540                        })
2541                    }
2542                    0x24e471395b95088 => {
2543                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2544                        let mut req = fidl::new_empty!(
2545                            CapabilitiesDataRouterCreateRequest,
2546                            fidl::encoding::DefaultFuchsiaResourceDialect
2547                        );
2548                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2549                        let control_handle =
2550                            CapabilitiesControlHandle { inner: this.inner.clone() };
2551                        Ok(CapabilitiesRequest::DataRouterCreate {
2552                            router: req.router,
2553                            router_client_end: req.router_client_end,
2554
2555                            responder: CapabilitiesDataRouterCreateResponder {
2556                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2557                                tx_id: header.tx_id,
2558                            },
2559                        })
2560                    }
2561                    0x3576e31727c40813 => {
2562                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2563                        let mut req = fidl::new_empty!(
2564                            CapabilitiesInstanceTokenCreateRequest,
2565                            fidl::encoding::DefaultFuchsiaResourceDialect
2566                        );
2567                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesInstanceTokenCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2568                        let control_handle =
2569                            CapabilitiesControlHandle { inner: this.inner.clone() };
2570                        Ok(CapabilitiesRequest::InstanceTokenCreate {
2571                            instance_token: req.instance_token,
2572
2573                            responder: CapabilitiesInstanceTokenCreateResponder {
2574                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2575                                tx_id: header.tx_id,
2576                            },
2577                        })
2578                    }
2579                    0xc0646965f1884eb => {
2580                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2581                        let mut req = fidl::new_empty!(
2582                            CapabilitiesConnectorOpenRequest,
2583                            fidl::encoding::DefaultFuchsiaResourceDialect
2584                        );
2585                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2586                        let control_handle =
2587                            CapabilitiesControlHandle { inner: this.inner.clone() };
2588                        Ok(CapabilitiesRequest::ConnectorOpen {
2589                            connector: req.connector,
2590                            channel: req.channel,
2591
2592                            responder: CapabilitiesConnectorOpenResponder {
2593                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2594                                tx_id: header.tx_id,
2595                            },
2596                        })
2597                    }
2598                    0x1332bbf5debd6c20 => {
2599                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2600                        let mut req = fidl::new_empty!(
2601                            CapabilitiesDirConnectorOpenRequest,
2602                            fidl::encoding::DefaultFuchsiaResourceDialect
2603                        );
2604                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2605                        let control_handle =
2606                            CapabilitiesControlHandle { inner: this.inner.clone() };
2607                        Ok(CapabilitiesRequest::DirConnectorOpen {
2608                            payload: req,
2609                            responder: CapabilitiesDirConnectorOpenResponder {
2610                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2611                                tx_id: header.tx_id,
2612                            },
2613                        })
2614                    }
2615                    0x5972e3061a760e7a => {
2616                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2617                        let mut req = fidl::new_empty!(
2618                            CapabilitiesDictionaryInsertRequest,
2619                            fidl::encoding::DefaultFuchsiaResourceDialect
2620                        );
2621                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2622                        let control_handle =
2623                            CapabilitiesControlHandle { inner: this.inner.clone() };
2624                        Ok(CapabilitiesRequest::DictionaryInsert {
2625                            dictionary: req.dictionary,
2626                            key: req.key,
2627                            value: req.value,
2628
2629                            responder: CapabilitiesDictionaryInsertResponder {
2630                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2631                                tx_id: header.tx_id,
2632                            },
2633                        })
2634                    }
2635                    0x31fafe2280a283d5 => {
2636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2637                        let mut req = fidl::new_empty!(
2638                            CapabilitiesDictionaryGetRequest,
2639                            fidl::encoding::DefaultFuchsiaResourceDialect
2640                        );
2641                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2642                        let control_handle =
2643                            CapabilitiesControlHandle { inner: this.inner.clone() };
2644                        Ok(CapabilitiesRequest::DictionaryGet {
2645                            dictionary: req.dictionary,
2646                            key: req.key,
2647                            value: req.value,
2648
2649                            responder: CapabilitiesDictionaryGetResponder {
2650                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2651                                tx_id: header.tx_id,
2652                            },
2653                        })
2654                    }
2655                    0x6827c83106ac5a2c => {
2656                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2657                        let mut req = fidl::new_empty!(
2658                            CapabilitiesDictionaryRemoveRequest,
2659                            fidl::encoding::DefaultFuchsiaResourceDialect
2660                        );
2661                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2662                        let control_handle =
2663                            CapabilitiesControlHandle { inner: this.inner.clone() };
2664                        Ok(CapabilitiesRequest::DictionaryRemove {
2665                            payload: req,
2666                            responder: CapabilitiesDictionaryRemoveResponder {
2667                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2668                                tx_id: header.tx_id,
2669                            },
2670                        })
2671                    }
2672                    0x3d4ea59c80df9bb8 => {
2673                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2674                        let mut req = fidl::new_empty!(
2675                            CapabilitiesDictionaryIterateKeysRequest,
2676                            fidl::encoding::DefaultFuchsiaResourceDialect
2677                        );
2678                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryIterateKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2679                        let control_handle =
2680                            CapabilitiesControlHandle { inner: this.inner.clone() };
2681                        Ok(CapabilitiesRequest::DictionaryIterateKeys {
2682                            dictionary: req.dictionary,
2683                            key_iterator: req.key_iterator,
2684
2685                            responder: CapabilitiesDictionaryIterateKeysResponder {
2686                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2687                                tx_id: header.tx_id,
2688                            },
2689                        })
2690                    }
2691                    0x65ae25b59f9e0daf => {
2692                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2693                        let mut req = fidl::new_empty!(
2694                            CapabilitiesDataGetRequest,
2695                            fidl::encoding::DefaultFuchsiaResourceDialect
2696                        );
2697                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataGetRequest>(&header, _body_bytes, handles, &mut req)?;
2698                        let control_handle =
2699                            CapabilitiesControlHandle { inner: this.inner.clone() };
2700                        Ok(CapabilitiesRequest::DataGet {
2701                            data_handle: req.data_handle,
2702
2703                            responder: CapabilitiesDataGetResponder {
2704                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2705                                tx_id: header.tx_id,
2706                            },
2707                        })
2708                    }
2709                    0x1bd9c6e7e3dd487e => {
2710                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2711                        let mut req = fidl::new_empty!(
2712                            CapabilitiesConnectorRouterRouteRequest,
2713                            fidl::encoding::DefaultFuchsiaResourceDialect
2714                        );
2715                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2716                        let control_handle =
2717                            CapabilitiesControlHandle { inner: this.inner.clone() };
2718                        Ok(CapabilitiesRequest::ConnectorRouterRoute {
2719                            router: req.router,
2720                            request: req.request,
2721                            instance_token: req.instance_token,
2722                            connector: req.connector,
2723
2724                            responder: CapabilitiesConnectorRouterRouteResponder {
2725                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2726                                tx_id: header.tx_id,
2727                            },
2728                        })
2729                    }
2730                    0x3afdcc1b79e0799d => {
2731                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2732                        let mut req = fidl::new_empty!(
2733                            CapabilitiesDirConnectorRouterRouteRequest,
2734                            fidl::encoding::DefaultFuchsiaResourceDialect
2735                        );
2736                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2737                        let control_handle =
2738                            CapabilitiesControlHandle { inner: this.inner.clone() };
2739                        Ok(CapabilitiesRequest::DirConnectorRouterRoute {
2740                            router: req.router,
2741                            request: req.request,
2742                            instance_token: req.instance_token,
2743                            dir_connector: req.dir_connector,
2744
2745                            responder: CapabilitiesDirConnectorRouterRouteResponder {
2746                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2747                                tx_id: header.tx_id,
2748                            },
2749                        })
2750                    }
2751                    0xcf72de10714a708 => {
2752                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2753                        let mut req = fidl::new_empty!(
2754                            CapabilitiesDictionaryRouterRouteRequest,
2755                            fidl::encoding::DefaultFuchsiaResourceDialect
2756                        );
2757                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2758                        let control_handle =
2759                            CapabilitiesControlHandle { inner: this.inner.clone() };
2760                        Ok(CapabilitiesRequest::DictionaryRouterRoute {
2761                            router: req.router,
2762                            request: req.request,
2763                            instance_token: req.instance_token,
2764                            dictionary: req.dictionary,
2765
2766                            responder: CapabilitiesDictionaryRouterRouteResponder {
2767                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2768                                tx_id: header.tx_id,
2769                            },
2770                        })
2771                    }
2772                    0x61ab188455ed0643 => {
2773                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2774                        let mut req = fidl::new_empty!(
2775                            CapabilitiesDataRouterRouteRequest,
2776                            fidl::encoding::DefaultFuchsiaResourceDialect
2777                        );
2778                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2779                        let control_handle =
2780                            CapabilitiesControlHandle { inner: this.inner.clone() };
2781                        Ok(CapabilitiesRequest::DataRouterRoute {
2782                            router: req.router,
2783                            request: req.request,
2784                            instance_token: req.instance_token,
2785                            data: req.data,
2786
2787                            responder: CapabilitiesDataRouterRouteResponder {
2788                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2789                                tx_id: header.tx_id,
2790                            },
2791                        })
2792                    }
2793                    0x1d69bb61953d8e7 => {
2794                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2795                        let mut req = fidl::new_empty!(
2796                            CapabilitiesCapabilityAssociateHandleRequest,
2797                            fidl::encoding::DefaultFuchsiaResourceDialect
2798                        );
2799                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesCapabilityAssociateHandleRequest>(&header, _body_bytes, handles, &mut req)?;
2800                        let control_handle =
2801                            CapabilitiesControlHandle { inner: this.inner.clone() };
2802                        Ok(CapabilitiesRequest::CapabilityAssociateHandle {
2803                            capability_handle: req.capability_handle,
2804                            other_handle: req.other_handle,
2805
2806                            responder: CapabilitiesCapabilityAssociateHandleResponder {
2807                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2808                                tx_id: header.tx_id,
2809                            },
2810                        })
2811                    }
2812                    _ if header.tx_id == 0
2813                        && header
2814                            .dynamic_flags()
2815                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2816                    {
2817                        Ok(CapabilitiesRequest::_UnknownMethod {
2818                            ordinal: header.ordinal,
2819                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2820                            method_type: fidl::MethodType::OneWay,
2821                        })
2822                    }
2823                    _ if header
2824                        .dynamic_flags()
2825                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2826                    {
2827                        this.inner.send_framework_err(
2828                            fidl::encoding::FrameworkErr::UnknownMethod,
2829                            header.tx_id,
2830                            header.ordinal,
2831                            header.dynamic_flags(),
2832                            (bytes, handles),
2833                        )?;
2834                        Ok(CapabilitiesRequest::_UnknownMethod {
2835                            ordinal: header.ordinal,
2836                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2837                            method_type: fidl::MethodType::TwoWay,
2838                        })
2839                    }
2840                    _ => Err(fidl::Error::UnknownOrdinal {
2841                        ordinal: header.ordinal,
2842                        protocol_name:
2843                            <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2844                    }),
2845                }))
2846            },
2847        )
2848    }
2849}
2850
2851/// An API for creating and manipulating references to runtime capabilities in
2852/// the component framework. These capabilities are all reference counted by
2853/// component manager, and when accessed with this protocol the references are
2854/// implemented as event pair handles.
2855#[derive(Debug)]
2856pub enum CapabilitiesRequest {
2857    /// Creates a reference to a new connector capability. When the connector is
2858    /// opened, the channel given to the open call will be sent over
2859    /// `receiver_client_end`.
2860    ///
2861    /// Make sure this method returns before passing the handle's peer to other
2862    /// methods in this API. The creation may not be complete before then.
2863    ConnectorCreate {
2864        connector: fidl::EventPair,
2865        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
2866        responder: CapabilitiesConnectorCreateResponder,
2867    },
2868    /// Creates a reference to a new directory connector capability. When the
2869    /// directory connector is opened, the channel given to the open call will
2870    /// be sent over `receiver_client_end`.
2871    ///
2872    /// Make sure this method returns before passing the handle's peer to other
2873    /// methods in this API. The creation may not be complete before then.
2874    DirConnectorCreate {
2875        dir_connector: fidl::EventPair,
2876        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2877        responder: CapabilitiesDirConnectorCreateResponder,
2878    },
2879    /// Creates a reference to a new dictionary capability.
2880    ///
2881    /// Make sure this method returns before passing the handle's peer to other
2882    /// methods in this API. The creation may not be complete before then.
2883    DictionaryCreate {
2884        dictionary: fidl::EventPair,
2885        responder: CapabilitiesDictionaryCreateResponder,
2886    },
2887    /// Creates a reference to a new data capability with the given value.
2888    ///
2889    /// Make sure this method returns before passing the handle's peer to other
2890    /// methods in this API. The creation may not be complete before then.
2891    DataCreate {
2892        data_handle: fidl::EventPair,
2893        data: Data,
2894        responder: CapabilitiesDataCreateResponder,
2895    },
2896    /// Creates a reference to a new router capability that will return a
2897    /// connector capability when used.
2898    ///
2899    /// Make sure this method returns before passing the handle's peer to other
2900    /// methods in this API. The creation may not be complete before then.
2901    ConnectorRouterCreate {
2902        router: fidl::EventPair,
2903        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
2904        responder: CapabilitiesConnectorRouterCreateResponder,
2905    },
2906    /// Creates a reference to a new router capability that will return a
2907    /// directory connector capability when used.
2908    ///
2909    /// Make sure this method returns before passing the handle's peer to other
2910    /// methods in this API. The creation may not be complete before then.
2911    DirConnectorRouterCreate {
2912        router: fidl::EventPair,
2913        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
2914        responder: CapabilitiesDirConnectorRouterCreateResponder,
2915    },
2916    /// Creates a reference to a new router capability that will return a
2917    /// dictionary capability when used.
2918    ///
2919    /// Make sure this method returns before passing the handle's peer to other
2920    /// methods in this API. The creation may not be complete before then.
2921    DictionaryRouterCreate {
2922        router: fidl::EventPair,
2923        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
2924        responder: CapabilitiesDictionaryRouterCreateResponder,
2925    },
2926    /// Creates a reference to a new router capability that will return a data
2927    /// value when used.
2928    ///
2929    /// Make sure this method returns before passing the handle's peer to other
2930    /// methods in this API. The creation may not be complete before then.
2931    DataRouterCreate {
2932        router: fidl::EventPair,
2933        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
2934        responder: CapabilitiesDataRouterCreateResponder,
2935    },
2936    /// Creates a new instance token, which is an opaque identifier associated
2937    /// with a specific component. This instance token will be associated with
2938    /// the component this connection is opened from.
2939    ///
2940    /// Make sure this method returns before passing the handle's peer to other
2941    /// methods in this API. The creation may not be complete before then.
2942    InstanceTokenCreate {
2943        instance_token: fidl::EventPair,
2944        responder: CapabilitiesInstanceTokenCreateResponder,
2945    },
2946    /// Uses the provided `connector` to open a new connection by delivering
2947    /// this channel to whoever created the connector.
2948    ///
2949    /// If there is an error, it will be reported as a zx.Status epitaph on
2950    /// `channel`.
2951    ///
2952    /// If the `connector` event pair handle is not correlated with a handle
2953    /// given to `ConnectorCreate`, this connection will be closed.
2954    ConnectorOpen {
2955        connector: fidl::EventPair,
2956        channel: fidl::Channel,
2957        responder: CapabilitiesConnectorOpenResponder,
2958    },
2959    /// Uses the provided `dir_connector` to open a new directory connection by
2960    /// delivering this channel to whoever created the directory connector.
2961    ///
2962    /// If there is an error, it will be reported as a zx.Status epitaph on
2963    /// `channel`.
2964    ///
2965    /// If the `dir_connector` event pair handle is not correlated with a handle
2966    /// given to `DirConnectorCreate`, this connection will be closed.
2967    ///
2968    /// `dir_connector` and `channel` are both required. `flags` and `path`
2969    /// may be omitted.
2970    DirConnectorOpen {
2971        payload: CapabilitiesDirConnectorOpenRequest,
2972        responder: CapabilitiesDirConnectorOpenResponder,
2973    },
2974    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
2975    /// Overwrites any existing entry.
2976    DictionaryInsert {
2977        dictionary: fidl::EventPair,
2978        key: String,
2979        value: fidl::EventPair,
2980        responder: CapabilitiesDictionaryInsertResponder,
2981    },
2982    /// Creates a new reference to the `capability` named `key` in this
2983    /// dictionary, if that capability exists. That capability will remain in
2984    /// the dictionary. To take a capability out of the dictionary, use
2985    /// `DictionaryRemove`.
2986    ///
2987    /// If `key` does not exist, `value` will not reference any capability and
2988    /// the `NO_SUCH_CAPABILITY` error value will be returned.
2989    ///
2990    /// Make sure this method returns before passing the handle's peer to other
2991    /// methods in this API. The creation may not be complete before then.
2992    DictionaryGet {
2993        dictionary: fidl::EventPair,
2994        key: String,
2995        value: fidl::EventPair,
2996        responder: CapabilitiesDictionaryGetResponder,
2997    },
2998    /// Removes the `capability` named `key` from this dictionary and returns a
2999    /// reference to it, if that capability exists.
3000    ///
3001    /// `dictionary` and `key` are required. `capability` is optional, and when
3002    /// set will become associated with the capability that was removed from the
3003    /// dictionary.
3004    ///
3005    /// If `key` does not exist, `value` will not reference any capability and
3006    /// the `NO_SUCH_CAPABILITY` error value will be returned.
3007    ///
3008    /// Make sure this method returns before passing the peer of `capability` to
3009    /// other methods in this API. The creation may not be complete before then.
3010    DictionaryRemove {
3011        payload: CapabilitiesDictionaryRemoveRequest,
3012        responder: CapabilitiesDictionaryRemoveResponder,
3013    },
3014    /// Opens an iterator which can be used to iterate over the keys of this
3015    /// dictionary.
3016    DictionaryIterateKeys {
3017        dictionary: fidl::EventPair,
3018        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3019        responder: CapabilitiesDictionaryIterateKeysResponder,
3020    },
3021    /// Returns the `Data` value that was provided to the `DataCreate` call used
3022    /// with `data_handle`.
3023    DataGet { data_handle: fidl::EventPair, responder: CapabilitiesDataGetResponder },
3024    /// Attempts to produce a `Connector` capability from this
3025    /// `ConnectorRouter`.
3026    ///
3027    /// `request` contains context for this route, and `instance_token`
3028    /// references the component that the routing operation is being performed
3029    /// for.
3030    ///
3031    /// This will return:
3032    ///
3033    /// - `SUCCESS` if `connector` has been associated with a connector.
3034    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3035    ///   `connector` will be closed.
3036    /// - An error, if the operation failed.
3037    ConnectorRouterRoute {
3038        router: fidl::EventPair,
3039        request: RouteRequest,
3040        instance_token: fidl::EventPair,
3041        connector: fidl::EventPair,
3042        responder: CapabilitiesConnectorRouterRouteResponder,
3043    },
3044    /// Attempts to produce a `DirConnector` capability from this
3045    /// `DirConnectorRouter`.
3046    ///
3047    /// `request` contains context for this route, and `instance_token`
3048    /// references the component that the routing operation is being performed
3049    /// for.
3050    ///
3051    /// This will return:
3052    ///
3053    /// - `SUCCESS` if `dir_connector` has been associated with a connector.
3054    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3055    ///   `dir_connector` will be closed.
3056    /// - An error, if the operation failed.
3057    DirConnectorRouterRoute {
3058        router: fidl::EventPair,
3059        request: RouteRequest,
3060        instance_token: fidl::EventPair,
3061        dir_connector: fidl::EventPair,
3062        responder: CapabilitiesDirConnectorRouterRouteResponder,
3063    },
3064    /// Attempts to produce a `Dictionary` capability from this
3065    /// `DictionaryRouter`.
3066    ///
3067    /// `request` contains context for this route, and `instance_token`
3068    /// references the component that the routing operation is being performed
3069    /// for.
3070    ///
3071    /// This will return:
3072    ///
3073    /// - `SUCCESS` if `dictionary` has been associated with a connector.
3074    /// - `UNAVAILABLE` if the capability is unavailable, in which case
3075    ///   `dictionary` will be closed.
3076    /// - An error, if the operation failed.
3077    DictionaryRouterRoute {
3078        router: fidl::EventPair,
3079        request: RouteRequest,
3080        instance_token: fidl::EventPair,
3081        dictionary: fidl::EventPair,
3082        responder: CapabilitiesDictionaryRouterRouteResponder,
3083    },
3084    /// Attempts to produce a `Data` capability from this `DataRouter`.
3085    ///
3086    /// `request` contains context for this route, and `instance_token`
3087    /// references the component that the routing operation is being performed
3088    /// for.
3089    ///
3090    /// This will return:
3091    ///
3092    /// - `SUCCESS` if `data` has been associated with a connector.
3093    /// - `UNAVAILABLE` if the capability is unavailable, in which case `data`
3094    ///   will be closed.
3095    /// - An error, if the operation failed.
3096    DataRouterRoute {
3097        router: fidl::EventPair,
3098        request: RouteRequest,
3099        instance_token: fidl::EventPair,
3100        data: fidl::EventPair,
3101        responder: CapabilitiesDataRouterRouteResponder,
3102    },
3103    /// Associates `other_handle` with the same capability referenced by
3104    /// `capability_handle`.
3105    ///
3106    /// Typically if one already has `capability_handle` the handle can be
3107    /// duplicated to make a new handle that references the same object, but
3108    /// this doesn't work when someone else has provided a handle that should be
3109    /// associated with an existing object.
3110    CapabilityAssociateHandle {
3111        capability_handle: fidl::EventPair,
3112        other_handle: fidl::EventPair,
3113        responder: CapabilitiesCapabilityAssociateHandleResponder,
3114    },
3115    /// An interaction was received which does not match any known method.
3116    #[non_exhaustive]
3117    _UnknownMethod {
3118        /// Ordinal of the method that was called.
3119        ordinal: u64,
3120        control_handle: CapabilitiesControlHandle,
3121        method_type: fidl::MethodType,
3122    },
3123}
3124
3125impl CapabilitiesRequest {
3126    #[allow(irrefutable_let_patterns)]
3127    pub fn into_connector_create(
3128        self,
3129    ) -> Option<(
3130        fidl::EventPair,
3131        fidl::endpoints::ClientEnd<ReceiverMarker>,
3132        CapabilitiesConnectorCreateResponder,
3133    )> {
3134        if let CapabilitiesRequest::ConnectorCreate { connector, receiver_client_end, responder } =
3135            self
3136        {
3137            Some((connector, receiver_client_end, responder))
3138        } else {
3139            None
3140        }
3141    }
3142
3143    #[allow(irrefutable_let_patterns)]
3144    pub fn into_dir_connector_create(
3145        self,
3146    ) -> Option<(
3147        fidl::EventPair,
3148        fidl::endpoints::ClientEnd<DirReceiverMarker>,
3149        CapabilitiesDirConnectorCreateResponder,
3150    )> {
3151        if let CapabilitiesRequest::DirConnectorCreate {
3152            dir_connector,
3153            receiver_client_end,
3154            responder,
3155        } = self
3156        {
3157            Some((dir_connector, receiver_client_end, responder))
3158        } else {
3159            None
3160        }
3161    }
3162
3163    #[allow(irrefutable_let_patterns)]
3164    pub fn into_dictionary_create(
3165        self,
3166    ) -> Option<(fidl::EventPair, CapabilitiesDictionaryCreateResponder)> {
3167        if let CapabilitiesRequest::DictionaryCreate { dictionary, responder } = self {
3168            Some((dictionary, responder))
3169        } else {
3170            None
3171        }
3172    }
3173
3174    #[allow(irrefutable_let_patterns)]
3175    pub fn into_data_create(
3176        self,
3177    ) -> Option<(fidl::EventPair, Data, CapabilitiesDataCreateResponder)> {
3178        if let CapabilitiesRequest::DataCreate { data_handle, data, responder } = self {
3179            Some((data_handle, data, responder))
3180        } else {
3181            None
3182        }
3183    }
3184
3185    #[allow(irrefutable_let_patterns)]
3186    pub fn into_connector_router_create(
3187        self,
3188    ) -> Option<(
3189        fidl::EventPair,
3190        fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
3191        CapabilitiesConnectorRouterCreateResponder,
3192    )> {
3193        if let CapabilitiesRequest::ConnectorRouterCreate { router, router_client_end, responder } =
3194            self
3195        {
3196            Some((router, router_client_end, responder))
3197        } else {
3198            None
3199        }
3200    }
3201
3202    #[allow(irrefutable_let_patterns)]
3203    pub fn into_dir_connector_router_create(
3204        self,
3205    ) -> Option<(
3206        fidl::EventPair,
3207        fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
3208        CapabilitiesDirConnectorRouterCreateResponder,
3209    )> {
3210        if let CapabilitiesRequest::DirConnectorRouterCreate {
3211            router,
3212            router_client_end,
3213            responder,
3214        } = self
3215        {
3216            Some((router, router_client_end, responder))
3217        } else {
3218            None
3219        }
3220    }
3221
3222    #[allow(irrefutable_let_patterns)]
3223    pub fn into_dictionary_router_create(
3224        self,
3225    ) -> Option<(
3226        fidl::EventPair,
3227        fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
3228        CapabilitiesDictionaryRouterCreateResponder,
3229    )> {
3230        if let CapabilitiesRequest::DictionaryRouterCreate {
3231            router,
3232            router_client_end,
3233            responder,
3234        } = self
3235        {
3236            Some((router, router_client_end, responder))
3237        } else {
3238            None
3239        }
3240    }
3241
3242    #[allow(irrefutable_let_patterns)]
3243    pub fn into_data_router_create(
3244        self,
3245    ) -> Option<(
3246        fidl::EventPair,
3247        fidl::endpoints::ClientEnd<DataRouterMarker>,
3248        CapabilitiesDataRouterCreateResponder,
3249    )> {
3250        if let CapabilitiesRequest::DataRouterCreate { router, router_client_end, responder } = self
3251        {
3252            Some((router, router_client_end, responder))
3253        } else {
3254            None
3255        }
3256    }
3257
3258    #[allow(irrefutable_let_patterns)]
3259    pub fn into_instance_token_create(
3260        self,
3261    ) -> Option<(fidl::EventPair, CapabilitiesInstanceTokenCreateResponder)> {
3262        if let CapabilitiesRequest::InstanceTokenCreate { instance_token, responder } = self {
3263            Some((instance_token, responder))
3264        } else {
3265            None
3266        }
3267    }
3268
3269    #[allow(irrefutable_let_patterns)]
3270    pub fn into_connector_open(
3271        self,
3272    ) -> Option<(fidl::EventPair, fidl::Channel, CapabilitiesConnectorOpenResponder)> {
3273        if let CapabilitiesRequest::ConnectorOpen { connector, channel, responder } = self {
3274            Some((connector, channel, responder))
3275        } else {
3276            None
3277        }
3278    }
3279
3280    #[allow(irrefutable_let_patterns)]
3281    pub fn into_dir_connector_open(
3282        self,
3283    ) -> Option<(CapabilitiesDirConnectorOpenRequest, CapabilitiesDirConnectorOpenResponder)> {
3284        if let CapabilitiesRequest::DirConnectorOpen { payload, responder } = self {
3285            Some((payload, responder))
3286        } else {
3287            None
3288        }
3289    }
3290
3291    #[allow(irrefutable_let_patterns)]
3292    pub fn into_dictionary_insert(
3293        self,
3294    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryInsertResponder)>
3295    {
3296        if let CapabilitiesRequest::DictionaryInsert { dictionary, key, value, responder } = self {
3297            Some((dictionary, key, value, responder))
3298        } else {
3299            None
3300        }
3301    }
3302
3303    #[allow(irrefutable_let_patterns)]
3304    pub fn into_dictionary_get(
3305        self,
3306    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryGetResponder)>
3307    {
3308        if let CapabilitiesRequest::DictionaryGet { dictionary, key, value, responder } = self {
3309            Some((dictionary, key, value, responder))
3310        } else {
3311            None
3312        }
3313    }
3314
3315    #[allow(irrefutable_let_patterns)]
3316    pub fn into_dictionary_remove(
3317        self,
3318    ) -> Option<(CapabilitiesDictionaryRemoveRequest, CapabilitiesDictionaryRemoveResponder)> {
3319        if let CapabilitiesRequest::DictionaryRemove { payload, responder } = self {
3320            Some((payload, responder))
3321        } else {
3322            None
3323        }
3324    }
3325
3326    #[allow(irrefutable_let_patterns)]
3327    pub fn into_dictionary_iterate_keys(
3328        self,
3329    ) -> Option<(
3330        fidl::EventPair,
3331        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3332        CapabilitiesDictionaryIterateKeysResponder,
3333    )> {
3334        if let CapabilitiesRequest::DictionaryIterateKeys { dictionary, key_iterator, responder } =
3335            self
3336        {
3337            Some((dictionary, key_iterator, responder))
3338        } else {
3339            None
3340        }
3341    }
3342
3343    #[allow(irrefutable_let_patterns)]
3344    pub fn into_data_get(self) -> Option<(fidl::EventPair, CapabilitiesDataGetResponder)> {
3345        if let CapabilitiesRequest::DataGet { data_handle, responder } = self {
3346            Some((data_handle, responder))
3347        } else {
3348            None
3349        }
3350    }
3351
3352    #[allow(irrefutable_let_patterns)]
3353    pub fn into_connector_router_route(
3354        self,
3355    ) -> Option<(
3356        fidl::EventPair,
3357        RouteRequest,
3358        fidl::EventPair,
3359        fidl::EventPair,
3360        CapabilitiesConnectorRouterRouteResponder,
3361    )> {
3362        if let CapabilitiesRequest::ConnectorRouterRoute {
3363            router,
3364            request,
3365            instance_token,
3366            connector,
3367            responder,
3368        } = self
3369        {
3370            Some((router, request, instance_token, connector, responder))
3371        } else {
3372            None
3373        }
3374    }
3375
3376    #[allow(irrefutable_let_patterns)]
3377    pub fn into_dir_connector_router_route(
3378        self,
3379    ) -> Option<(
3380        fidl::EventPair,
3381        RouteRequest,
3382        fidl::EventPair,
3383        fidl::EventPair,
3384        CapabilitiesDirConnectorRouterRouteResponder,
3385    )> {
3386        if let CapabilitiesRequest::DirConnectorRouterRoute {
3387            router,
3388            request,
3389            instance_token,
3390            dir_connector,
3391            responder,
3392        } = self
3393        {
3394            Some((router, request, instance_token, dir_connector, responder))
3395        } else {
3396            None
3397        }
3398    }
3399
3400    #[allow(irrefutable_let_patterns)]
3401    pub fn into_dictionary_router_route(
3402        self,
3403    ) -> Option<(
3404        fidl::EventPair,
3405        RouteRequest,
3406        fidl::EventPair,
3407        fidl::EventPair,
3408        CapabilitiesDictionaryRouterRouteResponder,
3409    )> {
3410        if let CapabilitiesRequest::DictionaryRouterRoute {
3411            router,
3412            request,
3413            instance_token,
3414            dictionary,
3415            responder,
3416        } = self
3417        {
3418            Some((router, request, instance_token, dictionary, responder))
3419        } else {
3420            None
3421        }
3422    }
3423
3424    #[allow(irrefutable_let_patterns)]
3425    pub fn into_data_router_route(
3426        self,
3427    ) -> Option<(
3428        fidl::EventPair,
3429        RouteRequest,
3430        fidl::EventPair,
3431        fidl::EventPair,
3432        CapabilitiesDataRouterRouteResponder,
3433    )> {
3434        if let CapabilitiesRequest::DataRouterRoute {
3435            router,
3436            request,
3437            instance_token,
3438            data,
3439            responder,
3440        } = self
3441        {
3442            Some((router, request, instance_token, data, responder))
3443        } else {
3444            None
3445        }
3446    }
3447
3448    #[allow(irrefutable_let_patterns)]
3449    pub fn into_capability_associate_handle(
3450        self,
3451    ) -> Option<(fidl::EventPair, fidl::EventPair, CapabilitiesCapabilityAssociateHandleResponder)>
3452    {
3453        if let CapabilitiesRequest::CapabilityAssociateHandle {
3454            capability_handle,
3455            other_handle,
3456            responder,
3457        } = self
3458        {
3459            Some((capability_handle, other_handle, responder))
3460        } else {
3461            None
3462        }
3463    }
3464
3465    /// Name of the method defined in FIDL
3466    pub fn method_name(&self) -> &'static str {
3467        match *self {
3468            CapabilitiesRequest::ConnectorCreate { .. } => "connector_create",
3469            CapabilitiesRequest::DirConnectorCreate { .. } => "dir_connector_create",
3470            CapabilitiesRequest::DictionaryCreate { .. } => "dictionary_create",
3471            CapabilitiesRequest::DataCreate { .. } => "data_create",
3472            CapabilitiesRequest::ConnectorRouterCreate { .. } => "connector_router_create",
3473            CapabilitiesRequest::DirConnectorRouterCreate { .. } => "dir_connector_router_create",
3474            CapabilitiesRequest::DictionaryRouterCreate { .. } => "dictionary_router_create",
3475            CapabilitiesRequest::DataRouterCreate { .. } => "data_router_create",
3476            CapabilitiesRequest::InstanceTokenCreate { .. } => "instance_token_create",
3477            CapabilitiesRequest::ConnectorOpen { .. } => "connector_open",
3478            CapabilitiesRequest::DirConnectorOpen { .. } => "dir_connector_open",
3479            CapabilitiesRequest::DictionaryInsert { .. } => "dictionary_insert",
3480            CapabilitiesRequest::DictionaryGet { .. } => "dictionary_get",
3481            CapabilitiesRequest::DictionaryRemove { .. } => "dictionary_remove",
3482            CapabilitiesRequest::DictionaryIterateKeys { .. } => "dictionary_iterate_keys",
3483            CapabilitiesRequest::DataGet { .. } => "data_get",
3484            CapabilitiesRequest::ConnectorRouterRoute { .. } => "connector_router_route",
3485            CapabilitiesRequest::DirConnectorRouterRoute { .. } => "dir_connector_router_route",
3486            CapabilitiesRequest::DictionaryRouterRoute { .. } => "dictionary_router_route",
3487            CapabilitiesRequest::DataRouterRoute { .. } => "data_router_route",
3488            CapabilitiesRequest::CapabilityAssociateHandle { .. } => "capability_associate_handle",
3489            CapabilitiesRequest::_UnknownMethod {
3490                method_type: fidl::MethodType::OneWay, ..
3491            } => "unknown one-way method",
3492            CapabilitiesRequest::_UnknownMethod {
3493                method_type: fidl::MethodType::TwoWay, ..
3494            } => "unknown two-way method",
3495        }
3496    }
3497}
3498
3499#[derive(Debug, Clone)]
3500pub struct CapabilitiesControlHandle {
3501    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3502}
3503
3504impl fidl::endpoints::ControlHandle for CapabilitiesControlHandle {
3505    fn shutdown(&self) {
3506        self.inner.shutdown()
3507    }
3508
3509    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3510        self.inner.shutdown_with_epitaph(status)
3511    }
3512
3513    fn is_closed(&self) -> bool {
3514        self.inner.channel().is_closed()
3515    }
3516    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3517        self.inner.channel().on_closed()
3518    }
3519
3520    #[cfg(target_os = "fuchsia")]
3521    fn signal_peer(
3522        &self,
3523        clear_mask: zx::Signals,
3524        set_mask: zx::Signals,
3525    ) -> Result<(), zx_status::Status> {
3526        use fidl::Peered;
3527        self.inner.channel().signal_peer(clear_mask, set_mask)
3528    }
3529}
3530
3531impl CapabilitiesControlHandle {}
3532
3533#[must_use = "FIDL methods require a response to be sent"]
3534#[derive(Debug)]
3535pub struct CapabilitiesConnectorCreateResponder {
3536    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3537    tx_id: u32,
3538}
3539
3540/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3541/// if the responder is dropped without sending a response, so that the client
3542/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3543impl std::ops::Drop for CapabilitiesConnectorCreateResponder {
3544    fn drop(&mut self) {
3545        self.control_handle.shutdown();
3546        // Safety: drops once, never accessed again
3547        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3548    }
3549}
3550
3551impl fidl::endpoints::Responder for CapabilitiesConnectorCreateResponder {
3552    type ControlHandle = CapabilitiesControlHandle;
3553
3554    fn control_handle(&self) -> &CapabilitiesControlHandle {
3555        &self.control_handle
3556    }
3557
3558    fn drop_without_shutdown(mut self) {
3559        // Safety: drops once, never accessed again due to mem::forget
3560        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3561        // Prevent Drop from running (which would shut down the channel)
3562        std::mem::forget(self);
3563    }
3564}
3565
3566impl CapabilitiesConnectorCreateResponder {
3567    /// Sends a response to the FIDL transaction.
3568    ///
3569    /// Sets the channel to shutdown if an error occurs.
3570    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3571        let _result = self.send_raw(result);
3572        if _result.is_err() {
3573            self.control_handle.shutdown();
3574        }
3575        self.drop_without_shutdown();
3576        _result
3577    }
3578
3579    /// Similar to "send" but does not shutdown the channel if an error occurs.
3580    pub fn send_no_shutdown_on_err(
3581        self,
3582        mut result: Result<(), CapabilitiesError>,
3583    ) -> Result<(), fidl::Error> {
3584        let _result = self.send_raw(result);
3585        self.drop_without_shutdown();
3586        _result
3587    }
3588
3589    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3590        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3591            fidl::encoding::EmptyStruct,
3592            CapabilitiesError,
3593        >>(
3594            fidl::encoding::FlexibleResult::new(result),
3595            self.tx_id,
3596            0xac2bc2dbd7033d1,
3597            fidl::encoding::DynamicFlags::FLEXIBLE,
3598        )
3599    }
3600}
3601
3602#[must_use = "FIDL methods require a response to be sent"]
3603#[derive(Debug)]
3604pub struct CapabilitiesDirConnectorCreateResponder {
3605    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3606    tx_id: u32,
3607}
3608
3609/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3610/// if the responder is dropped without sending a response, so that the client
3611/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3612impl std::ops::Drop for CapabilitiesDirConnectorCreateResponder {
3613    fn drop(&mut self) {
3614        self.control_handle.shutdown();
3615        // Safety: drops once, never accessed again
3616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3617    }
3618}
3619
3620impl fidl::endpoints::Responder for CapabilitiesDirConnectorCreateResponder {
3621    type ControlHandle = CapabilitiesControlHandle;
3622
3623    fn control_handle(&self) -> &CapabilitiesControlHandle {
3624        &self.control_handle
3625    }
3626
3627    fn drop_without_shutdown(mut self) {
3628        // Safety: drops once, never accessed again due to mem::forget
3629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3630        // Prevent Drop from running (which would shut down the channel)
3631        std::mem::forget(self);
3632    }
3633}
3634
3635impl CapabilitiesDirConnectorCreateResponder {
3636    /// Sends a response to the FIDL transaction.
3637    ///
3638    /// Sets the channel to shutdown if an error occurs.
3639    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3640        let _result = self.send_raw(result);
3641        if _result.is_err() {
3642            self.control_handle.shutdown();
3643        }
3644        self.drop_without_shutdown();
3645        _result
3646    }
3647
3648    /// Similar to "send" but does not shutdown the channel if an error occurs.
3649    pub fn send_no_shutdown_on_err(
3650        self,
3651        mut result: Result<(), CapabilitiesError>,
3652    ) -> Result<(), fidl::Error> {
3653        let _result = self.send_raw(result);
3654        self.drop_without_shutdown();
3655        _result
3656    }
3657
3658    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3659        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3660            fidl::encoding::EmptyStruct,
3661            CapabilitiesError,
3662        >>(
3663            fidl::encoding::FlexibleResult::new(result),
3664            self.tx_id,
3665            0x721911e05da2a3bf,
3666            fidl::encoding::DynamicFlags::FLEXIBLE,
3667        )
3668    }
3669}
3670
3671#[must_use = "FIDL methods require a response to be sent"]
3672#[derive(Debug)]
3673pub struct CapabilitiesDictionaryCreateResponder {
3674    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3675    tx_id: u32,
3676}
3677
3678/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3679/// if the responder is dropped without sending a response, so that the client
3680/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3681impl std::ops::Drop for CapabilitiesDictionaryCreateResponder {
3682    fn drop(&mut self) {
3683        self.control_handle.shutdown();
3684        // Safety: drops once, never accessed again
3685        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3686    }
3687}
3688
3689impl fidl::endpoints::Responder for CapabilitiesDictionaryCreateResponder {
3690    type ControlHandle = CapabilitiesControlHandle;
3691
3692    fn control_handle(&self) -> &CapabilitiesControlHandle {
3693        &self.control_handle
3694    }
3695
3696    fn drop_without_shutdown(mut self) {
3697        // Safety: drops once, never accessed again due to mem::forget
3698        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3699        // Prevent Drop from running (which would shut down the channel)
3700        std::mem::forget(self);
3701    }
3702}
3703
3704impl CapabilitiesDictionaryCreateResponder {
3705    /// Sends a response to the FIDL transaction.
3706    ///
3707    /// Sets the channel to shutdown if an error occurs.
3708    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3709        let _result = self.send_raw(result);
3710        if _result.is_err() {
3711            self.control_handle.shutdown();
3712        }
3713        self.drop_without_shutdown();
3714        _result
3715    }
3716
3717    /// Similar to "send" but does not shutdown the channel if an error occurs.
3718    pub fn send_no_shutdown_on_err(
3719        self,
3720        mut result: Result<(), CapabilitiesError>,
3721    ) -> Result<(), fidl::Error> {
3722        let _result = self.send_raw(result);
3723        self.drop_without_shutdown();
3724        _result
3725    }
3726
3727    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3728        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3729            fidl::encoding::EmptyStruct,
3730            CapabilitiesError,
3731        >>(
3732            fidl::encoding::FlexibleResult::new(result),
3733            self.tx_id,
3734            0x7f8bd91f0942a36e,
3735            fidl::encoding::DynamicFlags::FLEXIBLE,
3736        )
3737    }
3738}
3739
3740#[must_use = "FIDL methods require a response to be sent"]
3741#[derive(Debug)]
3742pub struct CapabilitiesDataCreateResponder {
3743    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3744    tx_id: u32,
3745}
3746
3747/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3748/// if the responder is dropped without sending a response, so that the client
3749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3750impl std::ops::Drop for CapabilitiesDataCreateResponder {
3751    fn drop(&mut self) {
3752        self.control_handle.shutdown();
3753        // Safety: drops once, never accessed again
3754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3755    }
3756}
3757
3758impl fidl::endpoints::Responder for CapabilitiesDataCreateResponder {
3759    type ControlHandle = CapabilitiesControlHandle;
3760
3761    fn control_handle(&self) -> &CapabilitiesControlHandle {
3762        &self.control_handle
3763    }
3764
3765    fn drop_without_shutdown(mut self) {
3766        // Safety: drops once, never accessed again due to mem::forget
3767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3768        // Prevent Drop from running (which would shut down the channel)
3769        std::mem::forget(self);
3770    }
3771}
3772
3773impl CapabilitiesDataCreateResponder {
3774    /// Sends a response to the FIDL transaction.
3775    ///
3776    /// Sets the channel to shutdown if an error occurs.
3777    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3778        let _result = self.send_raw(result);
3779        if _result.is_err() {
3780            self.control_handle.shutdown();
3781        }
3782        self.drop_without_shutdown();
3783        _result
3784    }
3785
3786    /// Similar to "send" but does not shutdown the channel if an error occurs.
3787    pub fn send_no_shutdown_on_err(
3788        self,
3789        mut result: Result<(), CapabilitiesError>,
3790    ) -> Result<(), fidl::Error> {
3791        let _result = self.send_raw(result);
3792        self.drop_without_shutdown();
3793        _result
3794    }
3795
3796    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3797        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3798            fidl::encoding::EmptyStruct,
3799            CapabilitiesError,
3800        >>(
3801            fidl::encoding::FlexibleResult::new(result),
3802            self.tx_id,
3803            0x40ef43e45372ee6a,
3804            fidl::encoding::DynamicFlags::FLEXIBLE,
3805        )
3806    }
3807}
3808
3809#[must_use = "FIDL methods require a response to be sent"]
3810#[derive(Debug)]
3811pub struct CapabilitiesConnectorRouterCreateResponder {
3812    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3813    tx_id: u32,
3814}
3815
3816/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3817/// if the responder is dropped without sending a response, so that the client
3818/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3819impl std::ops::Drop for CapabilitiesConnectorRouterCreateResponder {
3820    fn drop(&mut self) {
3821        self.control_handle.shutdown();
3822        // Safety: drops once, never accessed again
3823        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3824    }
3825}
3826
3827impl fidl::endpoints::Responder for CapabilitiesConnectorRouterCreateResponder {
3828    type ControlHandle = CapabilitiesControlHandle;
3829
3830    fn control_handle(&self) -> &CapabilitiesControlHandle {
3831        &self.control_handle
3832    }
3833
3834    fn drop_without_shutdown(mut self) {
3835        // Safety: drops once, never accessed again due to mem::forget
3836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3837        // Prevent Drop from running (which would shut down the channel)
3838        std::mem::forget(self);
3839    }
3840}
3841
3842impl CapabilitiesConnectorRouterCreateResponder {
3843    /// Sends a response to the FIDL transaction.
3844    ///
3845    /// Sets the channel to shutdown if an error occurs.
3846    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3847        let _result = self.send_raw(result);
3848        if _result.is_err() {
3849            self.control_handle.shutdown();
3850        }
3851        self.drop_without_shutdown();
3852        _result
3853    }
3854
3855    /// Similar to "send" but does not shutdown the channel if an error occurs.
3856    pub fn send_no_shutdown_on_err(
3857        self,
3858        mut result: Result<(), CapabilitiesError>,
3859    ) -> Result<(), fidl::Error> {
3860        let _result = self.send_raw(result);
3861        self.drop_without_shutdown();
3862        _result
3863    }
3864
3865    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3866        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3867            fidl::encoding::EmptyStruct,
3868            CapabilitiesError,
3869        >>(
3870            fidl::encoding::FlexibleResult::new(result),
3871            self.tx_id,
3872            0x7f7e7fbafcdf1761,
3873            fidl::encoding::DynamicFlags::FLEXIBLE,
3874        )
3875    }
3876}
3877
3878#[must_use = "FIDL methods require a response to be sent"]
3879#[derive(Debug)]
3880pub struct CapabilitiesDirConnectorRouterCreateResponder {
3881    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3882    tx_id: u32,
3883}
3884
3885/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3886/// if the responder is dropped without sending a response, so that the client
3887/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3888impl std::ops::Drop for CapabilitiesDirConnectorRouterCreateResponder {
3889    fn drop(&mut self) {
3890        self.control_handle.shutdown();
3891        // Safety: drops once, never accessed again
3892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3893    }
3894}
3895
3896impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterCreateResponder {
3897    type ControlHandle = CapabilitiesControlHandle;
3898
3899    fn control_handle(&self) -> &CapabilitiesControlHandle {
3900        &self.control_handle
3901    }
3902
3903    fn drop_without_shutdown(mut self) {
3904        // Safety: drops once, never accessed again due to mem::forget
3905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3906        // Prevent Drop from running (which would shut down the channel)
3907        std::mem::forget(self);
3908    }
3909}
3910
3911impl CapabilitiesDirConnectorRouterCreateResponder {
3912    /// Sends a response to the FIDL transaction.
3913    ///
3914    /// Sets the channel to shutdown if an error occurs.
3915    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3916        let _result = self.send_raw(result);
3917        if _result.is_err() {
3918            self.control_handle.shutdown();
3919        }
3920        self.drop_without_shutdown();
3921        _result
3922    }
3923
3924    /// Similar to "send" but does not shutdown the channel if an error occurs.
3925    pub fn send_no_shutdown_on_err(
3926        self,
3927        mut result: Result<(), CapabilitiesError>,
3928    ) -> Result<(), fidl::Error> {
3929        let _result = self.send_raw(result);
3930        self.drop_without_shutdown();
3931        _result
3932    }
3933
3934    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3935        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3936            fidl::encoding::EmptyStruct,
3937            CapabilitiesError,
3938        >>(
3939            fidl::encoding::FlexibleResult::new(result),
3940            self.tx_id,
3941            0x56520da453fad19f,
3942            fidl::encoding::DynamicFlags::FLEXIBLE,
3943        )
3944    }
3945}
3946
3947#[must_use = "FIDL methods require a response to be sent"]
3948#[derive(Debug)]
3949pub struct CapabilitiesDictionaryRouterCreateResponder {
3950    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3951    tx_id: u32,
3952}
3953
3954/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3955/// if the responder is dropped without sending a response, so that the client
3956/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3957impl std::ops::Drop for CapabilitiesDictionaryRouterCreateResponder {
3958    fn drop(&mut self) {
3959        self.control_handle.shutdown();
3960        // Safety: drops once, never accessed again
3961        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3962    }
3963}
3964
3965impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterCreateResponder {
3966    type ControlHandle = CapabilitiesControlHandle;
3967
3968    fn control_handle(&self) -> &CapabilitiesControlHandle {
3969        &self.control_handle
3970    }
3971
3972    fn drop_without_shutdown(mut self) {
3973        // Safety: drops once, never accessed again due to mem::forget
3974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3975        // Prevent Drop from running (which would shut down the channel)
3976        std::mem::forget(self);
3977    }
3978}
3979
3980impl CapabilitiesDictionaryRouterCreateResponder {
3981    /// Sends a response to the FIDL transaction.
3982    ///
3983    /// Sets the channel to shutdown if an error occurs.
3984    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3985        let _result = self.send_raw(result);
3986        if _result.is_err() {
3987            self.control_handle.shutdown();
3988        }
3989        self.drop_without_shutdown();
3990        _result
3991    }
3992
3993    /// Similar to "send" but does not shutdown the channel if an error occurs.
3994    pub fn send_no_shutdown_on_err(
3995        self,
3996        mut result: Result<(), CapabilitiesError>,
3997    ) -> Result<(), fidl::Error> {
3998        let _result = self.send_raw(result);
3999        self.drop_without_shutdown();
4000        _result
4001    }
4002
4003    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4004        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4005            fidl::encoding::EmptyStruct,
4006            CapabilitiesError,
4007        >>(
4008            fidl::encoding::FlexibleResult::new(result),
4009            self.tx_id,
4010            0x37acef18cd423d42,
4011            fidl::encoding::DynamicFlags::FLEXIBLE,
4012        )
4013    }
4014}
4015
4016#[must_use = "FIDL methods require a response to be sent"]
4017#[derive(Debug)]
4018pub struct CapabilitiesDataRouterCreateResponder {
4019    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4020    tx_id: u32,
4021}
4022
4023/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4024/// if the responder is dropped without sending a response, so that the client
4025/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4026impl std::ops::Drop for CapabilitiesDataRouterCreateResponder {
4027    fn drop(&mut self) {
4028        self.control_handle.shutdown();
4029        // Safety: drops once, never accessed again
4030        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4031    }
4032}
4033
4034impl fidl::endpoints::Responder for CapabilitiesDataRouterCreateResponder {
4035    type ControlHandle = CapabilitiesControlHandle;
4036
4037    fn control_handle(&self) -> &CapabilitiesControlHandle {
4038        &self.control_handle
4039    }
4040
4041    fn drop_without_shutdown(mut self) {
4042        // Safety: drops once, never accessed again due to mem::forget
4043        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4044        // Prevent Drop from running (which would shut down the channel)
4045        std::mem::forget(self);
4046    }
4047}
4048
4049impl CapabilitiesDataRouterCreateResponder {
4050    /// Sends a response to the FIDL transaction.
4051    ///
4052    /// Sets the channel to shutdown if an error occurs.
4053    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4054        let _result = self.send_raw(result);
4055        if _result.is_err() {
4056            self.control_handle.shutdown();
4057        }
4058        self.drop_without_shutdown();
4059        _result
4060    }
4061
4062    /// Similar to "send" but does not shutdown the channel if an error occurs.
4063    pub fn send_no_shutdown_on_err(
4064        self,
4065        mut result: Result<(), CapabilitiesError>,
4066    ) -> Result<(), fidl::Error> {
4067        let _result = self.send_raw(result);
4068        self.drop_without_shutdown();
4069        _result
4070    }
4071
4072    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4073        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4074            fidl::encoding::EmptyStruct,
4075            CapabilitiesError,
4076        >>(
4077            fidl::encoding::FlexibleResult::new(result),
4078            self.tx_id,
4079            0x24e471395b95088,
4080            fidl::encoding::DynamicFlags::FLEXIBLE,
4081        )
4082    }
4083}
4084
4085#[must_use = "FIDL methods require a response to be sent"]
4086#[derive(Debug)]
4087pub struct CapabilitiesInstanceTokenCreateResponder {
4088    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4089    tx_id: u32,
4090}
4091
4092/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4093/// if the responder is dropped without sending a response, so that the client
4094/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4095impl std::ops::Drop for CapabilitiesInstanceTokenCreateResponder {
4096    fn drop(&mut self) {
4097        self.control_handle.shutdown();
4098        // Safety: drops once, never accessed again
4099        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4100    }
4101}
4102
4103impl fidl::endpoints::Responder for CapabilitiesInstanceTokenCreateResponder {
4104    type ControlHandle = CapabilitiesControlHandle;
4105
4106    fn control_handle(&self) -> &CapabilitiesControlHandle {
4107        &self.control_handle
4108    }
4109
4110    fn drop_without_shutdown(mut self) {
4111        // Safety: drops once, never accessed again due to mem::forget
4112        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4113        // Prevent Drop from running (which would shut down the channel)
4114        std::mem::forget(self);
4115    }
4116}
4117
4118impl CapabilitiesInstanceTokenCreateResponder {
4119    /// Sends a response to the FIDL transaction.
4120    ///
4121    /// Sets the channel to shutdown if an error occurs.
4122    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4123        let _result = self.send_raw(result);
4124        if _result.is_err() {
4125            self.control_handle.shutdown();
4126        }
4127        self.drop_without_shutdown();
4128        _result
4129    }
4130
4131    /// Similar to "send" but does not shutdown the channel if an error occurs.
4132    pub fn send_no_shutdown_on_err(
4133        self,
4134        mut result: Result<(), CapabilitiesError>,
4135    ) -> Result<(), fidl::Error> {
4136        let _result = self.send_raw(result);
4137        self.drop_without_shutdown();
4138        _result
4139    }
4140
4141    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4142        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4143            fidl::encoding::EmptyStruct,
4144            CapabilitiesError,
4145        >>(
4146            fidl::encoding::FlexibleResult::new(result),
4147            self.tx_id,
4148            0x3576e31727c40813,
4149            fidl::encoding::DynamicFlags::FLEXIBLE,
4150        )
4151    }
4152}
4153
4154#[must_use = "FIDL methods require a response to be sent"]
4155#[derive(Debug)]
4156pub struct CapabilitiesConnectorOpenResponder {
4157    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4158    tx_id: u32,
4159}
4160
4161/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4162/// if the responder is dropped without sending a response, so that the client
4163/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4164impl std::ops::Drop for CapabilitiesConnectorOpenResponder {
4165    fn drop(&mut self) {
4166        self.control_handle.shutdown();
4167        // Safety: drops once, never accessed again
4168        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4169    }
4170}
4171
4172impl fidl::endpoints::Responder for CapabilitiesConnectorOpenResponder {
4173    type ControlHandle = CapabilitiesControlHandle;
4174
4175    fn control_handle(&self) -> &CapabilitiesControlHandle {
4176        &self.control_handle
4177    }
4178
4179    fn drop_without_shutdown(mut self) {
4180        // Safety: drops once, never accessed again due to mem::forget
4181        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4182        // Prevent Drop from running (which would shut down the channel)
4183        std::mem::forget(self);
4184    }
4185}
4186
4187impl CapabilitiesConnectorOpenResponder {
4188    /// Sends a response to the FIDL transaction.
4189    ///
4190    /// Sets the channel to shutdown if an error occurs.
4191    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4192        let _result = self.send_raw(result);
4193        if _result.is_err() {
4194            self.control_handle.shutdown();
4195        }
4196        self.drop_without_shutdown();
4197        _result
4198    }
4199
4200    /// Similar to "send" but does not shutdown the channel if an error occurs.
4201    pub fn send_no_shutdown_on_err(
4202        self,
4203        mut result: Result<(), CapabilitiesError>,
4204    ) -> Result<(), fidl::Error> {
4205        let _result = self.send_raw(result);
4206        self.drop_without_shutdown();
4207        _result
4208    }
4209
4210    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4211        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4212            fidl::encoding::EmptyStruct,
4213            CapabilitiesError,
4214        >>(
4215            fidl::encoding::FlexibleResult::new(result),
4216            self.tx_id,
4217            0xc0646965f1884eb,
4218            fidl::encoding::DynamicFlags::FLEXIBLE,
4219        )
4220    }
4221}
4222
4223#[must_use = "FIDL methods require a response to be sent"]
4224#[derive(Debug)]
4225pub struct CapabilitiesDirConnectorOpenResponder {
4226    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4227    tx_id: u32,
4228}
4229
4230/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4231/// if the responder is dropped without sending a response, so that the client
4232/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4233impl std::ops::Drop for CapabilitiesDirConnectorOpenResponder {
4234    fn drop(&mut self) {
4235        self.control_handle.shutdown();
4236        // Safety: drops once, never accessed again
4237        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4238    }
4239}
4240
4241impl fidl::endpoints::Responder for CapabilitiesDirConnectorOpenResponder {
4242    type ControlHandle = CapabilitiesControlHandle;
4243
4244    fn control_handle(&self) -> &CapabilitiesControlHandle {
4245        &self.control_handle
4246    }
4247
4248    fn drop_without_shutdown(mut self) {
4249        // Safety: drops once, never accessed again due to mem::forget
4250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4251        // Prevent Drop from running (which would shut down the channel)
4252        std::mem::forget(self);
4253    }
4254}
4255
4256impl CapabilitiesDirConnectorOpenResponder {
4257    /// Sends a response to the FIDL transaction.
4258    ///
4259    /// Sets the channel to shutdown if an error occurs.
4260    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4261        let _result = self.send_raw(result);
4262        if _result.is_err() {
4263            self.control_handle.shutdown();
4264        }
4265        self.drop_without_shutdown();
4266        _result
4267    }
4268
4269    /// Similar to "send" but does not shutdown the channel if an error occurs.
4270    pub fn send_no_shutdown_on_err(
4271        self,
4272        mut result: Result<(), CapabilitiesError>,
4273    ) -> Result<(), fidl::Error> {
4274        let _result = self.send_raw(result);
4275        self.drop_without_shutdown();
4276        _result
4277    }
4278
4279    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4280        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4281            fidl::encoding::EmptyStruct,
4282            CapabilitiesError,
4283        >>(
4284            fidl::encoding::FlexibleResult::new(result),
4285            self.tx_id,
4286            0x1332bbf5debd6c20,
4287            fidl::encoding::DynamicFlags::FLEXIBLE,
4288        )
4289    }
4290}
4291
4292#[must_use = "FIDL methods require a response to be sent"]
4293#[derive(Debug)]
4294pub struct CapabilitiesDictionaryInsertResponder {
4295    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4296    tx_id: u32,
4297}
4298
4299/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4300/// if the responder is dropped without sending a response, so that the client
4301/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4302impl std::ops::Drop for CapabilitiesDictionaryInsertResponder {
4303    fn drop(&mut self) {
4304        self.control_handle.shutdown();
4305        // Safety: drops once, never accessed again
4306        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4307    }
4308}
4309
4310impl fidl::endpoints::Responder for CapabilitiesDictionaryInsertResponder {
4311    type ControlHandle = CapabilitiesControlHandle;
4312
4313    fn control_handle(&self) -> &CapabilitiesControlHandle {
4314        &self.control_handle
4315    }
4316
4317    fn drop_without_shutdown(mut self) {
4318        // Safety: drops once, never accessed again due to mem::forget
4319        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4320        // Prevent Drop from running (which would shut down the channel)
4321        std::mem::forget(self);
4322    }
4323}
4324
4325impl CapabilitiesDictionaryInsertResponder {
4326    /// Sends a response to the FIDL transaction.
4327    ///
4328    /// Sets the channel to shutdown if an error occurs.
4329    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4330        let _result = self.send_raw(result);
4331        if _result.is_err() {
4332            self.control_handle.shutdown();
4333        }
4334        self.drop_without_shutdown();
4335        _result
4336    }
4337
4338    /// Similar to "send" but does not shutdown the channel if an error occurs.
4339    pub fn send_no_shutdown_on_err(
4340        self,
4341        mut result: Result<(), CapabilitiesError>,
4342    ) -> Result<(), fidl::Error> {
4343        let _result = self.send_raw(result);
4344        self.drop_without_shutdown();
4345        _result
4346    }
4347
4348    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4349        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4350            fidl::encoding::EmptyStruct,
4351            CapabilitiesError,
4352        >>(
4353            fidl::encoding::FlexibleResult::new(result),
4354            self.tx_id,
4355            0x5972e3061a760e7a,
4356            fidl::encoding::DynamicFlags::FLEXIBLE,
4357        )
4358    }
4359}
4360
4361#[must_use = "FIDL methods require a response to be sent"]
4362#[derive(Debug)]
4363pub struct CapabilitiesDictionaryGetResponder {
4364    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4365    tx_id: u32,
4366}
4367
4368/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4369/// if the responder is dropped without sending a response, so that the client
4370/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4371impl std::ops::Drop for CapabilitiesDictionaryGetResponder {
4372    fn drop(&mut self) {
4373        self.control_handle.shutdown();
4374        // Safety: drops once, never accessed again
4375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4376    }
4377}
4378
4379impl fidl::endpoints::Responder for CapabilitiesDictionaryGetResponder {
4380    type ControlHandle = CapabilitiesControlHandle;
4381
4382    fn control_handle(&self) -> &CapabilitiesControlHandle {
4383        &self.control_handle
4384    }
4385
4386    fn drop_without_shutdown(mut self) {
4387        // Safety: drops once, never accessed again due to mem::forget
4388        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4389        // Prevent Drop from running (which would shut down the channel)
4390        std::mem::forget(self);
4391    }
4392}
4393
4394impl CapabilitiesDictionaryGetResponder {
4395    /// Sends a response to the FIDL transaction.
4396    ///
4397    /// Sets the channel to shutdown if an error occurs.
4398    pub fn send(
4399        self,
4400        mut result: Result<CapabilityType, CapabilitiesError>,
4401    ) -> Result<(), fidl::Error> {
4402        let _result = self.send_raw(result);
4403        if _result.is_err() {
4404            self.control_handle.shutdown();
4405        }
4406        self.drop_without_shutdown();
4407        _result
4408    }
4409
4410    /// Similar to "send" but does not shutdown the channel if an error occurs.
4411    pub fn send_no_shutdown_on_err(
4412        self,
4413        mut result: Result<CapabilityType, CapabilitiesError>,
4414    ) -> Result<(), fidl::Error> {
4415        let _result = self.send_raw(result);
4416        self.drop_without_shutdown();
4417        _result
4418    }
4419
4420    fn send_raw(
4421        &self,
4422        mut result: Result<CapabilityType, CapabilitiesError>,
4423    ) -> Result<(), fidl::Error> {
4424        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4425            CapabilitiesDictionaryGetResponse,
4426            CapabilitiesError,
4427        >>(
4428            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4429            self.tx_id,
4430            0x31fafe2280a283d5,
4431            fidl::encoding::DynamicFlags::FLEXIBLE,
4432        )
4433    }
4434}
4435
4436#[must_use = "FIDL methods require a response to be sent"]
4437#[derive(Debug)]
4438pub struct CapabilitiesDictionaryRemoveResponder {
4439    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4440    tx_id: u32,
4441}
4442
4443/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4444/// if the responder is dropped without sending a response, so that the client
4445/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4446impl std::ops::Drop for CapabilitiesDictionaryRemoveResponder {
4447    fn drop(&mut self) {
4448        self.control_handle.shutdown();
4449        // Safety: drops once, never accessed again
4450        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4451    }
4452}
4453
4454impl fidl::endpoints::Responder for CapabilitiesDictionaryRemoveResponder {
4455    type ControlHandle = CapabilitiesControlHandle;
4456
4457    fn control_handle(&self) -> &CapabilitiesControlHandle {
4458        &self.control_handle
4459    }
4460
4461    fn drop_without_shutdown(mut self) {
4462        // Safety: drops once, never accessed again due to mem::forget
4463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4464        // Prevent Drop from running (which would shut down the channel)
4465        std::mem::forget(self);
4466    }
4467}
4468
4469impl CapabilitiesDictionaryRemoveResponder {
4470    /// Sends a response to the FIDL transaction.
4471    ///
4472    /// Sets the channel to shutdown if an error occurs.
4473    pub fn send(
4474        self,
4475        mut result: Result<CapabilityType, CapabilitiesError>,
4476    ) -> Result<(), fidl::Error> {
4477        let _result = self.send_raw(result);
4478        if _result.is_err() {
4479            self.control_handle.shutdown();
4480        }
4481        self.drop_without_shutdown();
4482        _result
4483    }
4484
4485    /// Similar to "send" but does not shutdown the channel if an error occurs.
4486    pub fn send_no_shutdown_on_err(
4487        self,
4488        mut result: Result<CapabilityType, CapabilitiesError>,
4489    ) -> Result<(), fidl::Error> {
4490        let _result = self.send_raw(result);
4491        self.drop_without_shutdown();
4492        _result
4493    }
4494
4495    fn send_raw(
4496        &self,
4497        mut result: Result<CapabilityType, CapabilitiesError>,
4498    ) -> Result<(), fidl::Error> {
4499        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4500            CapabilitiesDictionaryRemoveResponse,
4501            CapabilitiesError,
4502        >>(
4503            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4504            self.tx_id,
4505            0x6827c83106ac5a2c,
4506            fidl::encoding::DynamicFlags::FLEXIBLE,
4507        )
4508    }
4509}
4510
4511#[must_use = "FIDL methods require a response to be sent"]
4512#[derive(Debug)]
4513pub struct CapabilitiesDictionaryIterateKeysResponder {
4514    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4515    tx_id: u32,
4516}
4517
4518/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4519/// if the responder is dropped without sending a response, so that the client
4520/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4521impl std::ops::Drop for CapabilitiesDictionaryIterateKeysResponder {
4522    fn drop(&mut self) {
4523        self.control_handle.shutdown();
4524        // Safety: drops once, never accessed again
4525        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4526    }
4527}
4528
4529impl fidl::endpoints::Responder for CapabilitiesDictionaryIterateKeysResponder {
4530    type ControlHandle = CapabilitiesControlHandle;
4531
4532    fn control_handle(&self) -> &CapabilitiesControlHandle {
4533        &self.control_handle
4534    }
4535
4536    fn drop_without_shutdown(mut self) {
4537        // Safety: drops once, never accessed again due to mem::forget
4538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4539        // Prevent Drop from running (which would shut down the channel)
4540        std::mem::forget(self);
4541    }
4542}
4543
4544impl CapabilitiesDictionaryIterateKeysResponder {
4545    /// Sends a response to the FIDL transaction.
4546    ///
4547    /// Sets the channel to shutdown if an error occurs.
4548    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4549        let _result = self.send_raw(result);
4550        if _result.is_err() {
4551            self.control_handle.shutdown();
4552        }
4553        self.drop_without_shutdown();
4554        _result
4555    }
4556
4557    /// Similar to "send" but does not shutdown the channel if an error occurs.
4558    pub fn send_no_shutdown_on_err(
4559        self,
4560        mut result: Result<(), CapabilitiesError>,
4561    ) -> Result<(), fidl::Error> {
4562        let _result = self.send_raw(result);
4563        self.drop_without_shutdown();
4564        _result
4565    }
4566
4567    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4568        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4569            fidl::encoding::EmptyStruct,
4570            CapabilitiesError,
4571        >>(
4572            fidl::encoding::FlexibleResult::new(result),
4573            self.tx_id,
4574            0x3d4ea59c80df9bb8,
4575            fidl::encoding::DynamicFlags::FLEXIBLE,
4576        )
4577    }
4578}
4579
4580#[must_use = "FIDL methods require a response to be sent"]
4581#[derive(Debug)]
4582pub struct CapabilitiesDataGetResponder {
4583    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4584    tx_id: u32,
4585}
4586
4587/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4588/// if the responder is dropped without sending a response, so that the client
4589/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4590impl std::ops::Drop for CapabilitiesDataGetResponder {
4591    fn drop(&mut self) {
4592        self.control_handle.shutdown();
4593        // Safety: drops once, never accessed again
4594        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4595    }
4596}
4597
4598impl fidl::endpoints::Responder for CapabilitiesDataGetResponder {
4599    type ControlHandle = CapabilitiesControlHandle;
4600
4601    fn control_handle(&self) -> &CapabilitiesControlHandle {
4602        &self.control_handle
4603    }
4604
4605    fn drop_without_shutdown(mut self) {
4606        // Safety: drops once, never accessed again due to mem::forget
4607        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4608        // Prevent Drop from running (which would shut down the channel)
4609        std::mem::forget(self);
4610    }
4611}
4612
4613impl CapabilitiesDataGetResponder {
4614    /// Sends a response to the FIDL transaction.
4615    ///
4616    /// Sets the channel to shutdown if an error occurs.
4617    pub fn send(self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4618        let _result = self.send_raw(result);
4619        if _result.is_err() {
4620            self.control_handle.shutdown();
4621        }
4622        self.drop_without_shutdown();
4623        _result
4624    }
4625
4626    /// Similar to "send" but does not shutdown the channel if an error occurs.
4627    pub fn send_no_shutdown_on_err(
4628        self,
4629        mut result: Result<&Data, CapabilitiesError>,
4630    ) -> Result<(), fidl::Error> {
4631        let _result = self.send_raw(result);
4632        self.drop_without_shutdown();
4633        _result
4634    }
4635
4636    fn send_raw(&self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4637        self.control_handle
4638            .inner
4639            .send::<fidl::encoding::FlexibleResultType<Data, CapabilitiesError>>(
4640                fidl::encoding::FlexibleResult::new(result),
4641                self.tx_id,
4642                0x65ae25b59f9e0daf,
4643                fidl::encoding::DynamicFlags::FLEXIBLE,
4644            )
4645    }
4646}
4647
4648#[must_use = "FIDL methods require a response to be sent"]
4649#[derive(Debug)]
4650pub struct CapabilitiesConnectorRouterRouteResponder {
4651    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4652    tx_id: u32,
4653}
4654
4655/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4656/// if the responder is dropped without sending a response, so that the client
4657/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4658impl std::ops::Drop for CapabilitiesConnectorRouterRouteResponder {
4659    fn drop(&mut self) {
4660        self.control_handle.shutdown();
4661        // Safety: drops once, never accessed again
4662        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4663    }
4664}
4665
4666impl fidl::endpoints::Responder for CapabilitiesConnectorRouterRouteResponder {
4667    type ControlHandle = CapabilitiesControlHandle;
4668
4669    fn control_handle(&self) -> &CapabilitiesControlHandle {
4670        &self.control_handle
4671    }
4672
4673    fn drop_without_shutdown(mut self) {
4674        // Safety: drops once, never accessed again due to mem::forget
4675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4676        // Prevent Drop from running (which would shut down the channel)
4677        std::mem::forget(self);
4678    }
4679}
4680
4681impl CapabilitiesConnectorRouterRouteResponder {
4682    /// Sends a response to the FIDL transaction.
4683    ///
4684    /// Sets the channel to shutdown if an error occurs.
4685    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4686        let _result = self.send_raw(result);
4687        if _result.is_err() {
4688            self.control_handle.shutdown();
4689        }
4690        self.drop_without_shutdown();
4691        _result
4692    }
4693
4694    /// Similar to "send" but does not shutdown the channel if an error occurs.
4695    pub fn send_no_shutdown_on_err(
4696        self,
4697        mut result: Result<RouterResponse, i32>,
4698    ) -> Result<(), fidl::Error> {
4699        let _result = self.send_raw(result);
4700        self.drop_without_shutdown();
4701        _result
4702    }
4703
4704    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4705        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4706            CapabilitiesConnectorRouterRouteResponse,
4707            i32,
4708        >>(
4709            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4710            self.tx_id,
4711            0x1bd9c6e7e3dd487e,
4712            fidl::encoding::DynamicFlags::FLEXIBLE,
4713        )
4714    }
4715}
4716
4717#[must_use = "FIDL methods require a response to be sent"]
4718#[derive(Debug)]
4719pub struct CapabilitiesDirConnectorRouterRouteResponder {
4720    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4721    tx_id: u32,
4722}
4723
4724/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4725/// if the responder is dropped without sending a response, so that the client
4726/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4727impl std::ops::Drop for CapabilitiesDirConnectorRouterRouteResponder {
4728    fn drop(&mut self) {
4729        self.control_handle.shutdown();
4730        // Safety: drops once, never accessed again
4731        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4732    }
4733}
4734
4735impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterRouteResponder {
4736    type ControlHandle = CapabilitiesControlHandle;
4737
4738    fn control_handle(&self) -> &CapabilitiesControlHandle {
4739        &self.control_handle
4740    }
4741
4742    fn drop_without_shutdown(mut self) {
4743        // Safety: drops once, never accessed again due to mem::forget
4744        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4745        // Prevent Drop from running (which would shut down the channel)
4746        std::mem::forget(self);
4747    }
4748}
4749
4750impl CapabilitiesDirConnectorRouterRouteResponder {
4751    /// Sends a response to the FIDL transaction.
4752    ///
4753    /// Sets the channel to shutdown if an error occurs.
4754    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4755        let _result = self.send_raw(result);
4756        if _result.is_err() {
4757            self.control_handle.shutdown();
4758        }
4759        self.drop_without_shutdown();
4760        _result
4761    }
4762
4763    /// Similar to "send" but does not shutdown the channel if an error occurs.
4764    pub fn send_no_shutdown_on_err(
4765        self,
4766        mut result: Result<RouterResponse, i32>,
4767    ) -> Result<(), fidl::Error> {
4768        let _result = self.send_raw(result);
4769        self.drop_without_shutdown();
4770        _result
4771    }
4772
4773    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4774        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4775            CapabilitiesDirConnectorRouterRouteResponse,
4776            i32,
4777        >>(
4778            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4779            self.tx_id,
4780            0x3afdcc1b79e0799d,
4781            fidl::encoding::DynamicFlags::FLEXIBLE,
4782        )
4783    }
4784}
4785
4786#[must_use = "FIDL methods require a response to be sent"]
4787#[derive(Debug)]
4788pub struct CapabilitiesDictionaryRouterRouteResponder {
4789    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4790    tx_id: u32,
4791}
4792
4793/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4794/// if the responder is dropped without sending a response, so that the client
4795/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4796impl std::ops::Drop for CapabilitiesDictionaryRouterRouteResponder {
4797    fn drop(&mut self) {
4798        self.control_handle.shutdown();
4799        // Safety: drops once, never accessed again
4800        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4801    }
4802}
4803
4804impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterRouteResponder {
4805    type ControlHandle = CapabilitiesControlHandle;
4806
4807    fn control_handle(&self) -> &CapabilitiesControlHandle {
4808        &self.control_handle
4809    }
4810
4811    fn drop_without_shutdown(mut self) {
4812        // Safety: drops once, never accessed again due to mem::forget
4813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4814        // Prevent Drop from running (which would shut down the channel)
4815        std::mem::forget(self);
4816    }
4817}
4818
4819impl CapabilitiesDictionaryRouterRouteResponder {
4820    /// Sends a response to the FIDL transaction.
4821    ///
4822    /// Sets the channel to shutdown if an error occurs.
4823    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4824        let _result = self.send_raw(result);
4825        if _result.is_err() {
4826            self.control_handle.shutdown();
4827        }
4828        self.drop_without_shutdown();
4829        _result
4830    }
4831
4832    /// Similar to "send" but does not shutdown the channel if an error occurs.
4833    pub fn send_no_shutdown_on_err(
4834        self,
4835        mut result: Result<RouterResponse, i32>,
4836    ) -> Result<(), fidl::Error> {
4837        let _result = self.send_raw(result);
4838        self.drop_without_shutdown();
4839        _result
4840    }
4841
4842    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4843        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4844            CapabilitiesDictionaryRouterRouteResponse,
4845            i32,
4846        >>(
4847            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4848            self.tx_id,
4849            0xcf72de10714a708,
4850            fidl::encoding::DynamicFlags::FLEXIBLE,
4851        )
4852    }
4853}
4854
4855#[must_use = "FIDL methods require a response to be sent"]
4856#[derive(Debug)]
4857pub struct CapabilitiesDataRouterRouteResponder {
4858    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4859    tx_id: u32,
4860}
4861
4862/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4863/// if the responder is dropped without sending a response, so that the client
4864/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4865impl std::ops::Drop for CapabilitiesDataRouterRouteResponder {
4866    fn drop(&mut self) {
4867        self.control_handle.shutdown();
4868        // Safety: drops once, never accessed again
4869        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4870    }
4871}
4872
4873impl fidl::endpoints::Responder for CapabilitiesDataRouterRouteResponder {
4874    type ControlHandle = CapabilitiesControlHandle;
4875
4876    fn control_handle(&self) -> &CapabilitiesControlHandle {
4877        &self.control_handle
4878    }
4879
4880    fn drop_without_shutdown(mut self) {
4881        // Safety: drops once, never accessed again due to mem::forget
4882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4883        // Prevent Drop from running (which would shut down the channel)
4884        std::mem::forget(self);
4885    }
4886}
4887
4888impl CapabilitiesDataRouterRouteResponder {
4889    /// Sends a response to the FIDL transaction.
4890    ///
4891    /// Sets the channel to shutdown if an error occurs.
4892    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4893        let _result = self.send_raw(result);
4894        if _result.is_err() {
4895            self.control_handle.shutdown();
4896        }
4897        self.drop_without_shutdown();
4898        _result
4899    }
4900
4901    /// Similar to "send" but does not shutdown the channel if an error occurs.
4902    pub fn send_no_shutdown_on_err(
4903        self,
4904        mut result: Result<RouterResponse, i32>,
4905    ) -> Result<(), fidl::Error> {
4906        let _result = self.send_raw(result);
4907        self.drop_without_shutdown();
4908        _result
4909    }
4910
4911    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4912        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4913            CapabilitiesDataRouterRouteResponse,
4914            i32,
4915        >>(
4916            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4917            self.tx_id,
4918            0x61ab188455ed0643,
4919            fidl::encoding::DynamicFlags::FLEXIBLE,
4920        )
4921    }
4922}
4923
4924#[must_use = "FIDL methods require a response to be sent"]
4925#[derive(Debug)]
4926pub struct CapabilitiesCapabilityAssociateHandleResponder {
4927    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4928    tx_id: u32,
4929}
4930
4931/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4932/// if the responder is dropped without sending a response, so that the client
4933/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4934impl std::ops::Drop for CapabilitiesCapabilityAssociateHandleResponder {
4935    fn drop(&mut self) {
4936        self.control_handle.shutdown();
4937        // Safety: drops once, never accessed again
4938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4939    }
4940}
4941
4942impl fidl::endpoints::Responder for CapabilitiesCapabilityAssociateHandleResponder {
4943    type ControlHandle = CapabilitiesControlHandle;
4944
4945    fn control_handle(&self) -> &CapabilitiesControlHandle {
4946        &self.control_handle
4947    }
4948
4949    fn drop_without_shutdown(mut self) {
4950        // Safety: drops once, never accessed again due to mem::forget
4951        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4952        // Prevent Drop from running (which would shut down the channel)
4953        std::mem::forget(self);
4954    }
4955}
4956
4957impl CapabilitiesCapabilityAssociateHandleResponder {
4958    /// Sends a response to the FIDL transaction.
4959    ///
4960    /// Sets the channel to shutdown if an error occurs.
4961    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4962        let _result = self.send_raw(result);
4963        if _result.is_err() {
4964            self.control_handle.shutdown();
4965        }
4966        self.drop_without_shutdown();
4967        _result
4968    }
4969
4970    /// Similar to "send" but does not shutdown the channel if an error occurs.
4971    pub fn send_no_shutdown_on_err(
4972        self,
4973        mut result: Result<(), CapabilitiesError>,
4974    ) -> Result<(), fidl::Error> {
4975        let _result = self.send_raw(result);
4976        self.drop_without_shutdown();
4977        _result
4978    }
4979
4980    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4981        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4982            fidl::encoding::EmptyStruct,
4983            CapabilitiesError,
4984        >>(
4985            fidl::encoding::FlexibleResult::new(result),
4986            self.tx_id,
4987            0x1d69bb61953d8e7,
4988            fidl::encoding::DynamicFlags::FLEXIBLE,
4989        )
4990    }
4991}
4992
4993#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4994pub struct ConnectorRouterMarker;
4995
4996impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4997    type Proxy = ConnectorRouterProxy;
4998    type RequestStream = ConnectorRouterRequestStream;
4999    #[cfg(target_os = "fuchsia")]
5000    type SynchronousProxy = ConnectorRouterSynchronousProxy;
5001
5002    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouter";
5003}
5004pub type ConnectorRouterRouteResult = Result<RouterResponse, i32>;
5005
5006pub trait ConnectorRouterProxyInterface: Send + Sync {
5007    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
5008        + Send;
5009    fn r#route(
5010        &self,
5011        request: &RouteRequest,
5012        instance_token: fidl::EventPair,
5013        handle: fidl::EventPair,
5014    ) -> Self::RouteResponseFut;
5015}
5016#[derive(Debug)]
5017#[cfg(target_os = "fuchsia")]
5018pub struct ConnectorRouterSynchronousProxy {
5019    client: fidl::client::sync::Client,
5020}
5021
5022#[cfg(target_os = "fuchsia")]
5023impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
5024    type Proxy = ConnectorRouterProxy;
5025    type Protocol = ConnectorRouterMarker;
5026
5027    fn from_channel(inner: fidl::Channel) -> Self {
5028        Self::new(inner)
5029    }
5030
5031    fn into_channel(self) -> fidl::Channel {
5032        self.client.into_channel()
5033    }
5034
5035    fn as_channel(&self) -> &fidl::Channel {
5036        self.client.as_channel()
5037    }
5038}
5039
5040#[cfg(target_os = "fuchsia")]
5041impl ConnectorRouterSynchronousProxy {
5042    pub fn new(channel: fidl::Channel) -> Self {
5043        Self { client: fidl::client::sync::Client::new(channel) }
5044    }
5045
5046    pub fn into_channel(self) -> fidl::Channel {
5047        self.client.into_channel()
5048    }
5049
5050    /// Waits until an event arrives and returns it. It is safe for other
5051    /// threads to make concurrent requests while waiting for an event.
5052    pub fn wait_for_event(
5053        &self,
5054        deadline: zx::MonotonicInstant,
5055    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5056        ConnectorRouterEvent::decode(self.client.wait_for_event::<ConnectorRouterMarker>(deadline)?)
5057    }
5058
5059    /// Attempts to produce a `Connector` capability from this
5060    /// `ConnectorRouter`.
5061    ///
5062    /// `request` contains context for this route, and `instance_token`
5063    /// references the component that the routing operation is being performed
5064    /// for.
5065    ///
5066    /// This will return:
5067    ///
5068    /// - `SUCCESS` if `handle` has been associated with a connector.
5069    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5070    ///   will be closed.
5071    /// - An error, if the operation failed.
5072    pub fn r#route(
5073        &self,
5074        mut request: &RouteRequest,
5075        mut instance_token: fidl::EventPair,
5076        mut handle: fidl::EventPair,
5077        ___deadline: zx::MonotonicInstant,
5078    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5079        let _response = self.client.send_query::<
5080            ConnectorRouterRouteRequest,
5081            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5082            ConnectorRouterMarker,
5083        >(
5084            (request, instance_token, handle,),
5085            0x57a912c92a38f9f8,
5086            fidl::encoding::DynamicFlags::FLEXIBLE,
5087            ___deadline,
5088        )?
5089        .into_result::<ConnectorRouterMarker>("route")?;
5090        Ok(_response.map(|x| x.response))
5091    }
5092}
5093
5094#[cfg(target_os = "fuchsia")]
5095impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
5096    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
5097        value.into_channel().into()
5098    }
5099}
5100
5101#[cfg(target_os = "fuchsia")]
5102impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
5103    fn from(value: fidl::Channel) -> Self {
5104        Self::new(value)
5105    }
5106}
5107
5108#[cfg(target_os = "fuchsia")]
5109impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
5110    type Protocol = ConnectorRouterMarker;
5111
5112    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
5113        Self::new(value.into_channel())
5114    }
5115}
5116
5117#[derive(Debug, Clone)]
5118pub struct ConnectorRouterProxy {
5119    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5120}
5121
5122impl fidl::endpoints::Proxy for ConnectorRouterProxy {
5123    type Protocol = ConnectorRouterMarker;
5124
5125    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5126        Self::new(inner)
5127    }
5128
5129    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5130        self.client.into_channel().map_err(|client| Self { client })
5131    }
5132
5133    fn as_channel(&self) -> &::fidl::AsyncChannel {
5134        self.client.as_channel()
5135    }
5136}
5137
5138impl ConnectorRouterProxy {
5139    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouter.
5140    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5141        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5142        Self { client: fidl::client::Client::new(channel, protocol_name) }
5143    }
5144
5145    /// Get a Stream of events from the remote end of the protocol.
5146    ///
5147    /// # Panics
5148    ///
5149    /// Panics if the event stream was already taken.
5150    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
5151        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
5152    }
5153
5154    /// Attempts to produce a `Connector` capability from this
5155    /// `ConnectorRouter`.
5156    ///
5157    /// `request` contains context for this route, and `instance_token`
5158    /// references the component that the routing operation is being performed
5159    /// for.
5160    ///
5161    /// This will return:
5162    ///
5163    /// - `SUCCESS` if `handle` has been associated with a connector.
5164    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5165    ///   will be closed.
5166    /// - An error, if the operation failed.
5167    pub fn r#route(
5168        &self,
5169        mut request: &RouteRequest,
5170        mut instance_token: fidl::EventPair,
5171        mut handle: fidl::EventPair,
5172    ) -> fidl::client::QueryResponseFut<
5173        ConnectorRouterRouteResult,
5174        fidl::encoding::DefaultFuchsiaResourceDialect,
5175    > {
5176        ConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
5177    }
5178}
5179
5180impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
5181    type RouteResponseFut = fidl::client::QueryResponseFut<
5182        ConnectorRouterRouteResult,
5183        fidl::encoding::DefaultFuchsiaResourceDialect,
5184    >;
5185    fn r#route(
5186        &self,
5187        mut request: &RouteRequest,
5188        mut instance_token: fidl::EventPair,
5189        mut handle: fidl::EventPair,
5190    ) -> Self::RouteResponseFut {
5191        fn _decode(
5192            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5193        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5194            let _response = fidl::client::decode_transaction_body::<
5195                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5196                fidl::encoding::DefaultFuchsiaResourceDialect,
5197                0x57a912c92a38f9f8,
5198            >(_buf?)?
5199            .into_result::<ConnectorRouterMarker>("route")?;
5200            Ok(_response.map(|x| x.response))
5201        }
5202        self.client
5203            .send_query_and_decode::<ConnectorRouterRouteRequest, ConnectorRouterRouteResult>(
5204                (request, instance_token, handle),
5205                0x57a912c92a38f9f8,
5206                fidl::encoding::DynamicFlags::FLEXIBLE,
5207                _decode,
5208            )
5209    }
5210}
5211
5212pub struct ConnectorRouterEventStream {
5213    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5214}
5215
5216impl std::marker::Unpin for ConnectorRouterEventStream {}
5217
5218impl futures::stream::FusedStream for ConnectorRouterEventStream {
5219    fn is_terminated(&self) -> bool {
5220        self.event_receiver.is_terminated()
5221    }
5222}
5223
5224impl futures::Stream for ConnectorRouterEventStream {
5225    type Item = Result<ConnectorRouterEvent, fidl::Error>;
5226
5227    fn poll_next(
5228        mut self: std::pin::Pin<&mut Self>,
5229        cx: &mut std::task::Context<'_>,
5230    ) -> std::task::Poll<Option<Self::Item>> {
5231        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5232            &mut self.event_receiver,
5233            cx
5234        )?) {
5235            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
5236            None => std::task::Poll::Ready(None),
5237        }
5238    }
5239}
5240
5241#[derive(Debug)]
5242pub enum ConnectorRouterEvent {
5243    #[non_exhaustive]
5244    _UnknownEvent {
5245        /// Ordinal of the event that was sent.
5246        ordinal: u64,
5247    },
5248}
5249
5250impl ConnectorRouterEvent {
5251    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
5252    fn decode(
5253        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5254    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5255        let (bytes, _handles) = buf.split_mut();
5256        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5257        debug_assert_eq!(tx_header.tx_id, 0);
5258        match tx_header.ordinal {
5259            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5260                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5261            }
5262            _ => Err(fidl::Error::UnknownOrdinal {
5263                ordinal: tx_header.ordinal,
5264                protocol_name:
5265                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5266            }),
5267        }
5268    }
5269}
5270
5271/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouter.
5272pub struct ConnectorRouterRequestStream {
5273    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5274    is_terminated: bool,
5275}
5276
5277impl std::marker::Unpin for ConnectorRouterRequestStream {}
5278
5279impl futures::stream::FusedStream for ConnectorRouterRequestStream {
5280    fn is_terminated(&self) -> bool {
5281        self.is_terminated
5282    }
5283}
5284
5285impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
5286    type Protocol = ConnectorRouterMarker;
5287    type ControlHandle = ConnectorRouterControlHandle;
5288
5289    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5290        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5291    }
5292
5293    fn control_handle(&self) -> Self::ControlHandle {
5294        ConnectorRouterControlHandle { inner: self.inner.clone() }
5295    }
5296
5297    fn into_inner(
5298        self,
5299    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5300    {
5301        (self.inner, self.is_terminated)
5302    }
5303
5304    fn from_inner(
5305        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5306        is_terminated: bool,
5307    ) -> Self {
5308        Self { inner, is_terminated }
5309    }
5310}
5311
5312impl futures::Stream for ConnectorRouterRequestStream {
5313    type Item = Result<ConnectorRouterRequest, fidl::Error>;
5314
5315    fn poll_next(
5316        mut self: std::pin::Pin<&mut Self>,
5317        cx: &mut std::task::Context<'_>,
5318    ) -> std::task::Poll<Option<Self::Item>> {
5319        let this = &mut *self;
5320        if this.inner.check_shutdown(cx) {
5321            this.is_terminated = true;
5322            return std::task::Poll::Ready(None);
5323        }
5324        if this.is_terminated {
5325            panic!("polled ConnectorRouterRequestStream after completion");
5326        }
5327        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5328            |bytes, handles| {
5329                match this.inner.channel().read_etc(cx, bytes, handles) {
5330                    std::task::Poll::Ready(Ok(())) => {}
5331                    std::task::Poll::Pending => return std::task::Poll::Pending,
5332                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5333                        this.is_terminated = true;
5334                        return std::task::Poll::Ready(None);
5335                    }
5336                    std::task::Poll::Ready(Err(e)) => {
5337                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5338                            e.into(),
5339                        ))));
5340                    }
5341                }
5342
5343                // A message has been received from the channel
5344                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5345
5346                std::task::Poll::Ready(Some(match header.ordinal {
5347                    0x57a912c92a38f9f8 => {
5348                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5349                        let mut req = fidl::new_empty!(
5350                            ConnectorRouterRouteRequest,
5351                            fidl::encoding::DefaultFuchsiaResourceDialect
5352                        );
5353                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5354                        let control_handle =
5355                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5356                        Ok(ConnectorRouterRequest::Route {
5357                            request: req.request,
5358                            instance_token: req.instance_token,
5359                            handle: req.handle,
5360
5361                            responder: ConnectorRouterRouteResponder {
5362                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5363                                tx_id: header.tx_id,
5364                            },
5365                        })
5366                    }
5367                    _ if header.tx_id == 0
5368                        && header
5369                            .dynamic_flags()
5370                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5371                    {
5372                        Ok(ConnectorRouterRequest::_UnknownMethod {
5373                            ordinal: header.ordinal,
5374                            control_handle: ConnectorRouterControlHandle {
5375                                inner: this.inner.clone(),
5376                            },
5377                            method_type: fidl::MethodType::OneWay,
5378                        })
5379                    }
5380                    _ if header
5381                        .dynamic_flags()
5382                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5383                    {
5384                        this.inner.send_framework_err(
5385                            fidl::encoding::FrameworkErr::UnknownMethod,
5386                            header.tx_id,
5387                            header.ordinal,
5388                            header.dynamic_flags(),
5389                            (bytes, handles),
5390                        )?;
5391                        Ok(ConnectorRouterRequest::_UnknownMethod {
5392                            ordinal: header.ordinal,
5393                            control_handle: ConnectorRouterControlHandle {
5394                                inner: this.inner.clone(),
5395                            },
5396                            method_type: fidl::MethodType::TwoWay,
5397                        })
5398                    }
5399                    _ => Err(fidl::Error::UnknownOrdinal {
5400                        ordinal: header.ordinal,
5401                        protocol_name:
5402                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5403                    }),
5404                }))
5405            },
5406        )
5407    }
5408}
5409
5410/// A factory for `Connector` capabilities.
5411#[derive(Debug)]
5412pub enum ConnectorRouterRequest {
5413    /// Attempts to produce a `Connector` capability from this
5414    /// `ConnectorRouter`.
5415    ///
5416    /// `request` contains context for this route, and `instance_token`
5417    /// references the component that the routing operation is being performed
5418    /// for.
5419    ///
5420    /// This will return:
5421    ///
5422    /// - `SUCCESS` if `handle` has been associated with a connector.
5423    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5424    ///   will be closed.
5425    /// - An error, if the operation failed.
5426    Route {
5427        request: RouteRequest,
5428        instance_token: fidl::EventPair,
5429        handle: fidl::EventPair,
5430        responder: ConnectorRouterRouteResponder,
5431    },
5432    /// An interaction was received which does not match any known method.
5433    #[non_exhaustive]
5434    _UnknownMethod {
5435        /// Ordinal of the method that was called.
5436        ordinal: u64,
5437        control_handle: ConnectorRouterControlHandle,
5438        method_type: fidl::MethodType,
5439    },
5440}
5441
5442impl ConnectorRouterRequest {
5443    #[allow(irrefutable_let_patterns)]
5444    pub fn into_route(
5445        self,
5446    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, ConnectorRouterRouteResponder)>
5447    {
5448        if let ConnectorRouterRequest::Route { request, instance_token, handle, responder } = self {
5449            Some((request, instance_token, handle, responder))
5450        } else {
5451            None
5452        }
5453    }
5454
5455    /// Name of the method defined in FIDL
5456    pub fn method_name(&self) -> &'static str {
5457        match *self {
5458            ConnectorRouterRequest::Route { .. } => "route",
5459            ConnectorRouterRequest::_UnknownMethod {
5460                method_type: fidl::MethodType::OneWay,
5461                ..
5462            } => "unknown one-way method",
5463            ConnectorRouterRequest::_UnknownMethod {
5464                method_type: fidl::MethodType::TwoWay,
5465                ..
5466            } => "unknown two-way method",
5467        }
5468    }
5469}
5470
5471#[derive(Debug, Clone)]
5472pub struct ConnectorRouterControlHandle {
5473    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5474}
5475
5476impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5477    fn shutdown(&self) {
5478        self.inner.shutdown()
5479    }
5480
5481    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5482        self.inner.shutdown_with_epitaph(status)
5483    }
5484
5485    fn is_closed(&self) -> bool {
5486        self.inner.channel().is_closed()
5487    }
5488    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5489        self.inner.channel().on_closed()
5490    }
5491
5492    #[cfg(target_os = "fuchsia")]
5493    fn signal_peer(
5494        &self,
5495        clear_mask: zx::Signals,
5496        set_mask: zx::Signals,
5497    ) -> Result<(), zx_status::Status> {
5498        use fidl::Peered;
5499        self.inner.channel().signal_peer(clear_mask, set_mask)
5500    }
5501}
5502
5503impl ConnectorRouterControlHandle {}
5504
5505#[must_use = "FIDL methods require a response to be sent"]
5506#[derive(Debug)]
5507pub struct ConnectorRouterRouteResponder {
5508    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5509    tx_id: u32,
5510}
5511
5512/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5513/// if the responder is dropped without sending a response, so that the client
5514/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5515impl std::ops::Drop for ConnectorRouterRouteResponder {
5516    fn drop(&mut self) {
5517        self.control_handle.shutdown();
5518        // Safety: drops once, never accessed again
5519        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5520    }
5521}
5522
5523impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5524    type ControlHandle = ConnectorRouterControlHandle;
5525
5526    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5527        &self.control_handle
5528    }
5529
5530    fn drop_without_shutdown(mut self) {
5531        // Safety: drops once, never accessed again due to mem::forget
5532        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5533        // Prevent Drop from running (which would shut down the channel)
5534        std::mem::forget(self);
5535    }
5536}
5537
5538impl ConnectorRouterRouteResponder {
5539    /// Sends a response to the FIDL transaction.
5540    ///
5541    /// Sets the channel to shutdown if an error occurs.
5542    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5543        let _result = self.send_raw(result);
5544        if _result.is_err() {
5545            self.control_handle.shutdown();
5546        }
5547        self.drop_without_shutdown();
5548        _result
5549    }
5550
5551    /// Similar to "send" but does not shutdown the channel if an error occurs.
5552    pub fn send_no_shutdown_on_err(
5553        self,
5554        mut result: Result<RouterResponse, i32>,
5555    ) -> Result<(), fidl::Error> {
5556        let _result = self.send_raw(result);
5557        self.drop_without_shutdown();
5558        _result
5559    }
5560
5561    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5562        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5563            ConnectorRouterRouteResponse,
5564            i32,
5565        >>(
5566            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
5567            self.tx_id,
5568            0x57a912c92a38f9f8,
5569            fidl::encoding::DynamicFlags::FLEXIBLE,
5570        )
5571    }
5572}
5573
5574#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5575pub struct DataRouterMarker;
5576
5577impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5578    type Proxy = DataRouterProxy;
5579    type RequestStream = DataRouterRequestStream;
5580    #[cfg(target_os = "fuchsia")]
5581    type SynchronousProxy = DataRouterSynchronousProxy;
5582
5583    const DEBUG_NAME: &'static str = "(anonymous) DataRouter";
5584}
5585pub type DataRouterRouteResult = Result<RouterResponse, i32>;
5586
5587pub trait DataRouterProxyInterface: Send + Sync {
5588    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5589        + Send;
5590    fn r#route(
5591        &self,
5592        request: &RouteRequest,
5593        instance_token: fidl::EventPair,
5594        handle: fidl::EventPair,
5595    ) -> Self::RouteResponseFut;
5596}
5597#[derive(Debug)]
5598#[cfg(target_os = "fuchsia")]
5599pub struct DataRouterSynchronousProxy {
5600    client: fidl::client::sync::Client,
5601}
5602
5603#[cfg(target_os = "fuchsia")]
5604impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5605    type Proxy = DataRouterProxy;
5606    type Protocol = DataRouterMarker;
5607
5608    fn from_channel(inner: fidl::Channel) -> Self {
5609        Self::new(inner)
5610    }
5611
5612    fn into_channel(self) -> fidl::Channel {
5613        self.client.into_channel()
5614    }
5615
5616    fn as_channel(&self) -> &fidl::Channel {
5617        self.client.as_channel()
5618    }
5619}
5620
5621#[cfg(target_os = "fuchsia")]
5622impl DataRouterSynchronousProxy {
5623    pub fn new(channel: fidl::Channel) -> Self {
5624        Self { client: fidl::client::sync::Client::new(channel) }
5625    }
5626
5627    pub fn into_channel(self) -> fidl::Channel {
5628        self.client.into_channel()
5629    }
5630
5631    /// Waits until an event arrives and returns it. It is safe for other
5632    /// threads to make concurrent requests while waiting for an event.
5633    pub fn wait_for_event(
5634        &self,
5635        deadline: zx::MonotonicInstant,
5636    ) -> Result<DataRouterEvent, fidl::Error> {
5637        DataRouterEvent::decode(self.client.wait_for_event::<DataRouterMarker>(deadline)?)
5638    }
5639
5640    /// Attempts to produce a `Data` capability from this
5641    /// `DataRouter`.
5642    ///
5643    /// `request` contains context for this route, and `instance_token`
5644    /// references the component that the routing operation is being performed
5645    /// for.
5646    ///
5647    /// This will return:
5648    ///
5649    /// - `SUCCESS` if `handle` has been associated with a connector.
5650    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5651    ///   will be closed.
5652    /// - An error, if the operation failed.
5653    pub fn r#route(
5654        &self,
5655        mut request: &RouteRequest,
5656        mut instance_token: fidl::EventPair,
5657        mut handle: fidl::EventPair,
5658        ___deadline: zx::MonotonicInstant,
5659    ) -> Result<DataRouterRouteResult, fidl::Error> {
5660        let _response = self.client.send_query::<
5661            DataRouterRouteRequest,
5662            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5663            DataRouterMarker,
5664        >(
5665            (request, instance_token, handle,),
5666            0x646885ba7e10ceeb,
5667            fidl::encoding::DynamicFlags::FLEXIBLE,
5668            ___deadline,
5669        )?
5670        .into_result::<DataRouterMarker>("route")?;
5671        Ok(_response.map(|x| x.response))
5672    }
5673}
5674
5675#[cfg(target_os = "fuchsia")]
5676impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5677    fn from(value: DataRouterSynchronousProxy) -> Self {
5678        value.into_channel().into()
5679    }
5680}
5681
5682#[cfg(target_os = "fuchsia")]
5683impl From<fidl::Channel> for DataRouterSynchronousProxy {
5684    fn from(value: fidl::Channel) -> Self {
5685        Self::new(value)
5686    }
5687}
5688
5689#[cfg(target_os = "fuchsia")]
5690impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5691    type Protocol = DataRouterMarker;
5692
5693    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5694        Self::new(value.into_channel())
5695    }
5696}
5697
5698#[derive(Debug, Clone)]
5699pub struct DataRouterProxy {
5700    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5701}
5702
5703impl fidl::endpoints::Proxy for DataRouterProxy {
5704    type Protocol = DataRouterMarker;
5705
5706    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5707        Self::new(inner)
5708    }
5709
5710    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5711        self.client.into_channel().map_err(|client| Self { client })
5712    }
5713
5714    fn as_channel(&self) -> &::fidl::AsyncChannel {
5715        self.client.as_channel()
5716    }
5717}
5718
5719impl DataRouterProxy {
5720    /// Create a new Proxy for fuchsia.component.runtime/DataRouter.
5721    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5722        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5723        Self { client: fidl::client::Client::new(channel, protocol_name) }
5724    }
5725
5726    /// Get a Stream of events from the remote end of the protocol.
5727    ///
5728    /// # Panics
5729    ///
5730    /// Panics if the event stream was already taken.
5731    pub fn take_event_stream(&self) -> DataRouterEventStream {
5732        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5733    }
5734
5735    /// Attempts to produce a `Data` capability from this
5736    /// `DataRouter`.
5737    ///
5738    /// `request` contains context for this route, and `instance_token`
5739    /// references the component that the routing operation is being performed
5740    /// for.
5741    ///
5742    /// This will return:
5743    ///
5744    /// - `SUCCESS` if `handle` has been associated with a connector.
5745    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5746    ///   will be closed.
5747    /// - An error, if the operation failed.
5748    pub fn r#route(
5749        &self,
5750        mut request: &RouteRequest,
5751        mut instance_token: fidl::EventPair,
5752        mut handle: fidl::EventPair,
5753    ) -> fidl::client::QueryResponseFut<
5754        DataRouterRouteResult,
5755        fidl::encoding::DefaultFuchsiaResourceDialect,
5756    > {
5757        DataRouterProxyInterface::r#route(self, request, instance_token, handle)
5758    }
5759}
5760
5761impl DataRouterProxyInterface for DataRouterProxy {
5762    type RouteResponseFut = fidl::client::QueryResponseFut<
5763        DataRouterRouteResult,
5764        fidl::encoding::DefaultFuchsiaResourceDialect,
5765    >;
5766    fn r#route(
5767        &self,
5768        mut request: &RouteRequest,
5769        mut instance_token: fidl::EventPair,
5770        mut handle: fidl::EventPair,
5771    ) -> Self::RouteResponseFut {
5772        fn _decode(
5773            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5774        ) -> Result<DataRouterRouteResult, fidl::Error> {
5775            let _response = fidl::client::decode_transaction_body::<
5776                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5777                fidl::encoding::DefaultFuchsiaResourceDialect,
5778                0x646885ba7e10ceeb,
5779            >(_buf?)?
5780            .into_result::<DataRouterMarker>("route")?;
5781            Ok(_response.map(|x| x.response))
5782        }
5783        self.client.send_query_and_decode::<DataRouterRouteRequest, DataRouterRouteResult>(
5784            (request, instance_token, handle),
5785            0x646885ba7e10ceeb,
5786            fidl::encoding::DynamicFlags::FLEXIBLE,
5787            _decode,
5788        )
5789    }
5790}
5791
5792pub struct DataRouterEventStream {
5793    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5794}
5795
5796impl std::marker::Unpin for DataRouterEventStream {}
5797
5798impl futures::stream::FusedStream for DataRouterEventStream {
5799    fn is_terminated(&self) -> bool {
5800        self.event_receiver.is_terminated()
5801    }
5802}
5803
5804impl futures::Stream for DataRouterEventStream {
5805    type Item = Result<DataRouterEvent, fidl::Error>;
5806
5807    fn poll_next(
5808        mut self: std::pin::Pin<&mut Self>,
5809        cx: &mut std::task::Context<'_>,
5810    ) -> std::task::Poll<Option<Self::Item>> {
5811        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5812            &mut self.event_receiver,
5813            cx
5814        )?) {
5815            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5816            None => std::task::Poll::Ready(None),
5817        }
5818    }
5819}
5820
5821#[derive(Debug)]
5822pub enum DataRouterEvent {
5823    #[non_exhaustive]
5824    _UnknownEvent {
5825        /// Ordinal of the event that was sent.
5826        ordinal: u64,
5827    },
5828}
5829
5830impl DataRouterEvent {
5831    /// Decodes a message buffer as a [`DataRouterEvent`].
5832    fn decode(
5833        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5834    ) -> Result<DataRouterEvent, fidl::Error> {
5835        let (bytes, _handles) = buf.split_mut();
5836        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5837        debug_assert_eq!(tx_header.tx_id, 0);
5838        match tx_header.ordinal {
5839            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5840                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5841            }
5842            _ => Err(fidl::Error::UnknownOrdinal {
5843                ordinal: tx_header.ordinal,
5844                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5845            }),
5846        }
5847    }
5848}
5849
5850/// A Stream of incoming requests for fuchsia.component.runtime/DataRouter.
5851pub struct DataRouterRequestStream {
5852    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5853    is_terminated: bool,
5854}
5855
5856impl std::marker::Unpin for DataRouterRequestStream {}
5857
5858impl futures::stream::FusedStream for DataRouterRequestStream {
5859    fn is_terminated(&self) -> bool {
5860        self.is_terminated
5861    }
5862}
5863
5864impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5865    type Protocol = DataRouterMarker;
5866    type ControlHandle = DataRouterControlHandle;
5867
5868    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5869        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5870    }
5871
5872    fn control_handle(&self) -> Self::ControlHandle {
5873        DataRouterControlHandle { inner: self.inner.clone() }
5874    }
5875
5876    fn into_inner(
5877        self,
5878    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5879    {
5880        (self.inner, self.is_terminated)
5881    }
5882
5883    fn from_inner(
5884        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5885        is_terminated: bool,
5886    ) -> Self {
5887        Self { inner, is_terminated }
5888    }
5889}
5890
5891impl futures::Stream for DataRouterRequestStream {
5892    type Item = Result<DataRouterRequest, fidl::Error>;
5893
5894    fn poll_next(
5895        mut self: std::pin::Pin<&mut Self>,
5896        cx: &mut std::task::Context<'_>,
5897    ) -> std::task::Poll<Option<Self::Item>> {
5898        let this = &mut *self;
5899        if this.inner.check_shutdown(cx) {
5900            this.is_terminated = true;
5901            return std::task::Poll::Ready(None);
5902        }
5903        if this.is_terminated {
5904            panic!("polled DataRouterRequestStream after completion");
5905        }
5906        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5907            |bytes, handles| {
5908                match this.inner.channel().read_etc(cx, bytes, handles) {
5909                    std::task::Poll::Ready(Ok(())) => {}
5910                    std::task::Poll::Pending => return std::task::Poll::Pending,
5911                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5912                        this.is_terminated = true;
5913                        return std::task::Poll::Ready(None);
5914                    }
5915                    std::task::Poll::Ready(Err(e)) => {
5916                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5917                            e.into(),
5918                        ))));
5919                    }
5920                }
5921
5922                // A message has been received from the channel
5923                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5924
5925                std::task::Poll::Ready(Some(match header.ordinal {
5926                    0x646885ba7e10ceeb => {
5927                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5928                        let mut req = fidl::new_empty!(
5929                            DataRouterRouteRequest,
5930                            fidl::encoding::DefaultFuchsiaResourceDialect
5931                        );
5932                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5933                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5934                        Ok(DataRouterRequest::Route {
5935                            request: req.request,
5936                            instance_token: req.instance_token,
5937                            handle: req.handle,
5938
5939                            responder: DataRouterRouteResponder {
5940                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5941                                tx_id: header.tx_id,
5942                            },
5943                        })
5944                    }
5945                    _ if header.tx_id == 0
5946                        && header
5947                            .dynamic_flags()
5948                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5949                    {
5950                        Ok(DataRouterRequest::_UnknownMethod {
5951                            ordinal: header.ordinal,
5952                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5953                            method_type: fidl::MethodType::OneWay,
5954                        })
5955                    }
5956                    _ if header
5957                        .dynamic_flags()
5958                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5959                    {
5960                        this.inner.send_framework_err(
5961                            fidl::encoding::FrameworkErr::UnknownMethod,
5962                            header.tx_id,
5963                            header.ordinal,
5964                            header.dynamic_flags(),
5965                            (bytes, handles),
5966                        )?;
5967                        Ok(DataRouterRequest::_UnknownMethod {
5968                            ordinal: header.ordinal,
5969                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5970                            method_type: fidl::MethodType::TwoWay,
5971                        })
5972                    }
5973                    _ => Err(fidl::Error::UnknownOrdinal {
5974                        ordinal: header.ordinal,
5975                        protocol_name:
5976                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5977                    }),
5978                }))
5979            },
5980        )
5981    }
5982}
5983
5984/// A factory for `Data` capabilities.
5985#[derive(Debug)]
5986pub enum DataRouterRequest {
5987    /// Attempts to produce a `Data` capability from this
5988    /// `DataRouter`.
5989    ///
5990    /// `request` contains context for this route, and `instance_token`
5991    /// references the component that the routing operation is being performed
5992    /// for.
5993    ///
5994    /// This will return:
5995    ///
5996    /// - `SUCCESS` if `handle` has been associated with a connector.
5997    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5998    ///   will be closed.
5999    /// - An error, if the operation failed.
6000    Route {
6001        request: RouteRequest,
6002        instance_token: fidl::EventPair,
6003        handle: fidl::EventPair,
6004        responder: DataRouterRouteResponder,
6005    },
6006    /// An interaction was received which does not match any known method.
6007    #[non_exhaustive]
6008    _UnknownMethod {
6009        /// Ordinal of the method that was called.
6010        ordinal: u64,
6011        control_handle: DataRouterControlHandle,
6012        method_type: fidl::MethodType,
6013    },
6014}
6015
6016impl DataRouterRequest {
6017    #[allow(irrefutable_let_patterns)]
6018    pub fn into_route(
6019        self,
6020    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DataRouterRouteResponder)> {
6021        if let DataRouterRequest::Route { request, instance_token, handle, responder } = self {
6022            Some((request, instance_token, handle, responder))
6023        } else {
6024            None
6025        }
6026    }
6027
6028    /// Name of the method defined in FIDL
6029    pub fn method_name(&self) -> &'static str {
6030        match *self {
6031            DataRouterRequest::Route { .. } => "route",
6032            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6033                "unknown one-way method"
6034            }
6035            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6036                "unknown two-way method"
6037            }
6038        }
6039    }
6040}
6041
6042#[derive(Debug, Clone)]
6043pub struct DataRouterControlHandle {
6044    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6045}
6046
6047impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
6048    fn shutdown(&self) {
6049        self.inner.shutdown()
6050    }
6051
6052    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6053        self.inner.shutdown_with_epitaph(status)
6054    }
6055
6056    fn is_closed(&self) -> bool {
6057        self.inner.channel().is_closed()
6058    }
6059    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6060        self.inner.channel().on_closed()
6061    }
6062
6063    #[cfg(target_os = "fuchsia")]
6064    fn signal_peer(
6065        &self,
6066        clear_mask: zx::Signals,
6067        set_mask: zx::Signals,
6068    ) -> Result<(), zx_status::Status> {
6069        use fidl::Peered;
6070        self.inner.channel().signal_peer(clear_mask, set_mask)
6071    }
6072}
6073
6074impl DataRouterControlHandle {}
6075
6076#[must_use = "FIDL methods require a response to be sent"]
6077#[derive(Debug)]
6078pub struct DataRouterRouteResponder {
6079    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
6080    tx_id: u32,
6081}
6082
6083/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
6084/// if the responder is dropped without sending a response, so that the client
6085/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6086impl std::ops::Drop for DataRouterRouteResponder {
6087    fn drop(&mut self) {
6088        self.control_handle.shutdown();
6089        // Safety: drops once, never accessed again
6090        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6091    }
6092}
6093
6094impl fidl::endpoints::Responder for DataRouterRouteResponder {
6095    type ControlHandle = DataRouterControlHandle;
6096
6097    fn control_handle(&self) -> &DataRouterControlHandle {
6098        &self.control_handle
6099    }
6100
6101    fn drop_without_shutdown(mut self) {
6102        // Safety: drops once, never accessed again due to mem::forget
6103        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6104        // Prevent Drop from running (which would shut down the channel)
6105        std::mem::forget(self);
6106    }
6107}
6108
6109impl DataRouterRouteResponder {
6110    /// Sends a response to the FIDL transaction.
6111    ///
6112    /// Sets the channel to shutdown if an error occurs.
6113    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6114        let _result = self.send_raw(result);
6115        if _result.is_err() {
6116            self.control_handle.shutdown();
6117        }
6118        self.drop_without_shutdown();
6119        _result
6120    }
6121
6122    /// Similar to "send" but does not shutdown the channel if an error occurs.
6123    pub fn send_no_shutdown_on_err(
6124        self,
6125        mut result: Result<RouterResponse, i32>,
6126    ) -> Result<(), fidl::Error> {
6127        let _result = self.send_raw(result);
6128        self.drop_without_shutdown();
6129        _result
6130    }
6131
6132    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6133        self.control_handle
6134            .inner
6135            .send::<fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>>(
6136                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
6137                self.tx_id,
6138                0x646885ba7e10ceeb,
6139                fidl::encoding::DynamicFlags::FLEXIBLE,
6140            )
6141    }
6142}
6143
6144#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6145pub struct DictionaryKeyIteratorMarker;
6146
6147impl fidl::endpoints::ProtocolMarker for DictionaryKeyIteratorMarker {
6148    type Proxy = DictionaryKeyIteratorProxy;
6149    type RequestStream = DictionaryKeyIteratorRequestStream;
6150    #[cfg(target_os = "fuchsia")]
6151    type SynchronousProxy = DictionaryKeyIteratorSynchronousProxy;
6152
6153    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeyIterator";
6154}
6155
6156pub trait DictionaryKeyIteratorProxyInterface: Send + Sync {
6157    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6158    fn r#get_next(&self) -> Self::GetNextResponseFut;
6159}
6160#[derive(Debug)]
6161#[cfg(target_os = "fuchsia")]
6162pub struct DictionaryKeyIteratorSynchronousProxy {
6163    client: fidl::client::sync::Client,
6164}
6165
6166#[cfg(target_os = "fuchsia")]
6167impl fidl::endpoints::SynchronousProxy for DictionaryKeyIteratorSynchronousProxy {
6168    type Proxy = DictionaryKeyIteratorProxy;
6169    type Protocol = DictionaryKeyIteratorMarker;
6170
6171    fn from_channel(inner: fidl::Channel) -> Self {
6172        Self::new(inner)
6173    }
6174
6175    fn into_channel(self) -> fidl::Channel {
6176        self.client.into_channel()
6177    }
6178
6179    fn as_channel(&self) -> &fidl::Channel {
6180        self.client.as_channel()
6181    }
6182}
6183
6184#[cfg(target_os = "fuchsia")]
6185impl DictionaryKeyIteratorSynchronousProxy {
6186    pub fn new(channel: fidl::Channel) -> Self {
6187        Self { client: fidl::client::sync::Client::new(channel) }
6188    }
6189
6190    pub fn into_channel(self) -> fidl::Channel {
6191        self.client.into_channel()
6192    }
6193
6194    /// Waits until an event arrives and returns it. It is safe for other
6195    /// threads to make concurrent requests while waiting for an event.
6196    pub fn wait_for_event(
6197        &self,
6198        deadline: zx::MonotonicInstant,
6199    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6200        DictionaryKeyIteratorEvent::decode(
6201            self.client.wait_for_event::<DictionaryKeyIteratorMarker>(deadline)?,
6202        )
6203    }
6204
6205    /// Returns the next set of keys in this dictionary. Returns an empty vector
6206    /// when there are no more keys to iterate.
6207    pub fn r#get_next(
6208        &self,
6209        ___deadline: zx::MonotonicInstant,
6210    ) -> Result<Vec<String>, fidl::Error> {
6211        let _response = self.client.send_query::<
6212            fidl::encoding::EmptyPayload,
6213            DictionaryKeyIteratorGetNextResponse,
6214            DictionaryKeyIteratorMarker,
6215        >(
6216            (),
6217            0x3806bda34433db54,
6218            fidl::encoding::DynamicFlags::empty(),
6219            ___deadline,
6220        )?;
6221        Ok(_response.keys)
6222    }
6223}
6224
6225#[cfg(target_os = "fuchsia")]
6226impl From<DictionaryKeyIteratorSynchronousProxy> for zx::NullableHandle {
6227    fn from(value: DictionaryKeyIteratorSynchronousProxy) -> Self {
6228        value.into_channel().into()
6229    }
6230}
6231
6232#[cfg(target_os = "fuchsia")]
6233impl From<fidl::Channel> for DictionaryKeyIteratorSynchronousProxy {
6234    fn from(value: fidl::Channel) -> Self {
6235        Self::new(value)
6236    }
6237}
6238
6239#[cfg(target_os = "fuchsia")]
6240impl fidl::endpoints::FromClient for DictionaryKeyIteratorSynchronousProxy {
6241    type Protocol = DictionaryKeyIteratorMarker;
6242
6243    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeyIteratorMarker>) -> Self {
6244        Self::new(value.into_channel())
6245    }
6246}
6247
6248#[derive(Debug, Clone)]
6249pub struct DictionaryKeyIteratorProxy {
6250    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6251}
6252
6253impl fidl::endpoints::Proxy for DictionaryKeyIteratorProxy {
6254    type Protocol = DictionaryKeyIteratorMarker;
6255
6256    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6257        Self::new(inner)
6258    }
6259
6260    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6261        self.client.into_channel().map_err(|client| Self { client })
6262    }
6263
6264    fn as_channel(&self) -> &::fidl::AsyncChannel {
6265        self.client.as_channel()
6266    }
6267}
6268
6269impl DictionaryKeyIteratorProxy {
6270    /// Create a new Proxy for fuchsia.component.runtime/DictionaryKeyIterator.
6271    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6272        let protocol_name =
6273            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6274        Self { client: fidl::client::Client::new(channel, protocol_name) }
6275    }
6276
6277    /// Get a Stream of events from the remote end of the protocol.
6278    ///
6279    /// # Panics
6280    ///
6281    /// Panics if the event stream was already taken.
6282    pub fn take_event_stream(&self) -> DictionaryKeyIteratorEventStream {
6283        DictionaryKeyIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6284    }
6285
6286    /// Returns the next set of keys in this dictionary. Returns an empty vector
6287    /// when there are no more keys to iterate.
6288    pub fn r#get_next(
6289        &self,
6290    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
6291    {
6292        DictionaryKeyIteratorProxyInterface::r#get_next(self)
6293    }
6294}
6295
6296impl DictionaryKeyIteratorProxyInterface for DictionaryKeyIteratorProxy {
6297    type GetNextResponseFut =
6298        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
6299    fn r#get_next(&self) -> Self::GetNextResponseFut {
6300        fn _decode(
6301            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6302        ) -> Result<Vec<String>, fidl::Error> {
6303            let _response = fidl::client::decode_transaction_body::<
6304                DictionaryKeyIteratorGetNextResponse,
6305                fidl::encoding::DefaultFuchsiaResourceDialect,
6306                0x3806bda34433db54,
6307            >(_buf?)?;
6308            Ok(_response.keys)
6309        }
6310        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6311            (),
6312            0x3806bda34433db54,
6313            fidl::encoding::DynamicFlags::empty(),
6314            _decode,
6315        )
6316    }
6317}
6318
6319pub struct DictionaryKeyIteratorEventStream {
6320    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6321}
6322
6323impl std::marker::Unpin for DictionaryKeyIteratorEventStream {}
6324
6325impl futures::stream::FusedStream for DictionaryKeyIteratorEventStream {
6326    fn is_terminated(&self) -> bool {
6327        self.event_receiver.is_terminated()
6328    }
6329}
6330
6331impl futures::Stream for DictionaryKeyIteratorEventStream {
6332    type Item = Result<DictionaryKeyIteratorEvent, fidl::Error>;
6333
6334    fn poll_next(
6335        mut self: std::pin::Pin<&mut Self>,
6336        cx: &mut std::task::Context<'_>,
6337    ) -> std::task::Poll<Option<Self::Item>> {
6338        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6339            &mut self.event_receiver,
6340            cx
6341        )?) {
6342            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeyIteratorEvent::decode(buf))),
6343            None => std::task::Poll::Ready(None),
6344        }
6345    }
6346}
6347
6348#[derive(Debug)]
6349pub enum DictionaryKeyIteratorEvent {}
6350
6351impl DictionaryKeyIteratorEvent {
6352    /// Decodes a message buffer as a [`DictionaryKeyIteratorEvent`].
6353    fn decode(
6354        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6355    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6356        let (bytes, _handles) = buf.split_mut();
6357        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6358        debug_assert_eq!(tx_header.tx_id, 0);
6359        match tx_header.ordinal {
6360            _ => Err(fidl::Error::UnknownOrdinal {
6361                ordinal: tx_header.ordinal,
6362                protocol_name:
6363                    <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6364            }),
6365        }
6366    }
6367}
6368
6369/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryKeyIterator.
6370pub struct DictionaryKeyIteratorRequestStream {
6371    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6372    is_terminated: bool,
6373}
6374
6375impl std::marker::Unpin for DictionaryKeyIteratorRequestStream {}
6376
6377impl futures::stream::FusedStream for DictionaryKeyIteratorRequestStream {
6378    fn is_terminated(&self) -> bool {
6379        self.is_terminated
6380    }
6381}
6382
6383impl fidl::endpoints::RequestStream for DictionaryKeyIteratorRequestStream {
6384    type Protocol = DictionaryKeyIteratorMarker;
6385    type ControlHandle = DictionaryKeyIteratorControlHandle;
6386
6387    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6388        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6389    }
6390
6391    fn control_handle(&self) -> Self::ControlHandle {
6392        DictionaryKeyIteratorControlHandle { inner: self.inner.clone() }
6393    }
6394
6395    fn into_inner(
6396        self,
6397    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6398    {
6399        (self.inner, self.is_terminated)
6400    }
6401
6402    fn from_inner(
6403        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6404        is_terminated: bool,
6405    ) -> Self {
6406        Self { inner, is_terminated }
6407    }
6408}
6409
6410impl futures::Stream for DictionaryKeyIteratorRequestStream {
6411    type Item = Result<DictionaryKeyIteratorRequest, fidl::Error>;
6412
6413    fn poll_next(
6414        mut self: std::pin::Pin<&mut Self>,
6415        cx: &mut std::task::Context<'_>,
6416    ) -> std::task::Poll<Option<Self::Item>> {
6417        let this = &mut *self;
6418        if this.inner.check_shutdown(cx) {
6419            this.is_terminated = true;
6420            return std::task::Poll::Ready(None);
6421        }
6422        if this.is_terminated {
6423            panic!("polled DictionaryKeyIteratorRequestStream after completion");
6424        }
6425        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6426            |bytes, handles| {
6427                match this.inner.channel().read_etc(cx, bytes, handles) {
6428                    std::task::Poll::Ready(Ok(())) => {}
6429                    std::task::Poll::Pending => return std::task::Poll::Pending,
6430                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6431                        this.is_terminated = true;
6432                        return std::task::Poll::Ready(None);
6433                    }
6434                    std::task::Poll::Ready(Err(e)) => {
6435                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6436                            e.into(),
6437                        ))));
6438                    }
6439                }
6440
6441                // A message has been received from the channel
6442                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6443
6444                std::task::Poll::Ready(Some(match header.ordinal {
6445                0x3806bda34433db54 => {
6446                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6447                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6448                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6449                    let control_handle = DictionaryKeyIteratorControlHandle {
6450                        inner: this.inner.clone(),
6451                    };
6452                    Ok(DictionaryKeyIteratorRequest::GetNext {
6453                        responder: DictionaryKeyIteratorGetNextResponder {
6454                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6455                            tx_id: header.tx_id,
6456                        },
6457                    })
6458                }
6459                _ => Err(fidl::Error::UnknownOrdinal {
6460                    ordinal: header.ordinal,
6461                    protocol_name: <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6462                }),
6463            }))
6464            },
6465        )
6466    }
6467}
6468
6469#[derive(Debug)]
6470pub enum DictionaryKeyIteratorRequest {
6471    /// Returns the next set of keys in this dictionary. Returns an empty vector
6472    /// when there are no more keys to iterate.
6473    GetNext { responder: DictionaryKeyIteratorGetNextResponder },
6474}
6475
6476impl DictionaryKeyIteratorRequest {
6477    #[allow(irrefutable_let_patterns)]
6478    pub fn into_get_next(self) -> Option<(DictionaryKeyIteratorGetNextResponder)> {
6479        if let DictionaryKeyIteratorRequest::GetNext { responder } = self {
6480            Some((responder))
6481        } else {
6482            None
6483        }
6484    }
6485
6486    /// Name of the method defined in FIDL
6487    pub fn method_name(&self) -> &'static str {
6488        match *self {
6489            DictionaryKeyIteratorRequest::GetNext { .. } => "get_next",
6490        }
6491    }
6492}
6493
6494#[derive(Debug, Clone)]
6495pub struct DictionaryKeyIteratorControlHandle {
6496    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6497}
6498
6499impl fidl::endpoints::ControlHandle for DictionaryKeyIteratorControlHandle {
6500    fn shutdown(&self) {
6501        self.inner.shutdown()
6502    }
6503
6504    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6505        self.inner.shutdown_with_epitaph(status)
6506    }
6507
6508    fn is_closed(&self) -> bool {
6509        self.inner.channel().is_closed()
6510    }
6511    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6512        self.inner.channel().on_closed()
6513    }
6514
6515    #[cfg(target_os = "fuchsia")]
6516    fn signal_peer(
6517        &self,
6518        clear_mask: zx::Signals,
6519        set_mask: zx::Signals,
6520    ) -> Result<(), zx_status::Status> {
6521        use fidl::Peered;
6522        self.inner.channel().signal_peer(clear_mask, set_mask)
6523    }
6524}
6525
6526impl DictionaryKeyIteratorControlHandle {}
6527
6528#[must_use = "FIDL methods require a response to be sent"]
6529#[derive(Debug)]
6530pub struct DictionaryKeyIteratorGetNextResponder {
6531    control_handle: std::mem::ManuallyDrop<DictionaryKeyIteratorControlHandle>,
6532    tx_id: u32,
6533}
6534
6535/// Set the the channel to be shutdown (see [`DictionaryKeyIteratorControlHandle::shutdown`])
6536/// if the responder is dropped without sending a response, so that the client
6537/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6538impl std::ops::Drop for DictionaryKeyIteratorGetNextResponder {
6539    fn drop(&mut self) {
6540        self.control_handle.shutdown();
6541        // Safety: drops once, never accessed again
6542        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6543    }
6544}
6545
6546impl fidl::endpoints::Responder for DictionaryKeyIteratorGetNextResponder {
6547    type ControlHandle = DictionaryKeyIteratorControlHandle;
6548
6549    fn control_handle(&self) -> &DictionaryKeyIteratorControlHandle {
6550        &self.control_handle
6551    }
6552
6553    fn drop_without_shutdown(mut self) {
6554        // Safety: drops once, never accessed again due to mem::forget
6555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6556        // Prevent Drop from running (which would shut down the channel)
6557        std::mem::forget(self);
6558    }
6559}
6560
6561impl DictionaryKeyIteratorGetNextResponder {
6562    /// Sends a response to the FIDL transaction.
6563    ///
6564    /// Sets the channel to shutdown if an error occurs.
6565    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6566        let _result = self.send_raw(keys);
6567        if _result.is_err() {
6568            self.control_handle.shutdown();
6569        }
6570        self.drop_without_shutdown();
6571        _result
6572    }
6573
6574    /// Similar to "send" but does not shutdown the channel if an error occurs.
6575    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6576        let _result = self.send_raw(keys);
6577        self.drop_without_shutdown();
6578        _result
6579    }
6580
6581    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6582        self.control_handle.inner.send::<DictionaryKeyIteratorGetNextResponse>(
6583            (keys,),
6584            self.tx_id,
6585            0x3806bda34433db54,
6586            fidl::encoding::DynamicFlags::empty(),
6587        )
6588    }
6589}
6590
6591#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6592pub struct DictionaryRouterMarker;
6593
6594impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
6595    type Proxy = DictionaryRouterProxy;
6596    type RequestStream = DictionaryRouterRequestStream;
6597    #[cfg(target_os = "fuchsia")]
6598    type SynchronousProxy = DictionaryRouterSynchronousProxy;
6599
6600    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DictionaryRouter";
6601}
6602impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6603pub type DictionaryRouterRouteResult = Result<RouterResponse, i32>;
6604
6605pub trait DictionaryRouterProxyInterface: Send + Sync {
6606    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6607        + Send;
6608    fn r#route(
6609        &self,
6610        request: &RouteRequest,
6611        instance_token: fidl::EventPair,
6612        handle: fidl::EventPair,
6613    ) -> Self::RouteResponseFut;
6614}
6615#[derive(Debug)]
6616#[cfg(target_os = "fuchsia")]
6617pub struct DictionaryRouterSynchronousProxy {
6618    client: fidl::client::sync::Client,
6619}
6620
6621#[cfg(target_os = "fuchsia")]
6622impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
6623    type Proxy = DictionaryRouterProxy;
6624    type Protocol = DictionaryRouterMarker;
6625
6626    fn from_channel(inner: fidl::Channel) -> Self {
6627        Self::new(inner)
6628    }
6629
6630    fn into_channel(self) -> fidl::Channel {
6631        self.client.into_channel()
6632    }
6633
6634    fn as_channel(&self) -> &fidl::Channel {
6635        self.client.as_channel()
6636    }
6637}
6638
6639#[cfg(target_os = "fuchsia")]
6640impl DictionaryRouterSynchronousProxy {
6641    pub fn new(channel: fidl::Channel) -> Self {
6642        Self { client: fidl::client::sync::Client::new(channel) }
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(
6656            self.client.wait_for_event::<DictionaryRouterMarker>(deadline)?,
6657        )
6658    }
6659
6660    /// Attempts to produce a `Dictionary` capability from this
6661    /// `DictionaryRouter`.
6662    ///
6663    /// `request` contains context for this route, and `instance_token`
6664    /// references the component that the routing operation is being performed
6665    /// for.
6666    ///
6667    /// This will return:
6668    ///
6669    /// - `SUCCESS` if `handle` has been associated with a connector.
6670    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6671    ///   will be closed.
6672    /// - An error, if the operation failed.
6673    pub fn r#route(
6674        &self,
6675        mut request: &RouteRequest,
6676        mut instance_token: fidl::EventPair,
6677        mut handle: fidl::EventPair,
6678        ___deadline: zx::MonotonicInstant,
6679    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6680        let _response = self.client.send_query::<
6681            DictionaryRouterRouteRequest,
6682            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6683            DictionaryRouterMarker,
6684        >(
6685            (request, instance_token, handle,),
6686            0x199389f437b3937b,
6687            fidl::encoding::DynamicFlags::FLEXIBLE,
6688            ___deadline,
6689        )?
6690        .into_result::<DictionaryRouterMarker>("route")?;
6691        Ok(_response.map(|x| x.response))
6692    }
6693}
6694
6695#[cfg(target_os = "fuchsia")]
6696impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
6697    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
6698        value.into_channel().into()
6699    }
6700}
6701
6702#[cfg(target_os = "fuchsia")]
6703impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
6704    fn from(value: fidl::Channel) -> Self {
6705        Self::new(value)
6706    }
6707}
6708
6709#[cfg(target_os = "fuchsia")]
6710impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
6711    type Protocol = DictionaryRouterMarker;
6712
6713    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
6714        Self::new(value.into_channel())
6715    }
6716}
6717
6718#[derive(Debug, Clone)]
6719pub struct DictionaryRouterProxy {
6720    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6721}
6722
6723impl fidl::endpoints::Proxy for DictionaryRouterProxy {
6724    type Protocol = DictionaryRouterMarker;
6725
6726    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6727        Self::new(inner)
6728    }
6729
6730    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6731        self.client.into_channel().map_err(|client| Self { client })
6732    }
6733
6734    fn as_channel(&self) -> &::fidl::AsyncChannel {
6735        self.client.as_channel()
6736    }
6737}
6738
6739impl DictionaryRouterProxy {
6740    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouter.
6741    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6742        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6743        Self { client: fidl::client::Client::new(channel, protocol_name) }
6744    }
6745
6746    /// Get a Stream of events from the remote end of the protocol.
6747    ///
6748    /// # Panics
6749    ///
6750    /// Panics if the event stream was already taken.
6751    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6752        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6753    }
6754
6755    /// Attempts to produce a `Dictionary` capability from this
6756    /// `DictionaryRouter`.
6757    ///
6758    /// `request` contains context for this route, and `instance_token`
6759    /// references the component that the routing operation is being performed
6760    /// for.
6761    ///
6762    /// This will return:
6763    ///
6764    /// - `SUCCESS` if `handle` has been associated with a connector.
6765    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6766    ///   will be closed.
6767    /// - An error, if the operation failed.
6768    pub fn r#route(
6769        &self,
6770        mut request: &RouteRequest,
6771        mut instance_token: fidl::EventPair,
6772        mut handle: fidl::EventPair,
6773    ) -> fidl::client::QueryResponseFut<
6774        DictionaryRouterRouteResult,
6775        fidl::encoding::DefaultFuchsiaResourceDialect,
6776    > {
6777        DictionaryRouterProxyInterface::r#route(self, request, instance_token, handle)
6778    }
6779}
6780
6781impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6782    type RouteResponseFut = fidl::client::QueryResponseFut<
6783        DictionaryRouterRouteResult,
6784        fidl::encoding::DefaultFuchsiaResourceDialect,
6785    >;
6786    fn r#route(
6787        &self,
6788        mut request: &RouteRequest,
6789        mut instance_token: fidl::EventPair,
6790        mut handle: fidl::EventPair,
6791    ) -> Self::RouteResponseFut {
6792        fn _decode(
6793            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6794        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6795            let _response = fidl::client::decode_transaction_body::<
6796                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6797                fidl::encoding::DefaultFuchsiaResourceDialect,
6798                0x199389f437b3937b,
6799            >(_buf?)?
6800            .into_result::<DictionaryRouterMarker>("route")?;
6801            Ok(_response.map(|x| x.response))
6802        }
6803        self.client
6804            .send_query_and_decode::<DictionaryRouterRouteRequest, DictionaryRouterRouteResult>(
6805                (request, instance_token, handle),
6806                0x199389f437b3937b,
6807                fidl::encoding::DynamicFlags::FLEXIBLE,
6808                _decode,
6809            )
6810    }
6811}
6812
6813pub struct DictionaryRouterEventStream {
6814    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6815}
6816
6817impl std::marker::Unpin for DictionaryRouterEventStream {}
6818
6819impl futures::stream::FusedStream for DictionaryRouterEventStream {
6820    fn is_terminated(&self) -> bool {
6821        self.event_receiver.is_terminated()
6822    }
6823}
6824
6825impl futures::Stream for DictionaryRouterEventStream {
6826    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6827
6828    fn poll_next(
6829        mut self: std::pin::Pin<&mut Self>,
6830        cx: &mut std::task::Context<'_>,
6831    ) -> std::task::Poll<Option<Self::Item>> {
6832        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6833            &mut self.event_receiver,
6834            cx
6835        )?) {
6836            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6837            None => std::task::Poll::Ready(None),
6838        }
6839    }
6840}
6841
6842#[derive(Debug)]
6843pub enum DictionaryRouterEvent {
6844    #[non_exhaustive]
6845    _UnknownEvent {
6846        /// Ordinal of the event that was sent.
6847        ordinal: u64,
6848    },
6849}
6850
6851impl DictionaryRouterEvent {
6852    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6853    fn decode(
6854        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6855    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6856        let (bytes, _handles) = buf.split_mut();
6857        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6858        debug_assert_eq!(tx_header.tx_id, 0);
6859        match tx_header.ordinal {
6860            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6861                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6862            }
6863            _ => Err(fidl::Error::UnknownOrdinal {
6864                ordinal: tx_header.ordinal,
6865                protocol_name:
6866                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6867            }),
6868        }
6869    }
6870}
6871
6872/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouter.
6873pub struct DictionaryRouterRequestStream {
6874    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6875    is_terminated: bool,
6876}
6877
6878impl std::marker::Unpin for DictionaryRouterRequestStream {}
6879
6880impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6881    fn is_terminated(&self) -> bool {
6882        self.is_terminated
6883    }
6884}
6885
6886impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
6887    type Protocol = DictionaryRouterMarker;
6888    type ControlHandle = DictionaryRouterControlHandle;
6889
6890    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6891        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6892    }
6893
6894    fn control_handle(&self) -> Self::ControlHandle {
6895        DictionaryRouterControlHandle { inner: self.inner.clone() }
6896    }
6897
6898    fn into_inner(
6899        self,
6900    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6901    {
6902        (self.inner, self.is_terminated)
6903    }
6904
6905    fn from_inner(
6906        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6907        is_terminated: bool,
6908    ) -> Self {
6909        Self { inner, is_terminated }
6910    }
6911}
6912
6913impl futures::Stream for DictionaryRouterRequestStream {
6914    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6915
6916    fn poll_next(
6917        mut self: std::pin::Pin<&mut Self>,
6918        cx: &mut std::task::Context<'_>,
6919    ) -> std::task::Poll<Option<Self::Item>> {
6920        let this = &mut *self;
6921        if this.inner.check_shutdown(cx) {
6922            this.is_terminated = true;
6923            return std::task::Poll::Ready(None);
6924        }
6925        if this.is_terminated {
6926            panic!("polled DictionaryRouterRequestStream after completion");
6927        }
6928        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6929            |bytes, handles| {
6930                match this.inner.channel().read_etc(cx, bytes, handles) {
6931                    std::task::Poll::Ready(Ok(())) => {}
6932                    std::task::Poll::Pending => return std::task::Poll::Pending,
6933                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6934                        this.is_terminated = true;
6935                        return std::task::Poll::Ready(None);
6936                    }
6937                    std::task::Poll::Ready(Err(e)) => {
6938                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6939                            e.into(),
6940                        ))));
6941                    }
6942                }
6943
6944                // A message has been received from the channel
6945                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6946
6947                std::task::Poll::Ready(Some(match header.ordinal {
6948                    0x199389f437b3937b => {
6949                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6950                        let mut req = fidl::new_empty!(
6951                            DictionaryRouterRouteRequest,
6952                            fidl::encoding::DefaultFuchsiaResourceDialect
6953                        );
6954                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6955                        let control_handle =
6956                            DictionaryRouterControlHandle { inner: this.inner.clone() };
6957                        Ok(DictionaryRouterRequest::Route {
6958                            request: req.request,
6959                            instance_token: req.instance_token,
6960                            handle: req.handle,
6961
6962                            responder: DictionaryRouterRouteResponder {
6963                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6964                                tx_id: header.tx_id,
6965                            },
6966                        })
6967                    }
6968                    _ if header.tx_id == 0
6969                        && header
6970                            .dynamic_flags()
6971                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6972                    {
6973                        Ok(DictionaryRouterRequest::_UnknownMethod {
6974                            ordinal: header.ordinal,
6975                            control_handle: DictionaryRouterControlHandle {
6976                                inner: this.inner.clone(),
6977                            },
6978                            method_type: fidl::MethodType::OneWay,
6979                        })
6980                    }
6981                    _ if header
6982                        .dynamic_flags()
6983                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6984                    {
6985                        this.inner.send_framework_err(
6986                            fidl::encoding::FrameworkErr::UnknownMethod,
6987                            header.tx_id,
6988                            header.ordinal,
6989                            header.dynamic_flags(),
6990                            (bytes, handles),
6991                        )?;
6992                        Ok(DictionaryRouterRequest::_UnknownMethod {
6993                            ordinal: header.ordinal,
6994                            control_handle: DictionaryRouterControlHandle {
6995                                inner: this.inner.clone(),
6996                            },
6997                            method_type: fidl::MethodType::TwoWay,
6998                        })
6999                    }
7000                    _ => Err(fidl::Error::UnknownOrdinal {
7001                        ordinal: header.ordinal,
7002                        protocol_name:
7003                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7004                    }),
7005                }))
7006            },
7007        )
7008    }
7009}
7010
7011/// A factory for `Dictionary` capabilities.
7012#[derive(Debug)]
7013pub enum DictionaryRouterRequest {
7014    /// Attempts to produce a `Dictionary` capability from this
7015    /// `DictionaryRouter`.
7016    ///
7017    /// `request` contains context for this route, and `instance_token`
7018    /// references the component that the routing operation is being performed
7019    /// for.
7020    ///
7021    /// This will return:
7022    ///
7023    /// - `SUCCESS` if `handle` has been associated with a connector.
7024    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7025    ///   will be closed.
7026    /// - An error, if the operation failed.
7027    Route {
7028        request: RouteRequest,
7029        instance_token: fidl::EventPair,
7030        handle: fidl::EventPair,
7031        responder: DictionaryRouterRouteResponder,
7032    },
7033    /// An interaction was received which does not match any known method.
7034    #[non_exhaustive]
7035    _UnknownMethod {
7036        /// Ordinal of the method that was called.
7037        ordinal: u64,
7038        control_handle: DictionaryRouterControlHandle,
7039        method_type: fidl::MethodType,
7040    },
7041}
7042
7043impl DictionaryRouterRequest {
7044    #[allow(irrefutable_let_patterns)]
7045    pub fn into_route(
7046        self,
7047    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DictionaryRouterRouteResponder)>
7048    {
7049        if let DictionaryRouterRequest::Route { request, instance_token, handle, responder } = self
7050        {
7051            Some((request, instance_token, handle, responder))
7052        } else {
7053            None
7054        }
7055    }
7056
7057    /// Name of the method defined in FIDL
7058    pub fn method_name(&self) -> &'static str {
7059        match *self {
7060            DictionaryRouterRequest::Route { .. } => "route",
7061            DictionaryRouterRequest::_UnknownMethod {
7062                method_type: fidl::MethodType::OneWay,
7063                ..
7064            } => "unknown one-way method",
7065            DictionaryRouterRequest::_UnknownMethod {
7066                method_type: fidl::MethodType::TwoWay,
7067                ..
7068            } => "unknown two-way method",
7069        }
7070    }
7071}
7072
7073#[derive(Debug, Clone)]
7074pub struct DictionaryRouterControlHandle {
7075    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7076}
7077
7078impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7079    fn shutdown(&self) {
7080        self.inner.shutdown()
7081    }
7082
7083    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7084        self.inner.shutdown_with_epitaph(status)
7085    }
7086
7087    fn is_closed(&self) -> bool {
7088        self.inner.channel().is_closed()
7089    }
7090    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7091        self.inner.channel().on_closed()
7092    }
7093
7094    #[cfg(target_os = "fuchsia")]
7095    fn signal_peer(
7096        &self,
7097        clear_mask: zx::Signals,
7098        set_mask: zx::Signals,
7099    ) -> Result<(), zx_status::Status> {
7100        use fidl::Peered;
7101        self.inner.channel().signal_peer(clear_mask, set_mask)
7102    }
7103}
7104
7105impl DictionaryRouterControlHandle {}
7106
7107#[must_use = "FIDL methods require a response to be sent"]
7108#[derive(Debug)]
7109pub struct DictionaryRouterRouteResponder {
7110    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7111    tx_id: u32,
7112}
7113
7114/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7115/// if the responder is dropped without sending a response, so that the client
7116/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7117impl std::ops::Drop for DictionaryRouterRouteResponder {
7118    fn drop(&mut self) {
7119        self.control_handle.shutdown();
7120        // Safety: drops once, never accessed again
7121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7122    }
7123}
7124
7125impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7126    type ControlHandle = DictionaryRouterControlHandle;
7127
7128    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7129        &self.control_handle
7130    }
7131
7132    fn drop_without_shutdown(mut self) {
7133        // Safety: drops once, never accessed again due to mem::forget
7134        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7135        // Prevent Drop from running (which would shut down the channel)
7136        std::mem::forget(self);
7137    }
7138}
7139
7140impl DictionaryRouterRouteResponder {
7141    /// Sends a response to the FIDL transaction.
7142    ///
7143    /// Sets the channel to shutdown if an error occurs.
7144    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7145        let _result = self.send_raw(result);
7146        if _result.is_err() {
7147            self.control_handle.shutdown();
7148        }
7149        self.drop_without_shutdown();
7150        _result
7151    }
7152
7153    /// Similar to "send" but does not shutdown the channel if an error occurs.
7154    pub fn send_no_shutdown_on_err(
7155        self,
7156        mut result: Result<RouterResponse, i32>,
7157    ) -> Result<(), fidl::Error> {
7158        let _result = self.send_raw(result);
7159        self.drop_without_shutdown();
7160        _result
7161    }
7162
7163    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7164        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7165            DictionaryRouterRouteResponse,
7166            i32,
7167        >>(
7168            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7169            self.tx_id,
7170            0x199389f437b3937b,
7171            fidl::encoding::DynamicFlags::FLEXIBLE,
7172        )
7173    }
7174}
7175
7176#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7177pub struct DirConnectorRouterMarker;
7178
7179impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7180    type Proxy = DirConnectorRouterProxy;
7181    type RequestStream = DirConnectorRouterRequestStream;
7182    #[cfg(target_os = "fuchsia")]
7183    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7184
7185    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouter";
7186}
7187pub type DirConnectorRouterRouteResult = Result<RouterResponse, i32>;
7188
7189pub trait DirConnectorRouterProxyInterface: Send + Sync {
7190    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7191        + Send;
7192    fn r#route(
7193        &self,
7194        request: &RouteRequest,
7195        instance_token: fidl::EventPair,
7196        handle: fidl::EventPair,
7197    ) -> Self::RouteResponseFut;
7198}
7199#[derive(Debug)]
7200#[cfg(target_os = "fuchsia")]
7201pub struct DirConnectorRouterSynchronousProxy {
7202    client: fidl::client::sync::Client,
7203}
7204
7205#[cfg(target_os = "fuchsia")]
7206impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7207    type Proxy = DirConnectorRouterProxy;
7208    type Protocol = DirConnectorRouterMarker;
7209
7210    fn from_channel(inner: fidl::Channel) -> Self {
7211        Self::new(inner)
7212    }
7213
7214    fn into_channel(self) -> fidl::Channel {
7215        self.client.into_channel()
7216    }
7217
7218    fn as_channel(&self) -> &fidl::Channel {
7219        self.client.as_channel()
7220    }
7221}
7222
7223#[cfg(target_os = "fuchsia")]
7224impl DirConnectorRouterSynchronousProxy {
7225    pub fn new(channel: fidl::Channel) -> Self {
7226        Self { client: fidl::client::sync::Client::new(channel) }
7227    }
7228
7229    pub fn into_channel(self) -> fidl::Channel {
7230        self.client.into_channel()
7231    }
7232
7233    /// Waits until an event arrives and returns it. It is safe for other
7234    /// threads to make concurrent requests while waiting for an event.
7235    pub fn wait_for_event(
7236        &self,
7237        deadline: zx::MonotonicInstant,
7238    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7239        DirConnectorRouterEvent::decode(
7240            self.client.wait_for_event::<DirConnectorRouterMarker>(deadline)?,
7241        )
7242    }
7243
7244    /// Attempts to produce a `DirConnector` capability from this
7245    /// `DirConnectorRouter`.
7246    ///
7247    /// `request` contains context for this route, and `instance_token`
7248    /// references the component that the routing operation is being performed
7249    /// for.
7250    ///
7251    /// This will return:
7252    ///
7253    /// - `SUCCESS` if `handle` has been associated with a connector.
7254    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7255    ///   will be closed.
7256    /// - An error, if the operation failed.
7257    pub fn r#route(
7258        &self,
7259        mut request: &RouteRequest,
7260        mut instance_token: fidl::EventPair,
7261        mut handle: fidl::EventPair,
7262        ___deadline: zx::MonotonicInstant,
7263    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7264        let _response = self.client.send_query::<
7265            DirConnectorRouterRouteRequest,
7266            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7267            DirConnectorRouterMarker,
7268        >(
7269            (request, instance_token, handle,),
7270            0x233f2ac038127462,
7271            fidl::encoding::DynamicFlags::FLEXIBLE,
7272            ___deadline,
7273        )?
7274        .into_result::<DirConnectorRouterMarker>("route")?;
7275        Ok(_response.map(|x| x.response))
7276    }
7277}
7278
7279#[cfg(target_os = "fuchsia")]
7280impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
7281    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
7282        value.into_channel().into()
7283    }
7284}
7285
7286#[cfg(target_os = "fuchsia")]
7287impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
7288    fn from(value: fidl::Channel) -> Self {
7289        Self::new(value)
7290    }
7291}
7292
7293#[cfg(target_os = "fuchsia")]
7294impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
7295    type Protocol = DirConnectorRouterMarker;
7296
7297    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
7298        Self::new(value.into_channel())
7299    }
7300}
7301
7302#[derive(Debug, Clone)]
7303pub struct DirConnectorRouterProxy {
7304    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7305}
7306
7307impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
7308    type Protocol = DirConnectorRouterMarker;
7309
7310    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7311        Self::new(inner)
7312    }
7313
7314    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7315        self.client.into_channel().map_err(|client| Self { client })
7316    }
7317
7318    fn as_channel(&self) -> &::fidl::AsyncChannel {
7319        self.client.as_channel()
7320    }
7321}
7322
7323impl DirConnectorRouterProxy {
7324    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouter.
7325    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7326        let protocol_name =
7327            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7328        Self { client: fidl::client::Client::new(channel, protocol_name) }
7329    }
7330
7331    /// Get a Stream of events from the remote end of the protocol.
7332    ///
7333    /// # Panics
7334    ///
7335    /// Panics if the event stream was already taken.
7336    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
7337        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
7338    }
7339
7340    /// Attempts to produce a `DirConnector` capability from this
7341    /// `DirConnectorRouter`.
7342    ///
7343    /// `request` contains context for this route, and `instance_token`
7344    /// references the component that the routing operation is being performed
7345    /// for.
7346    ///
7347    /// This will return:
7348    ///
7349    /// - `SUCCESS` if `handle` has been associated with a connector.
7350    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7351    ///   will be closed.
7352    /// - An error, if the operation failed.
7353    pub fn r#route(
7354        &self,
7355        mut request: &RouteRequest,
7356        mut instance_token: fidl::EventPair,
7357        mut handle: fidl::EventPair,
7358    ) -> fidl::client::QueryResponseFut<
7359        DirConnectorRouterRouteResult,
7360        fidl::encoding::DefaultFuchsiaResourceDialect,
7361    > {
7362        DirConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
7363    }
7364}
7365
7366impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
7367    type RouteResponseFut = fidl::client::QueryResponseFut<
7368        DirConnectorRouterRouteResult,
7369        fidl::encoding::DefaultFuchsiaResourceDialect,
7370    >;
7371    fn r#route(
7372        &self,
7373        mut request: &RouteRequest,
7374        mut instance_token: fidl::EventPair,
7375        mut handle: fidl::EventPair,
7376    ) -> Self::RouteResponseFut {
7377        fn _decode(
7378            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7379        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7380            let _response = fidl::client::decode_transaction_body::<
7381                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7382                fidl::encoding::DefaultFuchsiaResourceDialect,
7383                0x233f2ac038127462,
7384            >(_buf?)?
7385            .into_result::<DirConnectorRouterMarker>("route")?;
7386            Ok(_response.map(|x| x.response))
7387        }
7388        self.client
7389            .send_query_and_decode::<DirConnectorRouterRouteRequest, DirConnectorRouterRouteResult>(
7390                (request, instance_token, handle),
7391                0x233f2ac038127462,
7392                fidl::encoding::DynamicFlags::FLEXIBLE,
7393                _decode,
7394            )
7395    }
7396}
7397
7398pub struct DirConnectorRouterEventStream {
7399    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7400}
7401
7402impl std::marker::Unpin for DirConnectorRouterEventStream {}
7403
7404impl futures::stream::FusedStream for DirConnectorRouterEventStream {
7405    fn is_terminated(&self) -> bool {
7406        self.event_receiver.is_terminated()
7407    }
7408}
7409
7410impl futures::Stream for DirConnectorRouterEventStream {
7411    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
7412
7413    fn poll_next(
7414        mut self: std::pin::Pin<&mut Self>,
7415        cx: &mut std::task::Context<'_>,
7416    ) -> std::task::Poll<Option<Self::Item>> {
7417        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7418            &mut self.event_receiver,
7419            cx
7420        )?) {
7421            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
7422            None => std::task::Poll::Ready(None),
7423        }
7424    }
7425}
7426
7427#[derive(Debug)]
7428pub enum DirConnectorRouterEvent {
7429    #[non_exhaustive]
7430    _UnknownEvent {
7431        /// Ordinal of the event that was sent.
7432        ordinal: u64,
7433    },
7434}
7435
7436impl DirConnectorRouterEvent {
7437    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
7438    fn decode(
7439        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7440    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7441        let (bytes, _handles) = buf.split_mut();
7442        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7443        debug_assert_eq!(tx_header.tx_id, 0);
7444        match tx_header.ordinal {
7445            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7446                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7447            }
7448            _ => Err(fidl::Error::UnknownOrdinal {
7449                ordinal: tx_header.ordinal,
7450                protocol_name:
7451                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7452            }),
7453        }
7454    }
7455}
7456
7457/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouter.
7458pub struct DirConnectorRouterRequestStream {
7459    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7460    is_terminated: bool,
7461}
7462
7463impl std::marker::Unpin for DirConnectorRouterRequestStream {}
7464
7465impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
7466    fn is_terminated(&self) -> bool {
7467        self.is_terminated
7468    }
7469}
7470
7471impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
7472    type Protocol = DirConnectorRouterMarker;
7473    type ControlHandle = DirConnectorRouterControlHandle;
7474
7475    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7476        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7477    }
7478
7479    fn control_handle(&self) -> Self::ControlHandle {
7480        DirConnectorRouterControlHandle { inner: self.inner.clone() }
7481    }
7482
7483    fn into_inner(
7484        self,
7485    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7486    {
7487        (self.inner, self.is_terminated)
7488    }
7489
7490    fn from_inner(
7491        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7492        is_terminated: bool,
7493    ) -> Self {
7494        Self { inner, is_terminated }
7495    }
7496}
7497
7498impl futures::Stream for DirConnectorRouterRequestStream {
7499    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
7500
7501    fn poll_next(
7502        mut self: std::pin::Pin<&mut Self>,
7503        cx: &mut std::task::Context<'_>,
7504    ) -> std::task::Poll<Option<Self::Item>> {
7505        let this = &mut *self;
7506        if this.inner.check_shutdown(cx) {
7507            this.is_terminated = true;
7508            return std::task::Poll::Ready(None);
7509        }
7510        if this.is_terminated {
7511            panic!("polled DirConnectorRouterRequestStream after completion");
7512        }
7513        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7514            |bytes, handles| {
7515                match this.inner.channel().read_etc(cx, bytes, handles) {
7516                    std::task::Poll::Ready(Ok(())) => {}
7517                    std::task::Poll::Pending => return std::task::Poll::Pending,
7518                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7519                        this.is_terminated = true;
7520                        return std::task::Poll::Ready(None);
7521                    }
7522                    std::task::Poll::Ready(Err(e)) => {
7523                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7524                            e.into(),
7525                        ))));
7526                    }
7527                }
7528
7529                // A message has been received from the channel
7530                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7531
7532                std::task::Poll::Ready(Some(match header.ordinal {
7533                0x233f2ac038127462 => {
7534                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7535                    let mut req = fidl::new_empty!(DirConnectorRouterRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7536                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7537                    let control_handle = DirConnectorRouterControlHandle {
7538                        inner: this.inner.clone(),
7539                    };
7540                    Ok(DirConnectorRouterRequest::Route {request: req.request,
7541instance_token: req.instance_token,
7542handle: req.handle,
7543
7544                        responder: DirConnectorRouterRouteResponder {
7545                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7546                            tx_id: header.tx_id,
7547                        },
7548                    })
7549                }
7550                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7551                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7552                        ordinal: header.ordinal,
7553                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7554                        method_type: fidl::MethodType::OneWay,
7555                    })
7556                }
7557                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7558                    this.inner.send_framework_err(
7559                        fidl::encoding::FrameworkErr::UnknownMethod,
7560                        header.tx_id,
7561                        header.ordinal,
7562                        header.dynamic_flags(),
7563                        (bytes, handles),
7564                    )?;
7565                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7566                        ordinal: header.ordinal,
7567                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7568                        method_type: fidl::MethodType::TwoWay,
7569                    })
7570                }
7571                _ => Err(fidl::Error::UnknownOrdinal {
7572                    ordinal: header.ordinal,
7573                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7574                }),
7575            }))
7576            },
7577        )
7578    }
7579}
7580
7581/// A factory for `DirConnector` capabilities.
7582#[derive(Debug)]
7583pub enum DirConnectorRouterRequest {
7584    /// Attempts to produce a `DirConnector` capability from this
7585    /// `DirConnectorRouter`.
7586    ///
7587    /// `request` contains context for this route, and `instance_token`
7588    /// references the component that the routing operation is being performed
7589    /// for.
7590    ///
7591    /// This will return:
7592    ///
7593    /// - `SUCCESS` if `handle` has been associated with a connector.
7594    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7595    ///   will be closed.
7596    /// - An error, if the operation failed.
7597    Route {
7598        request: RouteRequest,
7599        instance_token: fidl::EventPair,
7600        handle: fidl::EventPair,
7601        responder: DirConnectorRouterRouteResponder,
7602    },
7603    /// An interaction was received which does not match any known method.
7604    #[non_exhaustive]
7605    _UnknownMethod {
7606        /// Ordinal of the method that was called.
7607        ordinal: u64,
7608        control_handle: DirConnectorRouterControlHandle,
7609        method_type: fidl::MethodType,
7610    },
7611}
7612
7613impl DirConnectorRouterRequest {
7614    #[allow(irrefutable_let_patterns)]
7615    pub fn into_route(
7616        self,
7617    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DirConnectorRouterRouteResponder)>
7618    {
7619        if let DirConnectorRouterRequest::Route { request, instance_token, handle, responder } =
7620            self
7621        {
7622            Some((request, instance_token, handle, responder))
7623        } else {
7624            None
7625        }
7626    }
7627
7628    /// Name of the method defined in FIDL
7629    pub fn method_name(&self) -> &'static str {
7630        match *self {
7631            DirConnectorRouterRequest::Route { .. } => "route",
7632            DirConnectorRouterRequest::_UnknownMethod {
7633                method_type: fidl::MethodType::OneWay,
7634                ..
7635            } => "unknown one-way method",
7636            DirConnectorRouterRequest::_UnknownMethod {
7637                method_type: fidl::MethodType::TwoWay,
7638                ..
7639            } => "unknown two-way method",
7640        }
7641    }
7642}
7643
7644#[derive(Debug, Clone)]
7645pub struct DirConnectorRouterControlHandle {
7646    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7647}
7648
7649impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
7650    fn shutdown(&self) {
7651        self.inner.shutdown()
7652    }
7653
7654    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7655        self.inner.shutdown_with_epitaph(status)
7656    }
7657
7658    fn is_closed(&self) -> bool {
7659        self.inner.channel().is_closed()
7660    }
7661    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7662        self.inner.channel().on_closed()
7663    }
7664
7665    #[cfg(target_os = "fuchsia")]
7666    fn signal_peer(
7667        &self,
7668        clear_mask: zx::Signals,
7669        set_mask: zx::Signals,
7670    ) -> Result<(), zx_status::Status> {
7671        use fidl::Peered;
7672        self.inner.channel().signal_peer(clear_mask, set_mask)
7673    }
7674}
7675
7676impl DirConnectorRouterControlHandle {}
7677
7678#[must_use = "FIDL methods require a response to be sent"]
7679#[derive(Debug)]
7680pub struct DirConnectorRouterRouteResponder {
7681    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
7682    tx_id: u32,
7683}
7684
7685/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
7686/// if the responder is dropped without sending a response, so that the client
7687/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7688impl std::ops::Drop for DirConnectorRouterRouteResponder {
7689    fn drop(&mut self) {
7690        self.control_handle.shutdown();
7691        // Safety: drops once, never accessed again
7692        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7693    }
7694}
7695
7696impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
7697    type ControlHandle = DirConnectorRouterControlHandle;
7698
7699    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
7700        &self.control_handle
7701    }
7702
7703    fn drop_without_shutdown(mut self) {
7704        // Safety: drops once, never accessed again due to mem::forget
7705        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7706        // Prevent Drop from running (which would shut down the channel)
7707        std::mem::forget(self);
7708    }
7709}
7710
7711impl DirConnectorRouterRouteResponder {
7712    /// Sends a response to the FIDL transaction.
7713    ///
7714    /// Sets the channel to shutdown if an error occurs.
7715    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7716        let _result = self.send_raw(result);
7717        if _result.is_err() {
7718            self.control_handle.shutdown();
7719        }
7720        self.drop_without_shutdown();
7721        _result
7722    }
7723
7724    /// Similar to "send" but does not shutdown the channel if an error occurs.
7725    pub fn send_no_shutdown_on_err(
7726        self,
7727        mut result: Result<RouterResponse, i32>,
7728    ) -> Result<(), fidl::Error> {
7729        let _result = self.send_raw(result);
7730        self.drop_without_shutdown();
7731        _result
7732    }
7733
7734    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7735        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7736            DirConnectorRouterRouteResponse,
7737            i32,
7738        >>(
7739            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7740            self.tx_id,
7741            0x233f2ac038127462,
7742            fidl::encoding::DynamicFlags::FLEXIBLE,
7743        )
7744    }
7745}
7746
7747#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7748pub struct DirReceiverMarker;
7749
7750impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
7751    type Proxy = DirReceiverProxy;
7752    type RequestStream = DirReceiverRequestStream;
7753    #[cfg(target_os = "fuchsia")]
7754    type SynchronousProxy = DirReceiverSynchronousProxy;
7755
7756    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DirReceiver";
7757}
7758impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
7759
7760pub trait DirReceiverProxyInterface: Send + Sync {
7761    fn r#receive(
7762        &self,
7763        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7764        path: &str,
7765        rights: fidl_fuchsia_io::Flags,
7766    ) -> Result<(), fidl::Error>;
7767}
7768#[derive(Debug)]
7769#[cfg(target_os = "fuchsia")]
7770pub struct DirReceiverSynchronousProxy {
7771    client: fidl::client::sync::Client,
7772}
7773
7774#[cfg(target_os = "fuchsia")]
7775impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
7776    type Proxy = DirReceiverProxy;
7777    type Protocol = DirReceiverMarker;
7778
7779    fn from_channel(inner: fidl::Channel) -> Self {
7780        Self::new(inner)
7781    }
7782
7783    fn into_channel(self) -> fidl::Channel {
7784        self.client.into_channel()
7785    }
7786
7787    fn as_channel(&self) -> &fidl::Channel {
7788        self.client.as_channel()
7789    }
7790}
7791
7792#[cfg(target_os = "fuchsia")]
7793impl DirReceiverSynchronousProxy {
7794    pub fn new(channel: fidl::Channel) -> Self {
7795        Self { client: fidl::client::sync::Client::new(channel) }
7796    }
7797
7798    pub fn into_channel(self) -> fidl::Channel {
7799        self.client.into_channel()
7800    }
7801
7802    /// Waits until an event arrives and returns it. It is safe for other
7803    /// threads to make concurrent requests while waiting for an event.
7804    pub fn wait_for_event(
7805        &self,
7806        deadline: zx::MonotonicInstant,
7807    ) -> Result<DirReceiverEvent, fidl::Error> {
7808        DirReceiverEvent::decode(self.client.wait_for_event::<DirReceiverMarker>(deadline)?)
7809    }
7810
7811    /// `Receive` will be called by component manager whenever a new handle has
7812    /// been given to any `DirConnector` associated with this `DirReceiver`.
7813    pub fn r#receive(
7814        &self,
7815        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7816        mut path: &str,
7817        mut rights: fidl_fuchsia_io::Flags,
7818    ) -> Result<(), fidl::Error> {
7819        self.client.send::<DirReceiverReceiveRequest>(
7820            (channel, path, rights),
7821            0x4ac564d726bb325e,
7822            fidl::encoding::DynamicFlags::empty(),
7823        )
7824    }
7825}
7826
7827#[cfg(target_os = "fuchsia")]
7828impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
7829    fn from(value: DirReceiverSynchronousProxy) -> Self {
7830        value.into_channel().into()
7831    }
7832}
7833
7834#[cfg(target_os = "fuchsia")]
7835impl From<fidl::Channel> for DirReceiverSynchronousProxy {
7836    fn from(value: fidl::Channel) -> Self {
7837        Self::new(value)
7838    }
7839}
7840
7841#[cfg(target_os = "fuchsia")]
7842impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
7843    type Protocol = DirReceiverMarker;
7844
7845    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
7846        Self::new(value.into_channel())
7847    }
7848}
7849
7850#[derive(Debug, Clone)]
7851pub struct DirReceiverProxy {
7852    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7853}
7854
7855impl fidl::endpoints::Proxy for DirReceiverProxy {
7856    type Protocol = DirReceiverMarker;
7857
7858    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7859        Self::new(inner)
7860    }
7861
7862    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7863        self.client.into_channel().map_err(|client| Self { client })
7864    }
7865
7866    fn as_channel(&self) -> &::fidl::AsyncChannel {
7867        self.client.as_channel()
7868    }
7869}
7870
7871impl DirReceiverProxy {
7872    /// Create a new Proxy for fuchsia.component.runtime/DirReceiver.
7873    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7874        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7875        Self { client: fidl::client::Client::new(channel, protocol_name) }
7876    }
7877
7878    /// Get a Stream of events from the remote end of the protocol.
7879    ///
7880    /// # Panics
7881    ///
7882    /// Panics if the event stream was already taken.
7883    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7884        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7885    }
7886
7887    /// `Receive` will be called by component manager whenever a new handle has
7888    /// been given to any `DirConnector` associated with this `DirReceiver`.
7889    pub fn r#receive(
7890        &self,
7891        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7892        mut path: &str,
7893        mut rights: fidl_fuchsia_io::Flags,
7894    ) -> Result<(), fidl::Error> {
7895        DirReceiverProxyInterface::r#receive(self, channel, path, rights)
7896    }
7897}
7898
7899impl DirReceiverProxyInterface for DirReceiverProxy {
7900    fn r#receive(
7901        &self,
7902        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7903        mut path: &str,
7904        mut rights: fidl_fuchsia_io::Flags,
7905    ) -> Result<(), fidl::Error> {
7906        self.client.send::<DirReceiverReceiveRequest>(
7907            (channel, path, rights),
7908            0x4ac564d726bb325e,
7909            fidl::encoding::DynamicFlags::empty(),
7910        )
7911    }
7912}
7913
7914pub struct DirReceiverEventStream {
7915    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7916}
7917
7918impl std::marker::Unpin for DirReceiverEventStream {}
7919
7920impl futures::stream::FusedStream for DirReceiverEventStream {
7921    fn is_terminated(&self) -> bool {
7922        self.event_receiver.is_terminated()
7923    }
7924}
7925
7926impl futures::Stream for DirReceiverEventStream {
7927    type Item = Result<DirReceiverEvent, fidl::Error>;
7928
7929    fn poll_next(
7930        mut self: std::pin::Pin<&mut Self>,
7931        cx: &mut std::task::Context<'_>,
7932    ) -> std::task::Poll<Option<Self::Item>> {
7933        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7934            &mut self.event_receiver,
7935            cx
7936        )?) {
7937            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7938            None => std::task::Poll::Ready(None),
7939        }
7940    }
7941}
7942
7943#[derive(Debug)]
7944pub enum DirReceiverEvent {}
7945
7946impl DirReceiverEvent {
7947    /// Decodes a message buffer as a [`DirReceiverEvent`].
7948    fn decode(
7949        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7950    ) -> Result<DirReceiverEvent, fidl::Error> {
7951        let (bytes, _handles) = buf.split_mut();
7952        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7953        debug_assert_eq!(tx_header.tx_id, 0);
7954        match tx_header.ordinal {
7955            _ => Err(fidl::Error::UnknownOrdinal {
7956                ordinal: tx_header.ordinal,
7957                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7958            }),
7959        }
7960    }
7961}
7962
7963/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiver.
7964pub struct DirReceiverRequestStream {
7965    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7966    is_terminated: bool,
7967}
7968
7969impl std::marker::Unpin for DirReceiverRequestStream {}
7970
7971impl futures::stream::FusedStream for DirReceiverRequestStream {
7972    fn is_terminated(&self) -> bool {
7973        self.is_terminated
7974    }
7975}
7976
7977impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
7978    type Protocol = DirReceiverMarker;
7979    type ControlHandle = DirReceiverControlHandle;
7980
7981    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7982        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7983    }
7984
7985    fn control_handle(&self) -> Self::ControlHandle {
7986        DirReceiverControlHandle { inner: self.inner.clone() }
7987    }
7988
7989    fn into_inner(
7990        self,
7991    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7992    {
7993        (self.inner, self.is_terminated)
7994    }
7995
7996    fn from_inner(
7997        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7998        is_terminated: bool,
7999    ) -> Self {
8000        Self { inner, is_terminated }
8001    }
8002}
8003
8004impl futures::Stream for DirReceiverRequestStream {
8005    type Item = Result<DirReceiverRequest, fidl::Error>;
8006
8007    fn poll_next(
8008        mut self: std::pin::Pin<&mut Self>,
8009        cx: &mut std::task::Context<'_>,
8010    ) -> std::task::Poll<Option<Self::Item>> {
8011        let this = &mut *self;
8012        if this.inner.check_shutdown(cx) {
8013            this.is_terminated = true;
8014            return std::task::Poll::Ready(None);
8015        }
8016        if this.is_terminated {
8017            panic!("polled DirReceiverRequestStream after completion");
8018        }
8019        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8020            |bytes, handles| {
8021                match this.inner.channel().read_etc(cx, bytes, handles) {
8022                    std::task::Poll::Ready(Ok(())) => {}
8023                    std::task::Poll::Pending => return std::task::Poll::Pending,
8024                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8025                        this.is_terminated = true;
8026                        return std::task::Poll::Ready(None);
8027                    }
8028                    std::task::Poll::Ready(Err(e)) => {
8029                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8030                            e.into(),
8031                        ))));
8032                    }
8033                }
8034
8035                // A message has been received from the channel
8036                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8037
8038                std::task::Poll::Ready(Some(match header.ordinal {
8039                    0x4ac564d726bb325e => {
8040                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8041                        let mut req = fidl::new_empty!(
8042                            DirReceiverReceiveRequest,
8043                            fidl::encoding::DefaultFuchsiaResourceDialect
8044                        );
8045                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8046                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
8047                        Ok(DirReceiverRequest::Receive {
8048                            channel: req.channel,
8049                            path: req.path,
8050                            rights: req.rights,
8051
8052                            control_handle,
8053                        })
8054                    }
8055                    _ => Err(fidl::Error::UnknownOrdinal {
8056                        ordinal: header.ordinal,
8057                        protocol_name:
8058                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8059                    }),
8060                }))
8061            },
8062        )
8063    }
8064}
8065
8066/// A `DirReceiver` represents the receiving end of a `DirConnector`.
8067#[derive(Debug)]
8068pub enum DirReceiverRequest {
8069    /// `Receive` will be called by component manager whenever a new handle has
8070    /// been given to any `DirConnector` associated with this `DirReceiver`.
8071    Receive {
8072        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8073        path: String,
8074        rights: fidl_fuchsia_io::Flags,
8075        control_handle: DirReceiverControlHandle,
8076    },
8077}
8078
8079impl DirReceiverRequest {
8080    #[allow(irrefutable_let_patterns)]
8081    pub fn into_receive(
8082        self,
8083    ) -> Option<(
8084        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8085        String,
8086        fidl_fuchsia_io::Flags,
8087        DirReceiverControlHandle,
8088    )> {
8089        if let DirReceiverRequest::Receive { channel, path, rights, control_handle } = self {
8090            Some((channel, path, rights, control_handle))
8091        } else {
8092            None
8093        }
8094    }
8095
8096    /// Name of the method defined in FIDL
8097    pub fn method_name(&self) -> &'static str {
8098        match *self {
8099            DirReceiverRequest::Receive { .. } => "receive",
8100        }
8101    }
8102}
8103
8104#[derive(Debug, Clone)]
8105pub struct DirReceiverControlHandle {
8106    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8107}
8108
8109impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
8110    fn shutdown(&self) {
8111        self.inner.shutdown()
8112    }
8113
8114    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8115        self.inner.shutdown_with_epitaph(status)
8116    }
8117
8118    fn is_closed(&self) -> bool {
8119        self.inner.channel().is_closed()
8120    }
8121    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8122        self.inner.channel().on_closed()
8123    }
8124
8125    #[cfg(target_os = "fuchsia")]
8126    fn signal_peer(
8127        &self,
8128        clear_mask: zx::Signals,
8129        set_mask: zx::Signals,
8130    ) -> Result<(), zx_status::Status> {
8131        use fidl::Peered;
8132        self.inner.channel().signal_peer(clear_mask, set_mask)
8133    }
8134}
8135
8136impl DirReceiverControlHandle {}
8137
8138#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8139pub struct ReceiverMarker;
8140
8141impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
8142    type Proxy = ReceiverProxy;
8143    type RequestStream = ReceiverRequestStream;
8144    #[cfg(target_os = "fuchsia")]
8145    type SynchronousProxy = ReceiverSynchronousProxy;
8146
8147    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Receiver";
8148}
8149impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
8150
8151pub trait ReceiverProxyInterface: Send + Sync {
8152    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
8153}
8154#[derive(Debug)]
8155#[cfg(target_os = "fuchsia")]
8156pub struct ReceiverSynchronousProxy {
8157    client: fidl::client::sync::Client,
8158}
8159
8160#[cfg(target_os = "fuchsia")]
8161impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
8162    type Proxy = ReceiverProxy;
8163    type Protocol = ReceiverMarker;
8164
8165    fn from_channel(inner: fidl::Channel) -> Self {
8166        Self::new(inner)
8167    }
8168
8169    fn into_channel(self) -> fidl::Channel {
8170        self.client.into_channel()
8171    }
8172
8173    fn as_channel(&self) -> &fidl::Channel {
8174        self.client.as_channel()
8175    }
8176}
8177
8178#[cfg(target_os = "fuchsia")]
8179impl ReceiverSynchronousProxy {
8180    pub fn new(channel: fidl::Channel) -> Self {
8181        Self { client: fidl::client::sync::Client::new(channel) }
8182    }
8183
8184    pub fn into_channel(self) -> fidl::Channel {
8185        self.client.into_channel()
8186    }
8187
8188    /// Waits until an event arrives and returns it. It is safe for other
8189    /// threads to make concurrent requests while waiting for an event.
8190    pub fn wait_for_event(
8191        &self,
8192        deadline: zx::MonotonicInstant,
8193    ) -> Result<ReceiverEvent, fidl::Error> {
8194        ReceiverEvent::decode(self.client.wait_for_event::<ReceiverMarker>(deadline)?)
8195    }
8196
8197    /// `Receive` will be called by component manager whenever an new handle has
8198    /// been given to any `Connector` associated with this `Receiver`.
8199    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8200        self.client.send::<ReceiverReceiveRequest>(
8201            (channel,),
8202            0x609ca5c7943b58d0,
8203            fidl::encoding::DynamicFlags::empty(),
8204        )
8205    }
8206}
8207
8208#[cfg(target_os = "fuchsia")]
8209impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
8210    fn from(value: ReceiverSynchronousProxy) -> Self {
8211        value.into_channel().into()
8212    }
8213}
8214
8215#[cfg(target_os = "fuchsia")]
8216impl From<fidl::Channel> for ReceiverSynchronousProxy {
8217    fn from(value: fidl::Channel) -> Self {
8218        Self::new(value)
8219    }
8220}
8221
8222#[cfg(target_os = "fuchsia")]
8223impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
8224    type Protocol = ReceiverMarker;
8225
8226    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
8227        Self::new(value.into_channel())
8228    }
8229}
8230
8231#[derive(Debug, Clone)]
8232pub struct ReceiverProxy {
8233    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8234}
8235
8236impl fidl::endpoints::Proxy for ReceiverProxy {
8237    type Protocol = ReceiverMarker;
8238
8239    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8240        Self::new(inner)
8241    }
8242
8243    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8244        self.client.into_channel().map_err(|client| Self { client })
8245    }
8246
8247    fn as_channel(&self) -> &::fidl::AsyncChannel {
8248        self.client.as_channel()
8249    }
8250}
8251
8252impl ReceiverProxy {
8253    /// Create a new Proxy for fuchsia.component.runtime/Receiver.
8254    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8255        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8256        Self { client: fidl::client::Client::new(channel, protocol_name) }
8257    }
8258
8259    /// Get a Stream of events from the remote end of the protocol.
8260    ///
8261    /// # Panics
8262    ///
8263    /// Panics if the event stream was already taken.
8264    pub fn take_event_stream(&self) -> ReceiverEventStream {
8265        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8266    }
8267
8268    /// `Receive` will be called by component manager whenever an new handle has
8269    /// been given to any `Connector` associated with this `Receiver`.
8270    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8271        ReceiverProxyInterface::r#receive(self, channel)
8272    }
8273}
8274
8275impl ReceiverProxyInterface for ReceiverProxy {
8276    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8277        self.client.send::<ReceiverReceiveRequest>(
8278            (channel,),
8279            0x609ca5c7943b58d0,
8280            fidl::encoding::DynamicFlags::empty(),
8281        )
8282    }
8283}
8284
8285pub struct ReceiverEventStream {
8286    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8287}
8288
8289impl std::marker::Unpin for ReceiverEventStream {}
8290
8291impl futures::stream::FusedStream for ReceiverEventStream {
8292    fn is_terminated(&self) -> bool {
8293        self.event_receiver.is_terminated()
8294    }
8295}
8296
8297impl futures::Stream for ReceiverEventStream {
8298    type Item = Result<ReceiverEvent, fidl::Error>;
8299
8300    fn poll_next(
8301        mut self: std::pin::Pin<&mut Self>,
8302        cx: &mut std::task::Context<'_>,
8303    ) -> std::task::Poll<Option<Self::Item>> {
8304        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8305            &mut self.event_receiver,
8306            cx
8307        )?) {
8308            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8309            None => std::task::Poll::Ready(None),
8310        }
8311    }
8312}
8313
8314#[derive(Debug)]
8315pub enum ReceiverEvent {}
8316
8317impl ReceiverEvent {
8318    /// Decodes a message buffer as a [`ReceiverEvent`].
8319    fn decode(
8320        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8321    ) -> Result<ReceiverEvent, fidl::Error> {
8322        let (bytes, _handles) = buf.split_mut();
8323        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8324        debug_assert_eq!(tx_header.tx_id, 0);
8325        match tx_header.ordinal {
8326            _ => Err(fidl::Error::UnknownOrdinal {
8327                ordinal: tx_header.ordinal,
8328                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8329            }),
8330        }
8331    }
8332}
8333
8334/// A Stream of incoming requests for fuchsia.component.runtime/Receiver.
8335pub struct ReceiverRequestStream {
8336    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8337    is_terminated: bool,
8338}
8339
8340impl std::marker::Unpin for ReceiverRequestStream {}
8341
8342impl futures::stream::FusedStream for ReceiverRequestStream {
8343    fn is_terminated(&self) -> bool {
8344        self.is_terminated
8345    }
8346}
8347
8348impl fidl::endpoints::RequestStream for ReceiverRequestStream {
8349    type Protocol = ReceiverMarker;
8350    type ControlHandle = ReceiverControlHandle;
8351
8352    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8353        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8354    }
8355
8356    fn control_handle(&self) -> Self::ControlHandle {
8357        ReceiverControlHandle { inner: self.inner.clone() }
8358    }
8359
8360    fn into_inner(
8361        self,
8362    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8363    {
8364        (self.inner, self.is_terminated)
8365    }
8366
8367    fn from_inner(
8368        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8369        is_terminated: bool,
8370    ) -> Self {
8371        Self { inner, is_terminated }
8372    }
8373}
8374
8375impl futures::Stream for ReceiverRequestStream {
8376    type Item = Result<ReceiverRequest, fidl::Error>;
8377
8378    fn poll_next(
8379        mut self: std::pin::Pin<&mut Self>,
8380        cx: &mut std::task::Context<'_>,
8381    ) -> std::task::Poll<Option<Self::Item>> {
8382        let this = &mut *self;
8383        if this.inner.check_shutdown(cx) {
8384            this.is_terminated = true;
8385            return std::task::Poll::Ready(None);
8386        }
8387        if this.is_terminated {
8388            panic!("polled ReceiverRequestStream after completion");
8389        }
8390        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8391            |bytes, handles| {
8392                match this.inner.channel().read_etc(cx, bytes, handles) {
8393                    std::task::Poll::Ready(Ok(())) => {}
8394                    std::task::Poll::Pending => return std::task::Poll::Pending,
8395                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8396                        this.is_terminated = true;
8397                        return std::task::Poll::Ready(None);
8398                    }
8399                    std::task::Poll::Ready(Err(e)) => {
8400                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8401                            e.into(),
8402                        ))));
8403                    }
8404                }
8405
8406                // A message has been received from the channel
8407                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8408
8409                std::task::Poll::Ready(Some(match header.ordinal {
8410                    0x609ca5c7943b58d0 => {
8411                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8412                        let mut req = fidl::new_empty!(
8413                            ReceiverReceiveRequest,
8414                            fidl::encoding::DefaultFuchsiaResourceDialect
8415                        );
8416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8417                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8418                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8419                    }
8420                    _ => Err(fidl::Error::UnknownOrdinal {
8421                        ordinal: header.ordinal,
8422                        protocol_name:
8423                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8424                    }),
8425                }))
8426            },
8427        )
8428    }
8429}
8430
8431/// A `Receiver` represents the receiving end of a `Connector`.
8432#[derive(Debug)]
8433pub enum ReceiverRequest {
8434    /// `Receive` will be called by component manager whenever an new handle has
8435    /// been given to any `Connector` associated with this `Receiver`.
8436    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
8437}
8438
8439impl ReceiverRequest {
8440    #[allow(irrefutable_let_patterns)]
8441    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
8442        if let ReceiverRequest::Receive { channel, control_handle } = self {
8443            Some((channel, control_handle))
8444        } else {
8445            None
8446        }
8447    }
8448
8449    /// Name of the method defined in FIDL
8450    pub fn method_name(&self) -> &'static str {
8451        match *self {
8452            ReceiverRequest::Receive { .. } => "receive",
8453        }
8454    }
8455}
8456
8457#[derive(Debug, Clone)]
8458pub struct ReceiverControlHandle {
8459    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8460}
8461
8462impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
8463    fn shutdown(&self) {
8464        self.inner.shutdown()
8465    }
8466
8467    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8468        self.inner.shutdown_with_epitaph(status)
8469    }
8470
8471    fn is_closed(&self) -> bool {
8472        self.inner.channel().is_closed()
8473    }
8474    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8475        self.inner.channel().on_closed()
8476    }
8477
8478    #[cfg(target_os = "fuchsia")]
8479    fn signal_peer(
8480        &self,
8481        clear_mask: zx::Signals,
8482        set_mask: zx::Signals,
8483    ) -> Result<(), zx_status::Status> {
8484        use fidl::Peered;
8485        self.inner.channel().signal_peer(clear_mask, set_mask)
8486    }
8487}
8488
8489impl ReceiverControlHandle {}
8490
8491mod internal {
8492    use super::*;
8493
8494    impl fidl::encoding::ResourceTypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8495        type Borrowed<'a> = &'a mut Self;
8496        fn take_or_borrow<'a>(
8497            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8498        ) -> Self::Borrowed<'a> {
8499            value
8500        }
8501    }
8502
8503    unsafe impl fidl::encoding::TypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8504        type Owned = Self;
8505
8506        #[inline(always)]
8507        fn inline_align(_context: fidl::encoding::Context) -> usize {
8508            4
8509        }
8510
8511        #[inline(always)]
8512        fn inline_size(_context: fidl::encoding::Context) -> usize {
8513            8
8514        }
8515    }
8516
8517    unsafe impl
8518        fidl::encoding::Encode<
8519            CapabilitiesCapabilityAssociateHandleRequest,
8520            fidl::encoding::DefaultFuchsiaResourceDialect,
8521        > for &mut CapabilitiesCapabilityAssociateHandleRequest
8522    {
8523        #[inline]
8524        unsafe fn encode(
8525            self,
8526            encoder: &mut fidl::encoding::Encoder<
8527                '_,
8528                fidl::encoding::DefaultFuchsiaResourceDialect,
8529            >,
8530            offset: usize,
8531            _depth: fidl::encoding::Depth,
8532        ) -> fidl::Result<()> {
8533            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8534            // Delegate to tuple encoding.
8535            fidl::encoding::Encode::<
8536                CapabilitiesCapabilityAssociateHandleRequest,
8537                fidl::encoding::DefaultFuchsiaResourceDialect,
8538            >::encode(
8539                (
8540                    <fidl::encoding::HandleType<
8541                        fidl::EventPair,
8542                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8543                        2147483648,
8544                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8545                        &mut self.capability_handle,
8546                    ),
8547                    <fidl::encoding::HandleType<
8548                        fidl::EventPair,
8549                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8550                        2147483648,
8551                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8552                        &mut self.other_handle,
8553                    ),
8554                ),
8555                encoder,
8556                offset,
8557                _depth,
8558            )
8559        }
8560    }
8561    unsafe impl<
8562        T0: fidl::encoding::Encode<
8563                fidl::encoding::HandleType<
8564                    fidl::EventPair,
8565                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8566                    2147483648,
8567                >,
8568                fidl::encoding::DefaultFuchsiaResourceDialect,
8569            >,
8570        T1: fidl::encoding::Encode<
8571                fidl::encoding::HandleType<
8572                    fidl::EventPair,
8573                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8574                    2147483648,
8575                >,
8576                fidl::encoding::DefaultFuchsiaResourceDialect,
8577            >,
8578    >
8579        fidl::encoding::Encode<
8580            CapabilitiesCapabilityAssociateHandleRequest,
8581            fidl::encoding::DefaultFuchsiaResourceDialect,
8582        > for (T0, T1)
8583    {
8584        #[inline]
8585        unsafe fn encode(
8586            self,
8587            encoder: &mut fidl::encoding::Encoder<
8588                '_,
8589                fidl::encoding::DefaultFuchsiaResourceDialect,
8590            >,
8591            offset: usize,
8592            depth: fidl::encoding::Depth,
8593        ) -> fidl::Result<()> {
8594            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8595            // Zero out padding regions. There's no need to apply masks
8596            // because the unmasked parts will be overwritten by fields.
8597            // Write the fields.
8598            self.0.encode(encoder, offset + 0, depth)?;
8599            self.1.encode(encoder, offset + 4, depth)?;
8600            Ok(())
8601        }
8602    }
8603
8604    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8605        for CapabilitiesCapabilityAssociateHandleRequest
8606    {
8607        #[inline(always)]
8608        fn new_empty() -> Self {
8609            Self {
8610                capability_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8611                other_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8612            }
8613        }
8614
8615        #[inline]
8616        unsafe fn decode(
8617            &mut self,
8618            decoder: &mut fidl::encoding::Decoder<
8619                '_,
8620                fidl::encoding::DefaultFuchsiaResourceDialect,
8621            >,
8622            offset: usize,
8623            _depth: fidl::encoding::Depth,
8624        ) -> fidl::Result<()> {
8625            decoder.debug_check_bounds::<Self>(offset);
8626            // Verify that padding bytes are zero.
8627            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.capability_handle, decoder, offset + 0, _depth)?;
8628            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.other_handle, decoder, offset + 4, _depth)?;
8629            Ok(())
8630        }
8631    }
8632
8633    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorCreateRequest {
8634        type Borrowed<'a> = &'a mut Self;
8635        fn take_or_borrow<'a>(
8636            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8637        ) -> Self::Borrowed<'a> {
8638            value
8639        }
8640    }
8641
8642    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorCreateRequest {
8643        type Owned = Self;
8644
8645        #[inline(always)]
8646        fn inline_align(_context: fidl::encoding::Context) -> usize {
8647            4
8648        }
8649
8650        #[inline(always)]
8651        fn inline_size(_context: fidl::encoding::Context) -> usize {
8652            8
8653        }
8654    }
8655
8656    unsafe impl
8657        fidl::encoding::Encode<
8658            CapabilitiesConnectorCreateRequest,
8659            fidl::encoding::DefaultFuchsiaResourceDialect,
8660        > for &mut CapabilitiesConnectorCreateRequest
8661    {
8662        #[inline]
8663        unsafe fn encode(
8664            self,
8665            encoder: &mut fidl::encoding::Encoder<
8666                '_,
8667                fidl::encoding::DefaultFuchsiaResourceDialect,
8668            >,
8669            offset: usize,
8670            _depth: fidl::encoding::Depth,
8671        ) -> fidl::Result<()> {
8672            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8673            // Delegate to tuple encoding.
8674            fidl::encoding::Encode::<CapabilitiesConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8675                (
8676                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector),
8677                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
8678                ),
8679                encoder, offset, _depth
8680            )
8681        }
8682    }
8683    unsafe impl<
8684        T0: fidl::encoding::Encode<
8685                fidl::encoding::HandleType<
8686                    fidl::EventPair,
8687                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8688                    2147483648,
8689                >,
8690                fidl::encoding::DefaultFuchsiaResourceDialect,
8691            >,
8692        T1: fidl::encoding::Encode<
8693                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8694                fidl::encoding::DefaultFuchsiaResourceDialect,
8695            >,
8696    >
8697        fidl::encoding::Encode<
8698            CapabilitiesConnectorCreateRequest,
8699            fidl::encoding::DefaultFuchsiaResourceDialect,
8700        > for (T0, T1)
8701    {
8702        #[inline]
8703        unsafe fn encode(
8704            self,
8705            encoder: &mut fidl::encoding::Encoder<
8706                '_,
8707                fidl::encoding::DefaultFuchsiaResourceDialect,
8708            >,
8709            offset: usize,
8710            depth: fidl::encoding::Depth,
8711        ) -> fidl::Result<()> {
8712            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8713            // Zero out padding regions. There's no need to apply masks
8714            // because the unmasked parts will be overwritten by fields.
8715            // Write the fields.
8716            self.0.encode(encoder, offset + 0, depth)?;
8717            self.1.encode(encoder, offset + 4, depth)?;
8718            Ok(())
8719        }
8720    }
8721
8722    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8723        for CapabilitiesConnectorCreateRequest
8724    {
8725        #[inline(always)]
8726        fn new_empty() -> Self {
8727            Self {
8728                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8729                receiver_client_end: fidl::new_empty!(
8730                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8731                    fidl::encoding::DefaultFuchsiaResourceDialect
8732                ),
8733            }
8734        }
8735
8736        #[inline]
8737        unsafe fn decode(
8738            &mut self,
8739            decoder: &mut fidl::encoding::Decoder<
8740                '_,
8741                fidl::encoding::DefaultFuchsiaResourceDialect,
8742            >,
8743            offset: usize,
8744            _depth: fidl::encoding::Depth,
8745        ) -> fidl::Result<()> {
8746            decoder.debug_check_bounds::<Self>(offset);
8747            // Verify that padding bytes are zero.
8748            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8749            fidl::decode!(
8750                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8751                fidl::encoding::DefaultFuchsiaResourceDialect,
8752                &mut self.receiver_client_end,
8753                decoder,
8754                offset + 4,
8755                _depth
8756            )?;
8757            Ok(())
8758        }
8759    }
8760
8761    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorOpenRequest {
8762        type Borrowed<'a> = &'a mut Self;
8763        fn take_or_borrow<'a>(
8764            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8765        ) -> Self::Borrowed<'a> {
8766            value
8767        }
8768    }
8769
8770    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorOpenRequest {
8771        type Owned = Self;
8772
8773        #[inline(always)]
8774        fn inline_align(_context: fidl::encoding::Context) -> usize {
8775            4
8776        }
8777
8778        #[inline(always)]
8779        fn inline_size(_context: fidl::encoding::Context) -> usize {
8780            8
8781        }
8782    }
8783
8784    unsafe impl
8785        fidl::encoding::Encode<
8786            CapabilitiesConnectorOpenRequest,
8787            fidl::encoding::DefaultFuchsiaResourceDialect,
8788        > for &mut CapabilitiesConnectorOpenRequest
8789    {
8790        #[inline]
8791        unsafe fn encode(
8792            self,
8793            encoder: &mut fidl::encoding::Encoder<
8794                '_,
8795                fidl::encoding::DefaultFuchsiaResourceDialect,
8796            >,
8797            offset: usize,
8798            _depth: fidl::encoding::Depth,
8799        ) -> fidl::Result<()> {
8800            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8801            // Delegate to tuple encoding.
8802            fidl::encoding::Encode::<
8803                CapabilitiesConnectorOpenRequest,
8804                fidl::encoding::DefaultFuchsiaResourceDialect,
8805            >::encode(
8806                (
8807                    <fidl::encoding::HandleType<
8808                        fidl::EventPair,
8809                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8810                        2147483648,
8811                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8812                        &mut self.connector
8813                    ),
8814                    <fidl::encoding::HandleType<
8815                        fidl::Channel,
8816                        { fidl::ObjectType::CHANNEL.into_raw() },
8817                        2147483648,
8818                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8819                        &mut self.channel
8820                    ),
8821                ),
8822                encoder,
8823                offset,
8824                _depth,
8825            )
8826        }
8827    }
8828    unsafe impl<
8829        T0: fidl::encoding::Encode<
8830                fidl::encoding::HandleType<
8831                    fidl::EventPair,
8832                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8833                    2147483648,
8834                >,
8835                fidl::encoding::DefaultFuchsiaResourceDialect,
8836            >,
8837        T1: fidl::encoding::Encode<
8838                fidl::encoding::HandleType<
8839                    fidl::Channel,
8840                    { fidl::ObjectType::CHANNEL.into_raw() },
8841                    2147483648,
8842                >,
8843                fidl::encoding::DefaultFuchsiaResourceDialect,
8844            >,
8845    >
8846        fidl::encoding::Encode<
8847            CapabilitiesConnectorOpenRequest,
8848            fidl::encoding::DefaultFuchsiaResourceDialect,
8849        > for (T0, T1)
8850    {
8851        #[inline]
8852        unsafe fn encode(
8853            self,
8854            encoder: &mut fidl::encoding::Encoder<
8855                '_,
8856                fidl::encoding::DefaultFuchsiaResourceDialect,
8857            >,
8858            offset: usize,
8859            depth: fidl::encoding::Depth,
8860        ) -> fidl::Result<()> {
8861            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8862            // Zero out padding regions. There's no need to apply masks
8863            // because the unmasked parts will be overwritten by fields.
8864            // Write the fields.
8865            self.0.encode(encoder, offset + 0, depth)?;
8866            self.1.encode(encoder, offset + 4, depth)?;
8867            Ok(())
8868        }
8869    }
8870
8871    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8872        for CapabilitiesConnectorOpenRequest
8873    {
8874        #[inline(always)]
8875        fn new_empty() -> Self {
8876            Self {
8877                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8878                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8879            }
8880        }
8881
8882        #[inline]
8883        unsafe fn decode(
8884            &mut self,
8885            decoder: &mut fidl::encoding::Decoder<
8886                '_,
8887                fidl::encoding::DefaultFuchsiaResourceDialect,
8888            >,
8889            offset: usize,
8890            _depth: fidl::encoding::Depth,
8891        ) -> fidl::Result<()> {
8892            decoder.debug_check_bounds::<Self>(offset);
8893            // Verify that padding bytes are zero.
8894            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8895            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
8896            Ok(())
8897        }
8898    }
8899
8900    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterCreateRequest {
8901        type Borrowed<'a> = &'a mut Self;
8902        fn take_or_borrow<'a>(
8903            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8904        ) -> Self::Borrowed<'a> {
8905            value
8906        }
8907    }
8908
8909    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterCreateRequest {
8910        type Owned = Self;
8911
8912        #[inline(always)]
8913        fn inline_align(_context: fidl::encoding::Context) -> usize {
8914            4
8915        }
8916
8917        #[inline(always)]
8918        fn inline_size(_context: fidl::encoding::Context) -> usize {
8919            8
8920        }
8921    }
8922
8923    unsafe impl
8924        fidl::encoding::Encode<
8925            CapabilitiesConnectorRouterCreateRequest,
8926            fidl::encoding::DefaultFuchsiaResourceDialect,
8927        > for &mut CapabilitiesConnectorRouterCreateRequest
8928    {
8929        #[inline]
8930        unsafe fn encode(
8931            self,
8932            encoder: &mut fidl::encoding::Encoder<
8933                '_,
8934                fidl::encoding::DefaultFuchsiaResourceDialect,
8935            >,
8936            offset: usize,
8937            _depth: fidl::encoding::Depth,
8938        ) -> fidl::Result<()> {
8939            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8940            // Delegate to tuple encoding.
8941            fidl::encoding::Encode::<CapabilitiesConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8942                (
8943                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
8944                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
8945                ),
8946                encoder, offset, _depth
8947            )
8948        }
8949    }
8950    unsafe impl<
8951        T0: fidl::encoding::Encode<
8952                fidl::encoding::HandleType<
8953                    fidl::EventPair,
8954                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8955                    2147483648,
8956                >,
8957                fidl::encoding::DefaultFuchsiaResourceDialect,
8958            >,
8959        T1: fidl::encoding::Encode<
8960                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
8961                fidl::encoding::DefaultFuchsiaResourceDialect,
8962            >,
8963    >
8964        fidl::encoding::Encode<
8965            CapabilitiesConnectorRouterCreateRequest,
8966            fidl::encoding::DefaultFuchsiaResourceDialect,
8967        > for (T0, T1)
8968    {
8969        #[inline]
8970        unsafe fn encode(
8971            self,
8972            encoder: &mut fidl::encoding::Encoder<
8973                '_,
8974                fidl::encoding::DefaultFuchsiaResourceDialect,
8975            >,
8976            offset: usize,
8977            depth: fidl::encoding::Depth,
8978        ) -> fidl::Result<()> {
8979            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8980            // Zero out padding regions. There's no need to apply masks
8981            // because the unmasked parts will be overwritten by fields.
8982            // Write the fields.
8983            self.0.encode(encoder, offset + 0, depth)?;
8984            self.1.encode(encoder, offset + 4, depth)?;
8985            Ok(())
8986        }
8987    }
8988
8989    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8990        for CapabilitiesConnectorRouterCreateRequest
8991    {
8992        #[inline(always)]
8993        fn new_empty() -> Self {
8994            Self {
8995                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8996                router_client_end: fidl::new_empty!(
8997                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
8998                    fidl::encoding::DefaultFuchsiaResourceDialect
8999                ),
9000            }
9001        }
9002
9003        #[inline]
9004        unsafe fn decode(
9005            &mut self,
9006            decoder: &mut fidl::encoding::Decoder<
9007                '_,
9008                fidl::encoding::DefaultFuchsiaResourceDialect,
9009            >,
9010            offset: usize,
9011            _depth: fidl::encoding::Depth,
9012        ) -> fidl::Result<()> {
9013            decoder.debug_check_bounds::<Self>(offset);
9014            // Verify that padding bytes are zero.
9015            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9016            fidl::decode!(
9017                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9018                fidl::encoding::DefaultFuchsiaResourceDialect,
9019                &mut self.router_client_end,
9020                decoder,
9021                offset + 4,
9022                _depth
9023            )?;
9024            Ok(())
9025        }
9026    }
9027
9028    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterRouteRequest {
9029        type Borrowed<'a> = &'a mut Self;
9030        fn take_or_borrow<'a>(
9031            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9032        ) -> Self::Borrowed<'a> {
9033            value
9034        }
9035    }
9036
9037    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteRequest {
9038        type Owned = Self;
9039
9040        #[inline(always)]
9041        fn inline_align(_context: fidl::encoding::Context) -> usize {
9042            8
9043        }
9044
9045        #[inline(always)]
9046        fn inline_size(_context: fidl::encoding::Context) -> usize {
9047            32
9048        }
9049    }
9050
9051    unsafe impl
9052        fidl::encoding::Encode<
9053            CapabilitiesConnectorRouterRouteRequest,
9054            fidl::encoding::DefaultFuchsiaResourceDialect,
9055        > for &mut CapabilitiesConnectorRouterRouteRequest
9056    {
9057        #[inline]
9058        unsafe fn encode(
9059            self,
9060            encoder: &mut fidl::encoding::Encoder<
9061                '_,
9062                fidl::encoding::DefaultFuchsiaResourceDialect,
9063            >,
9064            offset: usize,
9065            _depth: fidl::encoding::Depth,
9066        ) -> fidl::Result<()> {
9067            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9068            // Delegate to tuple encoding.
9069            fidl::encoding::Encode::<
9070                CapabilitiesConnectorRouterRouteRequest,
9071                fidl::encoding::DefaultFuchsiaResourceDialect,
9072            >::encode(
9073                (
9074                    <fidl::encoding::HandleType<
9075                        fidl::EventPair,
9076                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9077                        2147483648,
9078                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9079                        &mut self.router
9080                    ),
9081                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
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::ValueTypeMarker>::borrow(&self.request),
9660                    <fidl::encoding::HandleType<
9661                        fidl::EventPair,
9662                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9663                        2147483648,
9664                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9665                        &mut self.instance_token,
9666                    ),
9667                    <fidl::encoding::HandleType<
9668                        fidl::EventPair,
9669                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9670                        2147483648,
9671                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9672                        &mut self.data
9673                    ),
9674                ),
9675                encoder,
9676                offset,
9677                _depth,
9678            )
9679        }
9680    }
9681    unsafe impl<
9682        T0: fidl::encoding::Encode<
9683                fidl::encoding::HandleType<
9684                    fidl::EventPair,
9685                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9686                    2147483648,
9687                >,
9688                fidl::encoding::DefaultFuchsiaResourceDialect,
9689            >,
9690        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9691        T2: fidl::encoding::Encode<
9692                fidl::encoding::HandleType<
9693                    fidl::EventPair,
9694                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9695                    2147483648,
9696                >,
9697                fidl::encoding::DefaultFuchsiaResourceDialect,
9698            >,
9699        T3: fidl::encoding::Encode<
9700                fidl::encoding::HandleType<
9701                    fidl::EventPair,
9702                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9703                    2147483648,
9704                >,
9705                fidl::encoding::DefaultFuchsiaResourceDialect,
9706            >,
9707    >
9708        fidl::encoding::Encode<
9709            CapabilitiesDataRouterRouteRequest,
9710            fidl::encoding::DefaultFuchsiaResourceDialect,
9711        > for (T0, T1, T2, T3)
9712    {
9713        #[inline]
9714        unsafe fn encode(
9715            self,
9716            encoder: &mut fidl::encoding::Encoder<
9717                '_,
9718                fidl::encoding::DefaultFuchsiaResourceDialect,
9719            >,
9720            offset: usize,
9721            depth: fidl::encoding::Depth,
9722        ) -> fidl::Result<()> {
9723            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9724            // Zero out padding regions. There's no need to apply masks
9725            // because the unmasked parts will be overwritten by fields.
9726            unsafe {
9727                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9728                (ptr as *mut u64).write_unaligned(0);
9729            }
9730            // Write the fields.
9731            self.0.encode(encoder, offset + 0, depth)?;
9732            self.1.encode(encoder, offset + 8, depth)?;
9733            self.2.encode(encoder, offset + 24, depth)?;
9734            self.3.encode(encoder, offset + 28, depth)?;
9735            Ok(())
9736        }
9737    }
9738
9739    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9740        for CapabilitiesDataRouterRouteRequest
9741    {
9742        #[inline(always)]
9743        fn new_empty() -> Self {
9744            Self {
9745                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9746                request: fidl::new_empty!(
9747                    RouteRequest,
9748                    fidl::encoding::DefaultFuchsiaResourceDialect
9749                ),
9750                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9751                data: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9752            }
9753        }
9754
9755        #[inline]
9756        unsafe fn decode(
9757            &mut self,
9758            decoder: &mut fidl::encoding::Decoder<
9759                '_,
9760                fidl::encoding::DefaultFuchsiaResourceDialect,
9761            >,
9762            offset: usize,
9763            _depth: fidl::encoding::Depth,
9764        ) -> fidl::Result<()> {
9765            decoder.debug_check_bounds::<Self>(offset);
9766            // Verify that padding bytes are zero.
9767            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9768            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9769            let mask = 0xffffffff00000000u64;
9770            let maskedval = padval & mask;
9771            if maskedval != 0 {
9772                return Err(fidl::Error::NonZeroPadding {
9773                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9774                });
9775            }
9776            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9777            fidl::decode!(
9778                RouteRequest,
9779                fidl::encoding::DefaultFuchsiaResourceDialect,
9780                &mut self.request,
9781                decoder,
9782                offset + 8,
9783                _depth
9784            )?;
9785            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9786            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data, decoder, offset + 28, _depth)?;
9787            Ok(())
9788        }
9789    }
9790
9791    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryCreateRequest {
9792        type Borrowed<'a> = &'a mut Self;
9793        fn take_or_borrow<'a>(
9794            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9795        ) -> Self::Borrowed<'a> {
9796            value
9797        }
9798    }
9799
9800    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryCreateRequest {
9801        type Owned = Self;
9802
9803        #[inline(always)]
9804        fn inline_align(_context: fidl::encoding::Context) -> usize {
9805            4
9806        }
9807
9808        #[inline(always)]
9809        fn inline_size(_context: fidl::encoding::Context) -> usize {
9810            4
9811        }
9812    }
9813
9814    unsafe impl
9815        fidl::encoding::Encode<
9816            CapabilitiesDictionaryCreateRequest,
9817            fidl::encoding::DefaultFuchsiaResourceDialect,
9818        > for &mut CapabilitiesDictionaryCreateRequest
9819    {
9820        #[inline]
9821        unsafe fn encode(
9822            self,
9823            encoder: &mut fidl::encoding::Encoder<
9824                '_,
9825                fidl::encoding::DefaultFuchsiaResourceDialect,
9826            >,
9827            offset: usize,
9828            _depth: fidl::encoding::Depth,
9829        ) -> fidl::Result<()> {
9830            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9831            // Delegate to tuple encoding.
9832            fidl::encoding::Encode::<
9833                CapabilitiesDictionaryCreateRequest,
9834                fidl::encoding::DefaultFuchsiaResourceDialect,
9835            >::encode(
9836                (<fidl::encoding::HandleType<
9837                    fidl::EventPair,
9838                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9839                    2147483648,
9840                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9841                    &mut self.dictionary
9842                ),),
9843                encoder,
9844                offset,
9845                _depth,
9846            )
9847        }
9848    }
9849    unsafe impl<
9850        T0: fidl::encoding::Encode<
9851                fidl::encoding::HandleType<
9852                    fidl::EventPair,
9853                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9854                    2147483648,
9855                >,
9856                fidl::encoding::DefaultFuchsiaResourceDialect,
9857            >,
9858    >
9859        fidl::encoding::Encode<
9860            CapabilitiesDictionaryCreateRequest,
9861            fidl::encoding::DefaultFuchsiaResourceDialect,
9862        > for (T0,)
9863    {
9864        #[inline]
9865        unsafe fn encode(
9866            self,
9867            encoder: &mut fidl::encoding::Encoder<
9868                '_,
9869                fidl::encoding::DefaultFuchsiaResourceDialect,
9870            >,
9871            offset: usize,
9872            depth: fidl::encoding::Depth,
9873        ) -> fidl::Result<()> {
9874            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9875            // Zero out padding regions. There's no need to apply masks
9876            // because the unmasked parts will be overwritten by fields.
9877            // Write the fields.
9878            self.0.encode(encoder, offset + 0, depth)?;
9879            Ok(())
9880        }
9881    }
9882
9883    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9884        for CapabilitiesDictionaryCreateRequest
9885    {
9886        #[inline(always)]
9887        fn new_empty() -> Self {
9888            Self {
9889                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9890            }
9891        }
9892
9893        #[inline]
9894        unsafe fn decode(
9895            &mut self,
9896            decoder: &mut fidl::encoding::Decoder<
9897                '_,
9898                fidl::encoding::DefaultFuchsiaResourceDialect,
9899            >,
9900            offset: usize,
9901            _depth: fidl::encoding::Depth,
9902        ) -> fidl::Result<()> {
9903            decoder.debug_check_bounds::<Self>(offset);
9904            // Verify that padding bytes are zero.
9905            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9906            Ok(())
9907        }
9908    }
9909
9910    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetRequest {
9911        type Borrowed<'a> = &'a mut Self;
9912        fn take_or_borrow<'a>(
9913            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9914        ) -> Self::Borrowed<'a> {
9915            value
9916        }
9917    }
9918
9919    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetRequest {
9920        type Owned = Self;
9921
9922        #[inline(always)]
9923        fn inline_align(_context: fidl::encoding::Context) -> usize {
9924            8
9925        }
9926
9927        #[inline(always)]
9928        fn inline_size(_context: fidl::encoding::Context) -> usize {
9929            32
9930        }
9931    }
9932
9933    unsafe impl
9934        fidl::encoding::Encode<
9935            CapabilitiesDictionaryGetRequest,
9936            fidl::encoding::DefaultFuchsiaResourceDialect,
9937        > for &mut CapabilitiesDictionaryGetRequest
9938    {
9939        #[inline]
9940        unsafe fn encode(
9941            self,
9942            encoder: &mut fidl::encoding::Encoder<
9943                '_,
9944                fidl::encoding::DefaultFuchsiaResourceDialect,
9945            >,
9946            offset: usize,
9947            _depth: fidl::encoding::Depth,
9948        ) -> fidl::Result<()> {
9949            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
9950            // Delegate to tuple encoding.
9951            fidl::encoding::Encode::<
9952                CapabilitiesDictionaryGetRequest,
9953                fidl::encoding::DefaultFuchsiaResourceDialect,
9954            >::encode(
9955                (
9956                    <fidl::encoding::HandleType<
9957                        fidl::EventPair,
9958                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9959                        2147483648,
9960                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9961                        &mut self.dictionary
9962                    ),
9963                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
9964                        &self.key,
9965                    ),
9966                    <fidl::encoding::HandleType<
9967                        fidl::EventPair,
9968                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9969                        2147483648,
9970                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9971                        &mut self.value
9972                    ),
9973                ),
9974                encoder,
9975                offset,
9976                _depth,
9977            )
9978        }
9979    }
9980    unsafe impl<
9981        T0: fidl::encoding::Encode<
9982                fidl::encoding::HandleType<
9983                    fidl::EventPair,
9984                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9985                    2147483648,
9986                >,
9987                fidl::encoding::DefaultFuchsiaResourceDialect,
9988            >,
9989        T1: fidl::encoding::Encode<
9990                fidl::encoding::BoundedString<100>,
9991                fidl::encoding::DefaultFuchsiaResourceDialect,
9992            >,
9993        T2: fidl::encoding::Encode<
9994                fidl::encoding::HandleType<
9995                    fidl::EventPair,
9996                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9997                    2147483648,
9998                >,
9999                fidl::encoding::DefaultFuchsiaResourceDialect,
10000            >,
10001    >
10002        fidl::encoding::Encode<
10003            CapabilitiesDictionaryGetRequest,
10004            fidl::encoding::DefaultFuchsiaResourceDialect,
10005        > for (T0, T1, T2)
10006    {
10007        #[inline]
10008        unsafe fn encode(
10009            self,
10010            encoder: &mut fidl::encoding::Encoder<
10011                '_,
10012                fidl::encoding::DefaultFuchsiaResourceDialect,
10013            >,
10014            offset: usize,
10015            depth: fidl::encoding::Depth,
10016        ) -> fidl::Result<()> {
10017            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
10018            // Zero out padding regions. There's no need to apply masks
10019            // because the unmasked parts will be overwritten by fields.
10020            unsafe {
10021                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10022                (ptr as *mut u64).write_unaligned(0);
10023            }
10024            unsafe {
10025                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10026                (ptr as *mut u64).write_unaligned(0);
10027            }
10028            // Write the fields.
10029            self.0.encode(encoder, offset + 0, depth)?;
10030            self.1.encode(encoder, offset + 8, depth)?;
10031            self.2.encode(encoder, offset + 24, depth)?;
10032            Ok(())
10033        }
10034    }
10035
10036    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10037        for CapabilitiesDictionaryGetRequest
10038    {
10039        #[inline(always)]
10040        fn new_empty() -> Self {
10041            Self {
10042                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10043                key: fidl::new_empty!(
10044                    fidl::encoding::BoundedString<100>,
10045                    fidl::encoding::DefaultFuchsiaResourceDialect
10046                ),
10047                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10048            }
10049        }
10050
10051        #[inline]
10052        unsafe fn decode(
10053            &mut self,
10054            decoder: &mut fidl::encoding::Decoder<
10055                '_,
10056                fidl::encoding::DefaultFuchsiaResourceDialect,
10057            >,
10058            offset: usize,
10059            _depth: fidl::encoding::Depth,
10060        ) -> fidl::Result<()> {
10061            decoder.debug_check_bounds::<Self>(offset);
10062            // Verify that padding bytes are zero.
10063            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10064            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10065            let mask = 0xffffffff00000000u64;
10066            let maskedval = padval & mask;
10067            if maskedval != 0 {
10068                return Err(fidl::Error::NonZeroPadding {
10069                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10070                });
10071            }
10072            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10073            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10074            let mask = 0xffffffff00000000u64;
10075            let maskedval = padval & mask;
10076            if maskedval != 0 {
10077                return Err(fidl::Error::NonZeroPadding {
10078                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10079                });
10080            }
10081            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10082            fidl::decode!(
10083                fidl::encoding::BoundedString<100>,
10084                fidl::encoding::DefaultFuchsiaResourceDialect,
10085                &mut self.key,
10086                decoder,
10087                offset + 8,
10088                _depth
10089            )?;
10090            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10091            Ok(())
10092        }
10093    }
10094
10095    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryInsertRequest {
10096        type Borrowed<'a> = &'a mut Self;
10097        fn take_or_borrow<'a>(
10098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10099        ) -> Self::Borrowed<'a> {
10100            value
10101        }
10102    }
10103
10104    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryInsertRequest {
10105        type Owned = Self;
10106
10107        #[inline(always)]
10108        fn inline_align(_context: fidl::encoding::Context) -> usize {
10109            8
10110        }
10111
10112        #[inline(always)]
10113        fn inline_size(_context: fidl::encoding::Context) -> usize {
10114            32
10115        }
10116    }
10117
10118    unsafe impl
10119        fidl::encoding::Encode<
10120            CapabilitiesDictionaryInsertRequest,
10121            fidl::encoding::DefaultFuchsiaResourceDialect,
10122        > for &mut CapabilitiesDictionaryInsertRequest
10123    {
10124        #[inline]
10125        unsafe fn encode(
10126            self,
10127            encoder: &mut fidl::encoding::Encoder<
10128                '_,
10129                fidl::encoding::DefaultFuchsiaResourceDialect,
10130            >,
10131            offset: usize,
10132            _depth: fidl::encoding::Depth,
10133        ) -> fidl::Result<()> {
10134            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10135            // Delegate to tuple encoding.
10136            fidl::encoding::Encode::<
10137                CapabilitiesDictionaryInsertRequest,
10138                fidl::encoding::DefaultFuchsiaResourceDialect,
10139            >::encode(
10140                (
10141                    <fidl::encoding::HandleType<
10142                        fidl::EventPair,
10143                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10144                        2147483648,
10145                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10146                        &mut self.dictionary
10147                    ),
10148                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10149                        &self.key,
10150                    ),
10151                    <fidl::encoding::HandleType<
10152                        fidl::EventPair,
10153                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10154                        2147483648,
10155                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10156                        &mut self.value
10157                    ),
10158                ),
10159                encoder,
10160                offset,
10161                _depth,
10162            )
10163        }
10164    }
10165    unsafe impl<
10166        T0: fidl::encoding::Encode<
10167                fidl::encoding::HandleType<
10168                    fidl::EventPair,
10169                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10170                    2147483648,
10171                >,
10172                fidl::encoding::DefaultFuchsiaResourceDialect,
10173            >,
10174        T1: fidl::encoding::Encode<
10175                fidl::encoding::BoundedString<100>,
10176                fidl::encoding::DefaultFuchsiaResourceDialect,
10177            >,
10178        T2: fidl::encoding::Encode<
10179                fidl::encoding::HandleType<
10180                    fidl::EventPair,
10181                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10182                    2147483648,
10183                >,
10184                fidl::encoding::DefaultFuchsiaResourceDialect,
10185            >,
10186    >
10187        fidl::encoding::Encode<
10188            CapabilitiesDictionaryInsertRequest,
10189            fidl::encoding::DefaultFuchsiaResourceDialect,
10190        > for (T0, T1, T2)
10191    {
10192        #[inline]
10193        unsafe fn encode(
10194            self,
10195            encoder: &mut fidl::encoding::Encoder<
10196                '_,
10197                fidl::encoding::DefaultFuchsiaResourceDialect,
10198            >,
10199            offset: usize,
10200            depth: fidl::encoding::Depth,
10201        ) -> fidl::Result<()> {
10202            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10203            // Zero out padding regions. There's no need to apply masks
10204            // because the unmasked parts will be overwritten by fields.
10205            unsafe {
10206                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10207                (ptr as *mut u64).write_unaligned(0);
10208            }
10209            unsafe {
10210                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10211                (ptr as *mut u64).write_unaligned(0);
10212            }
10213            // Write the fields.
10214            self.0.encode(encoder, offset + 0, depth)?;
10215            self.1.encode(encoder, offset + 8, depth)?;
10216            self.2.encode(encoder, offset + 24, depth)?;
10217            Ok(())
10218        }
10219    }
10220
10221    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10222        for CapabilitiesDictionaryInsertRequest
10223    {
10224        #[inline(always)]
10225        fn new_empty() -> Self {
10226            Self {
10227                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10228                key: fidl::new_empty!(
10229                    fidl::encoding::BoundedString<100>,
10230                    fidl::encoding::DefaultFuchsiaResourceDialect
10231                ),
10232                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10233            }
10234        }
10235
10236        #[inline]
10237        unsafe fn decode(
10238            &mut self,
10239            decoder: &mut fidl::encoding::Decoder<
10240                '_,
10241                fidl::encoding::DefaultFuchsiaResourceDialect,
10242            >,
10243            offset: usize,
10244            _depth: fidl::encoding::Depth,
10245        ) -> fidl::Result<()> {
10246            decoder.debug_check_bounds::<Self>(offset);
10247            // Verify that padding bytes are zero.
10248            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10249            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10250            let mask = 0xffffffff00000000u64;
10251            let maskedval = padval & mask;
10252            if maskedval != 0 {
10253                return Err(fidl::Error::NonZeroPadding {
10254                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10255                });
10256            }
10257            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10258            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10259            let mask = 0xffffffff00000000u64;
10260            let maskedval = padval & mask;
10261            if maskedval != 0 {
10262                return Err(fidl::Error::NonZeroPadding {
10263                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10264                });
10265            }
10266            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10267            fidl::decode!(
10268                fidl::encoding::BoundedString<100>,
10269                fidl::encoding::DefaultFuchsiaResourceDialect,
10270                &mut self.key,
10271                decoder,
10272                offset + 8,
10273                _depth
10274            )?;
10275            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10276            Ok(())
10277        }
10278    }
10279
10280    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10281        type Borrowed<'a> = &'a mut Self;
10282        fn take_or_borrow<'a>(
10283            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10284        ) -> Self::Borrowed<'a> {
10285            value
10286        }
10287    }
10288
10289    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10290        type Owned = Self;
10291
10292        #[inline(always)]
10293        fn inline_align(_context: fidl::encoding::Context) -> usize {
10294            4
10295        }
10296
10297        #[inline(always)]
10298        fn inline_size(_context: fidl::encoding::Context) -> usize {
10299            8
10300        }
10301    }
10302
10303    unsafe impl
10304        fidl::encoding::Encode<
10305            CapabilitiesDictionaryIterateKeysRequest,
10306            fidl::encoding::DefaultFuchsiaResourceDialect,
10307        > for &mut CapabilitiesDictionaryIterateKeysRequest
10308    {
10309        #[inline]
10310        unsafe fn encode(
10311            self,
10312            encoder: &mut fidl::encoding::Encoder<
10313                '_,
10314                fidl::encoding::DefaultFuchsiaResourceDialect,
10315            >,
10316            offset: usize,
10317            _depth: fidl::encoding::Depth,
10318        ) -> fidl::Result<()> {
10319            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10320            // Delegate to tuple encoding.
10321            fidl::encoding::Encode::<
10322                CapabilitiesDictionaryIterateKeysRequest,
10323                fidl::encoding::DefaultFuchsiaResourceDialect,
10324            >::encode(
10325                (
10326                    <fidl::encoding::HandleType<
10327                        fidl::EventPair,
10328                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10329                        2147483648,
10330                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10331                        &mut self.dictionary
10332                    ),
10333                    <fidl::encoding::Endpoint<
10334                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10335                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10336                        &mut self.key_iterator,
10337                    ),
10338                ),
10339                encoder,
10340                offset,
10341                _depth,
10342            )
10343        }
10344    }
10345    unsafe impl<
10346        T0: fidl::encoding::Encode<
10347                fidl::encoding::HandleType<
10348                    fidl::EventPair,
10349                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10350                    2147483648,
10351                >,
10352                fidl::encoding::DefaultFuchsiaResourceDialect,
10353            >,
10354        T1: fidl::encoding::Encode<
10355                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10356                fidl::encoding::DefaultFuchsiaResourceDialect,
10357            >,
10358    >
10359        fidl::encoding::Encode<
10360            CapabilitiesDictionaryIterateKeysRequest,
10361            fidl::encoding::DefaultFuchsiaResourceDialect,
10362        > for (T0, T1)
10363    {
10364        #[inline]
10365        unsafe fn encode(
10366            self,
10367            encoder: &mut fidl::encoding::Encoder<
10368                '_,
10369                fidl::encoding::DefaultFuchsiaResourceDialect,
10370            >,
10371            offset: usize,
10372            depth: fidl::encoding::Depth,
10373        ) -> fidl::Result<()> {
10374            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10375            // Zero out padding regions. There's no need to apply masks
10376            // because the unmasked parts will be overwritten by fields.
10377            // Write the fields.
10378            self.0.encode(encoder, offset + 0, depth)?;
10379            self.1.encode(encoder, offset + 4, depth)?;
10380            Ok(())
10381        }
10382    }
10383
10384    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10385        for CapabilitiesDictionaryIterateKeysRequest
10386    {
10387        #[inline(always)]
10388        fn new_empty() -> Self {
10389            Self {
10390                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10391                key_iterator: fidl::new_empty!(
10392                    fidl::encoding::Endpoint<
10393                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10394                    >,
10395                    fidl::encoding::DefaultFuchsiaResourceDialect
10396                ),
10397            }
10398        }
10399
10400        #[inline]
10401        unsafe fn decode(
10402            &mut self,
10403            decoder: &mut fidl::encoding::Decoder<
10404                '_,
10405                fidl::encoding::DefaultFuchsiaResourceDialect,
10406            >,
10407            offset: usize,
10408            _depth: fidl::encoding::Depth,
10409        ) -> fidl::Result<()> {
10410            decoder.debug_check_bounds::<Self>(offset);
10411            // Verify that padding bytes are zero.
10412            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10413            fidl::decode!(
10414                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10415                fidl::encoding::DefaultFuchsiaResourceDialect,
10416                &mut self.key_iterator,
10417                decoder,
10418                offset + 4,
10419                _depth
10420            )?;
10421            Ok(())
10422        }
10423    }
10424
10425    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10426        type Borrowed<'a> = &'a mut Self;
10427        fn take_or_borrow<'a>(
10428            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10429        ) -> Self::Borrowed<'a> {
10430            value
10431        }
10432    }
10433
10434    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10435        type Owned = Self;
10436
10437        #[inline(always)]
10438        fn inline_align(_context: fidl::encoding::Context) -> usize {
10439            4
10440        }
10441
10442        #[inline(always)]
10443        fn inline_size(_context: fidl::encoding::Context) -> usize {
10444            8
10445        }
10446    }
10447
10448    unsafe impl
10449        fidl::encoding::Encode<
10450            CapabilitiesDictionaryRouterCreateRequest,
10451            fidl::encoding::DefaultFuchsiaResourceDialect,
10452        > for &mut CapabilitiesDictionaryRouterCreateRequest
10453    {
10454        #[inline]
10455        unsafe fn encode(
10456            self,
10457            encoder: &mut fidl::encoding::Encoder<
10458                '_,
10459                fidl::encoding::DefaultFuchsiaResourceDialect,
10460            >,
10461            offset: usize,
10462            _depth: fidl::encoding::Depth,
10463        ) -> fidl::Result<()> {
10464            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10465            // Delegate to tuple encoding.
10466            fidl::encoding::Encode::<CapabilitiesDictionaryRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10467                (
10468                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10469                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10470                ),
10471                encoder, offset, _depth
10472            )
10473        }
10474    }
10475    unsafe impl<
10476        T0: fidl::encoding::Encode<
10477                fidl::encoding::HandleType<
10478                    fidl::EventPair,
10479                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10480                    2147483648,
10481                >,
10482                fidl::encoding::DefaultFuchsiaResourceDialect,
10483            >,
10484        T1: fidl::encoding::Encode<
10485                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10486                fidl::encoding::DefaultFuchsiaResourceDialect,
10487            >,
10488    >
10489        fidl::encoding::Encode<
10490            CapabilitiesDictionaryRouterCreateRequest,
10491            fidl::encoding::DefaultFuchsiaResourceDialect,
10492        > for (T0, T1)
10493    {
10494        #[inline]
10495        unsafe fn encode(
10496            self,
10497            encoder: &mut fidl::encoding::Encoder<
10498                '_,
10499                fidl::encoding::DefaultFuchsiaResourceDialect,
10500            >,
10501            offset: usize,
10502            depth: fidl::encoding::Depth,
10503        ) -> fidl::Result<()> {
10504            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10505            // Zero out padding regions. There's no need to apply masks
10506            // because the unmasked parts will be overwritten by fields.
10507            // Write the fields.
10508            self.0.encode(encoder, offset + 0, depth)?;
10509            self.1.encode(encoder, offset + 4, depth)?;
10510            Ok(())
10511        }
10512    }
10513
10514    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10515        for CapabilitiesDictionaryRouterCreateRequest
10516    {
10517        #[inline(always)]
10518        fn new_empty() -> Self {
10519            Self {
10520                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10521                router_client_end: fidl::new_empty!(
10522                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10523                    fidl::encoding::DefaultFuchsiaResourceDialect
10524                ),
10525            }
10526        }
10527
10528        #[inline]
10529        unsafe fn decode(
10530            &mut self,
10531            decoder: &mut fidl::encoding::Decoder<
10532                '_,
10533                fidl::encoding::DefaultFuchsiaResourceDialect,
10534            >,
10535            offset: usize,
10536            _depth: fidl::encoding::Depth,
10537        ) -> fidl::Result<()> {
10538            decoder.debug_check_bounds::<Self>(offset);
10539            // Verify that padding bytes are zero.
10540            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10541            fidl::decode!(
10542                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10543                fidl::encoding::DefaultFuchsiaResourceDialect,
10544                &mut self.router_client_end,
10545                decoder,
10546                offset + 4,
10547                _depth
10548            )?;
10549            Ok(())
10550        }
10551    }
10552
10553    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10554        type Borrowed<'a> = &'a mut Self;
10555        fn take_or_borrow<'a>(
10556            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10557        ) -> Self::Borrowed<'a> {
10558            value
10559        }
10560    }
10561
10562    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10563        type Owned = Self;
10564
10565        #[inline(always)]
10566        fn inline_align(_context: fidl::encoding::Context) -> usize {
10567            8
10568        }
10569
10570        #[inline(always)]
10571        fn inline_size(_context: fidl::encoding::Context) -> usize {
10572            32
10573        }
10574    }
10575
10576    unsafe impl
10577        fidl::encoding::Encode<
10578            CapabilitiesDictionaryRouterRouteRequest,
10579            fidl::encoding::DefaultFuchsiaResourceDialect,
10580        > for &mut CapabilitiesDictionaryRouterRouteRequest
10581    {
10582        #[inline]
10583        unsafe fn encode(
10584            self,
10585            encoder: &mut fidl::encoding::Encoder<
10586                '_,
10587                fidl::encoding::DefaultFuchsiaResourceDialect,
10588            >,
10589            offset: usize,
10590            _depth: fidl::encoding::Depth,
10591        ) -> fidl::Result<()> {
10592            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10593            // Delegate to tuple encoding.
10594            fidl::encoding::Encode::<
10595                CapabilitiesDictionaryRouterRouteRequest,
10596                fidl::encoding::DefaultFuchsiaResourceDialect,
10597            >::encode(
10598                (
10599                    <fidl::encoding::HandleType<
10600                        fidl::EventPair,
10601                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10602                        2147483648,
10603                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10604                        &mut self.router
10605                    ),
10606                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
10607                    <fidl::encoding::HandleType<
10608                        fidl::EventPair,
10609                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10610                        2147483648,
10611                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10612                        &mut self.instance_token,
10613                    ),
10614                    <fidl::encoding::HandleType<
10615                        fidl::EventPair,
10616                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10617                        2147483648,
10618                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10619                        &mut self.dictionary
10620                    ),
10621                ),
10622                encoder,
10623                offset,
10624                _depth,
10625            )
10626        }
10627    }
10628    unsafe impl<
10629        T0: fidl::encoding::Encode<
10630                fidl::encoding::HandleType<
10631                    fidl::EventPair,
10632                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10633                    2147483648,
10634                >,
10635                fidl::encoding::DefaultFuchsiaResourceDialect,
10636            >,
10637        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
10638        T2: fidl::encoding::Encode<
10639                fidl::encoding::HandleType<
10640                    fidl::EventPair,
10641                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10642                    2147483648,
10643                >,
10644                fidl::encoding::DefaultFuchsiaResourceDialect,
10645            >,
10646        T3: fidl::encoding::Encode<
10647                fidl::encoding::HandleType<
10648                    fidl::EventPair,
10649                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10650                    2147483648,
10651                >,
10652                fidl::encoding::DefaultFuchsiaResourceDialect,
10653            >,
10654    >
10655        fidl::encoding::Encode<
10656            CapabilitiesDictionaryRouterRouteRequest,
10657            fidl::encoding::DefaultFuchsiaResourceDialect,
10658        > for (T0, T1, T2, T3)
10659    {
10660        #[inline]
10661        unsafe fn encode(
10662            self,
10663            encoder: &mut fidl::encoding::Encoder<
10664                '_,
10665                fidl::encoding::DefaultFuchsiaResourceDialect,
10666            >,
10667            offset: usize,
10668            depth: fidl::encoding::Depth,
10669        ) -> fidl::Result<()> {
10670            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10671            // Zero out padding regions. There's no need to apply masks
10672            // because the unmasked parts will be overwritten by fields.
10673            unsafe {
10674                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10675                (ptr as *mut u64).write_unaligned(0);
10676            }
10677            // Write the fields.
10678            self.0.encode(encoder, offset + 0, depth)?;
10679            self.1.encode(encoder, offset + 8, depth)?;
10680            self.2.encode(encoder, offset + 24, depth)?;
10681            self.3.encode(encoder, offset + 28, depth)?;
10682            Ok(())
10683        }
10684    }
10685
10686    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10687        for CapabilitiesDictionaryRouterRouteRequest
10688    {
10689        #[inline(always)]
10690        fn new_empty() -> Self {
10691            Self {
10692                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10693                request: fidl::new_empty!(
10694                    RouteRequest,
10695                    fidl::encoding::DefaultFuchsiaResourceDialect
10696                ),
10697                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10698                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10699            }
10700        }
10701
10702        #[inline]
10703        unsafe fn decode(
10704            &mut self,
10705            decoder: &mut fidl::encoding::Decoder<
10706                '_,
10707                fidl::encoding::DefaultFuchsiaResourceDialect,
10708            >,
10709            offset: usize,
10710            _depth: fidl::encoding::Depth,
10711        ) -> fidl::Result<()> {
10712            decoder.debug_check_bounds::<Self>(offset);
10713            // Verify that padding bytes are zero.
10714            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10715            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10716            let mask = 0xffffffff00000000u64;
10717            let maskedval = padval & mask;
10718            if maskedval != 0 {
10719                return Err(fidl::Error::NonZeroPadding {
10720                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10721                });
10722            }
10723            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10724            fidl::decode!(
10725                RouteRequest,
10726                fidl::encoding::DefaultFuchsiaResourceDialect,
10727                &mut self.request,
10728                decoder,
10729                offset + 8,
10730                _depth
10731            )?;
10732            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
10733            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 28, _depth)?;
10734            Ok(())
10735        }
10736    }
10737
10738    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorCreateRequest {
10739        type Borrowed<'a> = &'a mut Self;
10740        fn take_or_borrow<'a>(
10741            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10742        ) -> Self::Borrowed<'a> {
10743            value
10744        }
10745    }
10746
10747    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorCreateRequest {
10748        type Owned = Self;
10749
10750        #[inline(always)]
10751        fn inline_align(_context: fidl::encoding::Context) -> usize {
10752            4
10753        }
10754
10755        #[inline(always)]
10756        fn inline_size(_context: fidl::encoding::Context) -> usize {
10757            8
10758        }
10759    }
10760
10761    unsafe impl
10762        fidl::encoding::Encode<
10763            CapabilitiesDirConnectorCreateRequest,
10764            fidl::encoding::DefaultFuchsiaResourceDialect,
10765        > for &mut CapabilitiesDirConnectorCreateRequest
10766    {
10767        #[inline]
10768        unsafe fn encode(
10769            self,
10770            encoder: &mut fidl::encoding::Encoder<
10771                '_,
10772                fidl::encoding::DefaultFuchsiaResourceDialect,
10773            >,
10774            offset: usize,
10775            _depth: fidl::encoding::Depth,
10776        ) -> fidl::Result<()> {
10777            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10778            // Delegate to tuple encoding.
10779            fidl::encoding::Encode::<CapabilitiesDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10780                (
10781                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector),
10782                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
10783                ),
10784                encoder, offset, _depth
10785            )
10786        }
10787    }
10788    unsafe impl<
10789        T0: fidl::encoding::Encode<
10790                fidl::encoding::HandleType<
10791                    fidl::EventPair,
10792                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10793                    2147483648,
10794                >,
10795                fidl::encoding::DefaultFuchsiaResourceDialect,
10796            >,
10797        T1: fidl::encoding::Encode<
10798                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10799                fidl::encoding::DefaultFuchsiaResourceDialect,
10800            >,
10801    >
10802        fidl::encoding::Encode<
10803            CapabilitiesDirConnectorCreateRequest,
10804            fidl::encoding::DefaultFuchsiaResourceDialect,
10805        > for (T0, T1)
10806    {
10807        #[inline]
10808        unsafe fn encode(
10809            self,
10810            encoder: &mut fidl::encoding::Encoder<
10811                '_,
10812                fidl::encoding::DefaultFuchsiaResourceDialect,
10813            >,
10814            offset: usize,
10815            depth: fidl::encoding::Depth,
10816        ) -> fidl::Result<()> {
10817            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10818            // Zero out padding regions. There's no need to apply masks
10819            // because the unmasked parts will be overwritten by fields.
10820            // Write the fields.
10821            self.0.encode(encoder, offset + 0, depth)?;
10822            self.1.encode(encoder, offset + 4, depth)?;
10823            Ok(())
10824        }
10825    }
10826
10827    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10828        for CapabilitiesDirConnectorCreateRequest
10829    {
10830        #[inline(always)]
10831        fn new_empty() -> Self {
10832            Self {
10833                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10834                receiver_client_end: fidl::new_empty!(
10835                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10836                    fidl::encoding::DefaultFuchsiaResourceDialect
10837                ),
10838            }
10839        }
10840
10841        #[inline]
10842        unsafe fn decode(
10843            &mut self,
10844            decoder: &mut fidl::encoding::Decoder<
10845                '_,
10846                fidl::encoding::DefaultFuchsiaResourceDialect,
10847            >,
10848            offset: usize,
10849            _depth: fidl::encoding::Depth,
10850        ) -> fidl::Result<()> {
10851            decoder.debug_check_bounds::<Self>(offset);
10852            // Verify that padding bytes are zero.
10853            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 0, _depth)?;
10854            fidl::decode!(
10855                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10856                fidl::encoding::DefaultFuchsiaResourceDialect,
10857                &mut self.receiver_client_end,
10858                decoder,
10859                offset + 4,
10860                _depth
10861            )?;
10862            Ok(())
10863        }
10864    }
10865
10866    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10867        type Borrowed<'a> = &'a mut Self;
10868        fn take_or_borrow<'a>(
10869            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10870        ) -> Self::Borrowed<'a> {
10871            value
10872        }
10873    }
10874
10875    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10876        type Owned = Self;
10877
10878        #[inline(always)]
10879        fn inline_align(_context: fidl::encoding::Context) -> usize {
10880            4
10881        }
10882
10883        #[inline(always)]
10884        fn inline_size(_context: fidl::encoding::Context) -> usize {
10885            8
10886        }
10887    }
10888
10889    unsafe impl
10890        fidl::encoding::Encode<
10891            CapabilitiesDirConnectorRouterCreateRequest,
10892            fidl::encoding::DefaultFuchsiaResourceDialect,
10893        > for &mut CapabilitiesDirConnectorRouterCreateRequest
10894    {
10895        #[inline]
10896        unsafe fn encode(
10897            self,
10898            encoder: &mut fidl::encoding::Encoder<
10899                '_,
10900                fidl::encoding::DefaultFuchsiaResourceDialect,
10901            >,
10902            offset: usize,
10903            _depth: fidl::encoding::Depth,
10904        ) -> fidl::Result<()> {
10905            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10906            // Delegate to tuple encoding.
10907            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10908                (
10909                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10910                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10911                ),
10912                encoder, offset, _depth
10913            )
10914        }
10915    }
10916    unsafe impl<
10917        T0: fidl::encoding::Encode<
10918                fidl::encoding::HandleType<
10919                    fidl::EventPair,
10920                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10921                    2147483648,
10922                >,
10923                fidl::encoding::DefaultFuchsiaResourceDialect,
10924            >,
10925        T1: fidl::encoding::Encode<
10926                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10927                fidl::encoding::DefaultFuchsiaResourceDialect,
10928            >,
10929    >
10930        fidl::encoding::Encode<
10931            CapabilitiesDirConnectorRouterCreateRequest,
10932            fidl::encoding::DefaultFuchsiaResourceDialect,
10933        > for (T0, T1)
10934    {
10935        #[inline]
10936        unsafe fn encode(
10937            self,
10938            encoder: &mut fidl::encoding::Encoder<
10939                '_,
10940                fidl::encoding::DefaultFuchsiaResourceDialect,
10941            >,
10942            offset: usize,
10943            depth: fidl::encoding::Depth,
10944        ) -> fidl::Result<()> {
10945            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10946            // Zero out padding regions. There's no need to apply masks
10947            // because the unmasked parts will be overwritten by fields.
10948            // Write the fields.
10949            self.0.encode(encoder, offset + 0, depth)?;
10950            self.1.encode(encoder, offset + 4, depth)?;
10951            Ok(())
10952        }
10953    }
10954
10955    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10956        for CapabilitiesDirConnectorRouterCreateRequest
10957    {
10958        #[inline(always)]
10959        fn new_empty() -> Self {
10960            Self {
10961                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10962                router_client_end: fidl::new_empty!(
10963                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10964                    fidl::encoding::DefaultFuchsiaResourceDialect
10965                ),
10966            }
10967        }
10968
10969        #[inline]
10970        unsafe fn decode(
10971            &mut self,
10972            decoder: &mut fidl::encoding::Decoder<
10973                '_,
10974                fidl::encoding::DefaultFuchsiaResourceDialect,
10975            >,
10976            offset: usize,
10977            _depth: fidl::encoding::Depth,
10978        ) -> fidl::Result<()> {
10979            decoder.debug_check_bounds::<Self>(offset);
10980            // Verify that padding bytes are zero.
10981            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10982            fidl::decode!(
10983                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10984                fidl::encoding::DefaultFuchsiaResourceDialect,
10985                &mut self.router_client_end,
10986                decoder,
10987                offset + 4,
10988                _depth
10989            )?;
10990            Ok(())
10991        }
10992    }
10993
10994    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
10995        type Borrowed<'a> = &'a mut Self;
10996        fn take_or_borrow<'a>(
10997            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10998        ) -> Self::Borrowed<'a> {
10999            value
11000        }
11001    }
11002
11003    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11004        type Owned = Self;
11005
11006        #[inline(always)]
11007        fn inline_align(_context: fidl::encoding::Context) -> usize {
11008            8
11009        }
11010
11011        #[inline(always)]
11012        fn inline_size(_context: fidl::encoding::Context) -> usize {
11013            32
11014        }
11015    }
11016
11017    unsafe impl
11018        fidl::encoding::Encode<
11019            CapabilitiesDirConnectorRouterRouteRequest,
11020            fidl::encoding::DefaultFuchsiaResourceDialect,
11021        > for &mut CapabilitiesDirConnectorRouterRouteRequest
11022    {
11023        #[inline]
11024        unsafe fn encode(
11025            self,
11026            encoder: &mut fidl::encoding::Encoder<
11027                '_,
11028                fidl::encoding::DefaultFuchsiaResourceDialect,
11029            >,
11030            offset: usize,
11031            _depth: fidl::encoding::Depth,
11032        ) -> fidl::Result<()> {
11033            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11034            // Delegate to tuple encoding.
11035            fidl::encoding::Encode::<
11036                CapabilitiesDirConnectorRouterRouteRequest,
11037                fidl::encoding::DefaultFuchsiaResourceDialect,
11038            >::encode(
11039                (
11040                    <fidl::encoding::HandleType<
11041                        fidl::EventPair,
11042                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11043                        2147483648,
11044                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11045                        &mut self.router
11046                    ),
11047                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11048                    <fidl::encoding::HandleType<
11049                        fidl::EventPair,
11050                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11051                        2147483648,
11052                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11053                        &mut self.instance_token,
11054                    ),
11055                    <fidl::encoding::HandleType<
11056                        fidl::EventPair,
11057                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11058                        2147483648,
11059                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11060                        &mut self.dir_connector,
11061                    ),
11062                ),
11063                encoder,
11064                offset,
11065                _depth,
11066            )
11067        }
11068    }
11069    unsafe impl<
11070        T0: fidl::encoding::Encode<
11071                fidl::encoding::HandleType<
11072                    fidl::EventPair,
11073                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11074                    2147483648,
11075                >,
11076                fidl::encoding::DefaultFuchsiaResourceDialect,
11077            >,
11078        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11079        T2: fidl::encoding::Encode<
11080                fidl::encoding::HandleType<
11081                    fidl::EventPair,
11082                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11083                    2147483648,
11084                >,
11085                fidl::encoding::DefaultFuchsiaResourceDialect,
11086            >,
11087        T3: fidl::encoding::Encode<
11088                fidl::encoding::HandleType<
11089                    fidl::EventPair,
11090                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11091                    2147483648,
11092                >,
11093                fidl::encoding::DefaultFuchsiaResourceDialect,
11094            >,
11095    >
11096        fidl::encoding::Encode<
11097            CapabilitiesDirConnectorRouterRouteRequest,
11098            fidl::encoding::DefaultFuchsiaResourceDialect,
11099        > for (T0, T1, T2, T3)
11100    {
11101        #[inline]
11102        unsafe fn encode(
11103            self,
11104            encoder: &mut fidl::encoding::Encoder<
11105                '_,
11106                fidl::encoding::DefaultFuchsiaResourceDialect,
11107            >,
11108            offset: usize,
11109            depth: fidl::encoding::Depth,
11110        ) -> fidl::Result<()> {
11111            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11112            // Zero out padding regions. There's no need to apply masks
11113            // because the unmasked parts will be overwritten by fields.
11114            unsafe {
11115                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11116                (ptr as *mut u64).write_unaligned(0);
11117            }
11118            // Write the fields.
11119            self.0.encode(encoder, offset + 0, depth)?;
11120            self.1.encode(encoder, offset + 8, depth)?;
11121            self.2.encode(encoder, offset + 24, depth)?;
11122            self.3.encode(encoder, offset + 28, depth)?;
11123            Ok(())
11124        }
11125    }
11126
11127    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11128        for CapabilitiesDirConnectorRouterRouteRequest
11129    {
11130        #[inline(always)]
11131        fn new_empty() -> Self {
11132            Self {
11133                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11134                request: fidl::new_empty!(
11135                    RouteRequest,
11136                    fidl::encoding::DefaultFuchsiaResourceDialect
11137                ),
11138                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11139                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11140            }
11141        }
11142
11143        #[inline]
11144        unsafe fn decode(
11145            &mut self,
11146            decoder: &mut fidl::encoding::Decoder<
11147                '_,
11148                fidl::encoding::DefaultFuchsiaResourceDialect,
11149            >,
11150            offset: usize,
11151            _depth: fidl::encoding::Depth,
11152        ) -> fidl::Result<()> {
11153            decoder.debug_check_bounds::<Self>(offset);
11154            // Verify that padding bytes are zero.
11155            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11156            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11157            let mask = 0xffffffff00000000u64;
11158            let maskedval = padval & mask;
11159            if maskedval != 0 {
11160                return Err(fidl::Error::NonZeroPadding {
11161                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11162                });
11163            }
11164            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11165            fidl::decode!(
11166                RouteRequest,
11167                fidl::encoding::DefaultFuchsiaResourceDialect,
11168                &mut self.request,
11169                decoder,
11170                offset + 8,
11171                _depth
11172            )?;
11173            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
11174            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 28, _depth)?;
11175            Ok(())
11176        }
11177    }
11178
11179    impl fidl::encoding::ResourceTypeMarker for CapabilitiesInstanceTokenCreateRequest {
11180        type Borrowed<'a> = &'a mut Self;
11181        fn take_or_borrow<'a>(
11182            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11183        ) -> Self::Borrowed<'a> {
11184            value
11185        }
11186    }
11187
11188    unsafe impl fidl::encoding::TypeMarker for CapabilitiesInstanceTokenCreateRequest {
11189        type Owned = Self;
11190
11191        #[inline(always)]
11192        fn inline_align(_context: fidl::encoding::Context) -> usize {
11193            4
11194        }
11195
11196        #[inline(always)]
11197        fn inline_size(_context: fidl::encoding::Context) -> usize {
11198            4
11199        }
11200    }
11201
11202    unsafe impl
11203        fidl::encoding::Encode<
11204            CapabilitiesInstanceTokenCreateRequest,
11205            fidl::encoding::DefaultFuchsiaResourceDialect,
11206        > for &mut CapabilitiesInstanceTokenCreateRequest
11207    {
11208        #[inline]
11209        unsafe fn encode(
11210            self,
11211            encoder: &mut fidl::encoding::Encoder<
11212                '_,
11213                fidl::encoding::DefaultFuchsiaResourceDialect,
11214            >,
11215            offset: usize,
11216            _depth: fidl::encoding::Depth,
11217        ) -> fidl::Result<()> {
11218            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11219            // Delegate to tuple encoding.
11220            fidl::encoding::Encode::<
11221                CapabilitiesInstanceTokenCreateRequest,
11222                fidl::encoding::DefaultFuchsiaResourceDialect,
11223            >::encode(
11224                (<fidl::encoding::HandleType<
11225                    fidl::EventPair,
11226                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11227                    2147483648,
11228                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11229                    &mut self.instance_token
11230                ),),
11231                encoder,
11232                offset,
11233                _depth,
11234            )
11235        }
11236    }
11237    unsafe impl<
11238        T0: fidl::encoding::Encode<
11239                fidl::encoding::HandleType<
11240                    fidl::EventPair,
11241                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11242                    2147483648,
11243                >,
11244                fidl::encoding::DefaultFuchsiaResourceDialect,
11245            >,
11246    >
11247        fidl::encoding::Encode<
11248            CapabilitiesInstanceTokenCreateRequest,
11249            fidl::encoding::DefaultFuchsiaResourceDialect,
11250        > for (T0,)
11251    {
11252        #[inline]
11253        unsafe fn encode(
11254            self,
11255            encoder: &mut fidl::encoding::Encoder<
11256                '_,
11257                fidl::encoding::DefaultFuchsiaResourceDialect,
11258            >,
11259            offset: usize,
11260            depth: fidl::encoding::Depth,
11261        ) -> fidl::Result<()> {
11262            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11263            // Zero out padding regions. There's no need to apply masks
11264            // because the unmasked parts will be overwritten by fields.
11265            // Write the fields.
11266            self.0.encode(encoder, offset + 0, depth)?;
11267            Ok(())
11268        }
11269    }
11270
11271    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11272        for CapabilitiesInstanceTokenCreateRequest
11273    {
11274        #[inline(always)]
11275        fn new_empty() -> Self {
11276            Self {
11277                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11278            }
11279        }
11280
11281        #[inline]
11282        unsafe fn decode(
11283            &mut self,
11284            decoder: &mut fidl::encoding::Decoder<
11285                '_,
11286                fidl::encoding::DefaultFuchsiaResourceDialect,
11287            >,
11288            offset: usize,
11289            _depth: fidl::encoding::Depth,
11290        ) -> fidl::Result<()> {
11291            decoder.debug_check_bounds::<Self>(offset);
11292            // Verify that padding bytes are zero.
11293            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 0, _depth)?;
11294            Ok(())
11295        }
11296    }
11297
11298    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetResponse {
11299        type Borrowed<'a> = &'a mut Self;
11300        fn take_or_borrow<'a>(
11301            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11302        ) -> Self::Borrowed<'a> {
11303            value
11304        }
11305    }
11306
11307    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetResponse {
11308        type Owned = Self;
11309
11310        #[inline(always)]
11311        fn inline_align(_context: fidl::encoding::Context) -> usize {
11312            4
11313        }
11314
11315        #[inline(always)]
11316        fn inline_size(_context: fidl::encoding::Context) -> usize {
11317            4
11318        }
11319    }
11320
11321    unsafe impl
11322        fidl::encoding::Encode<
11323            CapabilitiesDictionaryGetResponse,
11324            fidl::encoding::DefaultFuchsiaResourceDialect,
11325        > for &mut CapabilitiesDictionaryGetResponse
11326    {
11327        #[inline]
11328        unsafe fn encode(
11329            self,
11330            encoder: &mut fidl::encoding::Encoder<
11331                '_,
11332                fidl::encoding::DefaultFuchsiaResourceDialect,
11333            >,
11334            offset: usize,
11335            _depth: fidl::encoding::Depth,
11336        ) -> fidl::Result<()> {
11337            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11338            // Delegate to tuple encoding.
11339            fidl::encoding::Encode::<
11340                CapabilitiesDictionaryGetResponse,
11341                fidl::encoding::DefaultFuchsiaResourceDialect,
11342            >::encode(
11343                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11344                    &self.capability_type,
11345                ),),
11346                encoder,
11347                offset,
11348                _depth,
11349            )
11350        }
11351    }
11352    unsafe impl<
11353        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11354    >
11355        fidl::encoding::Encode<
11356            CapabilitiesDictionaryGetResponse,
11357            fidl::encoding::DefaultFuchsiaResourceDialect,
11358        > for (T0,)
11359    {
11360        #[inline]
11361        unsafe fn encode(
11362            self,
11363            encoder: &mut fidl::encoding::Encoder<
11364                '_,
11365                fidl::encoding::DefaultFuchsiaResourceDialect,
11366            >,
11367            offset: usize,
11368            depth: fidl::encoding::Depth,
11369        ) -> fidl::Result<()> {
11370            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11371            // Zero out padding regions. There's no need to apply masks
11372            // because the unmasked parts will be overwritten by fields.
11373            // Write the fields.
11374            self.0.encode(encoder, offset + 0, depth)?;
11375            Ok(())
11376        }
11377    }
11378
11379    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11380        for CapabilitiesDictionaryGetResponse
11381    {
11382        #[inline(always)]
11383        fn new_empty() -> Self {
11384            Self {
11385                capability_type: fidl::new_empty!(
11386                    CapabilityType,
11387                    fidl::encoding::DefaultFuchsiaResourceDialect
11388                ),
11389            }
11390        }
11391
11392        #[inline]
11393        unsafe fn decode(
11394            &mut self,
11395            decoder: &mut fidl::encoding::Decoder<
11396                '_,
11397                fidl::encoding::DefaultFuchsiaResourceDialect,
11398            >,
11399            offset: usize,
11400            _depth: fidl::encoding::Depth,
11401        ) -> fidl::Result<()> {
11402            decoder.debug_check_bounds::<Self>(offset);
11403            // Verify that padding bytes are zero.
11404            fidl::decode!(
11405                CapabilityType,
11406                fidl::encoding::DefaultFuchsiaResourceDialect,
11407                &mut self.capability_type,
11408                decoder,
11409                offset + 0,
11410                _depth
11411            )?;
11412            Ok(())
11413        }
11414    }
11415
11416    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveResponse {
11417        type Borrowed<'a> = &'a mut Self;
11418        fn take_or_borrow<'a>(
11419            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11420        ) -> Self::Borrowed<'a> {
11421            value
11422        }
11423    }
11424
11425    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveResponse {
11426        type Owned = Self;
11427
11428        #[inline(always)]
11429        fn inline_align(_context: fidl::encoding::Context) -> usize {
11430            4
11431        }
11432
11433        #[inline(always)]
11434        fn inline_size(_context: fidl::encoding::Context) -> usize {
11435            4
11436        }
11437    }
11438
11439    unsafe impl
11440        fidl::encoding::Encode<
11441            CapabilitiesDictionaryRemoveResponse,
11442            fidl::encoding::DefaultFuchsiaResourceDialect,
11443        > for &mut CapabilitiesDictionaryRemoveResponse
11444    {
11445        #[inline]
11446        unsafe fn encode(
11447            self,
11448            encoder: &mut fidl::encoding::Encoder<
11449                '_,
11450                fidl::encoding::DefaultFuchsiaResourceDialect,
11451            >,
11452            offset: usize,
11453            _depth: fidl::encoding::Depth,
11454        ) -> fidl::Result<()> {
11455            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11456            // Delegate to tuple encoding.
11457            fidl::encoding::Encode::<
11458                CapabilitiesDictionaryRemoveResponse,
11459                fidl::encoding::DefaultFuchsiaResourceDialect,
11460            >::encode(
11461                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11462                    &self.capability_type,
11463                ),),
11464                encoder,
11465                offset,
11466                _depth,
11467            )
11468        }
11469    }
11470    unsafe impl<
11471        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11472    >
11473        fidl::encoding::Encode<
11474            CapabilitiesDictionaryRemoveResponse,
11475            fidl::encoding::DefaultFuchsiaResourceDialect,
11476        > for (T0,)
11477    {
11478        #[inline]
11479        unsafe fn encode(
11480            self,
11481            encoder: &mut fidl::encoding::Encoder<
11482                '_,
11483                fidl::encoding::DefaultFuchsiaResourceDialect,
11484            >,
11485            offset: usize,
11486            depth: fidl::encoding::Depth,
11487        ) -> fidl::Result<()> {
11488            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11489            // Zero out padding regions. There's no need to apply masks
11490            // because the unmasked parts will be overwritten by fields.
11491            // Write the fields.
11492            self.0.encode(encoder, offset + 0, depth)?;
11493            Ok(())
11494        }
11495    }
11496
11497    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11498        for CapabilitiesDictionaryRemoveResponse
11499    {
11500        #[inline(always)]
11501        fn new_empty() -> Self {
11502            Self {
11503                capability_type: fidl::new_empty!(
11504                    CapabilityType,
11505                    fidl::encoding::DefaultFuchsiaResourceDialect
11506                ),
11507            }
11508        }
11509
11510        #[inline]
11511        unsafe fn decode(
11512            &mut self,
11513            decoder: &mut fidl::encoding::Decoder<
11514                '_,
11515                fidl::encoding::DefaultFuchsiaResourceDialect,
11516            >,
11517            offset: usize,
11518            _depth: fidl::encoding::Depth,
11519        ) -> fidl::Result<()> {
11520            decoder.debug_check_bounds::<Self>(offset);
11521            // Verify that padding bytes are zero.
11522            fidl::decode!(
11523                CapabilityType,
11524                fidl::encoding::DefaultFuchsiaResourceDialect,
11525                &mut self.capability_type,
11526                decoder,
11527                offset + 0,
11528                _depth
11529            )?;
11530            Ok(())
11531        }
11532    }
11533
11534    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteRequest {
11535        type Borrowed<'a> = &'a mut Self;
11536        fn take_or_borrow<'a>(
11537            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11538        ) -> Self::Borrowed<'a> {
11539            value
11540        }
11541    }
11542
11543    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteRequest {
11544        type Owned = Self;
11545
11546        #[inline(always)]
11547        fn inline_align(_context: fidl::encoding::Context) -> usize {
11548            8
11549        }
11550
11551        #[inline(always)]
11552        fn inline_size(_context: fidl::encoding::Context) -> usize {
11553            24
11554        }
11555    }
11556
11557    unsafe impl
11558        fidl::encoding::Encode<
11559            ConnectorRouterRouteRequest,
11560            fidl::encoding::DefaultFuchsiaResourceDialect,
11561        > for &mut ConnectorRouterRouteRequest
11562    {
11563        #[inline]
11564        unsafe fn encode(
11565            self,
11566            encoder: &mut fidl::encoding::Encoder<
11567                '_,
11568                fidl::encoding::DefaultFuchsiaResourceDialect,
11569            >,
11570            offset: usize,
11571            _depth: fidl::encoding::Depth,
11572        ) -> fidl::Result<()> {
11573            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11574            // Delegate to tuple encoding.
11575            fidl::encoding::Encode::<
11576                ConnectorRouterRouteRequest,
11577                fidl::encoding::DefaultFuchsiaResourceDialect,
11578            >::encode(
11579                (
11580                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11581                    <fidl::encoding::HandleType<
11582                        fidl::EventPair,
11583                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11584                        2147483648,
11585                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11586                        &mut self.instance_token,
11587                    ),
11588                    <fidl::encoding::HandleType<
11589                        fidl::EventPair,
11590                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11591                        2147483648,
11592                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11593                        &mut self.handle
11594                    ),
11595                ),
11596                encoder,
11597                offset,
11598                _depth,
11599            )
11600        }
11601    }
11602    unsafe impl<
11603        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11604        T1: fidl::encoding::Encode<
11605                fidl::encoding::HandleType<
11606                    fidl::EventPair,
11607                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11608                    2147483648,
11609                >,
11610                fidl::encoding::DefaultFuchsiaResourceDialect,
11611            >,
11612        T2: 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    >
11621        fidl::encoding::Encode<
11622            ConnectorRouterRouteRequest,
11623            fidl::encoding::DefaultFuchsiaResourceDialect,
11624        > for (T0, T1, T2)
11625    {
11626        #[inline]
11627        unsafe fn encode(
11628            self,
11629            encoder: &mut fidl::encoding::Encoder<
11630                '_,
11631                fidl::encoding::DefaultFuchsiaResourceDialect,
11632            >,
11633            offset: usize,
11634            depth: fidl::encoding::Depth,
11635        ) -> fidl::Result<()> {
11636            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11637            // Zero out padding regions. There's no need to apply masks
11638            // because the unmasked parts will be overwritten by fields.
11639            // Write the fields.
11640            self.0.encode(encoder, offset + 0, depth)?;
11641            self.1.encode(encoder, offset + 16, depth)?;
11642            self.2.encode(encoder, offset + 20, depth)?;
11643            Ok(())
11644        }
11645    }
11646
11647    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11648        for ConnectorRouterRouteRequest
11649    {
11650        #[inline(always)]
11651        fn new_empty() -> Self {
11652            Self {
11653                request: fidl::new_empty!(
11654                    RouteRequest,
11655                    fidl::encoding::DefaultFuchsiaResourceDialect
11656                ),
11657                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11658                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11659            }
11660        }
11661
11662        #[inline]
11663        unsafe fn decode(
11664            &mut self,
11665            decoder: &mut fidl::encoding::Decoder<
11666                '_,
11667                fidl::encoding::DefaultFuchsiaResourceDialect,
11668            >,
11669            offset: usize,
11670            _depth: fidl::encoding::Depth,
11671        ) -> fidl::Result<()> {
11672            decoder.debug_check_bounds::<Self>(offset);
11673            // Verify that padding bytes are zero.
11674            fidl::decode!(
11675                RouteRequest,
11676                fidl::encoding::DefaultFuchsiaResourceDialect,
11677                &mut self.request,
11678                decoder,
11679                offset + 0,
11680                _depth
11681            )?;
11682            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11683            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11684            Ok(())
11685        }
11686    }
11687
11688    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteRequest {
11689        type Borrowed<'a> = &'a mut Self;
11690        fn take_or_borrow<'a>(
11691            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11692        ) -> Self::Borrowed<'a> {
11693            value
11694        }
11695    }
11696
11697    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteRequest {
11698        type Owned = Self;
11699
11700        #[inline(always)]
11701        fn inline_align(_context: fidl::encoding::Context) -> usize {
11702            8
11703        }
11704
11705        #[inline(always)]
11706        fn inline_size(_context: fidl::encoding::Context) -> usize {
11707            24
11708        }
11709    }
11710
11711    unsafe impl
11712        fidl::encoding::Encode<
11713            DataRouterRouteRequest,
11714            fidl::encoding::DefaultFuchsiaResourceDialect,
11715        > for &mut DataRouterRouteRequest
11716    {
11717        #[inline]
11718        unsafe fn encode(
11719            self,
11720            encoder: &mut fidl::encoding::Encoder<
11721                '_,
11722                fidl::encoding::DefaultFuchsiaResourceDialect,
11723            >,
11724            offset: usize,
11725            _depth: fidl::encoding::Depth,
11726        ) -> fidl::Result<()> {
11727            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11728            // Delegate to tuple encoding.
11729            fidl::encoding::Encode::<
11730                DataRouterRouteRequest,
11731                fidl::encoding::DefaultFuchsiaResourceDialect,
11732            >::encode(
11733                (
11734                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11735                    <fidl::encoding::HandleType<
11736                        fidl::EventPair,
11737                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11738                        2147483648,
11739                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11740                        &mut self.instance_token,
11741                    ),
11742                    <fidl::encoding::HandleType<
11743                        fidl::EventPair,
11744                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11745                        2147483648,
11746                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11747                        &mut self.handle
11748                    ),
11749                ),
11750                encoder,
11751                offset,
11752                _depth,
11753            )
11754        }
11755    }
11756    unsafe impl<
11757        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11758        T1: fidl::encoding::Encode<
11759                fidl::encoding::HandleType<
11760                    fidl::EventPair,
11761                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11762                    2147483648,
11763                >,
11764                fidl::encoding::DefaultFuchsiaResourceDialect,
11765            >,
11766        T2: fidl::encoding::Encode<
11767                fidl::encoding::HandleType<
11768                    fidl::EventPair,
11769                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11770                    2147483648,
11771                >,
11772                fidl::encoding::DefaultFuchsiaResourceDialect,
11773            >,
11774    >
11775        fidl::encoding::Encode<
11776            DataRouterRouteRequest,
11777            fidl::encoding::DefaultFuchsiaResourceDialect,
11778        > for (T0, T1, T2)
11779    {
11780        #[inline]
11781        unsafe fn encode(
11782            self,
11783            encoder: &mut fidl::encoding::Encoder<
11784                '_,
11785                fidl::encoding::DefaultFuchsiaResourceDialect,
11786            >,
11787            offset: usize,
11788            depth: fidl::encoding::Depth,
11789        ) -> fidl::Result<()> {
11790            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11791            // Zero out padding regions. There's no need to apply masks
11792            // because the unmasked parts will be overwritten by fields.
11793            // Write the fields.
11794            self.0.encode(encoder, offset + 0, depth)?;
11795            self.1.encode(encoder, offset + 16, depth)?;
11796            self.2.encode(encoder, offset + 20, depth)?;
11797            Ok(())
11798        }
11799    }
11800
11801    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11802        for DataRouterRouteRequest
11803    {
11804        #[inline(always)]
11805        fn new_empty() -> Self {
11806            Self {
11807                request: fidl::new_empty!(
11808                    RouteRequest,
11809                    fidl::encoding::DefaultFuchsiaResourceDialect
11810                ),
11811                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11812                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11813            }
11814        }
11815
11816        #[inline]
11817        unsafe fn decode(
11818            &mut self,
11819            decoder: &mut fidl::encoding::Decoder<
11820                '_,
11821                fidl::encoding::DefaultFuchsiaResourceDialect,
11822            >,
11823            offset: usize,
11824            _depth: fidl::encoding::Depth,
11825        ) -> fidl::Result<()> {
11826            decoder.debug_check_bounds::<Self>(offset);
11827            // Verify that padding bytes are zero.
11828            fidl::decode!(
11829                RouteRequest,
11830                fidl::encoding::DefaultFuchsiaResourceDialect,
11831                &mut self.request,
11832                decoder,
11833                offset + 0,
11834                _depth
11835            )?;
11836            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11837            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11838            Ok(())
11839        }
11840    }
11841
11842    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteRequest {
11843        type Borrowed<'a> = &'a mut Self;
11844        fn take_or_borrow<'a>(
11845            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11846        ) -> Self::Borrowed<'a> {
11847            value
11848        }
11849    }
11850
11851    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteRequest {
11852        type Owned = Self;
11853
11854        #[inline(always)]
11855        fn inline_align(_context: fidl::encoding::Context) -> usize {
11856            8
11857        }
11858
11859        #[inline(always)]
11860        fn inline_size(_context: fidl::encoding::Context) -> usize {
11861            24
11862        }
11863    }
11864
11865    unsafe impl
11866        fidl::encoding::Encode<
11867            DictionaryRouterRouteRequest,
11868            fidl::encoding::DefaultFuchsiaResourceDialect,
11869        > for &mut DictionaryRouterRouteRequest
11870    {
11871        #[inline]
11872        unsafe fn encode(
11873            self,
11874            encoder: &mut fidl::encoding::Encoder<
11875                '_,
11876                fidl::encoding::DefaultFuchsiaResourceDialect,
11877            >,
11878            offset: usize,
11879            _depth: fidl::encoding::Depth,
11880        ) -> fidl::Result<()> {
11881            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11882            // Delegate to tuple encoding.
11883            fidl::encoding::Encode::<
11884                DictionaryRouterRouteRequest,
11885                fidl::encoding::DefaultFuchsiaResourceDialect,
11886            >::encode(
11887                (
11888                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11889                    <fidl::encoding::HandleType<
11890                        fidl::EventPair,
11891                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11892                        2147483648,
11893                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11894                        &mut self.instance_token,
11895                    ),
11896                    <fidl::encoding::HandleType<
11897                        fidl::EventPair,
11898                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11899                        2147483648,
11900                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11901                        &mut self.handle
11902                    ),
11903                ),
11904                encoder,
11905                offset,
11906                _depth,
11907            )
11908        }
11909    }
11910    unsafe impl<
11911        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11912        T1: fidl::encoding::Encode<
11913                fidl::encoding::HandleType<
11914                    fidl::EventPair,
11915                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11916                    2147483648,
11917                >,
11918                fidl::encoding::DefaultFuchsiaResourceDialect,
11919            >,
11920        T2: fidl::encoding::Encode<
11921                fidl::encoding::HandleType<
11922                    fidl::EventPair,
11923                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11924                    2147483648,
11925                >,
11926                fidl::encoding::DefaultFuchsiaResourceDialect,
11927            >,
11928    >
11929        fidl::encoding::Encode<
11930            DictionaryRouterRouteRequest,
11931            fidl::encoding::DefaultFuchsiaResourceDialect,
11932        > for (T0, T1, T2)
11933    {
11934        #[inline]
11935        unsafe fn encode(
11936            self,
11937            encoder: &mut fidl::encoding::Encoder<
11938                '_,
11939                fidl::encoding::DefaultFuchsiaResourceDialect,
11940            >,
11941            offset: usize,
11942            depth: fidl::encoding::Depth,
11943        ) -> fidl::Result<()> {
11944            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11945            // Zero out padding regions. There's no need to apply masks
11946            // because the unmasked parts will be overwritten by fields.
11947            // Write the fields.
11948            self.0.encode(encoder, offset + 0, depth)?;
11949            self.1.encode(encoder, offset + 16, depth)?;
11950            self.2.encode(encoder, offset + 20, depth)?;
11951            Ok(())
11952        }
11953    }
11954
11955    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11956        for DictionaryRouterRouteRequest
11957    {
11958        #[inline(always)]
11959        fn new_empty() -> Self {
11960            Self {
11961                request: fidl::new_empty!(
11962                    RouteRequest,
11963                    fidl::encoding::DefaultFuchsiaResourceDialect
11964                ),
11965                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11966                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11967            }
11968        }
11969
11970        #[inline]
11971        unsafe fn decode(
11972            &mut self,
11973            decoder: &mut fidl::encoding::Decoder<
11974                '_,
11975                fidl::encoding::DefaultFuchsiaResourceDialect,
11976            >,
11977            offset: usize,
11978            _depth: fidl::encoding::Depth,
11979        ) -> fidl::Result<()> {
11980            decoder.debug_check_bounds::<Self>(offset);
11981            // Verify that padding bytes are zero.
11982            fidl::decode!(
11983                RouteRequest,
11984                fidl::encoding::DefaultFuchsiaResourceDialect,
11985                &mut self.request,
11986                decoder,
11987                offset + 0,
11988                _depth
11989            )?;
11990            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11991            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11992            Ok(())
11993        }
11994    }
11995
11996    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteRequest {
11997        type Borrowed<'a> = &'a mut Self;
11998        fn take_or_borrow<'a>(
11999            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12000        ) -> Self::Borrowed<'a> {
12001            value
12002        }
12003    }
12004
12005    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteRequest {
12006        type Owned = Self;
12007
12008        #[inline(always)]
12009        fn inline_align(_context: fidl::encoding::Context) -> usize {
12010            8
12011        }
12012
12013        #[inline(always)]
12014        fn inline_size(_context: fidl::encoding::Context) -> usize {
12015            24
12016        }
12017    }
12018
12019    unsafe impl
12020        fidl::encoding::Encode<
12021            DirConnectorRouterRouteRequest,
12022            fidl::encoding::DefaultFuchsiaResourceDialect,
12023        > for &mut DirConnectorRouterRouteRequest
12024    {
12025        #[inline]
12026        unsafe fn encode(
12027            self,
12028            encoder: &mut fidl::encoding::Encoder<
12029                '_,
12030                fidl::encoding::DefaultFuchsiaResourceDialect,
12031            >,
12032            offset: usize,
12033            _depth: fidl::encoding::Depth,
12034        ) -> fidl::Result<()> {
12035            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12036            // Delegate to tuple encoding.
12037            fidl::encoding::Encode::<
12038                DirConnectorRouterRouteRequest,
12039                fidl::encoding::DefaultFuchsiaResourceDialect,
12040            >::encode(
12041                (
12042                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
12043                    <fidl::encoding::HandleType<
12044                        fidl::EventPair,
12045                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12046                        2147483648,
12047                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12048                        &mut self.instance_token,
12049                    ),
12050                    <fidl::encoding::HandleType<
12051                        fidl::EventPair,
12052                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12053                        2147483648,
12054                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12055                        &mut self.handle
12056                    ),
12057                ),
12058                encoder,
12059                offset,
12060                _depth,
12061            )
12062        }
12063    }
12064    unsafe impl<
12065        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
12066        T1: fidl::encoding::Encode<
12067                fidl::encoding::HandleType<
12068                    fidl::EventPair,
12069                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12070                    2147483648,
12071                >,
12072                fidl::encoding::DefaultFuchsiaResourceDialect,
12073            >,
12074        T2: fidl::encoding::Encode<
12075                fidl::encoding::HandleType<
12076                    fidl::EventPair,
12077                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12078                    2147483648,
12079                >,
12080                fidl::encoding::DefaultFuchsiaResourceDialect,
12081            >,
12082    >
12083        fidl::encoding::Encode<
12084            DirConnectorRouterRouteRequest,
12085            fidl::encoding::DefaultFuchsiaResourceDialect,
12086        > for (T0, T1, T2)
12087    {
12088        #[inline]
12089        unsafe fn encode(
12090            self,
12091            encoder: &mut fidl::encoding::Encoder<
12092                '_,
12093                fidl::encoding::DefaultFuchsiaResourceDialect,
12094            >,
12095            offset: usize,
12096            depth: fidl::encoding::Depth,
12097        ) -> fidl::Result<()> {
12098            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12099            // Zero out padding regions. There's no need to apply masks
12100            // because the unmasked parts will be overwritten by fields.
12101            // Write the fields.
12102            self.0.encode(encoder, offset + 0, depth)?;
12103            self.1.encode(encoder, offset + 16, depth)?;
12104            self.2.encode(encoder, offset + 20, depth)?;
12105            Ok(())
12106        }
12107    }
12108
12109    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12110        for DirConnectorRouterRouteRequest
12111    {
12112        #[inline(always)]
12113        fn new_empty() -> Self {
12114            Self {
12115                request: fidl::new_empty!(
12116                    RouteRequest,
12117                    fidl::encoding::DefaultFuchsiaResourceDialect
12118                ),
12119                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12120                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12121            }
12122        }
12123
12124        #[inline]
12125        unsafe fn decode(
12126            &mut self,
12127            decoder: &mut fidl::encoding::Decoder<
12128                '_,
12129                fidl::encoding::DefaultFuchsiaResourceDialect,
12130            >,
12131            offset: usize,
12132            _depth: fidl::encoding::Depth,
12133        ) -> fidl::Result<()> {
12134            decoder.debug_check_bounds::<Self>(offset);
12135            // Verify that padding bytes are zero.
12136            fidl::decode!(
12137                RouteRequest,
12138                fidl::encoding::DefaultFuchsiaResourceDialect,
12139                &mut self.request,
12140                decoder,
12141                offset + 0,
12142                _depth
12143            )?;
12144            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12145            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12146            Ok(())
12147        }
12148    }
12149
12150    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12151        type Borrowed<'a> = &'a mut Self;
12152        fn take_or_borrow<'a>(
12153            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12154        ) -> Self::Borrowed<'a> {
12155            value
12156        }
12157    }
12158
12159    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12160        type Owned = Self;
12161
12162        #[inline(always)]
12163        fn inline_align(_context: fidl::encoding::Context) -> usize {
12164            8
12165        }
12166
12167        #[inline(always)]
12168        fn inline_size(_context: fidl::encoding::Context) -> usize {
12169            32
12170        }
12171    }
12172
12173    unsafe impl
12174        fidl::encoding::Encode<
12175            DirReceiverReceiveRequest,
12176            fidl::encoding::DefaultFuchsiaResourceDialect,
12177        > for &mut DirReceiverReceiveRequest
12178    {
12179        #[inline]
12180        unsafe fn encode(
12181            self,
12182            encoder: &mut fidl::encoding::Encoder<
12183                '_,
12184                fidl::encoding::DefaultFuchsiaResourceDialect,
12185            >,
12186            offset: usize,
12187            _depth: fidl::encoding::Depth,
12188        ) -> fidl::Result<()> {
12189            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12190            // Delegate to tuple encoding.
12191            fidl::encoding::Encode::<DirReceiverReceiveRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12192                (
12193                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12194                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
12195                    <fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
12196                ),
12197                encoder, offset, _depth
12198            )
12199        }
12200    }
12201    unsafe impl<
12202        T0: fidl::encoding::Encode<
12203                fidl::encoding::Endpoint<
12204                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12205                >,
12206                fidl::encoding::DefaultFuchsiaResourceDialect,
12207            >,
12208        T1: fidl::encoding::Encode<
12209                fidl::encoding::BoundedString<4095>,
12210                fidl::encoding::DefaultFuchsiaResourceDialect,
12211            >,
12212        T2: fidl::encoding::Encode<
12213                fidl_fuchsia_io::Flags,
12214                fidl::encoding::DefaultFuchsiaResourceDialect,
12215            >,
12216    >
12217        fidl::encoding::Encode<
12218            DirReceiverReceiveRequest,
12219            fidl::encoding::DefaultFuchsiaResourceDialect,
12220        > for (T0, T1, T2)
12221    {
12222        #[inline]
12223        unsafe fn encode(
12224            self,
12225            encoder: &mut fidl::encoding::Encoder<
12226                '_,
12227                fidl::encoding::DefaultFuchsiaResourceDialect,
12228            >,
12229            offset: usize,
12230            depth: fidl::encoding::Depth,
12231        ) -> fidl::Result<()> {
12232            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12233            // Zero out padding regions. There's no need to apply masks
12234            // because the unmasked parts will be overwritten by fields.
12235            unsafe {
12236                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12237                (ptr as *mut u64).write_unaligned(0);
12238            }
12239            // Write the fields.
12240            self.0.encode(encoder, offset + 0, depth)?;
12241            self.1.encode(encoder, offset + 8, depth)?;
12242            self.2.encode(encoder, offset + 24, depth)?;
12243            Ok(())
12244        }
12245    }
12246
12247    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12248        for DirReceiverReceiveRequest
12249    {
12250        #[inline(always)]
12251        fn new_empty() -> Self {
12252            Self {
12253                channel: fidl::new_empty!(
12254                    fidl::encoding::Endpoint<
12255                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12256                    >,
12257                    fidl::encoding::DefaultFuchsiaResourceDialect
12258                ),
12259                path: fidl::new_empty!(
12260                    fidl::encoding::BoundedString<4095>,
12261                    fidl::encoding::DefaultFuchsiaResourceDialect
12262                ),
12263                rights: fidl::new_empty!(
12264                    fidl_fuchsia_io::Flags,
12265                    fidl::encoding::DefaultFuchsiaResourceDialect
12266                ),
12267            }
12268        }
12269
12270        #[inline]
12271        unsafe fn decode(
12272            &mut self,
12273            decoder: &mut fidl::encoding::Decoder<
12274                '_,
12275                fidl::encoding::DefaultFuchsiaResourceDialect,
12276            >,
12277            offset: usize,
12278            _depth: fidl::encoding::Depth,
12279        ) -> fidl::Result<()> {
12280            decoder.debug_check_bounds::<Self>(offset);
12281            // Verify that padding bytes are zero.
12282            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12283            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12284            let mask = 0xffffffff00000000u64;
12285            let maskedval = padval & mask;
12286            if maskedval != 0 {
12287                return Err(fidl::Error::NonZeroPadding {
12288                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12289                });
12290            }
12291            fidl::decode!(
12292                fidl::encoding::Endpoint<
12293                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12294                >,
12295                fidl::encoding::DefaultFuchsiaResourceDialect,
12296                &mut self.channel,
12297                decoder,
12298                offset + 0,
12299                _depth
12300            )?;
12301            fidl::decode!(
12302                fidl::encoding::BoundedString<4095>,
12303                fidl::encoding::DefaultFuchsiaResourceDialect,
12304                &mut self.path,
12305                decoder,
12306                offset + 8,
12307                _depth
12308            )?;
12309            fidl::decode!(
12310                fidl_fuchsia_io::Flags,
12311                fidl::encoding::DefaultFuchsiaResourceDialect,
12312                &mut self.rights,
12313                decoder,
12314                offset + 24,
12315                _depth
12316            )?;
12317            Ok(())
12318        }
12319    }
12320
12321    impl fidl::encoding::ResourceTypeMarker for ReceiverReceiveRequest {
12322        type Borrowed<'a> = &'a mut Self;
12323        fn take_or_borrow<'a>(
12324            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12325        ) -> Self::Borrowed<'a> {
12326            value
12327        }
12328    }
12329
12330    unsafe impl fidl::encoding::TypeMarker for ReceiverReceiveRequest {
12331        type Owned = Self;
12332
12333        #[inline(always)]
12334        fn inline_align(_context: fidl::encoding::Context) -> usize {
12335            4
12336        }
12337
12338        #[inline(always)]
12339        fn inline_size(_context: fidl::encoding::Context) -> usize {
12340            4
12341        }
12342    }
12343
12344    unsafe impl
12345        fidl::encoding::Encode<
12346            ReceiverReceiveRequest,
12347            fidl::encoding::DefaultFuchsiaResourceDialect,
12348        > for &mut ReceiverReceiveRequest
12349    {
12350        #[inline]
12351        unsafe fn encode(
12352            self,
12353            encoder: &mut fidl::encoding::Encoder<
12354                '_,
12355                fidl::encoding::DefaultFuchsiaResourceDialect,
12356            >,
12357            offset: usize,
12358            _depth: fidl::encoding::Depth,
12359        ) -> fidl::Result<()> {
12360            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12361            // Delegate to tuple encoding.
12362            fidl::encoding::Encode::<
12363                ReceiverReceiveRequest,
12364                fidl::encoding::DefaultFuchsiaResourceDialect,
12365            >::encode(
12366                (<fidl::encoding::HandleType<
12367                    fidl::Channel,
12368                    { fidl::ObjectType::CHANNEL.into_raw() },
12369                    2147483648,
12370                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12371                    &mut self.channel
12372                ),),
12373                encoder,
12374                offset,
12375                _depth,
12376            )
12377        }
12378    }
12379    unsafe impl<
12380        T0: fidl::encoding::Encode<
12381                fidl::encoding::HandleType<
12382                    fidl::Channel,
12383                    { fidl::ObjectType::CHANNEL.into_raw() },
12384                    2147483648,
12385                >,
12386                fidl::encoding::DefaultFuchsiaResourceDialect,
12387            >,
12388    >
12389        fidl::encoding::Encode<
12390            ReceiverReceiveRequest,
12391            fidl::encoding::DefaultFuchsiaResourceDialect,
12392        > for (T0,)
12393    {
12394        #[inline]
12395        unsafe fn encode(
12396            self,
12397            encoder: &mut fidl::encoding::Encoder<
12398                '_,
12399                fidl::encoding::DefaultFuchsiaResourceDialect,
12400            >,
12401            offset: usize,
12402            depth: fidl::encoding::Depth,
12403        ) -> fidl::Result<()> {
12404            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12405            // Zero out padding regions. There's no need to apply masks
12406            // because the unmasked parts will be overwritten by fields.
12407            // Write the fields.
12408            self.0.encode(encoder, offset + 0, depth)?;
12409            Ok(())
12410        }
12411    }
12412
12413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12414        for ReceiverReceiveRequest
12415    {
12416        #[inline(always)]
12417        fn new_empty() -> Self {
12418            Self {
12419                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12420            }
12421        }
12422
12423        #[inline]
12424        unsafe fn decode(
12425            &mut self,
12426            decoder: &mut fidl::encoding::Decoder<
12427                '_,
12428                fidl::encoding::DefaultFuchsiaResourceDialect,
12429            >,
12430            offset: usize,
12431            _depth: fidl::encoding::Depth,
12432        ) -> fidl::Result<()> {
12433            decoder.debug_check_bounds::<Self>(offset);
12434            // Verify that padding bytes are zero.
12435            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12436            Ok(())
12437        }
12438    }
12439
12440    impl CapabilitiesDictionaryRemoveRequest {
12441        #[inline(always)]
12442        fn max_ordinal_present(&self) -> u64 {
12443            if let Some(_) = self.value {
12444                return 3;
12445            }
12446            if let Some(_) = self.key {
12447                return 2;
12448            }
12449            if let Some(_) = self.dictionary {
12450                return 1;
12451            }
12452            0
12453        }
12454    }
12455
12456    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveRequest {
12457        type Borrowed<'a> = &'a mut Self;
12458        fn take_or_borrow<'a>(
12459            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12460        ) -> Self::Borrowed<'a> {
12461            value
12462        }
12463    }
12464
12465    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveRequest {
12466        type Owned = Self;
12467
12468        #[inline(always)]
12469        fn inline_align(_context: fidl::encoding::Context) -> usize {
12470            8
12471        }
12472
12473        #[inline(always)]
12474        fn inline_size(_context: fidl::encoding::Context) -> usize {
12475            16
12476        }
12477    }
12478
12479    unsafe impl
12480        fidl::encoding::Encode<
12481            CapabilitiesDictionaryRemoveRequest,
12482            fidl::encoding::DefaultFuchsiaResourceDialect,
12483        > for &mut CapabilitiesDictionaryRemoveRequest
12484    {
12485        unsafe fn encode(
12486            self,
12487            encoder: &mut fidl::encoding::Encoder<
12488                '_,
12489                fidl::encoding::DefaultFuchsiaResourceDialect,
12490            >,
12491            offset: usize,
12492            mut depth: fidl::encoding::Depth,
12493        ) -> fidl::Result<()> {
12494            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveRequest>(offset);
12495            // Vector header
12496            let max_ordinal: u64 = self.max_ordinal_present();
12497            encoder.write_num(max_ordinal, offset);
12498            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12499            // Calling encoder.out_of_line_offset(0) is not allowed.
12500            if max_ordinal == 0 {
12501                return Ok(());
12502            }
12503            depth.increment()?;
12504            let envelope_size = 8;
12505            let bytes_len = max_ordinal as usize * envelope_size;
12506            #[allow(unused_variables)]
12507            let offset = encoder.out_of_line_offset(bytes_len);
12508            let mut _prev_end_offset: usize = 0;
12509            if 1 > max_ordinal {
12510                return Ok(());
12511            }
12512
12513            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12514            // are envelope_size bytes.
12515            let cur_offset: usize = (1 - 1) * envelope_size;
12516
12517            // Zero reserved fields.
12518            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12519
12520            // Safety:
12521            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12522            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12523            //   envelope_size bytes, there is always sufficient room.
12524            fidl::encoding::encode_in_envelope_optional::<
12525                fidl::encoding::HandleType<
12526                    fidl::EventPair,
12527                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12528                    2147483648,
12529                >,
12530                fidl::encoding::DefaultFuchsiaResourceDialect,
12531            >(
12532                self.dictionary.as_mut().map(
12533                    <fidl::encoding::HandleType<
12534                        fidl::EventPair,
12535                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12536                        2147483648,
12537                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12538                ),
12539                encoder,
12540                offset + cur_offset,
12541                depth,
12542            )?;
12543
12544            _prev_end_offset = cur_offset + envelope_size;
12545            if 2 > max_ordinal {
12546                return Ok(());
12547            }
12548
12549            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12550            // are envelope_size bytes.
12551            let cur_offset: usize = (2 - 1) * envelope_size;
12552
12553            // Zero reserved fields.
12554            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12555
12556            // Safety:
12557            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12558            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12559            //   envelope_size bytes, there is always sufficient room.
12560            fidl::encoding::encode_in_envelope_optional::<
12561                fidl::encoding::BoundedString<100>,
12562                fidl::encoding::DefaultFuchsiaResourceDialect,
12563            >(
12564                self.key.as_ref().map(
12565                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12566                ),
12567                encoder,
12568                offset + cur_offset,
12569                depth,
12570            )?;
12571
12572            _prev_end_offset = cur_offset + envelope_size;
12573            if 3 > max_ordinal {
12574                return Ok(());
12575            }
12576
12577            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12578            // are envelope_size bytes.
12579            let cur_offset: usize = (3 - 1) * envelope_size;
12580
12581            // Zero reserved fields.
12582            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12583
12584            // Safety:
12585            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12586            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12587            //   envelope_size bytes, there is always sufficient room.
12588            fidl::encoding::encode_in_envelope_optional::<
12589                fidl::encoding::HandleType<
12590                    fidl::EventPair,
12591                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12592                    2147483648,
12593                >,
12594                fidl::encoding::DefaultFuchsiaResourceDialect,
12595            >(
12596                self.value.as_mut().map(
12597                    <fidl::encoding::HandleType<
12598                        fidl::EventPair,
12599                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12600                        2147483648,
12601                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12602                ),
12603                encoder,
12604                offset + cur_offset,
12605                depth,
12606            )?;
12607
12608            _prev_end_offset = cur_offset + envelope_size;
12609
12610            Ok(())
12611        }
12612    }
12613
12614    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12615        for CapabilitiesDictionaryRemoveRequest
12616    {
12617        #[inline(always)]
12618        fn new_empty() -> Self {
12619            Self::default()
12620        }
12621
12622        unsafe fn decode(
12623            &mut self,
12624            decoder: &mut fidl::encoding::Decoder<
12625                '_,
12626                fidl::encoding::DefaultFuchsiaResourceDialect,
12627            >,
12628            offset: usize,
12629            mut depth: fidl::encoding::Depth,
12630        ) -> fidl::Result<()> {
12631            decoder.debug_check_bounds::<Self>(offset);
12632            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12633                None => return Err(fidl::Error::NotNullable),
12634                Some(len) => len,
12635            };
12636            // Calling decoder.out_of_line_offset(0) is not allowed.
12637            if len == 0 {
12638                return Ok(());
12639            };
12640            depth.increment()?;
12641            let envelope_size = 8;
12642            let bytes_len = len * envelope_size;
12643            let offset = decoder.out_of_line_offset(bytes_len)?;
12644            // Decode the envelope for each type.
12645            let mut _next_ordinal_to_read = 0;
12646            let mut next_offset = offset;
12647            let end_offset = offset + bytes_len;
12648            _next_ordinal_to_read += 1;
12649            if next_offset >= end_offset {
12650                return Ok(());
12651            }
12652
12653            // Decode unknown envelopes for gaps in ordinals.
12654            while _next_ordinal_to_read < 1 {
12655                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12656                _next_ordinal_to_read += 1;
12657                next_offset += envelope_size;
12658            }
12659
12660            let next_out_of_line = decoder.next_out_of_line();
12661            let handles_before = decoder.remaining_handles();
12662            if let Some((inlined, num_bytes, num_handles)) =
12663                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12664            {
12665                let member_inline_size = <fidl::encoding::HandleType<
12666                    fidl::EventPair,
12667                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12668                    2147483648,
12669                > as fidl::encoding::TypeMarker>::inline_size(
12670                    decoder.context
12671                );
12672                if inlined != (member_inline_size <= 4) {
12673                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12674                }
12675                let inner_offset;
12676                let mut inner_depth = depth.clone();
12677                if inlined {
12678                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12679                    inner_offset = next_offset;
12680                } else {
12681                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12682                    inner_depth.increment()?;
12683                }
12684                let val_ref =
12685                self.dictionary.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12686                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12687                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12688                {
12689                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12690                }
12691                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12692                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12693                }
12694            }
12695
12696            next_offset += envelope_size;
12697            _next_ordinal_to_read += 1;
12698            if next_offset >= end_offset {
12699                return Ok(());
12700            }
12701
12702            // Decode unknown envelopes for gaps in ordinals.
12703            while _next_ordinal_to_read < 2 {
12704                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12705                _next_ordinal_to_read += 1;
12706                next_offset += envelope_size;
12707            }
12708
12709            let next_out_of_line = decoder.next_out_of_line();
12710            let handles_before = decoder.remaining_handles();
12711            if let Some((inlined, num_bytes, num_handles)) =
12712                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12713            {
12714                let member_inline_size =
12715                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12716                        decoder.context,
12717                    );
12718                if inlined != (member_inline_size <= 4) {
12719                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12720                }
12721                let inner_offset;
12722                let mut inner_depth = depth.clone();
12723                if inlined {
12724                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12725                    inner_offset = next_offset;
12726                } else {
12727                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12728                    inner_depth.increment()?;
12729                }
12730                let val_ref = self.key.get_or_insert_with(|| {
12731                    fidl::new_empty!(
12732                        fidl::encoding::BoundedString<100>,
12733                        fidl::encoding::DefaultFuchsiaResourceDialect
12734                    )
12735                });
12736                fidl::decode!(
12737                    fidl::encoding::BoundedString<100>,
12738                    fidl::encoding::DefaultFuchsiaResourceDialect,
12739                    val_ref,
12740                    decoder,
12741                    inner_offset,
12742                    inner_depth
12743                )?;
12744                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12745                {
12746                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12747                }
12748                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12749                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12750                }
12751            }
12752
12753            next_offset += envelope_size;
12754            _next_ordinal_to_read += 1;
12755            if next_offset >= end_offset {
12756                return Ok(());
12757            }
12758
12759            // Decode unknown envelopes for gaps in ordinals.
12760            while _next_ordinal_to_read < 3 {
12761                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12762                _next_ordinal_to_read += 1;
12763                next_offset += envelope_size;
12764            }
12765
12766            let next_out_of_line = decoder.next_out_of_line();
12767            let handles_before = decoder.remaining_handles();
12768            if let Some((inlined, num_bytes, num_handles)) =
12769                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12770            {
12771                let member_inline_size = <fidl::encoding::HandleType<
12772                    fidl::EventPair,
12773                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12774                    2147483648,
12775                > as fidl::encoding::TypeMarker>::inline_size(
12776                    decoder.context
12777                );
12778                if inlined != (member_inline_size <= 4) {
12779                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12780                }
12781                let inner_offset;
12782                let mut inner_depth = depth.clone();
12783                if inlined {
12784                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12785                    inner_offset = next_offset;
12786                } else {
12787                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12788                    inner_depth.increment()?;
12789                }
12790                let val_ref =
12791                self.value.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12792                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12793                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12794                {
12795                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12796                }
12797                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12798                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12799                }
12800            }
12801
12802            next_offset += envelope_size;
12803
12804            // Decode the remaining unknown envelopes.
12805            while next_offset < end_offset {
12806                _next_ordinal_to_read += 1;
12807                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12808                next_offset += envelope_size;
12809            }
12810
12811            Ok(())
12812        }
12813    }
12814
12815    impl CapabilitiesDirConnectorOpenRequest {
12816        #[inline(always)]
12817        fn max_ordinal_present(&self) -> u64 {
12818            if let Some(_) = self.path {
12819                return 4;
12820            }
12821            if let Some(_) = self.flags {
12822                return 3;
12823            }
12824            if let Some(_) = self.channel {
12825                return 2;
12826            }
12827            if let Some(_) = self.dir_connector {
12828                return 1;
12829            }
12830            0
12831        }
12832    }
12833
12834    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorOpenRequest {
12835        type Borrowed<'a> = &'a mut Self;
12836        fn take_or_borrow<'a>(
12837            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12838        ) -> Self::Borrowed<'a> {
12839            value
12840        }
12841    }
12842
12843    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorOpenRequest {
12844        type Owned = Self;
12845
12846        #[inline(always)]
12847        fn inline_align(_context: fidl::encoding::Context) -> usize {
12848            8
12849        }
12850
12851        #[inline(always)]
12852        fn inline_size(_context: fidl::encoding::Context) -> usize {
12853            16
12854        }
12855    }
12856
12857    unsafe impl
12858        fidl::encoding::Encode<
12859            CapabilitiesDirConnectorOpenRequest,
12860            fidl::encoding::DefaultFuchsiaResourceDialect,
12861        > for &mut CapabilitiesDirConnectorOpenRequest
12862    {
12863        unsafe fn encode(
12864            self,
12865            encoder: &mut fidl::encoding::Encoder<
12866                '_,
12867                fidl::encoding::DefaultFuchsiaResourceDialect,
12868            >,
12869            offset: usize,
12870            mut depth: fidl::encoding::Depth,
12871        ) -> fidl::Result<()> {
12872            encoder.debug_check_bounds::<CapabilitiesDirConnectorOpenRequest>(offset);
12873            // Vector header
12874            let max_ordinal: u64 = self.max_ordinal_present();
12875            encoder.write_num(max_ordinal, offset);
12876            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12877            // Calling encoder.out_of_line_offset(0) is not allowed.
12878            if max_ordinal == 0 {
12879                return Ok(());
12880            }
12881            depth.increment()?;
12882            let envelope_size = 8;
12883            let bytes_len = max_ordinal as usize * envelope_size;
12884            #[allow(unused_variables)]
12885            let offset = encoder.out_of_line_offset(bytes_len);
12886            let mut _prev_end_offset: usize = 0;
12887            if 1 > max_ordinal {
12888                return Ok(());
12889            }
12890
12891            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12892            // are envelope_size bytes.
12893            let cur_offset: usize = (1 - 1) * envelope_size;
12894
12895            // Zero reserved fields.
12896            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12897
12898            // Safety:
12899            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12900            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12901            //   envelope_size bytes, there is always sufficient room.
12902            fidl::encoding::encode_in_envelope_optional::<
12903                fidl::encoding::HandleType<
12904                    fidl::EventPair,
12905                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12906                    2147483648,
12907                >,
12908                fidl::encoding::DefaultFuchsiaResourceDialect,
12909            >(
12910                self.dir_connector.as_mut().map(
12911                    <fidl::encoding::HandleType<
12912                        fidl::EventPair,
12913                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12914                        2147483648,
12915                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12916                ),
12917                encoder,
12918                offset + cur_offset,
12919                depth,
12920            )?;
12921
12922            _prev_end_offset = cur_offset + envelope_size;
12923            if 2 > max_ordinal {
12924                return Ok(());
12925            }
12926
12927            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12928            // are envelope_size bytes.
12929            let cur_offset: usize = (2 - 1) * envelope_size;
12930
12931            // Zero reserved fields.
12932            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12933
12934            // Safety:
12935            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12936            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12937            //   envelope_size bytes, there is always sufficient room.
12938            fidl::encoding::encode_in_envelope_optional::<
12939                fidl::encoding::Endpoint<
12940                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12941                >,
12942                fidl::encoding::DefaultFuchsiaResourceDialect,
12943            >(
12944                self.channel.as_mut().map(
12945                    <fidl::encoding::Endpoint<
12946                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12947                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12948                ),
12949                encoder,
12950                offset + cur_offset,
12951                depth,
12952            )?;
12953
12954            _prev_end_offset = cur_offset + envelope_size;
12955            if 3 > max_ordinal {
12956                return Ok(());
12957            }
12958
12959            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12960            // are envelope_size bytes.
12961            let cur_offset: usize = (3 - 1) * envelope_size;
12962
12963            // Zero reserved fields.
12964            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12965
12966            // Safety:
12967            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12968            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12969            //   envelope_size bytes, there is always sufficient room.
12970            fidl::encoding::encode_in_envelope_optional::<
12971                fidl_fuchsia_io::Flags,
12972                fidl::encoding::DefaultFuchsiaResourceDialect,
12973            >(
12974                self.flags
12975                    .as_ref()
12976                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
12977                encoder,
12978                offset + cur_offset,
12979                depth,
12980            )?;
12981
12982            _prev_end_offset = cur_offset + envelope_size;
12983            if 4 > max_ordinal {
12984                return Ok(());
12985            }
12986
12987            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12988            // are envelope_size bytes.
12989            let cur_offset: usize = (4 - 1) * envelope_size;
12990
12991            // Zero reserved fields.
12992            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12993
12994            // Safety:
12995            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12996            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12997            //   envelope_size bytes, there is always sufficient room.
12998            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12999            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13000            encoder, offset + cur_offset, depth
13001        )?;
13002
13003            _prev_end_offset = cur_offset + envelope_size;
13004
13005            Ok(())
13006        }
13007    }
13008
13009    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13010        for CapabilitiesDirConnectorOpenRequest
13011    {
13012        #[inline(always)]
13013        fn new_empty() -> Self {
13014            Self::default()
13015        }
13016
13017        unsafe fn decode(
13018            &mut self,
13019            decoder: &mut fidl::encoding::Decoder<
13020                '_,
13021                fidl::encoding::DefaultFuchsiaResourceDialect,
13022            >,
13023            offset: usize,
13024            mut depth: fidl::encoding::Depth,
13025        ) -> fidl::Result<()> {
13026            decoder.debug_check_bounds::<Self>(offset);
13027            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13028                None => return Err(fidl::Error::NotNullable),
13029                Some(len) => len,
13030            };
13031            // Calling decoder.out_of_line_offset(0) is not allowed.
13032            if len == 0 {
13033                return Ok(());
13034            };
13035            depth.increment()?;
13036            let envelope_size = 8;
13037            let bytes_len = len * envelope_size;
13038            let offset = decoder.out_of_line_offset(bytes_len)?;
13039            // Decode the envelope for each type.
13040            let mut _next_ordinal_to_read = 0;
13041            let mut next_offset = offset;
13042            let end_offset = offset + bytes_len;
13043            _next_ordinal_to_read += 1;
13044            if next_offset >= end_offset {
13045                return Ok(());
13046            }
13047
13048            // Decode unknown envelopes for gaps in ordinals.
13049            while _next_ordinal_to_read < 1 {
13050                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13051                _next_ordinal_to_read += 1;
13052                next_offset += envelope_size;
13053            }
13054
13055            let next_out_of_line = decoder.next_out_of_line();
13056            let handles_before = decoder.remaining_handles();
13057            if let Some((inlined, num_bytes, num_handles)) =
13058                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13059            {
13060                let member_inline_size = <fidl::encoding::HandleType<
13061                    fidl::EventPair,
13062                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13063                    2147483648,
13064                > as fidl::encoding::TypeMarker>::inline_size(
13065                    decoder.context
13066                );
13067                if inlined != (member_inline_size <= 4) {
13068                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13069                }
13070                let inner_offset;
13071                let mut inner_depth = depth.clone();
13072                if inlined {
13073                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13074                    inner_offset = next_offset;
13075                } else {
13076                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13077                    inner_depth.increment()?;
13078                }
13079                let val_ref =
13080                self.dir_connector.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13081                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13082                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13083                {
13084                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13085                }
13086                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13087                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13088                }
13089            }
13090
13091            next_offset += envelope_size;
13092            _next_ordinal_to_read += 1;
13093            if next_offset >= end_offset {
13094                return Ok(());
13095            }
13096
13097            // Decode unknown envelopes for gaps in ordinals.
13098            while _next_ordinal_to_read < 2 {
13099                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13100                _next_ordinal_to_read += 1;
13101                next_offset += envelope_size;
13102            }
13103
13104            let next_out_of_line = decoder.next_out_of_line();
13105            let handles_before = decoder.remaining_handles();
13106            if let Some((inlined, num_bytes, num_handles)) =
13107                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13108            {
13109                let member_inline_size = <fidl::encoding::Endpoint<
13110                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13111                > as fidl::encoding::TypeMarker>::inline_size(
13112                    decoder.context
13113                );
13114                if inlined != (member_inline_size <= 4) {
13115                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13116                }
13117                let inner_offset;
13118                let mut inner_depth = depth.clone();
13119                if inlined {
13120                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13121                    inner_offset = next_offset;
13122                } else {
13123                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13124                    inner_depth.increment()?;
13125                }
13126                let val_ref = self.channel.get_or_insert_with(|| {
13127                    fidl::new_empty!(
13128                        fidl::encoding::Endpoint<
13129                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13130                        >,
13131                        fidl::encoding::DefaultFuchsiaResourceDialect
13132                    )
13133                });
13134                fidl::decode!(
13135                    fidl::encoding::Endpoint<
13136                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13137                    >,
13138                    fidl::encoding::DefaultFuchsiaResourceDialect,
13139                    val_ref,
13140                    decoder,
13141                    inner_offset,
13142                    inner_depth
13143                )?;
13144                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13145                {
13146                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13147                }
13148                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13149                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13150                }
13151            }
13152
13153            next_offset += envelope_size;
13154            _next_ordinal_to_read += 1;
13155            if next_offset >= end_offset {
13156                return Ok(());
13157            }
13158
13159            // Decode unknown envelopes for gaps in ordinals.
13160            while _next_ordinal_to_read < 3 {
13161                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13162                _next_ordinal_to_read += 1;
13163                next_offset += envelope_size;
13164            }
13165
13166            let next_out_of_line = decoder.next_out_of_line();
13167            let handles_before = decoder.remaining_handles();
13168            if let Some((inlined, num_bytes, num_handles)) =
13169                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13170            {
13171                let member_inline_size =
13172                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13173                        decoder.context,
13174                    );
13175                if inlined != (member_inline_size <= 4) {
13176                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13177                }
13178                let inner_offset;
13179                let mut inner_depth = depth.clone();
13180                if inlined {
13181                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13182                    inner_offset = next_offset;
13183                } else {
13184                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13185                    inner_depth.increment()?;
13186                }
13187                let val_ref = self.flags.get_or_insert_with(|| {
13188                    fidl::new_empty!(
13189                        fidl_fuchsia_io::Flags,
13190                        fidl::encoding::DefaultFuchsiaResourceDialect
13191                    )
13192                });
13193                fidl::decode!(
13194                    fidl_fuchsia_io::Flags,
13195                    fidl::encoding::DefaultFuchsiaResourceDialect,
13196                    val_ref,
13197                    decoder,
13198                    inner_offset,
13199                    inner_depth
13200                )?;
13201                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13202                {
13203                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13204                }
13205                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13206                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13207                }
13208            }
13209
13210            next_offset += envelope_size;
13211            _next_ordinal_to_read += 1;
13212            if next_offset >= end_offset {
13213                return Ok(());
13214            }
13215
13216            // Decode unknown envelopes for gaps in ordinals.
13217            while _next_ordinal_to_read < 4 {
13218                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13219                _next_ordinal_to_read += 1;
13220                next_offset += envelope_size;
13221            }
13222
13223            let next_out_of_line = decoder.next_out_of_line();
13224            let handles_before = decoder.remaining_handles();
13225            if let Some((inlined, num_bytes, num_handles)) =
13226                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13227            {
13228                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13229                if inlined != (member_inline_size <= 4) {
13230                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13231                }
13232                let inner_offset;
13233                let mut inner_depth = depth.clone();
13234                if inlined {
13235                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13236                    inner_offset = next_offset;
13237                } else {
13238                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13239                    inner_depth.increment()?;
13240                }
13241                let val_ref = self.path.get_or_insert_with(|| {
13242                    fidl::new_empty!(
13243                        fidl::encoding::BoundedString<4095>,
13244                        fidl::encoding::DefaultFuchsiaResourceDialect
13245                    )
13246                });
13247                fidl::decode!(
13248                    fidl::encoding::BoundedString<4095>,
13249                    fidl::encoding::DefaultFuchsiaResourceDialect,
13250                    val_ref,
13251                    decoder,
13252                    inner_offset,
13253                    inner_depth
13254                )?;
13255                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13256                {
13257                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13258                }
13259                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13260                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13261                }
13262            }
13263
13264            next_offset += envelope_size;
13265
13266            // Decode the remaining unknown envelopes.
13267            while next_offset < end_offset {
13268                _next_ordinal_to_read += 1;
13269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13270                next_offset += envelope_size;
13271            }
13272
13273            Ok(())
13274        }
13275    }
13276}