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 CapabilitiesControlHandle {
3505    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3506        self.inner.shutdown_with_epitaph(status.into())
3507    }
3508}
3509
3510impl fidl::endpoints::ControlHandle for CapabilitiesControlHandle {
3511    fn shutdown(&self) {
3512        self.inner.shutdown()
3513    }
3514
3515    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3516        self.inner.shutdown_with_epitaph(status)
3517    }
3518
3519    fn is_closed(&self) -> bool {
3520        self.inner.channel().is_closed()
3521    }
3522    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3523        self.inner.channel().on_closed()
3524    }
3525
3526    #[cfg(target_os = "fuchsia")]
3527    fn signal_peer(
3528        &self,
3529        clear_mask: zx::Signals,
3530        set_mask: zx::Signals,
3531    ) -> Result<(), zx_status::Status> {
3532        use fidl::Peered;
3533        self.inner.channel().signal_peer(clear_mask, set_mask)
3534    }
3535}
3536
3537impl CapabilitiesControlHandle {}
3538
3539#[must_use = "FIDL methods require a response to be sent"]
3540#[derive(Debug)]
3541pub struct CapabilitiesConnectorCreateResponder {
3542    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3543    tx_id: u32,
3544}
3545
3546/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3547/// if the responder is dropped without sending a response, so that the client
3548/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3549impl std::ops::Drop for CapabilitiesConnectorCreateResponder {
3550    fn drop(&mut self) {
3551        self.control_handle.shutdown();
3552        // Safety: drops once, never accessed again
3553        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3554    }
3555}
3556
3557impl fidl::endpoints::Responder for CapabilitiesConnectorCreateResponder {
3558    type ControlHandle = CapabilitiesControlHandle;
3559
3560    fn control_handle(&self) -> &CapabilitiesControlHandle {
3561        &self.control_handle
3562    }
3563
3564    fn drop_without_shutdown(mut self) {
3565        // Safety: drops once, never accessed again due to mem::forget
3566        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3567        // Prevent Drop from running (which would shut down the channel)
3568        std::mem::forget(self);
3569    }
3570}
3571
3572impl CapabilitiesConnectorCreateResponder {
3573    /// Sends a response to the FIDL transaction.
3574    ///
3575    /// Sets the channel to shutdown if an error occurs.
3576    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3577        let _result = self.send_raw(result);
3578        if _result.is_err() {
3579            self.control_handle.shutdown();
3580        }
3581        self.drop_without_shutdown();
3582        _result
3583    }
3584
3585    /// Similar to "send" but does not shutdown the channel if an error occurs.
3586    pub fn send_no_shutdown_on_err(
3587        self,
3588        mut result: Result<(), CapabilitiesError>,
3589    ) -> Result<(), fidl::Error> {
3590        let _result = self.send_raw(result);
3591        self.drop_without_shutdown();
3592        _result
3593    }
3594
3595    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3596        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3597            fidl::encoding::EmptyStruct,
3598            CapabilitiesError,
3599        >>(
3600            fidl::encoding::FlexibleResult::new(result),
3601            self.tx_id,
3602            0xac2bc2dbd7033d1,
3603            fidl::encoding::DynamicFlags::FLEXIBLE,
3604        )
3605    }
3606}
3607
3608#[must_use = "FIDL methods require a response to be sent"]
3609#[derive(Debug)]
3610pub struct CapabilitiesDirConnectorCreateResponder {
3611    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3612    tx_id: u32,
3613}
3614
3615/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3616/// if the responder is dropped without sending a response, so that the client
3617/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3618impl std::ops::Drop for CapabilitiesDirConnectorCreateResponder {
3619    fn drop(&mut self) {
3620        self.control_handle.shutdown();
3621        // Safety: drops once, never accessed again
3622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3623    }
3624}
3625
3626impl fidl::endpoints::Responder for CapabilitiesDirConnectorCreateResponder {
3627    type ControlHandle = CapabilitiesControlHandle;
3628
3629    fn control_handle(&self) -> &CapabilitiesControlHandle {
3630        &self.control_handle
3631    }
3632
3633    fn drop_without_shutdown(mut self) {
3634        // Safety: drops once, never accessed again due to mem::forget
3635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3636        // Prevent Drop from running (which would shut down the channel)
3637        std::mem::forget(self);
3638    }
3639}
3640
3641impl CapabilitiesDirConnectorCreateResponder {
3642    /// Sends a response to the FIDL transaction.
3643    ///
3644    /// Sets the channel to shutdown if an error occurs.
3645    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3646        let _result = self.send_raw(result);
3647        if _result.is_err() {
3648            self.control_handle.shutdown();
3649        }
3650        self.drop_without_shutdown();
3651        _result
3652    }
3653
3654    /// Similar to "send" but does not shutdown the channel if an error occurs.
3655    pub fn send_no_shutdown_on_err(
3656        self,
3657        mut result: Result<(), CapabilitiesError>,
3658    ) -> Result<(), fidl::Error> {
3659        let _result = self.send_raw(result);
3660        self.drop_without_shutdown();
3661        _result
3662    }
3663
3664    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3665        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3666            fidl::encoding::EmptyStruct,
3667            CapabilitiesError,
3668        >>(
3669            fidl::encoding::FlexibleResult::new(result),
3670            self.tx_id,
3671            0x721911e05da2a3bf,
3672            fidl::encoding::DynamicFlags::FLEXIBLE,
3673        )
3674    }
3675}
3676
3677#[must_use = "FIDL methods require a response to be sent"]
3678#[derive(Debug)]
3679pub struct CapabilitiesDictionaryCreateResponder {
3680    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3681    tx_id: u32,
3682}
3683
3684/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3685/// if the responder is dropped without sending a response, so that the client
3686/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3687impl std::ops::Drop for CapabilitiesDictionaryCreateResponder {
3688    fn drop(&mut self) {
3689        self.control_handle.shutdown();
3690        // Safety: drops once, never accessed again
3691        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3692    }
3693}
3694
3695impl fidl::endpoints::Responder for CapabilitiesDictionaryCreateResponder {
3696    type ControlHandle = CapabilitiesControlHandle;
3697
3698    fn control_handle(&self) -> &CapabilitiesControlHandle {
3699        &self.control_handle
3700    }
3701
3702    fn drop_without_shutdown(mut self) {
3703        // Safety: drops once, never accessed again due to mem::forget
3704        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3705        // Prevent Drop from running (which would shut down the channel)
3706        std::mem::forget(self);
3707    }
3708}
3709
3710impl CapabilitiesDictionaryCreateResponder {
3711    /// Sends a response to the FIDL transaction.
3712    ///
3713    /// Sets the channel to shutdown if an error occurs.
3714    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3715        let _result = self.send_raw(result);
3716        if _result.is_err() {
3717            self.control_handle.shutdown();
3718        }
3719        self.drop_without_shutdown();
3720        _result
3721    }
3722
3723    /// Similar to "send" but does not shutdown the channel if an error occurs.
3724    pub fn send_no_shutdown_on_err(
3725        self,
3726        mut result: Result<(), CapabilitiesError>,
3727    ) -> Result<(), fidl::Error> {
3728        let _result = self.send_raw(result);
3729        self.drop_without_shutdown();
3730        _result
3731    }
3732
3733    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3734        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3735            fidl::encoding::EmptyStruct,
3736            CapabilitiesError,
3737        >>(
3738            fidl::encoding::FlexibleResult::new(result),
3739            self.tx_id,
3740            0x7f8bd91f0942a36e,
3741            fidl::encoding::DynamicFlags::FLEXIBLE,
3742        )
3743    }
3744}
3745
3746#[must_use = "FIDL methods require a response to be sent"]
3747#[derive(Debug)]
3748pub struct CapabilitiesDataCreateResponder {
3749    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3750    tx_id: u32,
3751}
3752
3753/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3754/// if the responder is dropped without sending a response, so that the client
3755/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3756impl std::ops::Drop for CapabilitiesDataCreateResponder {
3757    fn drop(&mut self) {
3758        self.control_handle.shutdown();
3759        // Safety: drops once, never accessed again
3760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3761    }
3762}
3763
3764impl fidl::endpoints::Responder for CapabilitiesDataCreateResponder {
3765    type ControlHandle = CapabilitiesControlHandle;
3766
3767    fn control_handle(&self) -> &CapabilitiesControlHandle {
3768        &self.control_handle
3769    }
3770
3771    fn drop_without_shutdown(mut self) {
3772        // Safety: drops once, never accessed again due to mem::forget
3773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3774        // Prevent Drop from running (which would shut down the channel)
3775        std::mem::forget(self);
3776    }
3777}
3778
3779impl CapabilitiesDataCreateResponder {
3780    /// Sends a response to the FIDL transaction.
3781    ///
3782    /// Sets the channel to shutdown if an error occurs.
3783    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3784        let _result = self.send_raw(result);
3785        if _result.is_err() {
3786            self.control_handle.shutdown();
3787        }
3788        self.drop_without_shutdown();
3789        _result
3790    }
3791
3792    /// Similar to "send" but does not shutdown the channel if an error occurs.
3793    pub fn send_no_shutdown_on_err(
3794        self,
3795        mut result: Result<(), CapabilitiesError>,
3796    ) -> Result<(), fidl::Error> {
3797        let _result = self.send_raw(result);
3798        self.drop_without_shutdown();
3799        _result
3800    }
3801
3802    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3803        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3804            fidl::encoding::EmptyStruct,
3805            CapabilitiesError,
3806        >>(
3807            fidl::encoding::FlexibleResult::new(result),
3808            self.tx_id,
3809            0x40ef43e45372ee6a,
3810            fidl::encoding::DynamicFlags::FLEXIBLE,
3811        )
3812    }
3813}
3814
3815#[must_use = "FIDL methods require a response to be sent"]
3816#[derive(Debug)]
3817pub struct CapabilitiesConnectorRouterCreateResponder {
3818    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3819    tx_id: u32,
3820}
3821
3822/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3823/// if the responder is dropped without sending a response, so that the client
3824/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3825impl std::ops::Drop for CapabilitiesConnectorRouterCreateResponder {
3826    fn drop(&mut self) {
3827        self.control_handle.shutdown();
3828        // Safety: drops once, never accessed again
3829        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3830    }
3831}
3832
3833impl fidl::endpoints::Responder for CapabilitiesConnectorRouterCreateResponder {
3834    type ControlHandle = CapabilitiesControlHandle;
3835
3836    fn control_handle(&self) -> &CapabilitiesControlHandle {
3837        &self.control_handle
3838    }
3839
3840    fn drop_without_shutdown(mut self) {
3841        // Safety: drops once, never accessed again due to mem::forget
3842        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3843        // Prevent Drop from running (which would shut down the channel)
3844        std::mem::forget(self);
3845    }
3846}
3847
3848impl CapabilitiesConnectorRouterCreateResponder {
3849    /// Sends a response to the FIDL transaction.
3850    ///
3851    /// Sets the channel to shutdown if an error occurs.
3852    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3853        let _result = self.send_raw(result);
3854        if _result.is_err() {
3855            self.control_handle.shutdown();
3856        }
3857        self.drop_without_shutdown();
3858        _result
3859    }
3860
3861    /// Similar to "send" but does not shutdown the channel if an error occurs.
3862    pub fn send_no_shutdown_on_err(
3863        self,
3864        mut result: Result<(), CapabilitiesError>,
3865    ) -> Result<(), fidl::Error> {
3866        let _result = self.send_raw(result);
3867        self.drop_without_shutdown();
3868        _result
3869    }
3870
3871    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3872        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3873            fidl::encoding::EmptyStruct,
3874            CapabilitiesError,
3875        >>(
3876            fidl::encoding::FlexibleResult::new(result),
3877            self.tx_id,
3878            0x7f7e7fbafcdf1761,
3879            fidl::encoding::DynamicFlags::FLEXIBLE,
3880        )
3881    }
3882}
3883
3884#[must_use = "FIDL methods require a response to be sent"]
3885#[derive(Debug)]
3886pub struct CapabilitiesDirConnectorRouterCreateResponder {
3887    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3888    tx_id: u32,
3889}
3890
3891/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3892/// if the responder is dropped without sending a response, so that the client
3893/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3894impl std::ops::Drop for CapabilitiesDirConnectorRouterCreateResponder {
3895    fn drop(&mut self) {
3896        self.control_handle.shutdown();
3897        // Safety: drops once, never accessed again
3898        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3899    }
3900}
3901
3902impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterCreateResponder {
3903    type ControlHandle = CapabilitiesControlHandle;
3904
3905    fn control_handle(&self) -> &CapabilitiesControlHandle {
3906        &self.control_handle
3907    }
3908
3909    fn drop_without_shutdown(mut self) {
3910        // Safety: drops once, never accessed again due to mem::forget
3911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3912        // Prevent Drop from running (which would shut down the channel)
3913        std::mem::forget(self);
3914    }
3915}
3916
3917impl CapabilitiesDirConnectorRouterCreateResponder {
3918    /// Sends a response to the FIDL transaction.
3919    ///
3920    /// Sets the channel to shutdown if an error occurs.
3921    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3922        let _result = self.send_raw(result);
3923        if _result.is_err() {
3924            self.control_handle.shutdown();
3925        }
3926        self.drop_without_shutdown();
3927        _result
3928    }
3929
3930    /// Similar to "send" but does not shutdown the channel if an error occurs.
3931    pub fn send_no_shutdown_on_err(
3932        self,
3933        mut result: Result<(), CapabilitiesError>,
3934    ) -> Result<(), fidl::Error> {
3935        let _result = self.send_raw(result);
3936        self.drop_without_shutdown();
3937        _result
3938    }
3939
3940    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3941        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3942            fidl::encoding::EmptyStruct,
3943            CapabilitiesError,
3944        >>(
3945            fidl::encoding::FlexibleResult::new(result),
3946            self.tx_id,
3947            0x56520da453fad19f,
3948            fidl::encoding::DynamicFlags::FLEXIBLE,
3949        )
3950    }
3951}
3952
3953#[must_use = "FIDL methods require a response to be sent"]
3954#[derive(Debug)]
3955pub struct CapabilitiesDictionaryRouterCreateResponder {
3956    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3957    tx_id: u32,
3958}
3959
3960/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3961/// if the responder is dropped without sending a response, so that the client
3962/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3963impl std::ops::Drop for CapabilitiesDictionaryRouterCreateResponder {
3964    fn drop(&mut self) {
3965        self.control_handle.shutdown();
3966        // Safety: drops once, never accessed again
3967        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3968    }
3969}
3970
3971impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterCreateResponder {
3972    type ControlHandle = CapabilitiesControlHandle;
3973
3974    fn control_handle(&self) -> &CapabilitiesControlHandle {
3975        &self.control_handle
3976    }
3977
3978    fn drop_without_shutdown(mut self) {
3979        // Safety: drops once, never accessed again due to mem::forget
3980        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3981        // Prevent Drop from running (which would shut down the channel)
3982        std::mem::forget(self);
3983    }
3984}
3985
3986impl CapabilitiesDictionaryRouterCreateResponder {
3987    /// Sends a response to the FIDL transaction.
3988    ///
3989    /// Sets the channel to shutdown if an error occurs.
3990    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3991        let _result = self.send_raw(result);
3992        if _result.is_err() {
3993            self.control_handle.shutdown();
3994        }
3995        self.drop_without_shutdown();
3996        _result
3997    }
3998
3999    /// Similar to "send" but does not shutdown the channel if an error occurs.
4000    pub fn send_no_shutdown_on_err(
4001        self,
4002        mut result: Result<(), CapabilitiesError>,
4003    ) -> Result<(), fidl::Error> {
4004        let _result = self.send_raw(result);
4005        self.drop_without_shutdown();
4006        _result
4007    }
4008
4009    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4010        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4011            fidl::encoding::EmptyStruct,
4012            CapabilitiesError,
4013        >>(
4014            fidl::encoding::FlexibleResult::new(result),
4015            self.tx_id,
4016            0x37acef18cd423d42,
4017            fidl::encoding::DynamicFlags::FLEXIBLE,
4018        )
4019    }
4020}
4021
4022#[must_use = "FIDL methods require a response to be sent"]
4023#[derive(Debug)]
4024pub struct CapabilitiesDataRouterCreateResponder {
4025    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4026    tx_id: u32,
4027}
4028
4029/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4030/// if the responder is dropped without sending a response, so that the client
4031/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4032impl std::ops::Drop for CapabilitiesDataRouterCreateResponder {
4033    fn drop(&mut self) {
4034        self.control_handle.shutdown();
4035        // Safety: drops once, never accessed again
4036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4037    }
4038}
4039
4040impl fidl::endpoints::Responder for CapabilitiesDataRouterCreateResponder {
4041    type ControlHandle = CapabilitiesControlHandle;
4042
4043    fn control_handle(&self) -> &CapabilitiesControlHandle {
4044        &self.control_handle
4045    }
4046
4047    fn drop_without_shutdown(mut self) {
4048        // Safety: drops once, never accessed again due to mem::forget
4049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4050        // Prevent Drop from running (which would shut down the channel)
4051        std::mem::forget(self);
4052    }
4053}
4054
4055impl CapabilitiesDataRouterCreateResponder {
4056    /// Sends a response to the FIDL transaction.
4057    ///
4058    /// Sets the channel to shutdown if an error occurs.
4059    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4060        let _result = self.send_raw(result);
4061        if _result.is_err() {
4062            self.control_handle.shutdown();
4063        }
4064        self.drop_without_shutdown();
4065        _result
4066    }
4067
4068    /// Similar to "send" but does not shutdown the channel if an error occurs.
4069    pub fn send_no_shutdown_on_err(
4070        self,
4071        mut result: Result<(), CapabilitiesError>,
4072    ) -> Result<(), fidl::Error> {
4073        let _result = self.send_raw(result);
4074        self.drop_without_shutdown();
4075        _result
4076    }
4077
4078    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4079        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4080            fidl::encoding::EmptyStruct,
4081            CapabilitiesError,
4082        >>(
4083            fidl::encoding::FlexibleResult::new(result),
4084            self.tx_id,
4085            0x24e471395b95088,
4086            fidl::encoding::DynamicFlags::FLEXIBLE,
4087        )
4088    }
4089}
4090
4091#[must_use = "FIDL methods require a response to be sent"]
4092#[derive(Debug)]
4093pub struct CapabilitiesInstanceTokenCreateResponder {
4094    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4095    tx_id: u32,
4096}
4097
4098/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4099/// if the responder is dropped without sending a response, so that the client
4100/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4101impl std::ops::Drop for CapabilitiesInstanceTokenCreateResponder {
4102    fn drop(&mut self) {
4103        self.control_handle.shutdown();
4104        // Safety: drops once, never accessed again
4105        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4106    }
4107}
4108
4109impl fidl::endpoints::Responder for CapabilitiesInstanceTokenCreateResponder {
4110    type ControlHandle = CapabilitiesControlHandle;
4111
4112    fn control_handle(&self) -> &CapabilitiesControlHandle {
4113        &self.control_handle
4114    }
4115
4116    fn drop_without_shutdown(mut self) {
4117        // Safety: drops once, never accessed again due to mem::forget
4118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4119        // Prevent Drop from running (which would shut down the channel)
4120        std::mem::forget(self);
4121    }
4122}
4123
4124impl CapabilitiesInstanceTokenCreateResponder {
4125    /// Sends a response to the FIDL transaction.
4126    ///
4127    /// Sets the channel to shutdown if an error occurs.
4128    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4129        let _result = self.send_raw(result);
4130        if _result.is_err() {
4131            self.control_handle.shutdown();
4132        }
4133        self.drop_without_shutdown();
4134        _result
4135    }
4136
4137    /// Similar to "send" but does not shutdown the channel if an error occurs.
4138    pub fn send_no_shutdown_on_err(
4139        self,
4140        mut result: Result<(), CapabilitiesError>,
4141    ) -> Result<(), fidl::Error> {
4142        let _result = self.send_raw(result);
4143        self.drop_without_shutdown();
4144        _result
4145    }
4146
4147    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4148        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4149            fidl::encoding::EmptyStruct,
4150            CapabilitiesError,
4151        >>(
4152            fidl::encoding::FlexibleResult::new(result),
4153            self.tx_id,
4154            0x3576e31727c40813,
4155            fidl::encoding::DynamicFlags::FLEXIBLE,
4156        )
4157    }
4158}
4159
4160#[must_use = "FIDL methods require a response to be sent"]
4161#[derive(Debug)]
4162pub struct CapabilitiesConnectorOpenResponder {
4163    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4164    tx_id: u32,
4165}
4166
4167/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4168/// if the responder is dropped without sending a response, so that the client
4169/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4170impl std::ops::Drop for CapabilitiesConnectorOpenResponder {
4171    fn drop(&mut self) {
4172        self.control_handle.shutdown();
4173        // Safety: drops once, never accessed again
4174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4175    }
4176}
4177
4178impl fidl::endpoints::Responder for CapabilitiesConnectorOpenResponder {
4179    type ControlHandle = CapabilitiesControlHandle;
4180
4181    fn control_handle(&self) -> &CapabilitiesControlHandle {
4182        &self.control_handle
4183    }
4184
4185    fn drop_without_shutdown(mut self) {
4186        // Safety: drops once, never accessed again due to mem::forget
4187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4188        // Prevent Drop from running (which would shut down the channel)
4189        std::mem::forget(self);
4190    }
4191}
4192
4193impl CapabilitiesConnectorOpenResponder {
4194    /// Sends a response to the FIDL transaction.
4195    ///
4196    /// Sets the channel to shutdown if an error occurs.
4197    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4198        let _result = self.send_raw(result);
4199        if _result.is_err() {
4200            self.control_handle.shutdown();
4201        }
4202        self.drop_without_shutdown();
4203        _result
4204    }
4205
4206    /// Similar to "send" but does not shutdown the channel if an error occurs.
4207    pub fn send_no_shutdown_on_err(
4208        self,
4209        mut result: Result<(), CapabilitiesError>,
4210    ) -> Result<(), fidl::Error> {
4211        let _result = self.send_raw(result);
4212        self.drop_without_shutdown();
4213        _result
4214    }
4215
4216    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4217        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4218            fidl::encoding::EmptyStruct,
4219            CapabilitiesError,
4220        >>(
4221            fidl::encoding::FlexibleResult::new(result),
4222            self.tx_id,
4223            0xc0646965f1884eb,
4224            fidl::encoding::DynamicFlags::FLEXIBLE,
4225        )
4226    }
4227}
4228
4229#[must_use = "FIDL methods require a response to be sent"]
4230#[derive(Debug)]
4231pub struct CapabilitiesDirConnectorOpenResponder {
4232    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4233    tx_id: u32,
4234}
4235
4236/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4237/// if the responder is dropped without sending a response, so that the client
4238/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4239impl std::ops::Drop for CapabilitiesDirConnectorOpenResponder {
4240    fn drop(&mut self) {
4241        self.control_handle.shutdown();
4242        // Safety: drops once, never accessed again
4243        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4244    }
4245}
4246
4247impl fidl::endpoints::Responder for CapabilitiesDirConnectorOpenResponder {
4248    type ControlHandle = CapabilitiesControlHandle;
4249
4250    fn control_handle(&self) -> &CapabilitiesControlHandle {
4251        &self.control_handle
4252    }
4253
4254    fn drop_without_shutdown(mut self) {
4255        // Safety: drops once, never accessed again due to mem::forget
4256        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4257        // Prevent Drop from running (which would shut down the channel)
4258        std::mem::forget(self);
4259    }
4260}
4261
4262impl CapabilitiesDirConnectorOpenResponder {
4263    /// Sends a response to the FIDL transaction.
4264    ///
4265    /// Sets the channel to shutdown if an error occurs.
4266    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4267        let _result = self.send_raw(result);
4268        if _result.is_err() {
4269            self.control_handle.shutdown();
4270        }
4271        self.drop_without_shutdown();
4272        _result
4273    }
4274
4275    /// Similar to "send" but does not shutdown the channel if an error occurs.
4276    pub fn send_no_shutdown_on_err(
4277        self,
4278        mut result: Result<(), CapabilitiesError>,
4279    ) -> Result<(), fidl::Error> {
4280        let _result = self.send_raw(result);
4281        self.drop_without_shutdown();
4282        _result
4283    }
4284
4285    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4286        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4287            fidl::encoding::EmptyStruct,
4288            CapabilitiesError,
4289        >>(
4290            fidl::encoding::FlexibleResult::new(result),
4291            self.tx_id,
4292            0x1332bbf5debd6c20,
4293            fidl::encoding::DynamicFlags::FLEXIBLE,
4294        )
4295    }
4296}
4297
4298#[must_use = "FIDL methods require a response to be sent"]
4299#[derive(Debug)]
4300pub struct CapabilitiesDictionaryInsertResponder {
4301    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4302    tx_id: u32,
4303}
4304
4305/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4306/// if the responder is dropped without sending a response, so that the client
4307/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4308impl std::ops::Drop for CapabilitiesDictionaryInsertResponder {
4309    fn drop(&mut self) {
4310        self.control_handle.shutdown();
4311        // Safety: drops once, never accessed again
4312        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4313    }
4314}
4315
4316impl fidl::endpoints::Responder for CapabilitiesDictionaryInsertResponder {
4317    type ControlHandle = CapabilitiesControlHandle;
4318
4319    fn control_handle(&self) -> &CapabilitiesControlHandle {
4320        &self.control_handle
4321    }
4322
4323    fn drop_without_shutdown(mut self) {
4324        // Safety: drops once, never accessed again due to mem::forget
4325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4326        // Prevent Drop from running (which would shut down the channel)
4327        std::mem::forget(self);
4328    }
4329}
4330
4331impl CapabilitiesDictionaryInsertResponder {
4332    /// Sends a response to the FIDL transaction.
4333    ///
4334    /// Sets the channel to shutdown if an error occurs.
4335    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4336        let _result = self.send_raw(result);
4337        if _result.is_err() {
4338            self.control_handle.shutdown();
4339        }
4340        self.drop_without_shutdown();
4341        _result
4342    }
4343
4344    /// Similar to "send" but does not shutdown the channel if an error occurs.
4345    pub fn send_no_shutdown_on_err(
4346        self,
4347        mut result: Result<(), CapabilitiesError>,
4348    ) -> Result<(), fidl::Error> {
4349        let _result = self.send_raw(result);
4350        self.drop_without_shutdown();
4351        _result
4352    }
4353
4354    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4355        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4356            fidl::encoding::EmptyStruct,
4357            CapabilitiesError,
4358        >>(
4359            fidl::encoding::FlexibleResult::new(result),
4360            self.tx_id,
4361            0x5972e3061a760e7a,
4362            fidl::encoding::DynamicFlags::FLEXIBLE,
4363        )
4364    }
4365}
4366
4367#[must_use = "FIDL methods require a response to be sent"]
4368#[derive(Debug)]
4369pub struct CapabilitiesDictionaryGetResponder {
4370    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4371    tx_id: u32,
4372}
4373
4374/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4375/// if the responder is dropped without sending a response, so that the client
4376/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4377impl std::ops::Drop for CapabilitiesDictionaryGetResponder {
4378    fn drop(&mut self) {
4379        self.control_handle.shutdown();
4380        // Safety: drops once, never accessed again
4381        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4382    }
4383}
4384
4385impl fidl::endpoints::Responder for CapabilitiesDictionaryGetResponder {
4386    type ControlHandle = CapabilitiesControlHandle;
4387
4388    fn control_handle(&self) -> &CapabilitiesControlHandle {
4389        &self.control_handle
4390    }
4391
4392    fn drop_without_shutdown(mut self) {
4393        // Safety: drops once, never accessed again due to mem::forget
4394        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4395        // Prevent Drop from running (which would shut down the channel)
4396        std::mem::forget(self);
4397    }
4398}
4399
4400impl CapabilitiesDictionaryGetResponder {
4401    /// Sends a response to the FIDL transaction.
4402    ///
4403    /// Sets the channel to shutdown if an error occurs.
4404    pub fn send(
4405        self,
4406        mut result: Result<CapabilityType, CapabilitiesError>,
4407    ) -> Result<(), fidl::Error> {
4408        let _result = self.send_raw(result);
4409        if _result.is_err() {
4410            self.control_handle.shutdown();
4411        }
4412        self.drop_without_shutdown();
4413        _result
4414    }
4415
4416    /// Similar to "send" but does not shutdown the channel if an error occurs.
4417    pub fn send_no_shutdown_on_err(
4418        self,
4419        mut result: Result<CapabilityType, CapabilitiesError>,
4420    ) -> Result<(), fidl::Error> {
4421        let _result = self.send_raw(result);
4422        self.drop_without_shutdown();
4423        _result
4424    }
4425
4426    fn send_raw(
4427        &self,
4428        mut result: Result<CapabilityType, CapabilitiesError>,
4429    ) -> Result<(), fidl::Error> {
4430        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4431            CapabilitiesDictionaryGetResponse,
4432            CapabilitiesError,
4433        >>(
4434            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4435            self.tx_id,
4436            0x31fafe2280a283d5,
4437            fidl::encoding::DynamicFlags::FLEXIBLE,
4438        )
4439    }
4440}
4441
4442#[must_use = "FIDL methods require a response to be sent"]
4443#[derive(Debug)]
4444pub struct CapabilitiesDictionaryRemoveResponder {
4445    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4446    tx_id: u32,
4447}
4448
4449/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4450/// if the responder is dropped without sending a response, so that the client
4451/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4452impl std::ops::Drop for CapabilitiesDictionaryRemoveResponder {
4453    fn drop(&mut self) {
4454        self.control_handle.shutdown();
4455        // Safety: drops once, never accessed again
4456        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4457    }
4458}
4459
4460impl fidl::endpoints::Responder for CapabilitiesDictionaryRemoveResponder {
4461    type ControlHandle = CapabilitiesControlHandle;
4462
4463    fn control_handle(&self) -> &CapabilitiesControlHandle {
4464        &self.control_handle
4465    }
4466
4467    fn drop_without_shutdown(mut self) {
4468        // Safety: drops once, never accessed again due to mem::forget
4469        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4470        // Prevent Drop from running (which would shut down the channel)
4471        std::mem::forget(self);
4472    }
4473}
4474
4475impl CapabilitiesDictionaryRemoveResponder {
4476    /// Sends a response to the FIDL transaction.
4477    ///
4478    /// Sets the channel to shutdown if an error occurs.
4479    pub fn send(
4480        self,
4481        mut result: Result<CapabilityType, CapabilitiesError>,
4482    ) -> Result<(), fidl::Error> {
4483        let _result = self.send_raw(result);
4484        if _result.is_err() {
4485            self.control_handle.shutdown();
4486        }
4487        self.drop_without_shutdown();
4488        _result
4489    }
4490
4491    /// Similar to "send" but does not shutdown the channel if an error occurs.
4492    pub fn send_no_shutdown_on_err(
4493        self,
4494        mut result: Result<CapabilityType, CapabilitiesError>,
4495    ) -> Result<(), fidl::Error> {
4496        let _result = self.send_raw(result);
4497        self.drop_without_shutdown();
4498        _result
4499    }
4500
4501    fn send_raw(
4502        &self,
4503        mut result: Result<CapabilityType, CapabilitiesError>,
4504    ) -> Result<(), fidl::Error> {
4505        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4506            CapabilitiesDictionaryRemoveResponse,
4507            CapabilitiesError,
4508        >>(
4509            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4510            self.tx_id,
4511            0x6827c83106ac5a2c,
4512            fidl::encoding::DynamicFlags::FLEXIBLE,
4513        )
4514    }
4515}
4516
4517#[must_use = "FIDL methods require a response to be sent"]
4518#[derive(Debug)]
4519pub struct CapabilitiesDictionaryIterateKeysResponder {
4520    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4521    tx_id: u32,
4522}
4523
4524/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4525/// if the responder is dropped without sending a response, so that the client
4526/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4527impl std::ops::Drop for CapabilitiesDictionaryIterateKeysResponder {
4528    fn drop(&mut self) {
4529        self.control_handle.shutdown();
4530        // Safety: drops once, never accessed again
4531        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4532    }
4533}
4534
4535impl fidl::endpoints::Responder for CapabilitiesDictionaryIterateKeysResponder {
4536    type ControlHandle = CapabilitiesControlHandle;
4537
4538    fn control_handle(&self) -> &CapabilitiesControlHandle {
4539        &self.control_handle
4540    }
4541
4542    fn drop_without_shutdown(mut self) {
4543        // Safety: drops once, never accessed again due to mem::forget
4544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4545        // Prevent Drop from running (which would shut down the channel)
4546        std::mem::forget(self);
4547    }
4548}
4549
4550impl CapabilitiesDictionaryIterateKeysResponder {
4551    /// Sends a response to the FIDL transaction.
4552    ///
4553    /// Sets the channel to shutdown if an error occurs.
4554    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4555        let _result = self.send_raw(result);
4556        if _result.is_err() {
4557            self.control_handle.shutdown();
4558        }
4559        self.drop_without_shutdown();
4560        _result
4561    }
4562
4563    /// Similar to "send" but does not shutdown the channel if an error occurs.
4564    pub fn send_no_shutdown_on_err(
4565        self,
4566        mut result: Result<(), CapabilitiesError>,
4567    ) -> Result<(), fidl::Error> {
4568        let _result = self.send_raw(result);
4569        self.drop_without_shutdown();
4570        _result
4571    }
4572
4573    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4574        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4575            fidl::encoding::EmptyStruct,
4576            CapabilitiesError,
4577        >>(
4578            fidl::encoding::FlexibleResult::new(result),
4579            self.tx_id,
4580            0x3d4ea59c80df9bb8,
4581            fidl::encoding::DynamicFlags::FLEXIBLE,
4582        )
4583    }
4584}
4585
4586#[must_use = "FIDL methods require a response to be sent"]
4587#[derive(Debug)]
4588pub struct CapabilitiesDataGetResponder {
4589    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4590    tx_id: u32,
4591}
4592
4593/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4594/// if the responder is dropped without sending a response, so that the client
4595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4596impl std::ops::Drop for CapabilitiesDataGetResponder {
4597    fn drop(&mut self) {
4598        self.control_handle.shutdown();
4599        // Safety: drops once, never accessed again
4600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4601    }
4602}
4603
4604impl fidl::endpoints::Responder for CapabilitiesDataGetResponder {
4605    type ControlHandle = CapabilitiesControlHandle;
4606
4607    fn control_handle(&self) -> &CapabilitiesControlHandle {
4608        &self.control_handle
4609    }
4610
4611    fn drop_without_shutdown(mut self) {
4612        // Safety: drops once, never accessed again due to mem::forget
4613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4614        // Prevent Drop from running (which would shut down the channel)
4615        std::mem::forget(self);
4616    }
4617}
4618
4619impl CapabilitiesDataGetResponder {
4620    /// Sends a response to the FIDL transaction.
4621    ///
4622    /// Sets the channel to shutdown if an error occurs.
4623    pub fn send(self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4624        let _result = self.send_raw(result);
4625        if _result.is_err() {
4626            self.control_handle.shutdown();
4627        }
4628        self.drop_without_shutdown();
4629        _result
4630    }
4631
4632    /// Similar to "send" but does not shutdown the channel if an error occurs.
4633    pub fn send_no_shutdown_on_err(
4634        self,
4635        mut result: Result<&Data, CapabilitiesError>,
4636    ) -> Result<(), fidl::Error> {
4637        let _result = self.send_raw(result);
4638        self.drop_without_shutdown();
4639        _result
4640    }
4641
4642    fn send_raw(&self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4643        self.control_handle
4644            .inner
4645            .send::<fidl::encoding::FlexibleResultType<Data, CapabilitiesError>>(
4646                fidl::encoding::FlexibleResult::new(result),
4647                self.tx_id,
4648                0x65ae25b59f9e0daf,
4649                fidl::encoding::DynamicFlags::FLEXIBLE,
4650            )
4651    }
4652}
4653
4654#[must_use = "FIDL methods require a response to be sent"]
4655#[derive(Debug)]
4656pub struct CapabilitiesConnectorRouterRouteResponder {
4657    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4658    tx_id: u32,
4659}
4660
4661/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4662/// if the responder is dropped without sending a response, so that the client
4663/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4664impl std::ops::Drop for CapabilitiesConnectorRouterRouteResponder {
4665    fn drop(&mut self) {
4666        self.control_handle.shutdown();
4667        // Safety: drops once, never accessed again
4668        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4669    }
4670}
4671
4672impl fidl::endpoints::Responder for CapabilitiesConnectorRouterRouteResponder {
4673    type ControlHandle = CapabilitiesControlHandle;
4674
4675    fn control_handle(&self) -> &CapabilitiesControlHandle {
4676        &self.control_handle
4677    }
4678
4679    fn drop_without_shutdown(mut self) {
4680        // Safety: drops once, never accessed again due to mem::forget
4681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4682        // Prevent Drop from running (which would shut down the channel)
4683        std::mem::forget(self);
4684    }
4685}
4686
4687impl CapabilitiesConnectorRouterRouteResponder {
4688    /// Sends a response to the FIDL transaction.
4689    ///
4690    /// Sets the channel to shutdown if an error occurs.
4691    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4692        let _result = self.send_raw(result);
4693        if _result.is_err() {
4694            self.control_handle.shutdown();
4695        }
4696        self.drop_without_shutdown();
4697        _result
4698    }
4699
4700    /// Similar to "send" but does not shutdown the channel if an error occurs.
4701    pub fn send_no_shutdown_on_err(
4702        self,
4703        mut result: Result<RouterResponse, i32>,
4704    ) -> Result<(), fidl::Error> {
4705        let _result = self.send_raw(result);
4706        self.drop_without_shutdown();
4707        _result
4708    }
4709
4710    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4711        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4712            CapabilitiesConnectorRouterRouteResponse,
4713            i32,
4714        >>(
4715            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4716            self.tx_id,
4717            0x1bd9c6e7e3dd487e,
4718            fidl::encoding::DynamicFlags::FLEXIBLE,
4719        )
4720    }
4721}
4722
4723#[must_use = "FIDL methods require a response to be sent"]
4724#[derive(Debug)]
4725pub struct CapabilitiesDirConnectorRouterRouteResponder {
4726    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4727    tx_id: u32,
4728}
4729
4730/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4731/// if the responder is dropped without sending a response, so that the client
4732/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4733impl std::ops::Drop for CapabilitiesDirConnectorRouterRouteResponder {
4734    fn drop(&mut self) {
4735        self.control_handle.shutdown();
4736        // Safety: drops once, never accessed again
4737        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4738    }
4739}
4740
4741impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterRouteResponder {
4742    type ControlHandle = CapabilitiesControlHandle;
4743
4744    fn control_handle(&self) -> &CapabilitiesControlHandle {
4745        &self.control_handle
4746    }
4747
4748    fn drop_without_shutdown(mut self) {
4749        // Safety: drops once, never accessed again due to mem::forget
4750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4751        // Prevent Drop from running (which would shut down the channel)
4752        std::mem::forget(self);
4753    }
4754}
4755
4756impl CapabilitiesDirConnectorRouterRouteResponder {
4757    /// Sends a response to the FIDL transaction.
4758    ///
4759    /// Sets the channel to shutdown if an error occurs.
4760    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4761        let _result = self.send_raw(result);
4762        if _result.is_err() {
4763            self.control_handle.shutdown();
4764        }
4765        self.drop_without_shutdown();
4766        _result
4767    }
4768
4769    /// Similar to "send" but does not shutdown the channel if an error occurs.
4770    pub fn send_no_shutdown_on_err(
4771        self,
4772        mut result: Result<RouterResponse, i32>,
4773    ) -> Result<(), fidl::Error> {
4774        let _result = self.send_raw(result);
4775        self.drop_without_shutdown();
4776        _result
4777    }
4778
4779    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4780        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4781            CapabilitiesDirConnectorRouterRouteResponse,
4782            i32,
4783        >>(
4784            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4785            self.tx_id,
4786            0x3afdcc1b79e0799d,
4787            fidl::encoding::DynamicFlags::FLEXIBLE,
4788        )
4789    }
4790}
4791
4792#[must_use = "FIDL methods require a response to be sent"]
4793#[derive(Debug)]
4794pub struct CapabilitiesDictionaryRouterRouteResponder {
4795    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4796    tx_id: u32,
4797}
4798
4799/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4800/// if the responder is dropped without sending a response, so that the client
4801/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4802impl std::ops::Drop for CapabilitiesDictionaryRouterRouteResponder {
4803    fn drop(&mut self) {
4804        self.control_handle.shutdown();
4805        // Safety: drops once, never accessed again
4806        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4807    }
4808}
4809
4810impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterRouteResponder {
4811    type ControlHandle = CapabilitiesControlHandle;
4812
4813    fn control_handle(&self) -> &CapabilitiesControlHandle {
4814        &self.control_handle
4815    }
4816
4817    fn drop_without_shutdown(mut self) {
4818        // Safety: drops once, never accessed again due to mem::forget
4819        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4820        // Prevent Drop from running (which would shut down the channel)
4821        std::mem::forget(self);
4822    }
4823}
4824
4825impl CapabilitiesDictionaryRouterRouteResponder {
4826    /// Sends a response to the FIDL transaction.
4827    ///
4828    /// Sets the channel to shutdown if an error occurs.
4829    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4830        let _result = self.send_raw(result);
4831        if _result.is_err() {
4832            self.control_handle.shutdown();
4833        }
4834        self.drop_without_shutdown();
4835        _result
4836    }
4837
4838    /// Similar to "send" but does not shutdown the channel if an error occurs.
4839    pub fn send_no_shutdown_on_err(
4840        self,
4841        mut result: Result<RouterResponse, i32>,
4842    ) -> Result<(), fidl::Error> {
4843        let _result = self.send_raw(result);
4844        self.drop_without_shutdown();
4845        _result
4846    }
4847
4848    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4849        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4850            CapabilitiesDictionaryRouterRouteResponse,
4851            i32,
4852        >>(
4853            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4854            self.tx_id,
4855            0xcf72de10714a708,
4856            fidl::encoding::DynamicFlags::FLEXIBLE,
4857        )
4858    }
4859}
4860
4861#[must_use = "FIDL methods require a response to be sent"]
4862#[derive(Debug)]
4863pub struct CapabilitiesDataRouterRouteResponder {
4864    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4865    tx_id: u32,
4866}
4867
4868/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4869/// if the responder is dropped without sending a response, so that the client
4870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4871impl std::ops::Drop for CapabilitiesDataRouterRouteResponder {
4872    fn drop(&mut self) {
4873        self.control_handle.shutdown();
4874        // Safety: drops once, never accessed again
4875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4876    }
4877}
4878
4879impl fidl::endpoints::Responder for CapabilitiesDataRouterRouteResponder {
4880    type ControlHandle = CapabilitiesControlHandle;
4881
4882    fn control_handle(&self) -> &CapabilitiesControlHandle {
4883        &self.control_handle
4884    }
4885
4886    fn drop_without_shutdown(mut self) {
4887        // Safety: drops once, never accessed again due to mem::forget
4888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4889        // Prevent Drop from running (which would shut down the channel)
4890        std::mem::forget(self);
4891    }
4892}
4893
4894impl CapabilitiesDataRouterRouteResponder {
4895    /// Sends a response to the FIDL transaction.
4896    ///
4897    /// Sets the channel to shutdown if an error occurs.
4898    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4899        let _result = self.send_raw(result);
4900        if _result.is_err() {
4901            self.control_handle.shutdown();
4902        }
4903        self.drop_without_shutdown();
4904        _result
4905    }
4906
4907    /// Similar to "send" but does not shutdown the channel if an error occurs.
4908    pub fn send_no_shutdown_on_err(
4909        self,
4910        mut result: Result<RouterResponse, i32>,
4911    ) -> Result<(), fidl::Error> {
4912        let _result = self.send_raw(result);
4913        self.drop_without_shutdown();
4914        _result
4915    }
4916
4917    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
4918        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4919            CapabilitiesDataRouterRouteResponse,
4920            i32,
4921        >>(
4922            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
4923            self.tx_id,
4924            0x61ab188455ed0643,
4925            fidl::encoding::DynamicFlags::FLEXIBLE,
4926        )
4927    }
4928}
4929
4930#[must_use = "FIDL methods require a response to be sent"]
4931#[derive(Debug)]
4932pub struct CapabilitiesCapabilityAssociateHandleResponder {
4933    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4934    tx_id: u32,
4935}
4936
4937/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4938/// if the responder is dropped without sending a response, so that the client
4939/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4940impl std::ops::Drop for CapabilitiesCapabilityAssociateHandleResponder {
4941    fn drop(&mut self) {
4942        self.control_handle.shutdown();
4943        // Safety: drops once, never accessed again
4944        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4945    }
4946}
4947
4948impl fidl::endpoints::Responder for CapabilitiesCapabilityAssociateHandleResponder {
4949    type ControlHandle = CapabilitiesControlHandle;
4950
4951    fn control_handle(&self) -> &CapabilitiesControlHandle {
4952        &self.control_handle
4953    }
4954
4955    fn drop_without_shutdown(mut self) {
4956        // Safety: drops once, never accessed again due to mem::forget
4957        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4958        // Prevent Drop from running (which would shut down the channel)
4959        std::mem::forget(self);
4960    }
4961}
4962
4963impl CapabilitiesCapabilityAssociateHandleResponder {
4964    /// Sends a response to the FIDL transaction.
4965    ///
4966    /// Sets the channel to shutdown if an error occurs.
4967    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4968        let _result = self.send_raw(result);
4969        if _result.is_err() {
4970            self.control_handle.shutdown();
4971        }
4972        self.drop_without_shutdown();
4973        _result
4974    }
4975
4976    /// Similar to "send" but does not shutdown the channel if an error occurs.
4977    pub fn send_no_shutdown_on_err(
4978        self,
4979        mut result: Result<(), CapabilitiesError>,
4980    ) -> Result<(), fidl::Error> {
4981        let _result = self.send_raw(result);
4982        self.drop_without_shutdown();
4983        _result
4984    }
4985
4986    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4987        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4988            fidl::encoding::EmptyStruct,
4989            CapabilitiesError,
4990        >>(
4991            fidl::encoding::FlexibleResult::new(result),
4992            self.tx_id,
4993            0x1d69bb61953d8e7,
4994            fidl::encoding::DynamicFlags::FLEXIBLE,
4995        )
4996    }
4997}
4998
4999#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5000pub struct ConnectorRouterMarker;
5001
5002impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
5003    type Proxy = ConnectorRouterProxy;
5004    type RequestStream = ConnectorRouterRequestStream;
5005    #[cfg(target_os = "fuchsia")]
5006    type SynchronousProxy = ConnectorRouterSynchronousProxy;
5007
5008    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouter";
5009}
5010pub type ConnectorRouterRouteResult = Result<RouterResponse, i32>;
5011
5012pub trait ConnectorRouterProxyInterface: Send + Sync {
5013    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
5014        + Send;
5015    fn r#route(
5016        &self,
5017        request: &RouteRequest,
5018        instance_token: fidl::EventPair,
5019        handle: fidl::EventPair,
5020    ) -> Self::RouteResponseFut;
5021}
5022#[derive(Debug)]
5023#[cfg(target_os = "fuchsia")]
5024pub struct ConnectorRouterSynchronousProxy {
5025    client: fidl::client::sync::Client,
5026}
5027
5028#[cfg(target_os = "fuchsia")]
5029impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
5030    type Proxy = ConnectorRouterProxy;
5031    type Protocol = ConnectorRouterMarker;
5032
5033    fn from_channel(inner: fidl::Channel) -> Self {
5034        Self::new(inner)
5035    }
5036
5037    fn into_channel(self) -> fidl::Channel {
5038        self.client.into_channel()
5039    }
5040
5041    fn as_channel(&self) -> &fidl::Channel {
5042        self.client.as_channel()
5043    }
5044}
5045
5046#[cfg(target_os = "fuchsia")]
5047impl ConnectorRouterSynchronousProxy {
5048    pub fn new(channel: fidl::Channel) -> Self {
5049        Self { client: fidl::client::sync::Client::new(channel) }
5050    }
5051
5052    pub fn into_channel(self) -> fidl::Channel {
5053        self.client.into_channel()
5054    }
5055
5056    /// Waits until an event arrives and returns it. It is safe for other
5057    /// threads to make concurrent requests while waiting for an event.
5058    pub fn wait_for_event(
5059        &self,
5060        deadline: zx::MonotonicInstant,
5061    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5062        ConnectorRouterEvent::decode(self.client.wait_for_event::<ConnectorRouterMarker>(deadline)?)
5063    }
5064
5065    /// Attempts to produce a `Connector` capability from this
5066    /// `ConnectorRouter`.
5067    ///
5068    /// `request` contains context for this route, and `instance_token`
5069    /// references the component that the routing operation is being performed
5070    /// for.
5071    ///
5072    /// This will return:
5073    ///
5074    /// - `SUCCESS` if `handle` has been associated with a connector.
5075    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5076    ///   will be closed.
5077    /// - An error, if the operation failed.
5078    pub fn r#route(
5079        &self,
5080        mut request: &RouteRequest,
5081        mut instance_token: fidl::EventPair,
5082        mut handle: fidl::EventPair,
5083        ___deadline: zx::MonotonicInstant,
5084    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5085        let _response = self.client.send_query::<
5086            ConnectorRouterRouteRequest,
5087            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5088            ConnectorRouterMarker,
5089        >(
5090            (request, instance_token, handle,),
5091            0x57a912c92a38f9f8,
5092            fidl::encoding::DynamicFlags::FLEXIBLE,
5093            ___deadline,
5094        )?
5095        .into_result::<ConnectorRouterMarker>("route")?;
5096        Ok(_response.map(|x| x.response))
5097    }
5098}
5099
5100#[cfg(target_os = "fuchsia")]
5101impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
5102    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
5103        value.into_channel().into()
5104    }
5105}
5106
5107#[cfg(target_os = "fuchsia")]
5108impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
5109    fn from(value: fidl::Channel) -> Self {
5110        Self::new(value)
5111    }
5112}
5113
5114#[cfg(target_os = "fuchsia")]
5115impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
5116    type Protocol = ConnectorRouterMarker;
5117
5118    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
5119        Self::new(value.into_channel())
5120    }
5121}
5122
5123#[derive(Debug, Clone)]
5124pub struct ConnectorRouterProxy {
5125    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5126}
5127
5128impl fidl::endpoints::Proxy for ConnectorRouterProxy {
5129    type Protocol = ConnectorRouterMarker;
5130
5131    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5132        Self::new(inner)
5133    }
5134
5135    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5136        self.client.into_channel().map_err(|client| Self { client })
5137    }
5138
5139    fn as_channel(&self) -> &::fidl::AsyncChannel {
5140        self.client.as_channel()
5141    }
5142}
5143
5144impl ConnectorRouterProxy {
5145    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouter.
5146    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5147        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5148        Self { client: fidl::client::Client::new(channel, protocol_name) }
5149    }
5150
5151    /// Get a Stream of events from the remote end of the protocol.
5152    ///
5153    /// # Panics
5154    ///
5155    /// Panics if the event stream was already taken.
5156    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
5157        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
5158    }
5159
5160    /// Attempts to produce a `Connector` capability from this
5161    /// `ConnectorRouter`.
5162    ///
5163    /// `request` contains context for this route, and `instance_token`
5164    /// references the component that the routing operation is being performed
5165    /// for.
5166    ///
5167    /// This will return:
5168    ///
5169    /// - `SUCCESS` if `handle` has been associated with a connector.
5170    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5171    ///   will be closed.
5172    /// - An error, if the operation failed.
5173    pub fn r#route(
5174        &self,
5175        mut request: &RouteRequest,
5176        mut instance_token: fidl::EventPair,
5177        mut handle: fidl::EventPair,
5178    ) -> fidl::client::QueryResponseFut<
5179        ConnectorRouterRouteResult,
5180        fidl::encoding::DefaultFuchsiaResourceDialect,
5181    > {
5182        ConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
5183    }
5184}
5185
5186impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
5187    type RouteResponseFut = fidl::client::QueryResponseFut<
5188        ConnectorRouterRouteResult,
5189        fidl::encoding::DefaultFuchsiaResourceDialect,
5190    >;
5191    fn r#route(
5192        &self,
5193        mut request: &RouteRequest,
5194        mut instance_token: fidl::EventPair,
5195        mut handle: fidl::EventPair,
5196    ) -> Self::RouteResponseFut {
5197        fn _decode(
5198            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5199        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
5200            let _response = fidl::client::decode_transaction_body::<
5201                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, i32>,
5202                fidl::encoding::DefaultFuchsiaResourceDialect,
5203                0x57a912c92a38f9f8,
5204            >(_buf?)?
5205            .into_result::<ConnectorRouterMarker>("route")?;
5206            Ok(_response.map(|x| x.response))
5207        }
5208        self.client
5209            .send_query_and_decode::<ConnectorRouterRouteRequest, ConnectorRouterRouteResult>(
5210                (request, instance_token, handle),
5211                0x57a912c92a38f9f8,
5212                fidl::encoding::DynamicFlags::FLEXIBLE,
5213                _decode,
5214            )
5215    }
5216}
5217
5218pub struct ConnectorRouterEventStream {
5219    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5220}
5221
5222impl std::marker::Unpin for ConnectorRouterEventStream {}
5223
5224impl futures::stream::FusedStream for ConnectorRouterEventStream {
5225    fn is_terminated(&self) -> bool {
5226        self.event_receiver.is_terminated()
5227    }
5228}
5229
5230impl futures::Stream for ConnectorRouterEventStream {
5231    type Item = Result<ConnectorRouterEvent, fidl::Error>;
5232
5233    fn poll_next(
5234        mut self: std::pin::Pin<&mut Self>,
5235        cx: &mut std::task::Context<'_>,
5236    ) -> std::task::Poll<Option<Self::Item>> {
5237        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5238            &mut self.event_receiver,
5239            cx
5240        )?) {
5241            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
5242            None => std::task::Poll::Ready(None),
5243        }
5244    }
5245}
5246
5247#[derive(Debug)]
5248pub enum ConnectorRouterEvent {
5249    #[non_exhaustive]
5250    _UnknownEvent {
5251        /// Ordinal of the event that was sent.
5252        ordinal: u64,
5253    },
5254}
5255
5256impl ConnectorRouterEvent {
5257    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
5258    fn decode(
5259        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5260    ) -> Result<ConnectorRouterEvent, fidl::Error> {
5261        let (bytes, _handles) = buf.split_mut();
5262        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5263        debug_assert_eq!(tx_header.tx_id, 0);
5264        match tx_header.ordinal {
5265            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5266                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5267            }
5268            _ => Err(fidl::Error::UnknownOrdinal {
5269                ordinal: tx_header.ordinal,
5270                protocol_name:
5271                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5272            }),
5273        }
5274    }
5275}
5276
5277/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouter.
5278pub struct ConnectorRouterRequestStream {
5279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5280    is_terminated: bool,
5281}
5282
5283impl std::marker::Unpin for ConnectorRouterRequestStream {}
5284
5285impl futures::stream::FusedStream for ConnectorRouterRequestStream {
5286    fn is_terminated(&self) -> bool {
5287        self.is_terminated
5288    }
5289}
5290
5291impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
5292    type Protocol = ConnectorRouterMarker;
5293    type ControlHandle = ConnectorRouterControlHandle;
5294
5295    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5296        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5297    }
5298
5299    fn control_handle(&self) -> Self::ControlHandle {
5300        ConnectorRouterControlHandle { inner: self.inner.clone() }
5301    }
5302
5303    fn into_inner(
5304        self,
5305    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5306    {
5307        (self.inner, self.is_terminated)
5308    }
5309
5310    fn from_inner(
5311        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5312        is_terminated: bool,
5313    ) -> Self {
5314        Self { inner, is_terminated }
5315    }
5316}
5317
5318impl futures::Stream for ConnectorRouterRequestStream {
5319    type Item = Result<ConnectorRouterRequest, fidl::Error>;
5320
5321    fn poll_next(
5322        mut self: std::pin::Pin<&mut Self>,
5323        cx: &mut std::task::Context<'_>,
5324    ) -> std::task::Poll<Option<Self::Item>> {
5325        let this = &mut *self;
5326        if this.inner.check_shutdown(cx) {
5327            this.is_terminated = true;
5328            return std::task::Poll::Ready(None);
5329        }
5330        if this.is_terminated {
5331            panic!("polled ConnectorRouterRequestStream after completion");
5332        }
5333        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5334            |bytes, handles| {
5335                match this.inner.channel().read_etc(cx, bytes, handles) {
5336                    std::task::Poll::Ready(Ok(())) => {}
5337                    std::task::Poll::Pending => return std::task::Poll::Pending,
5338                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5339                        this.is_terminated = true;
5340                        return std::task::Poll::Ready(None);
5341                    }
5342                    std::task::Poll::Ready(Err(e)) => {
5343                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5344                            e.into(),
5345                        ))));
5346                    }
5347                }
5348
5349                // A message has been received from the channel
5350                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5351
5352                std::task::Poll::Ready(Some(match header.ordinal {
5353                    0x57a912c92a38f9f8 => {
5354                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5355                        let mut req = fidl::new_empty!(
5356                            ConnectorRouterRouteRequest,
5357                            fidl::encoding::DefaultFuchsiaResourceDialect
5358                        );
5359                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5360                        let control_handle =
5361                            ConnectorRouterControlHandle { inner: this.inner.clone() };
5362                        Ok(ConnectorRouterRequest::Route {
5363                            request: req.request,
5364                            instance_token: req.instance_token,
5365                            handle: req.handle,
5366
5367                            responder: ConnectorRouterRouteResponder {
5368                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5369                                tx_id: header.tx_id,
5370                            },
5371                        })
5372                    }
5373                    _ if header.tx_id == 0
5374                        && header
5375                            .dynamic_flags()
5376                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5377                    {
5378                        Ok(ConnectorRouterRequest::_UnknownMethod {
5379                            ordinal: header.ordinal,
5380                            control_handle: ConnectorRouterControlHandle {
5381                                inner: this.inner.clone(),
5382                            },
5383                            method_type: fidl::MethodType::OneWay,
5384                        })
5385                    }
5386                    _ if header
5387                        .dynamic_flags()
5388                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5389                    {
5390                        this.inner.send_framework_err(
5391                            fidl::encoding::FrameworkErr::UnknownMethod,
5392                            header.tx_id,
5393                            header.ordinal,
5394                            header.dynamic_flags(),
5395                            (bytes, handles),
5396                        )?;
5397                        Ok(ConnectorRouterRequest::_UnknownMethod {
5398                            ordinal: header.ordinal,
5399                            control_handle: ConnectorRouterControlHandle {
5400                                inner: this.inner.clone(),
5401                            },
5402                            method_type: fidl::MethodType::TwoWay,
5403                        })
5404                    }
5405                    _ => Err(fidl::Error::UnknownOrdinal {
5406                        ordinal: header.ordinal,
5407                        protocol_name:
5408                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5409                    }),
5410                }))
5411            },
5412        )
5413    }
5414}
5415
5416/// A factory for `Connector` capabilities.
5417#[derive(Debug)]
5418pub enum ConnectorRouterRequest {
5419    /// Attempts to produce a `Connector` capability from this
5420    /// `ConnectorRouter`.
5421    ///
5422    /// `request` contains context for this route, and `instance_token`
5423    /// references the component that the routing operation is being performed
5424    /// for.
5425    ///
5426    /// This will return:
5427    ///
5428    /// - `SUCCESS` if `handle` has been associated with a connector.
5429    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5430    ///   will be closed.
5431    /// - An error, if the operation failed.
5432    Route {
5433        request: RouteRequest,
5434        instance_token: fidl::EventPair,
5435        handle: fidl::EventPair,
5436        responder: ConnectorRouterRouteResponder,
5437    },
5438    /// An interaction was received which does not match any known method.
5439    #[non_exhaustive]
5440    _UnknownMethod {
5441        /// Ordinal of the method that was called.
5442        ordinal: u64,
5443        control_handle: ConnectorRouterControlHandle,
5444        method_type: fidl::MethodType,
5445    },
5446}
5447
5448impl ConnectorRouterRequest {
5449    #[allow(irrefutable_let_patterns)]
5450    pub fn into_route(
5451        self,
5452    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, ConnectorRouterRouteResponder)>
5453    {
5454        if let ConnectorRouterRequest::Route { request, instance_token, handle, responder } = self {
5455            Some((request, instance_token, handle, responder))
5456        } else {
5457            None
5458        }
5459    }
5460
5461    /// Name of the method defined in FIDL
5462    pub fn method_name(&self) -> &'static str {
5463        match *self {
5464            ConnectorRouterRequest::Route { .. } => "route",
5465            ConnectorRouterRequest::_UnknownMethod {
5466                method_type: fidl::MethodType::OneWay,
5467                ..
5468            } => "unknown one-way method",
5469            ConnectorRouterRequest::_UnknownMethod {
5470                method_type: fidl::MethodType::TwoWay,
5471                ..
5472            } => "unknown two-way method",
5473        }
5474    }
5475}
5476
5477#[derive(Debug, Clone)]
5478pub struct ConnectorRouterControlHandle {
5479    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5480}
5481
5482impl ConnectorRouterControlHandle {
5483    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5484        self.inner.shutdown_with_epitaph(status.into())
5485    }
5486}
5487
5488impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
5489    fn shutdown(&self) {
5490        self.inner.shutdown()
5491    }
5492
5493    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5494        self.inner.shutdown_with_epitaph(status)
5495    }
5496
5497    fn is_closed(&self) -> bool {
5498        self.inner.channel().is_closed()
5499    }
5500    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5501        self.inner.channel().on_closed()
5502    }
5503
5504    #[cfg(target_os = "fuchsia")]
5505    fn signal_peer(
5506        &self,
5507        clear_mask: zx::Signals,
5508        set_mask: zx::Signals,
5509    ) -> Result<(), zx_status::Status> {
5510        use fidl::Peered;
5511        self.inner.channel().signal_peer(clear_mask, set_mask)
5512    }
5513}
5514
5515impl ConnectorRouterControlHandle {}
5516
5517#[must_use = "FIDL methods require a response to be sent"]
5518#[derive(Debug)]
5519pub struct ConnectorRouterRouteResponder {
5520    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
5521    tx_id: u32,
5522}
5523
5524/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
5525/// if the responder is dropped without sending a response, so that the client
5526/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5527impl std::ops::Drop for ConnectorRouterRouteResponder {
5528    fn drop(&mut self) {
5529        self.control_handle.shutdown();
5530        // Safety: drops once, never accessed again
5531        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5532    }
5533}
5534
5535impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
5536    type ControlHandle = ConnectorRouterControlHandle;
5537
5538    fn control_handle(&self) -> &ConnectorRouterControlHandle {
5539        &self.control_handle
5540    }
5541
5542    fn drop_without_shutdown(mut self) {
5543        // Safety: drops once, never accessed again due to mem::forget
5544        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5545        // Prevent Drop from running (which would shut down the channel)
5546        std::mem::forget(self);
5547    }
5548}
5549
5550impl ConnectorRouterRouteResponder {
5551    /// Sends a response to the FIDL transaction.
5552    ///
5553    /// Sets the channel to shutdown if an error occurs.
5554    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5555        let _result = self.send_raw(result);
5556        if _result.is_err() {
5557            self.control_handle.shutdown();
5558        }
5559        self.drop_without_shutdown();
5560        _result
5561    }
5562
5563    /// Similar to "send" but does not shutdown the channel if an error occurs.
5564    pub fn send_no_shutdown_on_err(
5565        self,
5566        mut result: Result<RouterResponse, i32>,
5567    ) -> Result<(), fidl::Error> {
5568        let _result = self.send_raw(result);
5569        self.drop_without_shutdown();
5570        _result
5571    }
5572
5573    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
5574        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5575            ConnectorRouterRouteResponse,
5576            i32,
5577        >>(
5578            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
5579            self.tx_id,
5580            0x57a912c92a38f9f8,
5581            fidl::encoding::DynamicFlags::FLEXIBLE,
5582        )
5583    }
5584}
5585
5586#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5587pub struct DataRouterMarker;
5588
5589impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
5590    type Proxy = DataRouterProxy;
5591    type RequestStream = DataRouterRequestStream;
5592    #[cfg(target_os = "fuchsia")]
5593    type SynchronousProxy = DataRouterSynchronousProxy;
5594
5595    const DEBUG_NAME: &'static str = "(anonymous) DataRouter";
5596}
5597pub type DataRouterRouteResult = Result<RouterResponse, i32>;
5598
5599pub trait DataRouterProxyInterface: Send + Sync {
5600    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
5601        + Send;
5602    fn r#route(
5603        &self,
5604        request: &RouteRequest,
5605        instance_token: fidl::EventPair,
5606        handle: fidl::EventPair,
5607    ) -> Self::RouteResponseFut;
5608}
5609#[derive(Debug)]
5610#[cfg(target_os = "fuchsia")]
5611pub struct DataRouterSynchronousProxy {
5612    client: fidl::client::sync::Client,
5613}
5614
5615#[cfg(target_os = "fuchsia")]
5616impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
5617    type Proxy = DataRouterProxy;
5618    type Protocol = DataRouterMarker;
5619
5620    fn from_channel(inner: fidl::Channel) -> Self {
5621        Self::new(inner)
5622    }
5623
5624    fn into_channel(self) -> fidl::Channel {
5625        self.client.into_channel()
5626    }
5627
5628    fn as_channel(&self) -> &fidl::Channel {
5629        self.client.as_channel()
5630    }
5631}
5632
5633#[cfg(target_os = "fuchsia")]
5634impl DataRouterSynchronousProxy {
5635    pub fn new(channel: fidl::Channel) -> Self {
5636        Self { client: fidl::client::sync::Client::new(channel) }
5637    }
5638
5639    pub fn into_channel(self) -> fidl::Channel {
5640        self.client.into_channel()
5641    }
5642
5643    /// Waits until an event arrives and returns it. It is safe for other
5644    /// threads to make concurrent requests while waiting for an event.
5645    pub fn wait_for_event(
5646        &self,
5647        deadline: zx::MonotonicInstant,
5648    ) -> Result<DataRouterEvent, fidl::Error> {
5649        DataRouterEvent::decode(self.client.wait_for_event::<DataRouterMarker>(deadline)?)
5650    }
5651
5652    /// Attempts to produce a `Data` capability from this
5653    /// `DataRouter`.
5654    ///
5655    /// `request` contains context for this route, and `instance_token`
5656    /// references the component that the routing operation is being performed
5657    /// for.
5658    ///
5659    /// This will return:
5660    ///
5661    /// - `SUCCESS` if `handle` has been associated with a connector.
5662    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5663    ///   will be closed.
5664    /// - An error, if the operation failed.
5665    pub fn r#route(
5666        &self,
5667        mut request: &RouteRequest,
5668        mut instance_token: fidl::EventPair,
5669        mut handle: fidl::EventPair,
5670        ___deadline: zx::MonotonicInstant,
5671    ) -> Result<DataRouterRouteResult, fidl::Error> {
5672        let _response = self.client.send_query::<
5673            DataRouterRouteRequest,
5674            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5675            DataRouterMarker,
5676        >(
5677            (request, instance_token, handle,),
5678            0x646885ba7e10ceeb,
5679            fidl::encoding::DynamicFlags::FLEXIBLE,
5680            ___deadline,
5681        )?
5682        .into_result::<DataRouterMarker>("route")?;
5683        Ok(_response.map(|x| x.response))
5684    }
5685}
5686
5687#[cfg(target_os = "fuchsia")]
5688impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5689    fn from(value: DataRouterSynchronousProxy) -> Self {
5690        value.into_channel().into()
5691    }
5692}
5693
5694#[cfg(target_os = "fuchsia")]
5695impl From<fidl::Channel> for DataRouterSynchronousProxy {
5696    fn from(value: fidl::Channel) -> Self {
5697        Self::new(value)
5698    }
5699}
5700
5701#[cfg(target_os = "fuchsia")]
5702impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5703    type Protocol = DataRouterMarker;
5704
5705    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5706        Self::new(value.into_channel())
5707    }
5708}
5709
5710#[derive(Debug, Clone)]
5711pub struct DataRouterProxy {
5712    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5713}
5714
5715impl fidl::endpoints::Proxy for DataRouterProxy {
5716    type Protocol = DataRouterMarker;
5717
5718    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5719        Self::new(inner)
5720    }
5721
5722    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5723        self.client.into_channel().map_err(|client| Self { client })
5724    }
5725
5726    fn as_channel(&self) -> &::fidl::AsyncChannel {
5727        self.client.as_channel()
5728    }
5729}
5730
5731impl DataRouterProxy {
5732    /// Create a new Proxy for fuchsia.component.runtime/DataRouter.
5733    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5734        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5735        Self { client: fidl::client::Client::new(channel, protocol_name) }
5736    }
5737
5738    /// Get a Stream of events from the remote end of the protocol.
5739    ///
5740    /// # Panics
5741    ///
5742    /// Panics if the event stream was already taken.
5743    pub fn take_event_stream(&self) -> DataRouterEventStream {
5744        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5745    }
5746
5747    /// Attempts to produce a `Data` capability from this
5748    /// `DataRouter`.
5749    ///
5750    /// `request` contains context for this route, and `instance_token`
5751    /// references the component that the routing operation is being performed
5752    /// for.
5753    ///
5754    /// This will return:
5755    ///
5756    /// - `SUCCESS` if `handle` has been associated with a connector.
5757    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
5758    ///   will be closed.
5759    /// - An error, if the operation failed.
5760    pub fn r#route(
5761        &self,
5762        mut request: &RouteRequest,
5763        mut instance_token: fidl::EventPair,
5764        mut handle: fidl::EventPair,
5765    ) -> fidl::client::QueryResponseFut<
5766        DataRouterRouteResult,
5767        fidl::encoding::DefaultFuchsiaResourceDialect,
5768    > {
5769        DataRouterProxyInterface::r#route(self, request, instance_token, handle)
5770    }
5771}
5772
5773impl DataRouterProxyInterface for DataRouterProxy {
5774    type RouteResponseFut = fidl::client::QueryResponseFut<
5775        DataRouterRouteResult,
5776        fidl::encoding::DefaultFuchsiaResourceDialect,
5777    >;
5778    fn r#route(
5779        &self,
5780        mut request: &RouteRequest,
5781        mut instance_token: fidl::EventPair,
5782        mut handle: fidl::EventPair,
5783    ) -> Self::RouteResponseFut {
5784        fn _decode(
5785            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5786        ) -> Result<DataRouterRouteResult, fidl::Error> {
5787            let _response = fidl::client::decode_transaction_body::<
5788                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>,
5789                fidl::encoding::DefaultFuchsiaResourceDialect,
5790                0x646885ba7e10ceeb,
5791            >(_buf?)?
5792            .into_result::<DataRouterMarker>("route")?;
5793            Ok(_response.map(|x| x.response))
5794        }
5795        self.client.send_query_and_decode::<DataRouterRouteRequest, DataRouterRouteResult>(
5796            (request, instance_token, handle),
5797            0x646885ba7e10ceeb,
5798            fidl::encoding::DynamicFlags::FLEXIBLE,
5799            _decode,
5800        )
5801    }
5802}
5803
5804pub struct DataRouterEventStream {
5805    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5806}
5807
5808impl std::marker::Unpin for DataRouterEventStream {}
5809
5810impl futures::stream::FusedStream for DataRouterEventStream {
5811    fn is_terminated(&self) -> bool {
5812        self.event_receiver.is_terminated()
5813    }
5814}
5815
5816impl futures::Stream for DataRouterEventStream {
5817    type Item = Result<DataRouterEvent, fidl::Error>;
5818
5819    fn poll_next(
5820        mut self: std::pin::Pin<&mut Self>,
5821        cx: &mut std::task::Context<'_>,
5822    ) -> std::task::Poll<Option<Self::Item>> {
5823        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5824            &mut self.event_receiver,
5825            cx
5826        )?) {
5827            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5828            None => std::task::Poll::Ready(None),
5829        }
5830    }
5831}
5832
5833#[derive(Debug)]
5834pub enum DataRouterEvent {
5835    #[non_exhaustive]
5836    _UnknownEvent {
5837        /// Ordinal of the event that was sent.
5838        ordinal: u64,
5839    },
5840}
5841
5842impl DataRouterEvent {
5843    /// Decodes a message buffer as a [`DataRouterEvent`].
5844    fn decode(
5845        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5846    ) -> Result<DataRouterEvent, fidl::Error> {
5847        let (bytes, _handles) = buf.split_mut();
5848        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5849        debug_assert_eq!(tx_header.tx_id, 0);
5850        match tx_header.ordinal {
5851            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5852                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5853            }
5854            _ => Err(fidl::Error::UnknownOrdinal {
5855                ordinal: tx_header.ordinal,
5856                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5857            }),
5858        }
5859    }
5860}
5861
5862/// A Stream of incoming requests for fuchsia.component.runtime/DataRouter.
5863pub struct DataRouterRequestStream {
5864    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5865    is_terminated: bool,
5866}
5867
5868impl std::marker::Unpin for DataRouterRequestStream {}
5869
5870impl futures::stream::FusedStream for DataRouterRequestStream {
5871    fn is_terminated(&self) -> bool {
5872        self.is_terminated
5873    }
5874}
5875
5876impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5877    type Protocol = DataRouterMarker;
5878    type ControlHandle = DataRouterControlHandle;
5879
5880    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5881        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5882    }
5883
5884    fn control_handle(&self) -> Self::ControlHandle {
5885        DataRouterControlHandle { inner: self.inner.clone() }
5886    }
5887
5888    fn into_inner(
5889        self,
5890    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5891    {
5892        (self.inner, self.is_terminated)
5893    }
5894
5895    fn from_inner(
5896        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5897        is_terminated: bool,
5898    ) -> Self {
5899        Self { inner, is_terminated }
5900    }
5901}
5902
5903impl futures::Stream for DataRouterRequestStream {
5904    type Item = Result<DataRouterRequest, fidl::Error>;
5905
5906    fn poll_next(
5907        mut self: std::pin::Pin<&mut Self>,
5908        cx: &mut std::task::Context<'_>,
5909    ) -> std::task::Poll<Option<Self::Item>> {
5910        let this = &mut *self;
5911        if this.inner.check_shutdown(cx) {
5912            this.is_terminated = true;
5913            return std::task::Poll::Ready(None);
5914        }
5915        if this.is_terminated {
5916            panic!("polled DataRouterRequestStream after completion");
5917        }
5918        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5919            |bytes, handles| {
5920                match this.inner.channel().read_etc(cx, bytes, handles) {
5921                    std::task::Poll::Ready(Ok(())) => {}
5922                    std::task::Poll::Pending => return std::task::Poll::Pending,
5923                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5924                        this.is_terminated = true;
5925                        return std::task::Poll::Ready(None);
5926                    }
5927                    std::task::Poll::Ready(Err(e)) => {
5928                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5929                            e.into(),
5930                        ))));
5931                    }
5932                }
5933
5934                // A message has been received from the channel
5935                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5936
5937                std::task::Poll::Ready(Some(match header.ordinal {
5938                    0x646885ba7e10ceeb => {
5939                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5940                        let mut req = fidl::new_empty!(
5941                            DataRouterRouteRequest,
5942                            fidl::encoding::DefaultFuchsiaResourceDialect
5943                        );
5944                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5945                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5946                        Ok(DataRouterRequest::Route {
5947                            request: req.request,
5948                            instance_token: req.instance_token,
5949                            handle: req.handle,
5950
5951                            responder: DataRouterRouteResponder {
5952                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5953                                tx_id: header.tx_id,
5954                            },
5955                        })
5956                    }
5957                    _ if header.tx_id == 0
5958                        && header
5959                            .dynamic_flags()
5960                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5961                    {
5962                        Ok(DataRouterRequest::_UnknownMethod {
5963                            ordinal: header.ordinal,
5964                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5965                            method_type: fidl::MethodType::OneWay,
5966                        })
5967                    }
5968                    _ if header
5969                        .dynamic_flags()
5970                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5971                    {
5972                        this.inner.send_framework_err(
5973                            fidl::encoding::FrameworkErr::UnknownMethod,
5974                            header.tx_id,
5975                            header.ordinal,
5976                            header.dynamic_flags(),
5977                            (bytes, handles),
5978                        )?;
5979                        Ok(DataRouterRequest::_UnknownMethod {
5980                            ordinal: header.ordinal,
5981                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5982                            method_type: fidl::MethodType::TwoWay,
5983                        })
5984                    }
5985                    _ => Err(fidl::Error::UnknownOrdinal {
5986                        ordinal: header.ordinal,
5987                        protocol_name:
5988                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5989                    }),
5990                }))
5991            },
5992        )
5993    }
5994}
5995
5996/// A factory for `Data` capabilities.
5997#[derive(Debug)]
5998pub enum DataRouterRequest {
5999    /// Attempts to produce a `Data` capability from this
6000    /// `DataRouter`.
6001    ///
6002    /// `request` contains context for this route, and `instance_token`
6003    /// references the component that the routing operation is being performed
6004    /// for.
6005    ///
6006    /// This will return:
6007    ///
6008    /// - `SUCCESS` if `handle` has been associated with a connector.
6009    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6010    ///   will be closed.
6011    /// - An error, if the operation failed.
6012    Route {
6013        request: RouteRequest,
6014        instance_token: fidl::EventPair,
6015        handle: fidl::EventPair,
6016        responder: DataRouterRouteResponder,
6017    },
6018    /// An interaction was received which does not match any known method.
6019    #[non_exhaustive]
6020    _UnknownMethod {
6021        /// Ordinal of the method that was called.
6022        ordinal: u64,
6023        control_handle: DataRouterControlHandle,
6024        method_type: fidl::MethodType,
6025    },
6026}
6027
6028impl DataRouterRequest {
6029    #[allow(irrefutable_let_patterns)]
6030    pub fn into_route(
6031        self,
6032    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DataRouterRouteResponder)> {
6033        if let DataRouterRequest::Route { request, instance_token, handle, responder } = self {
6034            Some((request, instance_token, handle, responder))
6035        } else {
6036            None
6037        }
6038    }
6039
6040    /// Name of the method defined in FIDL
6041    pub fn method_name(&self) -> &'static str {
6042        match *self {
6043            DataRouterRequest::Route { .. } => "route",
6044            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6045                "unknown one-way method"
6046            }
6047            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6048                "unknown two-way method"
6049            }
6050        }
6051    }
6052}
6053
6054#[derive(Debug, Clone)]
6055pub struct DataRouterControlHandle {
6056    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6057}
6058
6059impl DataRouterControlHandle {
6060    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6061        self.inner.shutdown_with_epitaph(status.into())
6062    }
6063}
6064
6065impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
6066    fn shutdown(&self) {
6067        self.inner.shutdown()
6068    }
6069
6070    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6071        self.inner.shutdown_with_epitaph(status)
6072    }
6073
6074    fn is_closed(&self) -> bool {
6075        self.inner.channel().is_closed()
6076    }
6077    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6078        self.inner.channel().on_closed()
6079    }
6080
6081    #[cfg(target_os = "fuchsia")]
6082    fn signal_peer(
6083        &self,
6084        clear_mask: zx::Signals,
6085        set_mask: zx::Signals,
6086    ) -> Result<(), zx_status::Status> {
6087        use fidl::Peered;
6088        self.inner.channel().signal_peer(clear_mask, set_mask)
6089    }
6090}
6091
6092impl DataRouterControlHandle {}
6093
6094#[must_use = "FIDL methods require a response to be sent"]
6095#[derive(Debug)]
6096pub struct DataRouterRouteResponder {
6097    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
6098    tx_id: u32,
6099}
6100
6101/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
6102/// if the responder is dropped without sending a response, so that the client
6103/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6104impl std::ops::Drop for DataRouterRouteResponder {
6105    fn drop(&mut self) {
6106        self.control_handle.shutdown();
6107        // Safety: drops once, never accessed again
6108        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6109    }
6110}
6111
6112impl fidl::endpoints::Responder for DataRouterRouteResponder {
6113    type ControlHandle = DataRouterControlHandle;
6114
6115    fn control_handle(&self) -> &DataRouterControlHandle {
6116        &self.control_handle
6117    }
6118
6119    fn drop_without_shutdown(mut self) {
6120        // Safety: drops once, never accessed again due to mem::forget
6121        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6122        // Prevent Drop from running (which would shut down the channel)
6123        std::mem::forget(self);
6124    }
6125}
6126
6127impl DataRouterRouteResponder {
6128    /// Sends a response to the FIDL transaction.
6129    ///
6130    /// Sets the channel to shutdown if an error occurs.
6131    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6132        let _result = self.send_raw(result);
6133        if _result.is_err() {
6134            self.control_handle.shutdown();
6135        }
6136        self.drop_without_shutdown();
6137        _result
6138    }
6139
6140    /// Similar to "send" but does not shutdown the channel if an error occurs.
6141    pub fn send_no_shutdown_on_err(
6142        self,
6143        mut result: Result<RouterResponse, i32>,
6144    ) -> Result<(), fidl::Error> {
6145        let _result = self.send_raw(result);
6146        self.drop_without_shutdown();
6147        _result
6148    }
6149
6150    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
6151        self.control_handle
6152            .inner
6153            .send::<fidl::encoding::FlexibleResultType<DataRouterRouteResponse, i32>>(
6154                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
6155                self.tx_id,
6156                0x646885ba7e10ceeb,
6157                fidl::encoding::DynamicFlags::FLEXIBLE,
6158            )
6159    }
6160}
6161
6162#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6163pub struct DictionaryKeyIteratorMarker;
6164
6165impl fidl::endpoints::ProtocolMarker for DictionaryKeyIteratorMarker {
6166    type Proxy = DictionaryKeyIteratorProxy;
6167    type RequestStream = DictionaryKeyIteratorRequestStream;
6168    #[cfg(target_os = "fuchsia")]
6169    type SynchronousProxy = DictionaryKeyIteratorSynchronousProxy;
6170
6171    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeyIterator";
6172}
6173
6174pub trait DictionaryKeyIteratorProxyInterface: Send + Sync {
6175    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6176    fn r#get_next(&self) -> Self::GetNextResponseFut;
6177}
6178#[derive(Debug)]
6179#[cfg(target_os = "fuchsia")]
6180pub struct DictionaryKeyIteratorSynchronousProxy {
6181    client: fidl::client::sync::Client,
6182}
6183
6184#[cfg(target_os = "fuchsia")]
6185impl fidl::endpoints::SynchronousProxy for DictionaryKeyIteratorSynchronousProxy {
6186    type Proxy = DictionaryKeyIteratorProxy;
6187    type Protocol = DictionaryKeyIteratorMarker;
6188
6189    fn from_channel(inner: fidl::Channel) -> Self {
6190        Self::new(inner)
6191    }
6192
6193    fn into_channel(self) -> fidl::Channel {
6194        self.client.into_channel()
6195    }
6196
6197    fn as_channel(&self) -> &fidl::Channel {
6198        self.client.as_channel()
6199    }
6200}
6201
6202#[cfg(target_os = "fuchsia")]
6203impl DictionaryKeyIteratorSynchronousProxy {
6204    pub fn new(channel: fidl::Channel) -> Self {
6205        Self { client: fidl::client::sync::Client::new(channel) }
6206    }
6207
6208    pub fn into_channel(self) -> fidl::Channel {
6209        self.client.into_channel()
6210    }
6211
6212    /// Waits until an event arrives and returns it. It is safe for other
6213    /// threads to make concurrent requests while waiting for an event.
6214    pub fn wait_for_event(
6215        &self,
6216        deadline: zx::MonotonicInstant,
6217    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6218        DictionaryKeyIteratorEvent::decode(
6219            self.client.wait_for_event::<DictionaryKeyIteratorMarker>(deadline)?,
6220        )
6221    }
6222
6223    /// Returns the next set of keys in this dictionary. Returns an empty vector
6224    /// when there are no more keys to iterate.
6225    pub fn r#get_next(
6226        &self,
6227        ___deadline: zx::MonotonicInstant,
6228    ) -> Result<Vec<String>, fidl::Error> {
6229        let _response = self.client.send_query::<
6230            fidl::encoding::EmptyPayload,
6231            DictionaryKeyIteratorGetNextResponse,
6232            DictionaryKeyIteratorMarker,
6233        >(
6234            (),
6235            0x3806bda34433db54,
6236            fidl::encoding::DynamicFlags::empty(),
6237            ___deadline,
6238        )?;
6239        Ok(_response.keys)
6240    }
6241}
6242
6243#[cfg(target_os = "fuchsia")]
6244impl From<DictionaryKeyIteratorSynchronousProxy> for zx::NullableHandle {
6245    fn from(value: DictionaryKeyIteratorSynchronousProxy) -> Self {
6246        value.into_channel().into()
6247    }
6248}
6249
6250#[cfg(target_os = "fuchsia")]
6251impl From<fidl::Channel> for DictionaryKeyIteratorSynchronousProxy {
6252    fn from(value: fidl::Channel) -> Self {
6253        Self::new(value)
6254    }
6255}
6256
6257#[cfg(target_os = "fuchsia")]
6258impl fidl::endpoints::FromClient for DictionaryKeyIteratorSynchronousProxy {
6259    type Protocol = DictionaryKeyIteratorMarker;
6260
6261    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeyIteratorMarker>) -> Self {
6262        Self::new(value.into_channel())
6263    }
6264}
6265
6266#[derive(Debug, Clone)]
6267pub struct DictionaryKeyIteratorProxy {
6268    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6269}
6270
6271impl fidl::endpoints::Proxy for DictionaryKeyIteratorProxy {
6272    type Protocol = DictionaryKeyIteratorMarker;
6273
6274    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6275        Self::new(inner)
6276    }
6277
6278    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6279        self.client.into_channel().map_err(|client| Self { client })
6280    }
6281
6282    fn as_channel(&self) -> &::fidl::AsyncChannel {
6283        self.client.as_channel()
6284    }
6285}
6286
6287impl DictionaryKeyIteratorProxy {
6288    /// Create a new Proxy for fuchsia.component.runtime/DictionaryKeyIterator.
6289    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6290        let protocol_name =
6291            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6292        Self { client: fidl::client::Client::new(channel, protocol_name) }
6293    }
6294
6295    /// Get a Stream of events from the remote end of the protocol.
6296    ///
6297    /// # Panics
6298    ///
6299    /// Panics if the event stream was already taken.
6300    pub fn take_event_stream(&self) -> DictionaryKeyIteratorEventStream {
6301        DictionaryKeyIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6302    }
6303
6304    /// Returns the next set of keys in this dictionary. Returns an empty vector
6305    /// when there are no more keys to iterate.
6306    pub fn r#get_next(
6307        &self,
6308    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
6309    {
6310        DictionaryKeyIteratorProxyInterface::r#get_next(self)
6311    }
6312}
6313
6314impl DictionaryKeyIteratorProxyInterface for DictionaryKeyIteratorProxy {
6315    type GetNextResponseFut =
6316        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
6317    fn r#get_next(&self) -> Self::GetNextResponseFut {
6318        fn _decode(
6319            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6320        ) -> Result<Vec<String>, fidl::Error> {
6321            let _response = fidl::client::decode_transaction_body::<
6322                DictionaryKeyIteratorGetNextResponse,
6323                fidl::encoding::DefaultFuchsiaResourceDialect,
6324                0x3806bda34433db54,
6325            >(_buf?)?;
6326            Ok(_response.keys)
6327        }
6328        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6329            (),
6330            0x3806bda34433db54,
6331            fidl::encoding::DynamicFlags::empty(),
6332            _decode,
6333        )
6334    }
6335}
6336
6337pub struct DictionaryKeyIteratorEventStream {
6338    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6339}
6340
6341impl std::marker::Unpin for DictionaryKeyIteratorEventStream {}
6342
6343impl futures::stream::FusedStream for DictionaryKeyIteratorEventStream {
6344    fn is_terminated(&self) -> bool {
6345        self.event_receiver.is_terminated()
6346    }
6347}
6348
6349impl futures::Stream for DictionaryKeyIteratorEventStream {
6350    type Item = Result<DictionaryKeyIteratorEvent, fidl::Error>;
6351
6352    fn poll_next(
6353        mut self: std::pin::Pin<&mut Self>,
6354        cx: &mut std::task::Context<'_>,
6355    ) -> std::task::Poll<Option<Self::Item>> {
6356        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6357            &mut self.event_receiver,
6358            cx
6359        )?) {
6360            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeyIteratorEvent::decode(buf))),
6361            None => std::task::Poll::Ready(None),
6362        }
6363    }
6364}
6365
6366#[derive(Debug)]
6367pub enum DictionaryKeyIteratorEvent {}
6368
6369impl DictionaryKeyIteratorEvent {
6370    /// Decodes a message buffer as a [`DictionaryKeyIteratorEvent`].
6371    fn decode(
6372        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6373    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
6374        let (bytes, _handles) = buf.split_mut();
6375        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6376        debug_assert_eq!(tx_header.tx_id, 0);
6377        match tx_header.ordinal {
6378            _ => Err(fidl::Error::UnknownOrdinal {
6379                ordinal: tx_header.ordinal,
6380                protocol_name:
6381                    <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6382            }),
6383        }
6384    }
6385}
6386
6387/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryKeyIterator.
6388pub struct DictionaryKeyIteratorRequestStream {
6389    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6390    is_terminated: bool,
6391}
6392
6393impl std::marker::Unpin for DictionaryKeyIteratorRequestStream {}
6394
6395impl futures::stream::FusedStream for DictionaryKeyIteratorRequestStream {
6396    fn is_terminated(&self) -> bool {
6397        self.is_terminated
6398    }
6399}
6400
6401impl fidl::endpoints::RequestStream for DictionaryKeyIteratorRequestStream {
6402    type Protocol = DictionaryKeyIteratorMarker;
6403    type ControlHandle = DictionaryKeyIteratorControlHandle;
6404
6405    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6406        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6407    }
6408
6409    fn control_handle(&self) -> Self::ControlHandle {
6410        DictionaryKeyIteratorControlHandle { inner: self.inner.clone() }
6411    }
6412
6413    fn into_inner(
6414        self,
6415    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6416    {
6417        (self.inner, self.is_terminated)
6418    }
6419
6420    fn from_inner(
6421        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6422        is_terminated: bool,
6423    ) -> Self {
6424        Self { inner, is_terminated }
6425    }
6426}
6427
6428impl futures::Stream for DictionaryKeyIteratorRequestStream {
6429    type Item = Result<DictionaryKeyIteratorRequest, fidl::Error>;
6430
6431    fn poll_next(
6432        mut self: std::pin::Pin<&mut Self>,
6433        cx: &mut std::task::Context<'_>,
6434    ) -> std::task::Poll<Option<Self::Item>> {
6435        let this = &mut *self;
6436        if this.inner.check_shutdown(cx) {
6437            this.is_terminated = true;
6438            return std::task::Poll::Ready(None);
6439        }
6440        if this.is_terminated {
6441            panic!("polled DictionaryKeyIteratorRequestStream after completion");
6442        }
6443        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6444            |bytes, handles| {
6445                match this.inner.channel().read_etc(cx, bytes, handles) {
6446                    std::task::Poll::Ready(Ok(())) => {}
6447                    std::task::Poll::Pending => return std::task::Poll::Pending,
6448                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6449                        this.is_terminated = true;
6450                        return std::task::Poll::Ready(None);
6451                    }
6452                    std::task::Poll::Ready(Err(e)) => {
6453                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6454                            e.into(),
6455                        ))));
6456                    }
6457                }
6458
6459                // A message has been received from the channel
6460                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6461
6462                std::task::Poll::Ready(Some(match header.ordinal {
6463                0x3806bda34433db54 => {
6464                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6465                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6466                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6467                    let control_handle = DictionaryKeyIteratorControlHandle {
6468                        inner: this.inner.clone(),
6469                    };
6470                    Ok(DictionaryKeyIteratorRequest::GetNext {
6471                        responder: DictionaryKeyIteratorGetNextResponder {
6472                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6473                            tx_id: header.tx_id,
6474                        },
6475                    })
6476                }
6477                _ => Err(fidl::Error::UnknownOrdinal {
6478                    ordinal: header.ordinal,
6479                    protocol_name: <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6480                }),
6481            }))
6482            },
6483        )
6484    }
6485}
6486
6487#[derive(Debug)]
6488pub enum DictionaryKeyIteratorRequest {
6489    /// Returns the next set of keys in this dictionary. Returns an empty vector
6490    /// when there are no more keys to iterate.
6491    GetNext { responder: DictionaryKeyIteratorGetNextResponder },
6492}
6493
6494impl DictionaryKeyIteratorRequest {
6495    #[allow(irrefutable_let_patterns)]
6496    pub fn into_get_next(self) -> Option<(DictionaryKeyIteratorGetNextResponder)> {
6497        if let DictionaryKeyIteratorRequest::GetNext { responder } = self {
6498            Some((responder))
6499        } else {
6500            None
6501        }
6502    }
6503
6504    /// Name of the method defined in FIDL
6505    pub fn method_name(&self) -> &'static str {
6506        match *self {
6507            DictionaryKeyIteratorRequest::GetNext { .. } => "get_next",
6508        }
6509    }
6510}
6511
6512#[derive(Debug, Clone)]
6513pub struct DictionaryKeyIteratorControlHandle {
6514    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6515}
6516
6517impl DictionaryKeyIteratorControlHandle {
6518    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6519        self.inner.shutdown_with_epitaph(status.into())
6520    }
6521}
6522
6523impl fidl::endpoints::ControlHandle for DictionaryKeyIteratorControlHandle {
6524    fn shutdown(&self) {
6525        self.inner.shutdown()
6526    }
6527
6528    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6529        self.inner.shutdown_with_epitaph(status)
6530    }
6531
6532    fn is_closed(&self) -> bool {
6533        self.inner.channel().is_closed()
6534    }
6535    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6536        self.inner.channel().on_closed()
6537    }
6538
6539    #[cfg(target_os = "fuchsia")]
6540    fn signal_peer(
6541        &self,
6542        clear_mask: zx::Signals,
6543        set_mask: zx::Signals,
6544    ) -> Result<(), zx_status::Status> {
6545        use fidl::Peered;
6546        self.inner.channel().signal_peer(clear_mask, set_mask)
6547    }
6548}
6549
6550impl DictionaryKeyIteratorControlHandle {}
6551
6552#[must_use = "FIDL methods require a response to be sent"]
6553#[derive(Debug)]
6554pub struct DictionaryKeyIteratorGetNextResponder {
6555    control_handle: std::mem::ManuallyDrop<DictionaryKeyIteratorControlHandle>,
6556    tx_id: u32,
6557}
6558
6559/// Set the the channel to be shutdown (see [`DictionaryKeyIteratorControlHandle::shutdown`])
6560/// if the responder is dropped without sending a response, so that the client
6561/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6562impl std::ops::Drop for DictionaryKeyIteratorGetNextResponder {
6563    fn drop(&mut self) {
6564        self.control_handle.shutdown();
6565        // Safety: drops once, never accessed again
6566        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6567    }
6568}
6569
6570impl fidl::endpoints::Responder for DictionaryKeyIteratorGetNextResponder {
6571    type ControlHandle = DictionaryKeyIteratorControlHandle;
6572
6573    fn control_handle(&self) -> &DictionaryKeyIteratorControlHandle {
6574        &self.control_handle
6575    }
6576
6577    fn drop_without_shutdown(mut self) {
6578        // Safety: drops once, never accessed again due to mem::forget
6579        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6580        // Prevent Drop from running (which would shut down the channel)
6581        std::mem::forget(self);
6582    }
6583}
6584
6585impl DictionaryKeyIteratorGetNextResponder {
6586    /// Sends a response to the FIDL transaction.
6587    ///
6588    /// Sets the channel to shutdown if an error occurs.
6589    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6590        let _result = self.send_raw(keys);
6591        if _result.is_err() {
6592            self.control_handle.shutdown();
6593        }
6594        self.drop_without_shutdown();
6595        _result
6596    }
6597
6598    /// Similar to "send" but does not shutdown the channel if an error occurs.
6599    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
6600        let _result = self.send_raw(keys);
6601        self.drop_without_shutdown();
6602        _result
6603    }
6604
6605    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
6606        self.control_handle.inner.send::<DictionaryKeyIteratorGetNextResponse>(
6607            (keys,),
6608            self.tx_id,
6609            0x3806bda34433db54,
6610            fidl::encoding::DynamicFlags::empty(),
6611        )
6612    }
6613}
6614
6615#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6616pub struct DictionaryRouterMarker;
6617
6618impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
6619    type Proxy = DictionaryRouterProxy;
6620    type RequestStream = DictionaryRouterRequestStream;
6621    #[cfg(target_os = "fuchsia")]
6622    type SynchronousProxy = DictionaryRouterSynchronousProxy;
6623
6624    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DictionaryRouter";
6625}
6626impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
6627pub type DictionaryRouterRouteResult = Result<RouterResponse, i32>;
6628
6629pub trait DictionaryRouterProxyInterface: Send + Sync {
6630    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
6631        + Send;
6632    fn r#route(
6633        &self,
6634        request: &RouteRequest,
6635        instance_token: fidl::EventPair,
6636        handle: fidl::EventPair,
6637    ) -> Self::RouteResponseFut;
6638}
6639#[derive(Debug)]
6640#[cfg(target_os = "fuchsia")]
6641pub struct DictionaryRouterSynchronousProxy {
6642    client: fidl::client::sync::Client,
6643}
6644
6645#[cfg(target_os = "fuchsia")]
6646impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
6647    type Proxy = DictionaryRouterProxy;
6648    type Protocol = DictionaryRouterMarker;
6649
6650    fn from_channel(inner: fidl::Channel) -> Self {
6651        Self::new(inner)
6652    }
6653
6654    fn into_channel(self) -> fidl::Channel {
6655        self.client.into_channel()
6656    }
6657
6658    fn as_channel(&self) -> &fidl::Channel {
6659        self.client.as_channel()
6660    }
6661}
6662
6663#[cfg(target_os = "fuchsia")]
6664impl DictionaryRouterSynchronousProxy {
6665    pub fn new(channel: fidl::Channel) -> Self {
6666        Self { client: fidl::client::sync::Client::new(channel) }
6667    }
6668
6669    pub fn into_channel(self) -> fidl::Channel {
6670        self.client.into_channel()
6671    }
6672
6673    /// Waits until an event arrives and returns it. It is safe for other
6674    /// threads to make concurrent requests while waiting for an event.
6675    pub fn wait_for_event(
6676        &self,
6677        deadline: zx::MonotonicInstant,
6678    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6679        DictionaryRouterEvent::decode(
6680            self.client.wait_for_event::<DictionaryRouterMarker>(deadline)?,
6681        )
6682    }
6683
6684    /// Attempts to produce a `Dictionary` capability from this
6685    /// `DictionaryRouter`.
6686    ///
6687    /// `request` contains context for this route, and `instance_token`
6688    /// references the component that the routing operation is being performed
6689    /// for.
6690    ///
6691    /// This will return:
6692    ///
6693    /// - `SUCCESS` if `handle` has been associated with a connector.
6694    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6695    ///   will be closed.
6696    /// - An error, if the operation failed.
6697    pub fn r#route(
6698        &self,
6699        mut request: &RouteRequest,
6700        mut instance_token: fidl::EventPair,
6701        mut handle: fidl::EventPair,
6702        ___deadline: zx::MonotonicInstant,
6703    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6704        let _response = self.client.send_query::<
6705            DictionaryRouterRouteRequest,
6706            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6707            DictionaryRouterMarker,
6708        >(
6709            (request, instance_token, handle,),
6710            0x199389f437b3937b,
6711            fidl::encoding::DynamicFlags::FLEXIBLE,
6712            ___deadline,
6713        )?
6714        .into_result::<DictionaryRouterMarker>("route")?;
6715        Ok(_response.map(|x| x.response))
6716    }
6717}
6718
6719#[cfg(target_os = "fuchsia")]
6720impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
6721    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
6722        value.into_channel().into()
6723    }
6724}
6725
6726#[cfg(target_os = "fuchsia")]
6727impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
6728    fn from(value: fidl::Channel) -> Self {
6729        Self::new(value)
6730    }
6731}
6732
6733#[cfg(target_os = "fuchsia")]
6734impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
6735    type Protocol = DictionaryRouterMarker;
6736
6737    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
6738        Self::new(value.into_channel())
6739    }
6740}
6741
6742#[derive(Debug, Clone)]
6743pub struct DictionaryRouterProxy {
6744    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6745}
6746
6747impl fidl::endpoints::Proxy for DictionaryRouterProxy {
6748    type Protocol = DictionaryRouterMarker;
6749
6750    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6751        Self::new(inner)
6752    }
6753
6754    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6755        self.client.into_channel().map_err(|client| Self { client })
6756    }
6757
6758    fn as_channel(&self) -> &::fidl::AsyncChannel {
6759        self.client.as_channel()
6760    }
6761}
6762
6763impl DictionaryRouterProxy {
6764    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouter.
6765    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6766        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6767        Self { client: fidl::client::Client::new(channel, protocol_name) }
6768    }
6769
6770    /// Get a Stream of events from the remote end of the protocol.
6771    ///
6772    /// # Panics
6773    ///
6774    /// Panics if the event stream was already taken.
6775    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
6776        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
6777    }
6778
6779    /// Attempts to produce a `Dictionary` capability from this
6780    /// `DictionaryRouter`.
6781    ///
6782    /// `request` contains context for this route, and `instance_token`
6783    /// references the component that the routing operation is being performed
6784    /// for.
6785    ///
6786    /// This will return:
6787    ///
6788    /// - `SUCCESS` if `handle` has been associated with a connector.
6789    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
6790    ///   will be closed.
6791    /// - An error, if the operation failed.
6792    pub fn r#route(
6793        &self,
6794        mut request: &RouteRequest,
6795        mut instance_token: fidl::EventPair,
6796        mut handle: fidl::EventPair,
6797    ) -> fidl::client::QueryResponseFut<
6798        DictionaryRouterRouteResult,
6799        fidl::encoding::DefaultFuchsiaResourceDialect,
6800    > {
6801        DictionaryRouterProxyInterface::r#route(self, request, instance_token, handle)
6802    }
6803}
6804
6805impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
6806    type RouteResponseFut = fidl::client::QueryResponseFut<
6807        DictionaryRouterRouteResult,
6808        fidl::encoding::DefaultFuchsiaResourceDialect,
6809    >;
6810    fn r#route(
6811        &self,
6812        mut request: &RouteRequest,
6813        mut instance_token: fidl::EventPair,
6814        mut handle: fidl::EventPair,
6815    ) -> Self::RouteResponseFut {
6816        fn _decode(
6817            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6818        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
6819            let _response = fidl::client::decode_transaction_body::<
6820                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, i32>,
6821                fidl::encoding::DefaultFuchsiaResourceDialect,
6822                0x199389f437b3937b,
6823            >(_buf?)?
6824            .into_result::<DictionaryRouterMarker>("route")?;
6825            Ok(_response.map(|x| x.response))
6826        }
6827        self.client
6828            .send_query_and_decode::<DictionaryRouterRouteRequest, DictionaryRouterRouteResult>(
6829                (request, instance_token, handle),
6830                0x199389f437b3937b,
6831                fidl::encoding::DynamicFlags::FLEXIBLE,
6832                _decode,
6833            )
6834    }
6835}
6836
6837pub struct DictionaryRouterEventStream {
6838    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6839}
6840
6841impl std::marker::Unpin for DictionaryRouterEventStream {}
6842
6843impl futures::stream::FusedStream for DictionaryRouterEventStream {
6844    fn is_terminated(&self) -> bool {
6845        self.event_receiver.is_terminated()
6846    }
6847}
6848
6849impl futures::Stream for DictionaryRouterEventStream {
6850    type Item = Result<DictionaryRouterEvent, fidl::Error>;
6851
6852    fn poll_next(
6853        mut self: std::pin::Pin<&mut Self>,
6854        cx: &mut std::task::Context<'_>,
6855    ) -> std::task::Poll<Option<Self::Item>> {
6856        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6857            &mut self.event_receiver,
6858            cx
6859        )?) {
6860            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
6861            None => std::task::Poll::Ready(None),
6862        }
6863    }
6864}
6865
6866#[derive(Debug)]
6867pub enum DictionaryRouterEvent {
6868    #[non_exhaustive]
6869    _UnknownEvent {
6870        /// Ordinal of the event that was sent.
6871        ordinal: u64,
6872    },
6873}
6874
6875impl DictionaryRouterEvent {
6876    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
6877    fn decode(
6878        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6879    ) -> Result<DictionaryRouterEvent, fidl::Error> {
6880        let (bytes, _handles) = buf.split_mut();
6881        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6882        debug_assert_eq!(tx_header.tx_id, 0);
6883        match tx_header.ordinal {
6884            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6885                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6886            }
6887            _ => Err(fidl::Error::UnknownOrdinal {
6888                ordinal: tx_header.ordinal,
6889                protocol_name:
6890                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6891            }),
6892        }
6893    }
6894}
6895
6896/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouter.
6897pub struct DictionaryRouterRequestStream {
6898    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6899    is_terminated: bool,
6900}
6901
6902impl std::marker::Unpin for DictionaryRouterRequestStream {}
6903
6904impl futures::stream::FusedStream for DictionaryRouterRequestStream {
6905    fn is_terminated(&self) -> bool {
6906        self.is_terminated
6907    }
6908}
6909
6910impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
6911    type Protocol = DictionaryRouterMarker;
6912    type ControlHandle = DictionaryRouterControlHandle;
6913
6914    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6915        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6916    }
6917
6918    fn control_handle(&self) -> Self::ControlHandle {
6919        DictionaryRouterControlHandle { inner: self.inner.clone() }
6920    }
6921
6922    fn into_inner(
6923        self,
6924    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6925    {
6926        (self.inner, self.is_terminated)
6927    }
6928
6929    fn from_inner(
6930        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6931        is_terminated: bool,
6932    ) -> Self {
6933        Self { inner, is_terminated }
6934    }
6935}
6936
6937impl futures::Stream for DictionaryRouterRequestStream {
6938    type Item = Result<DictionaryRouterRequest, fidl::Error>;
6939
6940    fn poll_next(
6941        mut self: std::pin::Pin<&mut Self>,
6942        cx: &mut std::task::Context<'_>,
6943    ) -> std::task::Poll<Option<Self::Item>> {
6944        let this = &mut *self;
6945        if this.inner.check_shutdown(cx) {
6946            this.is_terminated = true;
6947            return std::task::Poll::Ready(None);
6948        }
6949        if this.is_terminated {
6950            panic!("polled DictionaryRouterRequestStream after completion");
6951        }
6952        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6953            |bytes, handles| {
6954                match this.inner.channel().read_etc(cx, bytes, handles) {
6955                    std::task::Poll::Ready(Ok(())) => {}
6956                    std::task::Poll::Pending => return std::task::Poll::Pending,
6957                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6958                        this.is_terminated = true;
6959                        return std::task::Poll::Ready(None);
6960                    }
6961                    std::task::Poll::Ready(Err(e)) => {
6962                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6963                            e.into(),
6964                        ))));
6965                    }
6966                }
6967
6968                // A message has been received from the channel
6969                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6970
6971                std::task::Poll::Ready(Some(match header.ordinal {
6972                    0x199389f437b3937b => {
6973                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6974                        let mut req = fidl::new_empty!(
6975                            DictionaryRouterRouteRequest,
6976                            fidl::encoding::DefaultFuchsiaResourceDialect
6977                        );
6978                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6979                        let control_handle =
6980                            DictionaryRouterControlHandle { inner: this.inner.clone() };
6981                        Ok(DictionaryRouterRequest::Route {
6982                            request: req.request,
6983                            instance_token: req.instance_token,
6984                            handle: req.handle,
6985
6986                            responder: DictionaryRouterRouteResponder {
6987                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6988                                tx_id: header.tx_id,
6989                            },
6990                        })
6991                    }
6992                    _ if header.tx_id == 0
6993                        && header
6994                            .dynamic_flags()
6995                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6996                    {
6997                        Ok(DictionaryRouterRequest::_UnknownMethod {
6998                            ordinal: header.ordinal,
6999                            control_handle: DictionaryRouterControlHandle {
7000                                inner: this.inner.clone(),
7001                            },
7002                            method_type: fidl::MethodType::OneWay,
7003                        })
7004                    }
7005                    _ if header
7006                        .dynamic_flags()
7007                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7008                    {
7009                        this.inner.send_framework_err(
7010                            fidl::encoding::FrameworkErr::UnknownMethod,
7011                            header.tx_id,
7012                            header.ordinal,
7013                            header.dynamic_flags(),
7014                            (bytes, handles),
7015                        )?;
7016                        Ok(DictionaryRouterRequest::_UnknownMethod {
7017                            ordinal: header.ordinal,
7018                            control_handle: DictionaryRouterControlHandle {
7019                                inner: this.inner.clone(),
7020                            },
7021                            method_type: fidl::MethodType::TwoWay,
7022                        })
7023                    }
7024                    _ => Err(fidl::Error::UnknownOrdinal {
7025                        ordinal: header.ordinal,
7026                        protocol_name:
7027                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7028                    }),
7029                }))
7030            },
7031        )
7032    }
7033}
7034
7035/// A factory for `Dictionary` capabilities.
7036#[derive(Debug)]
7037pub enum DictionaryRouterRequest {
7038    /// Attempts to produce a `Dictionary` capability from this
7039    /// `DictionaryRouter`.
7040    ///
7041    /// `request` contains context for this route, and `instance_token`
7042    /// references the component that the routing operation is being performed
7043    /// for.
7044    ///
7045    /// This will return:
7046    ///
7047    /// - `SUCCESS` if `handle` has been associated with a connector.
7048    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7049    ///   will be closed.
7050    /// - An error, if the operation failed.
7051    Route {
7052        request: RouteRequest,
7053        instance_token: fidl::EventPair,
7054        handle: fidl::EventPair,
7055        responder: DictionaryRouterRouteResponder,
7056    },
7057    /// An interaction was received which does not match any known method.
7058    #[non_exhaustive]
7059    _UnknownMethod {
7060        /// Ordinal of the method that was called.
7061        ordinal: u64,
7062        control_handle: DictionaryRouterControlHandle,
7063        method_type: fidl::MethodType,
7064    },
7065}
7066
7067impl DictionaryRouterRequest {
7068    #[allow(irrefutable_let_patterns)]
7069    pub fn into_route(
7070        self,
7071    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DictionaryRouterRouteResponder)>
7072    {
7073        if let DictionaryRouterRequest::Route { request, instance_token, handle, responder } = self
7074        {
7075            Some((request, instance_token, handle, responder))
7076        } else {
7077            None
7078        }
7079    }
7080
7081    /// Name of the method defined in FIDL
7082    pub fn method_name(&self) -> &'static str {
7083        match *self {
7084            DictionaryRouterRequest::Route { .. } => "route",
7085            DictionaryRouterRequest::_UnknownMethod {
7086                method_type: fidl::MethodType::OneWay,
7087                ..
7088            } => "unknown one-way method",
7089            DictionaryRouterRequest::_UnknownMethod {
7090                method_type: fidl::MethodType::TwoWay,
7091                ..
7092            } => "unknown two-way method",
7093        }
7094    }
7095}
7096
7097#[derive(Debug, Clone)]
7098pub struct DictionaryRouterControlHandle {
7099    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7100}
7101
7102impl DictionaryRouterControlHandle {
7103    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7104        self.inner.shutdown_with_epitaph(status.into())
7105    }
7106}
7107
7108impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7109    fn shutdown(&self) {
7110        self.inner.shutdown()
7111    }
7112
7113    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7114        self.inner.shutdown_with_epitaph(status)
7115    }
7116
7117    fn is_closed(&self) -> bool {
7118        self.inner.channel().is_closed()
7119    }
7120    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7121        self.inner.channel().on_closed()
7122    }
7123
7124    #[cfg(target_os = "fuchsia")]
7125    fn signal_peer(
7126        &self,
7127        clear_mask: zx::Signals,
7128        set_mask: zx::Signals,
7129    ) -> Result<(), zx_status::Status> {
7130        use fidl::Peered;
7131        self.inner.channel().signal_peer(clear_mask, set_mask)
7132    }
7133}
7134
7135impl DictionaryRouterControlHandle {}
7136
7137#[must_use = "FIDL methods require a response to be sent"]
7138#[derive(Debug)]
7139pub struct DictionaryRouterRouteResponder {
7140    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7141    tx_id: u32,
7142}
7143
7144/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
7145/// if the responder is dropped without sending a response, so that the client
7146/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7147impl std::ops::Drop for DictionaryRouterRouteResponder {
7148    fn drop(&mut self) {
7149        self.control_handle.shutdown();
7150        // Safety: drops once, never accessed again
7151        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7152    }
7153}
7154
7155impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7156    type ControlHandle = DictionaryRouterControlHandle;
7157
7158    fn control_handle(&self) -> &DictionaryRouterControlHandle {
7159        &self.control_handle
7160    }
7161
7162    fn drop_without_shutdown(mut self) {
7163        // Safety: drops once, never accessed again due to mem::forget
7164        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7165        // Prevent Drop from running (which would shut down the channel)
7166        std::mem::forget(self);
7167    }
7168}
7169
7170impl DictionaryRouterRouteResponder {
7171    /// Sends a response to the FIDL transaction.
7172    ///
7173    /// Sets the channel to shutdown if an error occurs.
7174    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7175        let _result = self.send_raw(result);
7176        if _result.is_err() {
7177            self.control_handle.shutdown();
7178        }
7179        self.drop_without_shutdown();
7180        _result
7181    }
7182
7183    /// Similar to "send" but does not shutdown the channel if an error occurs.
7184    pub fn send_no_shutdown_on_err(
7185        self,
7186        mut result: Result<RouterResponse, i32>,
7187    ) -> Result<(), fidl::Error> {
7188        let _result = self.send_raw(result);
7189        self.drop_without_shutdown();
7190        _result
7191    }
7192
7193    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7194        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7195            DictionaryRouterRouteResponse,
7196            i32,
7197        >>(
7198            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7199            self.tx_id,
7200            0x199389f437b3937b,
7201            fidl::encoding::DynamicFlags::FLEXIBLE,
7202        )
7203    }
7204}
7205
7206#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7207pub struct DirConnectorRouterMarker;
7208
7209impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
7210    type Proxy = DirConnectorRouterProxy;
7211    type RequestStream = DirConnectorRouterRequestStream;
7212    #[cfg(target_os = "fuchsia")]
7213    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
7214
7215    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouter";
7216}
7217pub type DirConnectorRouterRouteResult = Result<RouterResponse, i32>;
7218
7219pub trait DirConnectorRouterProxyInterface: Send + Sync {
7220    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
7221        + Send;
7222    fn r#route(
7223        &self,
7224        request: &RouteRequest,
7225        instance_token: fidl::EventPair,
7226        handle: fidl::EventPair,
7227    ) -> Self::RouteResponseFut;
7228}
7229#[derive(Debug)]
7230#[cfg(target_os = "fuchsia")]
7231pub struct DirConnectorRouterSynchronousProxy {
7232    client: fidl::client::sync::Client,
7233}
7234
7235#[cfg(target_os = "fuchsia")]
7236impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
7237    type Proxy = DirConnectorRouterProxy;
7238    type Protocol = DirConnectorRouterMarker;
7239
7240    fn from_channel(inner: fidl::Channel) -> Self {
7241        Self::new(inner)
7242    }
7243
7244    fn into_channel(self) -> fidl::Channel {
7245        self.client.into_channel()
7246    }
7247
7248    fn as_channel(&self) -> &fidl::Channel {
7249        self.client.as_channel()
7250    }
7251}
7252
7253#[cfg(target_os = "fuchsia")]
7254impl DirConnectorRouterSynchronousProxy {
7255    pub fn new(channel: fidl::Channel) -> Self {
7256        Self { client: fidl::client::sync::Client::new(channel) }
7257    }
7258
7259    pub fn into_channel(self) -> fidl::Channel {
7260        self.client.into_channel()
7261    }
7262
7263    /// Waits until an event arrives and returns it. It is safe for other
7264    /// threads to make concurrent requests while waiting for an event.
7265    pub fn wait_for_event(
7266        &self,
7267        deadline: zx::MonotonicInstant,
7268    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7269        DirConnectorRouterEvent::decode(
7270            self.client.wait_for_event::<DirConnectorRouterMarker>(deadline)?,
7271        )
7272    }
7273
7274    /// Attempts to produce a `DirConnector` capability from this
7275    /// `DirConnectorRouter`.
7276    ///
7277    /// `request` contains context for this route, and `instance_token`
7278    /// references the component that the routing operation is being performed
7279    /// for.
7280    ///
7281    /// This will return:
7282    ///
7283    /// - `SUCCESS` if `handle` has been associated with a connector.
7284    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7285    ///   will be closed.
7286    /// - An error, if the operation failed.
7287    pub fn r#route(
7288        &self,
7289        mut request: &RouteRequest,
7290        mut instance_token: fidl::EventPair,
7291        mut handle: fidl::EventPair,
7292        ___deadline: zx::MonotonicInstant,
7293    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7294        let _response = self.client.send_query::<
7295            DirConnectorRouterRouteRequest,
7296            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7297            DirConnectorRouterMarker,
7298        >(
7299            (request, instance_token, handle,),
7300            0x233f2ac038127462,
7301            fidl::encoding::DynamicFlags::FLEXIBLE,
7302            ___deadline,
7303        )?
7304        .into_result::<DirConnectorRouterMarker>("route")?;
7305        Ok(_response.map(|x| x.response))
7306    }
7307}
7308
7309#[cfg(target_os = "fuchsia")]
7310impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
7311    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
7312        value.into_channel().into()
7313    }
7314}
7315
7316#[cfg(target_os = "fuchsia")]
7317impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
7318    fn from(value: fidl::Channel) -> Self {
7319        Self::new(value)
7320    }
7321}
7322
7323#[cfg(target_os = "fuchsia")]
7324impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
7325    type Protocol = DirConnectorRouterMarker;
7326
7327    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
7328        Self::new(value.into_channel())
7329    }
7330}
7331
7332#[derive(Debug, Clone)]
7333pub struct DirConnectorRouterProxy {
7334    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7335}
7336
7337impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
7338    type Protocol = DirConnectorRouterMarker;
7339
7340    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7341        Self::new(inner)
7342    }
7343
7344    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7345        self.client.into_channel().map_err(|client| Self { client })
7346    }
7347
7348    fn as_channel(&self) -> &::fidl::AsyncChannel {
7349        self.client.as_channel()
7350    }
7351}
7352
7353impl DirConnectorRouterProxy {
7354    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouter.
7355    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7356        let protocol_name =
7357            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7358        Self { client: fidl::client::Client::new(channel, protocol_name) }
7359    }
7360
7361    /// Get a Stream of events from the remote end of the protocol.
7362    ///
7363    /// # Panics
7364    ///
7365    /// Panics if the event stream was already taken.
7366    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
7367        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
7368    }
7369
7370    /// Attempts to produce a `DirConnector` capability from this
7371    /// `DirConnectorRouter`.
7372    ///
7373    /// `request` contains context for this route, and `instance_token`
7374    /// references the component that the routing operation is being performed
7375    /// for.
7376    ///
7377    /// This will return:
7378    ///
7379    /// - `SUCCESS` if `handle` has been associated with a connector.
7380    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7381    ///   will be closed.
7382    /// - An error, if the operation failed.
7383    pub fn r#route(
7384        &self,
7385        mut request: &RouteRequest,
7386        mut instance_token: fidl::EventPair,
7387        mut handle: fidl::EventPair,
7388    ) -> fidl::client::QueryResponseFut<
7389        DirConnectorRouterRouteResult,
7390        fidl::encoding::DefaultFuchsiaResourceDialect,
7391    > {
7392        DirConnectorRouterProxyInterface::r#route(self, request, instance_token, handle)
7393    }
7394}
7395
7396impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
7397    type RouteResponseFut = fidl::client::QueryResponseFut<
7398        DirConnectorRouterRouteResult,
7399        fidl::encoding::DefaultFuchsiaResourceDialect,
7400    >;
7401    fn r#route(
7402        &self,
7403        mut request: &RouteRequest,
7404        mut instance_token: fidl::EventPair,
7405        mut handle: fidl::EventPair,
7406    ) -> Self::RouteResponseFut {
7407        fn _decode(
7408            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7409        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
7410            let _response = fidl::client::decode_transaction_body::<
7411                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, i32>,
7412                fidl::encoding::DefaultFuchsiaResourceDialect,
7413                0x233f2ac038127462,
7414            >(_buf?)?
7415            .into_result::<DirConnectorRouterMarker>("route")?;
7416            Ok(_response.map(|x| x.response))
7417        }
7418        self.client
7419            .send_query_and_decode::<DirConnectorRouterRouteRequest, DirConnectorRouterRouteResult>(
7420                (request, instance_token, handle),
7421                0x233f2ac038127462,
7422                fidl::encoding::DynamicFlags::FLEXIBLE,
7423                _decode,
7424            )
7425    }
7426}
7427
7428pub struct DirConnectorRouterEventStream {
7429    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7430}
7431
7432impl std::marker::Unpin for DirConnectorRouterEventStream {}
7433
7434impl futures::stream::FusedStream for DirConnectorRouterEventStream {
7435    fn is_terminated(&self) -> bool {
7436        self.event_receiver.is_terminated()
7437    }
7438}
7439
7440impl futures::Stream for DirConnectorRouterEventStream {
7441    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
7442
7443    fn poll_next(
7444        mut self: std::pin::Pin<&mut Self>,
7445        cx: &mut std::task::Context<'_>,
7446    ) -> std::task::Poll<Option<Self::Item>> {
7447        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7448            &mut self.event_receiver,
7449            cx
7450        )?) {
7451            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
7452            None => std::task::Poll::Ready(None),
7453        }
7454    }
7455}
7456
7457#[derive(Debug)]
7458pub enum DirConnectorRouterEvent {
7459    #[non_exhaustive]
7460    _UnknownEvent {
7461        /// Ordinal of the event that was sent.
7462        ordinal: u64,
7463    },
7464}
7465
7466impl DirConnectorRouterEvent {
7467    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
7468    fn decode(
7469        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7470    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
7471        let (bytes, _handles) = buf.split_mut();
7472        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7473        debug_assert_eq!(tx_header.tx_id, 0);
7474        match tx_header.ordinal {
7475            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7476                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7477            }
7478            _ => Err(fidl::Error::UnknownOrdinal {
7479                ordinal: tx_header.ordinal,
7480                protocol_name:
7481                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7482            }),
7483        }
7484    }
7485}
7486
7487/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouter.
7488pub struct DirConnectorRouterRequestStream {
7489    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7490    is_terminated: bool,
7491}
7492
7493impl std::marker::Unpin for DirConnectorRouterRequestStream {}
7494
7495impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
7496    fn is_terminated(&self) -> bool {
7497        self.is_terminated
7498    }
7499}
7500
7501impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
7502    type Protocol = DirConnectorRouterMarker;
7503    type ControlHandle = DirConnectorRouterControlHandle;
7504
7505    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7506        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7507    }
7508
7509    fn control_handle(&self) -> Self::ControlHandle {
7510        DirConnectorRouterControlHandle { inner: self.inner.clone() }
7511    }
7512
7513    fn into_inner(
7514        self,
7515    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7516    {
7517        (self.inner, self.is_terminated)
7518    }
7519
7520    fn from_inner(
7521        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7522        is_terminated: bool,
7523    ) -> Self {
7524        Self { inner, is_terminated }
7525    }
7526}
7527
7528impl futures::Stream for DirConnectorRouterRequestStream {
7529    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
7530
7531    fn poll_next(
7532        mut self: std::pin::Pin<&mut Self>,
7533        cx: &mut std::task::Context<'_>,
7534    ) -> std::task::Poll<Option<Self::Item>> {
7535        let this = &mut *self;
7536        if this.inner.check_shutdown(cx) {
7537            this.is_terminated = true;
7538            return std::task::Poll::Ready(None);
7539        }
7540        if this.is_terminated {
7541            panic!("polled DirConnectorRouterRequestStream after completion");
7542        }
7543        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7544            |bytes, handles| {
7545                match this.inner.channel().read_etc(cx, bytes, handles) {
7546                    std::task::Poll::Ready(Ok(())) => {}
7547                    std::task::Poll::Pending => return std::task::Poll::Pending,
7548                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7549                        this.is_terminated = true;
7550                        return std::task::Poll::Ready(None);
7551                    }
7552                    std::task::Poll::Ready(Err(e)) => {
7553                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7554                            e.into(),
7555                        ))));
7556                    }
7557                }
7558
7559                // A message has been received from the channel
7560                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7561
7562                std::task::Poll::Ready(Some(match header.ordinal {
7563                0x233f2ac038127462 => {
7564                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7565                    let mut req = fidl::new_empty!(DirConnectorRouterRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7566                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7567                    let control_handle = DirConnectorRouterControlHandle {
7568                        inner: this.inner.clone(),
7569                    };
7570                    Ok(DirConnectorRouterRequest::Route {request: req.request,
7571instance_token: req.instance_token,
7572handle: req.handle,
7573
7574                        responder: DirConnectorRouterRouteResponder {
7575                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7576                            tx_id: header.tx_id,
7577                        },
7578                    })
7579                }
7580                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7581                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7582                        ordinal: header.ordinal,
7583                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7584                        method_type: fidl::MethodType::OneWay,
7585                    })
7586                }
7587                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7588                    this.inner.send_framework_err(
7589                        fidl::encoding::FrameworkErr::UnknownMethod,
7590                        header.tx_id,
7591                        header.ordinal,
7592                        header.dynamic_flags(),
7593                        (bytes, handles),
7594                    )?;
7595                    Ok(DirConnectorRouterRequest::_UnknownMethod {
7596                        ordinal: header.ordinal,
7597                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
7598                        method_type: fidl::MethodType::TwoWay,
7599                    })
7600                }
7601                _ => Err(fidl::Error::UnknownOrdinal {
7602                    ordinal: header.ordinal,
7603                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7604                }),
7605            }))
7606            },
7607        )
7608    }
7609}
7610
7611/// A factory for `DirConnector` capabilities.
7612#[derive(Debug)]
7613pub enum DirConnectorRouterRequest {
7614    /// Attempts to produce a `DirConnector` capability from this
7615    /// `DirConnectorRouter`.
7616    ///
7617    /// `request` contains context for this route, and `instance_token`
7618    /// references the component that the routing operation is being performed
7619    /// for.
7620    ///
7621    /// This will return:
7622    ///
7623    /// - `SUCCESS` if `handle` has been associated with a connector.
7624    /// - `UNAVAILABLE` if the capability is unavailable, in which case `handle`
7625    ///   will be closed.
7626    /// - An error, if the operation failed.
7627    Route {
7628        request: RouteRequest,
7629        instance_token: fidl::EventPair,
7630        handle: fidl::EventPair,
7631        responder: DirConnectorRouterRouteResponder,
7632    },
7633    /// An interaction was received which does not match any known method.
7634    #[non_exhaustive]
7635    _UnknownMethod {
7636        /// Ordinal of the method that was called.
7637        ordinal: u64,
7638        control_handle: DirConnectorRouterControlHandle,
7639        method_type: fidl::MethodType,
7640    },
7641}
7642
7643impl DirConnectorRouterRequest {
7644    #[allow(irrefutable_let_patterns)]
7645    pub fn into_route(
7646        self,
7647    ) -> Option<(RouteRequest, fidl::EventPair, fidl::EventPair, DirConnectorRouterRouteResponder)>
7648    {
7649        if let DirConnectorRouterRequest::Route { request, instance_token, handle, responder } =
7650            self
7651        {
7652            Some((request, instance_token, handle, responder))
7653        } else {
7654            None
7655        }
7656    }
7657
7658    /// Name of the method defined in FIDL
7659    pub fn method_name(&self) -> &'static str {
7660        match *self {
7661            DirConnectorRouterRequest::Route { .. } => "route",
7662            DirConnectorRouterRequest::_UnknownMethod {
7663                method_type: fidl::MethodType::OneWay,
7664                ..
7665            } => "unknown one-way method",
7666            DirConnectorRouterRequest::_UnknownMethod {
7667                method_type: fidl::MethodType::TwoWay,
7668                ..
7669            } => "unknown two-way method",
7670        }
7671    }
7672}
7673
7674#[derive(Debug, Clone)]
7675pub struct DirConnectorRouterControlHandle {
7676    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7677}
7678
7679impl DirConnectorRouterControlHandle {
7680    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7681        self.inner.shutdown_with_epitaph(status.into())
7682    }
7683}
7684
7685impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
7686    fn shutdown(&self) {
7687        self.inner.shutdown()
7688    }
7689
7690    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7691        self.inner.shutdown_with_epitaph(status)
7692    }
7693
7694    fn is_closed(&self) -> bool {
7695        self.inner.channel().is_closed()
7696    }
7697    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7698        self.inner.channel().on_closed()
7699    }
7700
7701    #[cfg(target_os = "fuchsia")]
7702    fn signal_peer(
7703        &self,
7704        clear_mask: zx::Signals,
7705        set_mask: zx::Signals,
7706    ) -> Result<(), zx_status::Status> {
7707        use fidl::Peered;
7708        self.inner.channel().signal_peer(clear_mask, set_mask)
7709    }
7710}
7711
7712impl DirConnectorRouterControlHandle {}
7713
7714#[must_use = "FIDL methods require a response to be sent"]
7715#[derive(Debug)]
7716pub struct DirConnectorRouterRouteResponder {
7717    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
7718    tx_id: u32,
7719}
7720
7721/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
7722/// if the responder is dropped without sending a response, so that the client
7723/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7724impl std::ops::Drop for DirConnectorRouterRouteResponder {
7725    fn drop(&mut self) {
7726        self.control_handle.shutdown();
7727        // Safety: drops once, never accessed again
7728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7729    }
7730}
7731
7732impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
7733    type ControlHandle = DirConnectorRouterControlHandle;
7734
7735    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
7736        &self.control_handle
7737    }
7738
7739    fn drop_without_shutdown(mut self) {
7740        // Safety: drops once, never accessed again due to mem::forget
7741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7742        // Prevent Drop from running (which would shut down the channel)
7743        std::mem::forget(self);
7744    }
7745}
7746
7747impl DirConnectorRouterRouteResponder {
7748    /// Sends a response to the FIDL transaction.
7749    ///
7750    /// Sets the channel to shutdown if an error occurs.
7751    pub fn send(self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7752        let _result = self.send_raw(result);
7753        if _result.is_err() {
7754            self.control_handle.shutdown();
7755        }
7756        self.drop_without_shutdown();
7757        _result
7758    }
7759
7760    /// Similar to "send" but does not shutdown the channel if an error occurs.
7761    pub fn send_no_shutdown_on_err(
7762        self,
7763        mut result: Result<RouterResponse, i32>,
7764    ) -> Result<(), fidl::Error> {
7765        let _result = self.send_raw(result);
7766        self.drop_without_shutdown();
7767        _result
7768    }
7769
7770    fn send_raw(&self, mut result: Result<RouterResponse, i32>) -> Result<(), fidl::Error> {
7771        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7772            DirConnectorRouterRouteResponse,
7773            i32,
7774        >>(
7775            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7776            self.tx_id,
7777            0x233f2ac038127462,
7778            fidl::encoding::DynamicFlags::FLEXIBLE,
7779        )
7780    }
7781}
7782
7783#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7784pub struct DirReceiverMarker;
7785
7786impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
7787    type Proxy = DirReceiverProxy;
7788    type RequestStream = DirReceiverRequestStream;
7789    #[cfg(target_os = "fuchsia")]
7790    type SynchronousProxy = DirReceiverSynchronousProxy;
7791
7792    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.DirReceiver";
7793}
7794impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
7795
7796pub trait DirReceiverProxyInterface: Send + Sync {
7797    fn r#receive(
7798        &self,
7799        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7800        path: &str,
7801        rights: fidl_fuchsia_io::Flags,
7802    ) -> Result<(), fidl::Error>;
7803}
7804#[derive(Debug)]
7805#[cfg(target_os = "fuchsia")]
7806pub struct DirReceiverSynchronousProxy {
7807    client: fidl::client::sync::Client,
7808}
7809
7810#[cfg(target_os = "fuchsia")]
7811impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
7812    type Proxy = DirReceiverProxy;
7813    type Protocol = DirReceiverMarker;
7814
7815    fn from_channel(inner: fidl::Channel) -> Self {
7816        Self::new(inner)
7817    }
7818
7819    fn into_channel(self) -> fidl::Channel {
7820        self.client.into_channel()
7821    }
7822
7823    fn as_channel(&self) -> &fidl::Channel {
7824        self.client.as_channel()
7825    }
7826}
7827
7828#[cfg(target_os = "fuchsia")]
7829impl DirReceiverSynchronousProxy {
7830    pub fn new(channel: fidl::Channel) -> Self {
7831        Self { client: fidl::client::sync::Client::new(channel) }
7832    }
7833
7834    pub fn into_channel(self) -> fidl::Channel {
7835        self.client.into_channel()
7836    }
7837
7838    /// Waits until an event arrives and returns it. It is safe for other
7839    /// threads to make concurrent requests while waiting for an event.
7840    pub fn wait_for_event(
7841        &self,
7842        deadline: zx::MonotonicInstant,
7843    ) -> Result<DirReceiverEvent, fidl::Error> {
7844        DirReceiverEvent::decode(self.client.wait_for_event::<DirReceiverMarker>(deadline)?)
7845    }
7846
7847    /// `Receive` will be called by component manager whenever a new handle has
7848    /// been given to any `DirConnector` associated with this `DirReceiver`.
7849    pub fn r#receive(
7850        &self,
7851        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7852        mut path: &str,
7853        mut rights: fidl_fuchsia_io::Flags,
7854    ) -> Result<(), fidl::Error> {
7855        self.client.send::<DirReceiverReceiveRequest>(
7856            (channel, path, rights),
7857            0x4ac564d726bb325e,
7858            fidl::encoding::DynamicFlags::empty(),
7859        )
7860    }
7861}
7862
7863#[cfg(target_os = "fuchsia")]
7864impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
7865    fn from(value: DirReceiverSynchronousProxy) -> Self {
7866        value.into_channel().into()
7867    }
7868}
7869
7870#[cfg(target_os = "fuchsia")]
7871impl From<fidl::Channel> for DirReceiverSynchronousProxy {
7872    fn from(value: fidl::Channel) -> Self {
7873        Self::new(value)
7874    }
7875}
7876
7877#[cfg(target_os = "fuchsia")]
7878impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
7879    type Protocol = DirReceiverMarker;
7880
7881    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
7882        Self::new(value.into_channel())
7883    }
7884}
7885
7886#[derive(Debug, Clone)]
7887pub struct DirReceiverProxy {
7888    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7889}
7890
7891impl fidl::endpoints::Proxy for DirReceiverProxy {
7892    type Protocol = DirReceiverMarker;
7893
7894    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7895        Self::new(inner)
7896    }
7897
7898    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7899        self.client.into_channel().map_err(|client| Self { client })
7900    }
7901
7902    fn as_channel(&self) -> &::fidl::AsyncChannel {
7903        self.client.as_channel()
7904    }
7905}
7906
7907impl DirReceiverProxy {
7908    /// Create a new Proxy for fuchsia.component.runtime/DirReceiver.
7909    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7910        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7911        Self { client: fidl::client::Client::new(channel, protocol_name) }
7912    }
7913
7914    /// Get a Stream of events from the remote end of the protocol.
7915    ///
7916    /// # Panics
7917    ///
7918    /// Panics if the event stream was already taken.
7919    pub fn take_event_stream(&self) -> DirReceiverEventStream {
7920        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
7921    }
7922
7923    /// `Receive` will be called by component manager whenever a new handle has
7924    /// been given to any `DirConnector` associated with this `DirReceiver`.
7925    pub fn r#receive(
7926        &self,
7927        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7928        mut path: &str,
7929        mut rights: fidl_fuchsia_io::Flags,
7930    ) -> Result<(), fidl::Error> {
7931        DirReceiverProxyInterface::r#receive(self, channel, path, rights)
7932    }
7933}
7934
7935impl DirReceiverProxyInterface for DirReceiverProxy {
7936    fn r#receive(
7937        &self,
7938        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
7939        mut path: &str,
7940        mut rights: fidl_fuchsia_io::Flags,
7941    ) -> Result<(), fidl::Error> {
7942        self.client.send::<DirReceiverReceiveRequest>(
7943            (channel, path, rights),
7944            0x4ac564d726bb325e,
7945            fidl::encoding::DynamicFlags::empty(),
7946        )
7947    }
7948}
7949
7950pub struct DirReceiverEventStream {
7951    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7952}
7953
7954impl std::marker::Unpin for DirReceiverEventStream {}
7955
7956impl futures::stream::FusedStream for DirReceiverEventStream {
7957    fn is_terminated(&self) -> bool {
7958        self.event_receiver.is_terminated()
7959    }
7960}
7961
7962impl futures::Stream for DirReceiverEventStream {
7963    type Item = Result<DirReceiverEvent, fidl::Error>;
7964
7965    fn poll_next(
7966        mut self: std::pin::Pin<&mut Self>,
7967        cx: &mut std::task::Context<'_>,
7968    ) -> std::task::Poll<Option<Self::Item>> {
7969        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7970            &mut self.event_receiver,
7971            cx
7972        )?) {
7973            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
7974            None => std::task::Poll::Ready(None),
7975        }
7976    }
7977}
7978
7979#[derive(Debug)]
7980pub enum DirReceiverEvent {}
7981
7982impl DirReceiverEvent {
7983    /// Decodes a message buffer as a [`DirReceiverEvent`].
7984    fn decode(
7985        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7986    ) -> Result<DirReceiverEvent, fidl::Error> {
7987        let (bytes, _handles) = buf.split_mut();
7988        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7989        debug_assert_eq!(tx_header.tx_id, 0);
7990        match tx_header.ordinal {
7991            _ => Err(fidl::Error::UnknownOrdinal {
7992                ordinal: tx_header.ordinal,
7993                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7994            }),
7995        }
7996    }
7997}
7998
7999/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiver.
8000pub struct DirReceiverRequestStream {
8001    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8002    is_terminated: bool,
8003}
8004
8005impl std::marker::Unpin for DirReceiverRequestStream {}
8006
8007impl futures::stream::FusedStream for DirReceiverRequestStream {
8008    fn is_terminated(&self) -> bool {
8009        self.is_terminated
8010    }
8011}
8012
8013impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
8014    type Protocol = DirReceiverMarker;
8015    type ControlHandle = DirReceiverControlHandle;
8016
8017    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8018        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8019    }
8020
8021    fn control_handle(&self) -> Self::ControlHandle {
8022        DirReceiverControlHandle { inner: self.inner.clone() }
8023    }
8024
8025    fn into_inner(
8026        self,
8027    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8028    {
8029        (self.inner, self.is_terminated)
8030    }
8031
8032    fn from_inner(
8033        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8034        is_terminated: bool,
8035    ) -> Self {
8036        Self { inner, is_terminated }
8037    }
8038}
8039
8040impl futures::Stream for DirReceiverRequestStream {
8041    type Item = Result<DirReceiverRequest, fidl::Error>;
8042
8043    fn poll_next(
8044        mut self: std::pin::Pin<&mut Self>,
8045        cx: &mut std::task::Context<'_>,
8046    ) -> std::task::Poll<Option<Self::Item>> {
8047        let this = &mut *self;
8048        if this.inner.check_shutdown(cx) {
8049            this.is_terminated = true;
8050            return std::task::Poll::Ready(None);
8051        }
8052        if this.is_terminated {
8053            panic!("polled DirReceiverRequestStream after completion");
8054        }
8055        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8056            |bytes, handles| {
8057                match this.inner.channel().read_etc(cx, bytes, handles) {
8058                    std::task::Poll::Ready(Ok(())) => {}
8059                    std::task::Poll::Pending => return std::task::Poll::Pending,
8060                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8061                        this.is_terminated = true;
8062                        return std::task::Poll::Ready(None);
8063                    }
8064                    std::task::Poll::Ready(Err(e)) => {
8065                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8066                            e.into(),
8067                        ))));
8068                    }
8069                }
8070
8071                // A message has been received from the channel
8072                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8073
8074                std::task::Poll::Ready(Some(match header.ordinal {
8075                    0x4ac564d726bb325e => {
8076                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8077                        let mut req = fidl::new_empty!(
8078                            DirReceiverReceiveRequest,
8079                            fidl::encoding::DefaultFuchsiaResourceDialect
8080                        );
8081                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8082                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
8083                        Ok(DirReceiverRequest::Receive {
8084                            channel: req.channel,
8085                            path: req.path,
8086                            rights: req.rights,
8087
8088                            control_handle,
8089                        })
8090                    }
8091                    _ => Err(fidl::Error::UnknownOrdinal {
8092                        ordinal: header.ordinal,
8093                        protocol_name:
8094                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8095                    }),
8096                }))
8097            },
8098        )
8099    }
8100}
8101
8102/// A `DirReceiver` represents the receiving end of a `DirConnector`.
8103#[derive(Debug)]
8104pub enum DirReceiverRequest {
8105    /// `Receive` will be called by component manager whenever a new handle has
8106    /// been given to any `DirConnector` associated with this `DirReceiver`.
8107    Receive {
8108        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8109        path: String,
8110        rights: fidl_fuchsia_io::Flags,
8111        control_handle: DirReceiverControlHandle,
8112    },
8113}
8114
8115impl DirReceiverRequest {
8116    #[allow(irrefutable_let_patterns)]
8117    pub fn into_receive(
8118        self,
8119    ) -> Option<(
8120        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8121        String,
8122        fidl_fuchsia_io::Flags,
8123        DirReceiverControlHandle,
8124    )> {
8125        if let DirReceiverRequest::Receive { channel, path, rights, control_handle } = self {
8126            Some((channel, path, rights, control_handle))
8127        } else {
8128            None
8129        }
8130    }
8131
8132    /// Name of the method defined in FIDL
8133    pub fn method_name(&self) -> &'static str {
8134        match *self {
8135            DirReceiverRequest::Receive { .. } => "receive",
8136        }
8137    }
8138}
8139
8140#[derive(Debug, Clone)]
8141pub struct DirReceiverControlHandle {
8142    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8143}
8144
8145impl DirReceiverControlHandle {
8146    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8147        self.inner.shutdown_with_epitaph(status.into())
8148    }
8149}
8150
8151impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
8152    fn shutdown(&self) {
8153        self.inner.shutdown()
8154    }
8155
8156    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8157        self.inner.shutdown_with_epitaph(status)
8158    }
8159
8160    fn is_closed(&self) -> bool {
8161        self.inner.channel().is_closed()
8162    }
8163    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8164        self.inner.channel().on_closed()
8165    }
8166
8167    #[cfg(target_os = "fuchsia")]
8168    fn signal_peer(
8169        &self,
8170        clear_mask: zx::Signals,
8171        set_mask: zx::Signals,
8172    ) -> Result<(), zx_status::Status> {
8173        use fidl::Peered;
8174        self.inner.channel().signal_peer(clear_mask, set_mask)
8175    }
8176}
8177
8178impl DirReceiverControlHandle {}
8179
8180#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8181pub struct ReceiverMarker;
8182
8183impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
8184    type Proxy = ReceiverProxy;
8185    type RequestStream = ReceiverRequestStream;
8186    #[cfg(target_os = "fuchsia")]
8187    type SynchronousProxy = ReceiverSynchronousProxy;
8188
8189    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Receiver";
8190}
8191impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
8192
8193pub trait ReceiverProxyInterface: Send + Sync {
8194    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
8195}
8196#[derive(Debug)]
8197#[cfg(target_os = "fuchsia")]
8198pub struct ReceiverSynchronousProxy {
8199    client: fidl::client::sync::Client,
8200}
8201
8202#[cfg(target_os = "fuchsia")]
8203impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
8204    type Proxy = ReceiverProxy;
8205    type Protocol = ReceiverMarker;
8206
8207    fn from_channel(inner: fidl::Channel) -> Self {
8208        Self::new(inner)
8209    }
8210
8211    fn into_channel(self) -> fidl::Channel {
8212        self.client.into_channel()
8213    }
8214
8215    fn as_channel(&self) -> &fidl::Channel {
8216        self.client.as_channel()
8217    }
8218}
8219
8220#[cfg(target_os = "fuchsia")]
8221impl ReceiverSynchronousProxy {
8222    pub fn new(channel: fidl::Channel) -> Self {
8223        Self { client: fidl::client::sync::Client::new(channel) }
8224    }
8225
8226    pub fn into_channel(self) -> fidl::Channel {
8227        self.client.into_channel()
8228    }
8229
8230    /// Waits until an event arrives and returns it. It is safe for other
8231    /// threads to make concurrent requests while waiting for an event.
8232    pub fn wait_for_event(
8233        &self,
8234        deadline: zx::MonotonicInstant,
8235    ) -> Result<ReceiverEvent, fidl::Error> {
8236        ReceiverEvent::decode(self.client.wait_for_event::<ReceiverMarker>(deadline)?)
8237    }
8238
8239    /// `Receive` will be called by component manager whenever an new handle has
8240    /// been given to any `Connector` associated with this `Receiver`.
8241    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8242        self.client.send::<ReceiverReceiveRequest>(
8243            (channel,),
8244            0x609ca5c7943b58d0,
8245            fidl::encoding::DynamicFlags::empty(),
8246        )
8247    }
8248}
8249
8250#[cfg(target_os = "fuchsia")]
8251impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
8252    fn from(value: ReceiverSynchronousProxy) -> Self {
8253        value.into_channel().into()
8254    }
8255}
8256
8257#[cfg(target_os = "fuchsia")]
8258impl From<fidl::Channel> for ReceiverSynchronousProxy {
8259    fn from(value: fidl::Channel) -> Self {
8260        Self::new(value)
8261    }
8262}
8263
8264#[cfg(target_os = "fuchsia")]
8265impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
8266    type Protocol = ReceiverMarker;
8267
8268    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
8269        Self::new(value.into_channel())
8270    }
8271}
8272
8273#[derive(Debug, Clone)]
8274pub struct ReceiverProxy {
8275    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8276}
8277
8278impl fidl::endpoints::Proxy for ReceiverProxy {
8279    type Protocol = ReceiverMarker;
8280
8281    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8282        Self::new(inner)
8283    }
8284
8285    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8286        self.client.into_channel().map_err(|client| Self { client })
8287    }
8288
8289    fn as_channel(&self) -> &::fidl::AsyncChannel {
8290        self.client.as_channel()
8291    }
8292}
8293
8294impl ReceiverProxy {
8295    /// Create a new Proxy for fuchsia.component.runtime/Receiver.
8296    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8297        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8298        Self { client: fidl::client::Client::new(channel, protocol_name) }
8299    }
8300
8301    /// Get a Stream of events from the remote end of the protocol.
8302    ///
8303    /// # Panics
8304    ///
8305    /// Panics if the event stream was already taken.
8306    pub fn take_event_stream(&self) -> ReceiverEventStream {
8307        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
8308    }
8309
8310    /// `Receive` will be called by component manager whenever an new handle has
8311    /// been given to any `Connector` associated with this `Receiver`.
8312    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8313        ReceiverProxyInterface::r#receive(self, channel)
8314    }
8315}
8316
8317impl ReceiverProxyInterface for ReceiverProxy {
8318    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
8319        self.client.send::<ReceiverReceiveRequest>(
8320            (channel,),
8321            0x609ca5c7943b58d0,
8322            fidl::encoding::DynamicFlags::empty(),
8323        )
8324    }
8325}
8326
8327pub struct ReceiverEventStream {
8328    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8329}
8330
8331impl std::marker::Unpin for ReceiverEventStream {}
8332
8333impl futures::stream::FusedStream for ReceiverEventStream {
8334    fn is_terminated(&self) -> bool {
8335        self.event_receiver.is_terminated()
8336    }
8337}
8338
8339impl futures::Stream for ReceiverEventStream {
8340    type Item = Result<ReceiverEvent, fidl::Error>;
8341
8342    fn poll_next(
8343        mut self: std::pin::Pin<&mut Self>,
8344        cx: &mut std::task::Context<'_>,
8345    ) -> std::task::Poll<Option<Self::Item>> {
8346        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8347            &mut self.event_receiver,
8348            cx
8349        )?) {
8350            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
8351            None => std::task::Poll::Ready(None),
8352        }
8353    }
8354}
8355
8356#[derive(Debug)]
8357pub enum ReceiverEvent {}
8358
8359impl ReceiverEvent {
8360    /// Decodes a message buffer as a [`ReceiverEvent`].
8361    fn decode(
8362        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8363    ) -> Result<ReceiverEvent, fidl::Error> {
8364        let (bytes, _handles) = buf.split_mut();
8365        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8366        debug_assert_eq!(tx_header.tx_id, 0);
8367        match tx_header.ordinal {
8368            _ => Err(fidl::Error::UnknownOrdinal {
8369                ordinal: tx_header.ordinal,
8370                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8371            }),
8372        }
8373    }
8374}
8375
8376/// A Stream of incoming requests for fuchsia.component.runtime/Receiver.
8377pub struct ReceiverRequestStream {
8378    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8379    is_terminated: bool,
8380}
8381
8382impl std::marker::Unpin for ReceiverRequestStream {}
8383
8384impl futures::stream::FusedStream for ReceiverRequestStream {
8385    fn is_terminated(&self) -> bool {
8386        self.is_terminated
8387    }
8388}
8389
8390impl fidl::endpoints::RequestStream for ReceiverRequestStream {
8391    type Protocol = ReceiverMarker;
8392    type ControlHandle = ReceiverControlHandle;
8393
8394    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8395        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8396    }
8397
8398    fn control_handle(&self) -> Self::ControlHandle {
8399        ReceiverControlHandle { inner: self.inner.clone() }
8400    }
8401
8402    fn into_inner(
8403        self,
8404    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8405    {
8406        (self.inner, self.is_terminated)
8407    }
8408
8409    fn from_inner(
8410        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8411        is_terminated: bool,
8412    ) -> Self {
8413        Self { inner, is_terminated }
8414    }
8415}
8416
8417impl futures::Stream for ReceiverRequestStream {
8418    type Item = Result<ReceiverRequest, fidl::Error>;
8419
8420    fn poll_next(
8421        mut self: std::pin::Pin<&mut Self>,
8422        cx: &mut std::task::Context<'_>,
8423    ) -> std::task::Poll<Option<Self::Item>> {
8424        let this = &mut *self;
8425        if this.inner.check_shutdown(cx) {
8426            this.is_terminated = true;
8427            return std::task::Poll::Ready(None);
8428        }
8429        if this.is_terminated {
8430            panic!("polled ReceiverRequestStream after completion");
8431        }
8432        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8433            |bytes, handles| {
8434                match this.inner.channel().read_etc(cx, bytes, handles) {
8435                    std::task::Poll::Ready(Ok(())) => {}
8436                    std::task::Poll::Pending => return std::task::Poll::Pending,
8437                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8438                        this.is_terminated = true;
8439                        return std::task::Poll::Ready(None);
8440                    }
8441                    std::task::Poll::Ready(Err(e)) => {
8442                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8443                            e.into(),
8444                        ))));
8445                    }
8446                }
8447
8448                // A message has been received from the channel
8449                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8450
8451                std::task::Poll::Ready(Some(match header.ordinal {
8452                    0x609ca5c7943b58d0 => {
8453                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8454                        let mut req = fidl::new_empty!(
8455                            ReceiverReceiveRequest,
8456                            fidl::encoding::DefaultFuchsiaResourceDialect
8457                        );
8458                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
8459                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
8460                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
8461                    }
8462                    _ => Err(fidl::Error::UnknownOrdinal {
8463                        ordinal: header.ordinal,
8464                        protocol_name:
8465                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8466                    }),
8467                }))
8468            },
8469        )
8470    }
8471}
8472
8473/// A `Receiver` represents the receiving end of a `Connector`.
8474#[derive(Debug)]
8475pub enum ReceiverRequest {
8476    /// `Receive` will be called by component manager whenever an new handle has
8477    /// been given to any `Connector` associated with this `Receiver`.
8478    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
8479}
8480
8481impl ReceiverRequest {
8482    #[allow(irrefutable_let_patterns)]
8483    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
8484        if let ReceiverRequest::Receive { channel, control_handle } = self {
8485            Some((channel, control_handle))
8486        } else {
8487            None
8488        }
8489    }
8490
8491    /// Name of the method defined in FIDL
8492    pub fn method_name(&self) -> &'static str {
8493        match *self {
8494            ReceiverRequest::Receive { .. } => "receive",
8495        }
8496    }
8497}
8498
8499#[derive(Debug, Clone)]
8500pub struct ReceiverControlHandle {
8501    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8502}
8503
8504impl ReceiverControlHandle {
8505    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8506        self.inner.shutdown_with_epitaph(status.into())
8507    }
8508}
8509
8510impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
8511    fn shutdown(&self) {
8512        self.inner.shutdown()
8513    }
8514
8515    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8516        self.inner.shutdown_with_epitaph(status)
8517    }
8518
8519    fn is_closed(&self) -> bool {
8520        self.inner.channel().is_closed()
8521    }
8522    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8523        self.inner.channel().on_closed()
8524    }
8525
8526    #[cfg(target_os = "fuchsia")]
8527    fn signal_peer(
8528        &self,
8529        clear_mask: zx::Signals,
8530        set_mask: zx::Signals,
8531    ) -> Result<(), zx_status::Status> {
8532        use fidl::Peered;
8533        self.inner.channel().signal_peer(clear_mask, set_mask)
8534    }
8535}
8536
8537impl ReceiverControlHandle {}
8538
8539mod internal {
8540    use super::*;
8541
8542    impl fidl::encoding::ResourceTypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8543        type Borrowed<'a> = &'a mut Self;
8544        fn take_or_borrow<'a>(
8545            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8546        ) -> Self::Borrowed<'a> {
8547            value
8548        }
8549    }
8550
8551    unsafe impl fidl::encoding::TypeMarker for CapabilitiesCapabilityAssociateHandleRequest {
8552        type Owned = Self;
8553
8554        #[inline(always)]
8555        fn inline_align(_context: fidl::encoding::Context) -> usize {
8556            4
8557        }
8558
8559        #[inline(always)]
8560        fn inline_size(_context: fidl::encoding::Context) -> usize {
8561            8
8562        }
8563    }
8564
8565    unsafe impl
8566        fidl::encoding::Encode<
8567            CapabilitiesCapabilityAssociateHandleRequest,
8568            fidl::encoding::DefaultFuchsiaResourceDialect,
8569        > for &mut CapabilitiesCapabilityAssociateHandleRequest
8570    {
8571        #[inline]
8572        unsafe fn encode(
8573            self,
8574            encoder: &mut fidl::encoding::Encoder<
8575                '_,
8576                fidl::encoding::DefaultFuchsiaResourceDialect,
8577            >,
8578            offset: usize,
8579            _depth: fidl::encoding::Depth,
8580        ) -> fidl::Result<()> {
8581            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8582            // Delegate to tuple encoding.
8583            fidl::encoding::Encode::<
8584                CapabilitiesCapabilityAssociateHandleRequest,
8585                fidl::encoding::DefaultFuchsiaResourceDialect,
8586            >::encode(
8587                (
8588                    <fidl::encoding::HandleType<
8589                        fidl::EventPair,
8590                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8591                        2147483648,
8592                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8593                        &mut self.capability_handle,
8594                    ),
8595                    <fidl::encoding::HandleType<
8596                        fidl::EventPair,
8597                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8598                        2147483648,
8599                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8600                        &mut self.other_handle,
8601                    ),
8602                ),
8603                encoder,
8604                offset,
8605                _depth,
8606            )
8607        }
8608    }
8609    unsafe impl<
8610        T0: fidl::encoding::Encode<
8611                fidl::encoding::HandleType<
8612                    fidl::EventPair,
8613                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8614                    2147483648,
8615                >,
8616                fidl::encoding::DefaultFuchsiaResourceDialect,
8617            >,
8618        T1: fidl::encoding::Encode<
8619                fidl::encoding::HandleType<
8620                    fidl::EventPair,
8621                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8622                    2147483648,
8623                >,
8624                fidl::encoding::DefaultFuchsiaResourceDialect,
8625            >,
8626    >
8627        fidl::encoding::Encode<
8628            CapabilitiesCapabilityAssociateHandleRequest,
8629            fidl::encoding::DefaultFuchsiaResourceDialect,
8630        > for (T0, T1)
8631    {
8632        #[inline]
8633        unsafe fn encode(
8634            self,
8635            encoder: &mut fidl::encoding::Encoder<
8636                '_,
8637                fidl::encoding::DefaultFuchsiaResourceDialect,
8638            >,
8639            offset: usize,
8640            depth: fidl::encoding::Depth,
8641        ) -> fidl::Result<()> {
8642            encoder.debug_check_bounds::<CapabilitiesCapabilityAssociateHandleRequest>(offset);
8643            // Zero out padding regions. There's no need to apply masks
8644            // because the unmasked parts will be overwritten by fields.
8645            // Write the fields.
8646            self.0.encode(encoder, offset + 0, depth)?;
8647            self.1.encode(encoder, offset + 4, depth)?;
8648            Ok(())
8649        }
8650    }
8651
8652    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8653        for CapabilitiesCapabilityAssociateHandleRequest
8654    {
8655        #[inline(always)]
8656        fn new_empty() -> Self {
8657            Self {
8658                capability_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8659                other_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8660            }
8661        }
8662
8663        #[inline]
8664        unsafe fn decode(
8665            &mut self,
8666            decoder: &mut fidl::encoding::Decoder<
8667                '_,
8668                fidl::encoding::DefaultFuchsiaResourceDialect,
8669            >,
8670            offset: usize,
8671            _depth: fidl::encoding::Depth,
8672        ) -> fidl::Result<()> {
8673            decoder.debug_check_bounds::<Self>(offset);
8674            // Verify that padding bytes are zero.
8675            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.capability_handle, decoder, offset + 0, _depth)?;
8676            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.other_handle, decoder, offset + 4, _depth)?;
8677            Ok(())
8678        }
8679    }
8680
8681    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorCreateRequest {
8682        type Borrowed<'a> = &'a mut Self;
8683        fn take_or_borrow<'a>(
8684            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8685        ) -> Self::Borrowed<'a> {
8686            value
8687        }
8688    }
8689
8690    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorCreateRequest {
8691        type Owned = Self;
8692
8693        #[inline(always)]
8694        fn inline_align(_context: fidl::encoding::Context) -> usize {
8695            4
8696        }
8697
8698        #[inline(always)]
8699        fn inline_size(_context: fidl::encoding::Context) -> usize {
8700            8
8701        }
8702    }
8703
8704    unsafe impl
8705        fidl::encoding::Encode<
8706            CapabilitiesConnectorCreateRequest,
8707            fidl::encoding::DefaultFuchsiaResourceDialect,
8708        > for &mut CapabilitiesConnectorCreateRequest
8709    {
8710        #[inline]
8711        unsafe fn encode(
8712            self,
8713            encoder: &mut fidl::encoding::Encoder<
8714                '_,
8715                fidl::encoding::DefaultFuchsiaResourceDialect,
8716            >,
8717            offset: usize,
8718            _depth: fidl::encoding::Depth,
8719        ) -> fidl::Result<()> {
8720            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8721            // Delegate to tuple encoding.
8722            fidl::encoding::Encode::<CapabilitiesConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8723                (
8724                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector),
8725                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
8726                ),
8727                encoder, offset, _depth
8728            )
8729        }
8730    }
8731    unsafe impl<
8732        T0: fidl::encoding::Encode<
8733                fidl::encoding::HandleType<
8734                    fidl::EventPair,
8735                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8736                    2147483648,
8737                >,
8738                fidl::encoding::DefaultFuchsiaResourceDialect,
8739            >,
8740        T1: fidl::encoding::Encode<
8741                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8742                fidl::encoding::DefaultFuchsiaResourceDialect,
8743            >,
8744    >
8745        fidl::encoding::Encode<
8746            CapabilitiesConnectorCreateRequest,
8747            fidl::encoding::DefaultFuchsiaResourceDialect,
8748        > for (T0, T1)
8749    {
8750        #[inline]
8751        unsafe fn encode(
8752            self,
8753            encoder: &mut fidl::encoding::Encoder<
8754                '_,
8755                fidl::encoding::DefaultFuchsiaResourceDialect,
8756            >,
8757            offset: usize,
8758            depth: fidl::encoding::Depth,
8759        ) -> fidl::Result<()> {
8760            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
8761            // Zero out padding regions. There's no need to apply masks
8762            // because the unmasked parts will be overwritten by fields.
8763            // Write the fields.
8764            self.0.encode(encoder, offset + 0, depth)?;
8765            self.1.encode(encoder, offset + 4, depth)?;
8766            Ok(())
8767        }
8768    }
8769
8770    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8771        for CapabilitiesConnectorCreateRequest
8772    {
8773        #[inline(always)]
8774        fn new_empty() -> Self {
8775            Self {
8776                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8777                receiver_client_end: fidl::new_empty!(
8778                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8779                    fidl::encoding::DefaultFuchsiaResourceDialect
8780                ),
8781            }
8782        }
8783
8784        #[inline]
8785        unsafe fn decode(
8786            &mut self,
8787            decoder: &mut fidl::encoding::Decoder<
8788                '_,
8789                fidl::encoding::DefaultFuchsiaResourceDialect,
8790            >,
8791            offset: usize,
8792            _depth: fidl::encoding::Depth,
8793        ) -> fidl::Result<()> {
8794            decoder.debug_check_bounds::<Self>(offset);
8795            // Verify that padding bytes are zero.
8796            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8797            fidl::decode!(
8798                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
8799                fidl::encoding::DefaultFuchsiaResourceDialect,
8800                &mut self.receiver_client_end,
8801                decoder,
8802                offset + 4,
8803                _depth
8804            )?;
8805            Ok(())
8806        }
8807    }
8808
8809    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorOpenRequest {
8810        type Borrowed<'a> = &'a mut Self;
8811        fn take_or_borrow<'a>(
8812            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8813        ) -> Self::Borrowed<'a> {
8814            value
8815        }
8816    }
8817
8818    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorOpenRequest {
8819        type Owned = Self;
8820
8821        #[inline(always)]
8822        fn inline_align(_context: fidl::encoding::Context) -> usize {
8823            4
8824        }
8825
8826        #[inline(always)]
8827        fn inline_size(_context: fidl::encoding::Context) -> usize {
8828            8
8829        }
8830    }
8831
8832    unsafe impl
8833        fidl::encoding::Encode<
8834            CapabilitiesConnectorOpenRequest,
8835            fidl::encoding::DefaultFuchsiaResourceDialect,
8836        > for &mut CapabilitiesConnectorOpenRequest
8837    {
8838        #[inline]
8839        unsafe fn encode(
8840            self,
8841            encoder: &mut fidl::encoding::Encoder<
8842                '_,
8843                fidl::encoding::DefaultFuchsiaResourceDialect,
8844            >,
8845            offset: usize,
8846            _depth: fidl::encoding::Depth,
8847        ) -> fidl::Result<()> {
8848            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8849            // Delegate to tuple encoding.
8850            fidl::encoding::Encode::<
8851                CapabilitiesConnectorOpenRequest,
8852                fidl::encoding::DefaultFuchsiaResourceDialect,
8853            >::encode(
8854                (
8855                    <fidl::encoding::HandleType<
8856                        fidl::EventPair,
8857                        { fidl::ObjectType::EVENTPAIR.into_raw() },
8858                        2147483648,
8859                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8860                        &mut self.connector
8861                    ),
8862                    <fidl::encoding::HandleType<
8863                        fidl::Channel,
8864                        { fidl::ObjectType::CHANNEL.into_raw() },
8865                        2147483648,
8866                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8867                        &mut self.channel
8868                    ),
8869                ),
8870                encoder,
8871                offset,
8872                _depth,
8873            )
8874        }
8875    }
8876    unsafe impl<
8877        T0: fidl::encoding::Encode<
8878                fidl::encoding::HandleType<
8879                    fidl::EventPair,
8880                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8881                    2147483648,
8882                >,
8883                fidl::encoding::DefaultFuchsiaResourceDialect,
8884            >,
8885        T1: fidl::encoding::Encode<
8886                fidl::encoding::HandleType<
8887                    fidl::Channel,
8888                    { fidl::ObjectType::CHANNEL.into_raw() },
8889                    2147483648,
8890                >,
8891                fidl::encoding::DefaultFuchsiaResourceDialect,
8892            >,
8893    >
8894        fidl::encoding::Encode<
8895            CapabilitiesConnectorOpenRequest,
8896            fidl::encoding::DefaultFuchsiaResourceDialect,
8897        > for (T0, T1)
8898    {
8899        #[inline]
8900        unsafe fn encode(
8901            self,
8902            encoder: &mut fidl::encoding::Encoder<
8903                '_,
8904                fidl::encoding::DefaultFuchsiaResourceDialect,
8905            >,
8906            offset: usize,
8907            depth: fidl::encoding::Depth,
8908        ) -> fidl::Result<()> {
8909            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
8910            // Zero out padding regions. There's no need to apply masks
8911            // because the unmasked parts will be overwritten by fields.
8912            // Write the fields.
8913            self.0.encode(encoder, offset + 0, depth)?;
8914            self.1.encode(encoder, offset + 4, depth)?;
8915            Ok(())
8916        }
8917    }
8918
8919    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8920        for CapabilitiesConnectorOpenRequest
8921    {
8922        #[inline(always)]
8923        fn new_empty() -> Self {
8924            Self {
8925                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8926                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8927            }
8928        }
8929
8930        #[inline]
8931        unsafe fn decode(
8932            &mut self,
8933            decoder: &mut fidl::encoding::Decoder<
8934                '_,
8935                fidl::encoding::DefaultFuchsiaResourceDialect,
8936            >,
8937            offset: usize,
8938            _depth: fidl::encoding::Depth,
8939        ) -> fidl::Result<()> {
8940            decoder.debug_check_bounds::<Self>(offset);
8941            // Verify that padding bytes are zero.
8942            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
8943            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
8944            Ok(())
8945        }
8946    }
8947
8948    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterCreateRequest {
8949        type Borrowed<'a> = &'a mut Self;
8950        fn take_or_borrow<'a>(
8951            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8952        ) -> Self::Borrowed<'a> {
8953            value
8954        }
8955    }
8956
8957    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterCreateRequest {
8958        type Owned = Self;
8959
8960        #[inline(always)]
8961        fn inline_align(_context: fidl::encoding::Context) -> usize {
8962            4
8963        }
8964
8965        #[inline(always)]
8966        fn inline_size(_context: fidl::encoding::Context) -> usize {
8967            8
8968        }
8969    }
8970
8971    unsafe impl
8972        fidl::encoding::Encode<
8973            CapabilitiesConnectorRouterCreateRequest,
8974            fidl::encoding::DefaultFuchsiaResourceDialect,
8975        > for &mut CapabilitiesConnectorRouterCreateRequest
8976    {
8977        #[inline]
8978        unsafe fn encode(
8979            self,
8980            encoder: &mut fidl::encoding::Encoder<
8981                '_,
8982                fidl::encoding::DefaultFuchsiaResourceDialect,
8983            >,
8984            offset: usize,
8985            _depth: fidl::encoding::Depth,
8986        ) -> fidl::Result<()> {
8987            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
8988            // Delegate to tuple encoding.
8989            fidl::encoding::Encode::<CapabilitiesConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8990                (
8991                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
8992                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
8993                ),
8994                encoder, offset, _depth
8995            )
8996        }
8997    }
8998    unsafe impl<
8999        T0: fidl::encoding::Encode<
9000                fidl::encoding::HandleType<
9001                    fidl::EventPair,
9002                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9003                    2147483648,
9004                >,
9005                fidl::encoding::DefaultFuchsiaResourceDialect,
9006            >,
9007        T1: fidl::encoding::Encode<
9008                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9009                fidl::encoding::DefaultFuchsiaResourceDialect,
9010            >,
9011    >
9012        fidl::encoding::Encode<
9013            CapabilitiesConnectorRouterCreateRequest,
9014            fidl::encoding::DefaultFuchsiaResourceDialect,
9015        > for (T0, T1)
9016    {
9017        #[inline]
9018        unsafe fn encode(
9019            self,
9020            encoder: &mut fidl::encoding::Encoder<
9021                '_,
9022                fidl::encoding::DefaultFuchsiaResourceDialect,
9023            >,
9024            offset: usize,
9025            depth: fidl::encoding::Depth,
9026        ) -> fidl::Result<()> {
9027            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
9028            // Zero out padding regions. There's no need to apply masks
9029            // because the unmasked parts will be overwritten by fields.
9030            // Write the fields.
9031            self.0.encode(encoder, offset + 0, depth)?;
9032            self.1.encode(encoder, offset + 4, depth)?;
9033            Ok(())
9034        }
9035    }
9036
9037    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9038        for CapabilitiesConnectorRouterCreateRequest
9039    {
9040        #[inline(always)]
9041        fn new_empty() -> Self {
9042            Self {
9043                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9044                router_client_end: fidl::new_empty!(
9045                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9046                    fidl::encoding::DefaultFuchsiaResourceDialect
9047                ),
9048            }
9049        }
9050
9051        #[inline]
9052        unsafe fn decode(
9053            &mut self,
9054            decoder: &mut fidl::encoding::Decoder<
9055                '_,
9056                fidl::encoding::DefaultFuchsiaResourceDialect,
9057            >,
9058            offset: usize,
9059            _depth: fidl::encoding::Depth,
9060        ) -> fidl::Result<()> {
9061            decoder.debug_check_bounds::<Self>(offset);
9062            // Verify that padding bytes are zero.
9063            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9064            fidl::decode!(
9065                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
9066                fidl::encoding::DefaultFuchsiaResourceDialect,
9067                &mut self.router_client_end,
9068                decoder,
9069                offset + 4,
9070                _depth
9071            )?;
9072            Ok(())
9073        }
9074    }
9075
9076    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterRouteRequest {
9077        type Borrowed<'a> = &'a mut Self;
9078        fn take_or_borrow<'a>(
9079            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9080        ) -> Self::Borrowed<'a> {
9081            value
9082        }
9083    }
9084
9085    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteRequest {
9086        type Owned = Self;
9087
9088        #[inline(always)]
9089        fn inline_align(_context: fidl::encoding::Context) -> usize {
9090            8
9091        }
9092
9093        #[inline(always)]
9094        fn inline_size(_context: fidl::encoding::Context) -> usize {
9095            32
9096        }
9097    }
9098
9099    unsafe impl
9100        fidl::encoding::Encode<
9101            CapabilitiesConnectorRouterRouteRequest,
9102            fidl::encoding::DefaultFuchsiaResourceDialect,
9103        > for &mut CapabilitiesConnectorRouterRouteRequest
9104    {
9105        #[inline]
9106        unsafe fn encode(
9107            self,
9108            encoder: &mut fidl::encoding::Encoder<
9109                '_,
9110                fidl::encoding::DefaultFuchsiaResourceDialect,
9111            >,
9112            offset: usize,
9113            _depth: fidl::encoding::Depth,
9114        ) -> fidl::Result<()> {
9115            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9116            // Delegate to tuple encoding.
9117            fidl::encoding::Encode::<
9118                CapabilitiesConnectorRouterRouteRequest,
9119                fidl::encoding::DefaultFuchsiaResourceDialect,
9120            >::encode(
9121                (
9122                    <fidl::encoding::HandleType<
9123                        fidl::EventPair,
9124                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9125                        2147483648,
9126                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9127                        &mut self.router
9128                    ),
9129                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
9130                    <fidl::encoding::HandleType<
9131                        fidl::EventPair,
9132                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9133                        2147483648,
9134                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9135                        &mut self.instance_token,
9136                    ),
9137                    <fidl::encoding::HandleType<
9138                        fidl::EventPair,
9139                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9140                        2147483648,
9141                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9142                        &mut self.connector
9143                    ),
9144                ),
9145                encoder,
9146                offset,
9147                _depth,
9148            )
9149        }
9150    }
9151    unsafe impl<
9152        T0: fidl::encoding::Encode<
9153                fidl::encoding::HandleType<
9154                    fidl::EventPair,
9155                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9156                    2147483648,
9157                >,
9158                fidl::encoding::DefaultFuchsiaResourceDialect,
9159            >,
9160        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9161        T2: fidl::encoding::Encode<
9162                fidl::encoding::HandleType<
9163                    fidl::EventPair,
9164                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9165                    2147483648,
9166                >,
9167                fidl::encoding::DefaultFuchsiaResourceDialect,
9168            >,
9169        T3: fidl::encoding::Encode<
9170                fidl::encoding::HandleType<
9171                    fidl::EventPair,
9172                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9173                    2147483648,
9174                >,
9175                fidl::encoding::DefaultFuchsiaResourceDialect,
9176            >,
9177    >
9178        fidl::encoding::Encode<
9179            CapabilitiesConnectorRouterRouteRequest,
9180            fidl::encoding::DefaultFuchsiaResourceDialect,
9181        > for (T0, T1, T2, T3)
9182    {
9183        #[inline]
9184        unsafe fn encode(
9185            self,
9186            encoder: &mut fidl::encoding::Encoder<
9187                '_,
9188                fidl::encoding::DefaultFuchsiaResourceDialect,
9189            >,
9190            offset: usize,
9191            depth: fidl::encoding::Depth,
9192        ) -> fidl::Result<()> {
9193            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
9194            // Zero out padding regions. There's no need to apply masks
9195            // because the unmasked parts will be overwritten by fields.
9196            unsafe {
9197                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9198                (ptr as *mut u64).write_unaligned(0);
9199            }
9200            // Write the fields.
9201            self.0.encode(encoder, offset + 0, depth)?;
9202            self.1.encode(encoder, offset + 8, depth)?;
9203            self.2.encode(encoder, offset + 24, depth)?;
9204            self.3.encode(encoder, offset + 28, depth)?;
9205            Ok(())
9206        }
9207    }
9208
9209    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9210        for CapabilitiesConnectorRouterRouteRequest
9211    {
9212        #[inline(always)]
9213        fn new_empty() -> Self {
9214            Self {
9215                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9216                request: fidl::new_empty!(
9217                    RouteRequest,
9218                    fidl::encoding::DefaultFuchsiaResourceDialect
9219                ),
9220                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9221                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9222            }
9223        }
9224
9225        #[inline]
9226        unsafe fn decode(
9227            &mut self,
9228            decoder: &mut fidl::encoding::Decoder<
9229                '_,
9230                fidl::encoding::DefaultFuchsiaResourceDialect,
9231            >,
9232            offset: usize,
9233            _depth: fidl::encoding::Depth,
9234        ) -> fidl::Result<()> {
9235            decoder.debug_check_bounds::<Self>(offset);
9236            // Verify that padding bytes are zero.
9237            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9238            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9239            let mask = 0xffffffff00000000u64;
9240            let maskedval = padval & mask;
9241            if maskedval != 0 {
9242                return Err(fidl::Error::NonZeroPadding {
9243                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9244                });
9245            }
9246            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9247            fidl::decode!(
9248                RouteRequest,
9249                fidl::encoding::DefaultFuchsiaResourceDialect,
9250                &mut self.request,
9251                decoder,
9252                offset + 8,
9253                _depth
9254            )?;
9255            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9256            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 28, _depth)?;
9257            Ok(())
9258        }
9259    }
9260
9261    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataCreateRequest {
9262        type Borrowed<'a> = &'a mut Self;
9263        fn take_or_borrow<'a>(
9264            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9265        ) -> Self::Borrowed<'a> {
9266            value
9267        }
9268    }
9269
9270    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataCreateRequest {
9271        type Owned = Self;
9272
9273        #[inline(always)]
9274        fn inline_align(_context: fidl::encoding::Context) -> usize {
9275            8
9276        }
9277
9278        #[inline(always)]
9279        fn inline_size(_context: fidl::encoding::Context) -> usize {
9280            24
9281        }
9282    }
9283
9284    unsafe impl
9285        fidl::encoding::Encode<
9286            CapabilitiesDataCreateRequest,
9287            fidl::encoding::DefaultFuchsiaResourceDialect,
9288        > for &mut CapabilitiesDataCreateRequest
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            // Delegate to tuple encoding.
9302            fidl::encoding::Encode::<
9303                CapabilitiesDataCreateRequest,
9304                fidl::encoding::DefaultFuchsiaResourceDialect,
9305            >::encode(
9306                (
9307                    <fidl::encoding::HandleType<
9308                        fidl::EventPair,
9309                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9310                        2147483648,
9311                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9312                        &mut self.data_handle
9313                    ),
9314                    <Data as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
9315                ),
9316                encoder,
9317                offset,
9318                _depth,
9319            )
9320        }
9321    }
9322    unsafe impl<
9323        T0: fidl::encoding::Encode<
9324                fidl::encoding::HandleType<
9325                    fidl::EventPair,
9326                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9327                    2147483648,
9328                >,
9329                fidl::encoding::DefaultFuchsiaResourceDialect,
9330            >,
9331        T1: fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>,
9332    >
9333        fidl::encoding::Encode<
9334            CapabilitiesDataCreateRequest,
9335            fidl::encoding::DefaultFuchsiaResourceDialect,
9336        > for (T0, T1)
9337    {
9338        #[inline]
9339        unsafe fn encode(
9340            self,
9341            encoder: &mut fidl::encoding::Encoder<
9342                '_,
9343                fidl::encoding::DefaultFuchsiaResourceDialect,
9344            >,
9345            offset: usize,
9346            depth: fidl::encoding::Depth,
9347        ) -> fidl::Result<()> {
9348            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
9349            // Zero out padding regions. There's no need to apply masks
9350            // because the unmasked parts will be overwritten by fields.
9351            unsafe {
9352                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9353                (ptr as *mut u64).write_unaligned(0);
9354            }
9355            // Write the fields.
9356            self.0.encode(encoder, offset + 0, depth)?;
9357            self.1.encode(encoder, offset + 8, depth)?;
9358            Ok(())
9359        }
9360    }
9361
9362    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9363        for CapabilitiesDataCreateRequest
9364    {
9365        #[inline(always)]
9366        fn new_empty() -> Self {
9367            Self {
9368                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9369                data: fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect),
9370            }
9371        }
9372
9373        #[inline]
9374        unsafe fn decode(
9375            &mut self,
9376            decoder: &mut fidl::encoding::Decoder<
9377                '_,
9378                fidl::encoding::DefaultFuchsiaResourceDialect,
9379            >,
9380            offset: usize,
9381            _depth: fidl::encoding::Depth,
9382        ) -> fidl::Result<()> {
9383            decoder.debug_check_bounds::<Self>(offset);
9384            // Verify that padding bytes are zero.
9385            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9386            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9387            let mask = 0xffffffff00000000u64;
9388            let maskedval = padval & mask;
9389            if maskedval != 0 {
9390                return Err(fidl::Error::NonZeroPadding {
9391                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9392                });
9393            }
9394            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9395            fidl::decode!(
9396                Data,
9397                fidl::encoding::DefaultFuchsiaResourceDialect,
9398                &mut self.data,
9399                decoder,
9400                offset + 8,
9401                _depth
9402            )?;
9403            Ok(())
9404        }
9405    }
9406
9407    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataGetRequest {
9408        type Borrowed<'a> = &'a mut Self;
9409        fn take_or_borrow<'a>(
9410            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9411        ) -> Self::Borrowed<'a> {
9412            value
9413        }
9414    }
9415
9416    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataGetRequest {
9417        type Owned = Self;
9418
9419        #[inline(always)]
9420        fn inline_align(_context: fidl::encoding::Context) -> usize {
9421            4
9422        }
9423
9424        #[inline(always)]
9425        fn inline_size(_context: fidl::encoding::Context) -> usize {
9426            4
9427        }
9428    }
9429
9430    unsafe impl
9431        fidl::encoding::Encode<
9432            CapabilitiesDataGetRequest,
9433            fidl::encoding::DefaultFuchsiaResourceDialect,
9434        > for &mut CapabilitiesDataGetRequest
9435    {
9436        #[inline]
9437        unsafe fn encode(
9438            self,
9439            encoder: &mut fidl::encoding::Encoder<
9440                '_,
9441                fidl::encoding::DefaultFuchsiaResourceDialect,
9442            >,
9443            offset: usize,
9444            _depth: fidl::encoding::Depth,
9445        ) -> fidl::Result<()> {
9446            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9447            // Delegate to tuple encoding.
9448            fidl::encoding::Encode::<
9449                CapabilitiesDataGetRequest,
9450                fidl::encoding::DefaultFuchsiaResourceDialect,
9451            >::encode(
9452                (<fidl::encoding::HandleType<
9453                    fidl::EventPair,
9454                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9455                    2147483648,
9456                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9457                    &mut self.data_handle
9458                ),),
9459                encoder,
9460                offset,
9461                _depth,
9462            )
9463        }
9464    }
9465    unsafe impl<
9466        T0: fidl::encoding::Encode<
9467                fidl::encoding::HandleType<
9468                    fidl::EventPair,
9469                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9470                    2147483648,
9471                >,
9472                fidl::encoding::DefaultFuchsiaResourceDialect,
9473            >,
9474    >
9475        fidl::encoding::Encode<
9476            CapabilitiesDataGetRequest,
9477            fidl::encoding::DefaultFuchsiaResourceDialect,
9478        > for (T0,)
9479    {
9480        #[inline]
9481        unsafe fn encode(
9482            self,
9483            encoder: &mut fidl::encoding::Encoder<
9484                '_,
9485                fidl::encoding::DefaultFuchsiaResourceDialect,
9486            >,
9487            offset: usize,
9488            depth: fidl::encoding::Depth,
9489        ) -> fidl::Result<()> {
9490            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
9491            // Zero out padding regions. There's no need to apply masks
9492            // because the unmasked parts will be overwritten by fields.
9493            // Write the fields.
9494            self.0.encode(encoder, offset + 0, depth)?;
9495            Ok(())
9496        }
9497    }
9498
9499    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9500        for CapabilitiesDataGetRequest
9501    {
9502        #[inline(always)]
9503        fn new_empty() -> Self {
9504            Self {
9505                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9506            }
9507        }
9508
9509        #[inline]
9510        unsafe fn decode(
9511            &mut self,
9512            decoder: &mut fidl::encoding::Decoder<
9513                '_,
9514                fidl::encoding::DefaultFuchsiaResourceDialect,
9515            >,
9516            offset: usize,
9517            _depth: fidl::encoding::Depth,
9518        ) -> fidl::Result<()> {
9519            decoder.debug_check_bounds::<Self>(offset);
9520            // Verify that padding bytes are zero.
9521            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
9522            Ok(())
9523        }
9524    }
9525
9526    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterCreateRequest {
9527        type Borrowed<'a> = &'a mut Self;
9528        fn take_or_borrow<'a>(
9529            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9530        ) -> Self::Borrowed<'a> {
9531            value
9532        }
9533    }
9534
9535    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterCreateRequest {
9536        type Owned = Self;
9537
9538        #[inline(always)]
9539        fn inline_align(_context: fidl::encoding::Context) -> usize {
9540            4
9541        }
9542
9543        #[inline(always)]
9544        fn inline_size(_context: fidl::encoding::Context) -> usize {
9545            8
9546        }
9547    }
9548
9549    unsafe impl
9550        fidl::encoding::Encode<
9551            CapabilitiesDataRouterCreateRequest,
9552            fidl::encoding::DefaultFuchsiaResourceDialect,
9553        > for &mut CapabilitiesDataRouterCreateRequest
9554    {
9555        #[inline]
9556        unsafe fn encode(
9557            self,
9558            encoder: &mut fidl::encoding::Encoder<
9559                '_,
9560                fidl::encoding::DefaultFuchsiaResourceDialect,
9561            >,
9562            offset: usize,
9563            _depth: fidl::encoding::Depth,
9564        ) -> fidl::Result<()> {
9565            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9566            // Delegate to tuple encoding.
9567            fidl::encoding::Encode::<CapabilitiesDataRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9568                (
9569                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
9570                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
9571                ),
9572                encoder, offset, _depth
9573            )
9574        }
9575    }
9576    unsafe impl<
9577        T0: fidl::encoding::Encode<
9578                fidl::encoding::HandleType<
9579                    fidl::EventPair,
9580                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9581                    2147483648,
9582                >,
9583                fidl::encoding::DefaultFuchsiaResourceDialect,
9584            >,
9585        T1: fidl::encoding::Encode<
9586                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9587                fidl::encoding::DefaultFuchsiaResourceDialect,
9588            >,
9589    >
9590        fidl::encoding::Encode<
9591            CapabilitiesDataRouterCreateRequest,
9592            fidl::encoding::DefaultFuchsiaResourceDialect,
9593        > for (T0, T1)
9594    {
9595        #[inline]
9596        unsafe fn encode(
9597            self,
9598            encoder: &mut fidl::encoding::Encoder<
9599                '_,
9600                fidl::encoding::DefaultFuchsiaResourceDialect,
9601            >,
9602            offset: usize,
9603            depth: fidl::encoding::Depth,
9604        ) -> fidl::Result<()> {
9605            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
9606            // Zero out padding regions. There's no need to apply masks
9607            // because the unmasked parts will be overwritten by fields.
9608            // Write the fields.
9609            self.0.encode(encoder, offset + 0, depth)?;
9610            self.1.encode(encoder, offset + 4, depth)?;
9611            Ok(())
9612        }
9613    }
9614
9615    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9616        for CapabilitiesDataRouterCreateRequest
9617    {
9618        #[inline(always)]
9619        fn new_empty() -> Self {
9620            Self {
9621                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9622                router_client_end: fidl::new_empty!(
9623                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9624                    fidl::encoding::DefaultFuchsiaResourceDialect
9625                ),
9626            }
9627        }
9628
9629        #[inline]
9630        unsafe fn decode(
9631            &mut self,
9632            decoder: &mut fidl::encoding::Decoder<
9633                '_,
9634                fidl::encoding::DefaultFuchsiaResourceDialect,
9635            >,
9636            offset: usize,
9637            _depth: fidl::encoding::Depth,
9638        ) -> fidl::Result<()> {
9639            decoder.debug_check_bounds::<Self>(offset);
9640            // Verify that padding bytes are zero.
9641            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9642            fidl::decode!(
9643                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
9644                fidl::encoding::DefaultFuchsiaResourceDialect,
9645                &mut self.router_client_end,
9646                decoder,
9647                offset + 4,
9648                _depth
9649            )?;
9650            Ok(())
9651        }
9652    }
9653
9654    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterRouteRequest {
9655        type Borrowed<'a> = &'a mut Self;
9656        fn take_or_borrow<'a>(
9657            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9658        ) -> Self::Borrowed<'a> {
9659            value
9660        }
9661    }
9662
9663    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteRequest {
9664        type Owned = Self;
9665
9666        #[inline(always)]
9667        fn inline_align(_context: fidl::encoding::Context) -> usize {
9668            8
9669        }
9670
9671        #[inline(always)]
9672        fn inline_size(_context: fidl::encoding::Context) -> usize {
9673            32
9674        }
9675    }
9676
9677    unsafe impl
9678        fidl::encoding::Encode<
9679            CapabilitiesDataRouterRouteRequest,
9680            fidl::encoding::DefaultFuchsiaResourceDialect,
9681        > for &mut CapabilitiesDataRouterRouteRequest
9682    {
9683        #[inline]
9684        unsafe fn encode(
9685            self,
9686            encoder: &mut fidl::encoding::Encoder<
9687                '_,
9688                fidl::encoding::DefaultFuchsiaResourceDialect,
9689            >,
9690            offset: usize,
9691            _depth: fidl::encoding::Depth,
9692        ) -> fidl::Result<()> {
9693            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9694            // Delegate to tuple encoding.
9695            fidl::encoding::Encode::<
9696                CapabilitiesDataRouterRouteRequest,
9697                fidl::encoding::DefaultFuchsiaResourceDialect,
9698            >::encode(
9699                (
9700                    <fidl::encoding::HandleType<
9701                        fidl::EventPair,
9702                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9703                        2147483648,
9704                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9705                        &mut self.router
9706                    ),
9707                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
9708                    <fidl::encoding::HandleType<
9709                        fidl::EventPair,
9710                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9711                        2147483648,
9712                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9713                        &mut self.instance_token,
9714                    ),
9715                    <fidl::encoding::HandleType<
9716                        fidl::EventPair,
9717                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9718                        2147483648,
9719                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9720                        &mut self.data
9721                    ),
9722                ),
9723                encoder,
9724                offset,
9725                _depth,
9726            )
9727        }
9728    }
9729    unsafe impl<
9730        T0: fidl::encoding::Encode<
9731                fidl::encoding::HandleType<
9732                    fidl::EventPair,
9733                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9734                    2147483648,
9735                >,
9736                fidl::encoding::DefaultFuchsiaResourceDialect,
9737            >,
9738        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
9739        T2: fidl::encoding::Encode<
9740                fidl::encoding::HandleType<
9741                    fidl::EventPair,
9742                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9743                    2147483648,
9744                >,
9745                fidl::encoding::DefaultFuchsiaResourceDialect,
9746            >,
9747        T3: fidl::encoding::Encode<
9748                fidl::encoding::HandleType<
9749                    fidl::EventPair,
9750                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9751                    2147483648,
9752                >,
9753                fidl::encoding::DefaultFuchsiaResourceDialect,
9754            >,
9755    >
9756        fidl::encoding::Encode<
9757            CapabilitiesDataRouterRouteRequest,
9758            fidl::encoding::DefaultFuchsiaResourceDialect,
9759        > for (T0, T1, T2, T3)
9760    {
9761        #[inline]
9762        unsafe fn encode(
9763            self,
9764            encoder: &mut fidl::encoding::Encoder<
9765                '_,
9766                fidl::encoding::DefaultFuchsiaResourceDialect,
9767            >,
9768            offset: usize,
9769            depth: fidl::encoding::Depth,
9770        ) -> fidl::Result<()> {
9771            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
9772            // Zero out padding regions. There's no need to apply masks
9773            // because the unmasked parts will be overwritten by fields.
9774            unsafe {
9775                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9776                (ptr as *mut u64).write_unaligned(0);
9777            }
9778            // Write the fields.
9779            self.0.encode(encoder, offset + 0, depth)?;
9780            self.1.encode(encoder, offset + 8, depth)?;
9781            self.2.encode(encoder, offset + 24, depth)?;
9782            self.3.encode(encoder, offset + 28, depth)?;
9783            Ok(())
9784        }
9785    }
9786
9787    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9788        for CapabilitiesDataRouterRouteRequest
9789    {
9790        #[inline(always)]
9791        fn new_empty() -> Self {
9792            Self {
9793                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9794                request: fidl::new_empty!(
9795                    RouteRequest,
9796                    fidl::encoding::DefaultFuchsiaResourceDialect
9797                ),
9798                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9799                data: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9800            }
9801        }
9802
9803        #[inline]
9804        unsafe fn decode(
9805            &mut self,
9806            decoder: &mut fidl::encoding::Decoder<
9807                '_,
9808                fidl::encoding::DefaultFuchsiaResourceDialect,
9809            >,
9810            offset: usize,
9811            _depth: fidl::encoding::Depth,
9812        ) -> fidl::Result<()> {
9813            decoder.debug_check_bounds::<Self>(offset);
9814            // Verify that padding bytes are zero.
9815            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9816            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9817            let mask = 0xffffffff00000000u64;
9818            let maskedval = padval & mask;
9819            if maskedval != 0 {
9820                return Err(fidl::Error::NonZeroPadding {
9821                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9822                });
9823            }
9824            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
9825            fidl::decode!(
9826                RouteRequest,
9827                fidl::encoding::DefaultFuchsiaResourceDialect,
9828                &mut self.request,
9829                decoder,
9830                offset + 8,
9831                _depth
9832            )?;
9833            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
9834            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data, decoder, offset + 28, _depth)?;
9835            Ok(())
9836        }
9837    }
9838
9839    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryCreateRequest {
9840        type Borrowed<'a> = &'a mut Self;
9841        fn take_or_borrow<'a>(
9842            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9843        ) -> Self::Borrowed<'a> {
9844            value
9845        }
9846    }
9847
9848    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryCreateRequest {
9849        type Owned = Self;
9850
9851        #[inline(always)]
9852        fn inline_align(_context: fidl::encoding::Context) -> usize {
9853            4
9854        }
9855
9856        #[inline(always)]
9857        fn inline_size(_context: fidl::encoding::Context) -> usize {
9858            4
9859        }
9860    }
9861
9862    unsafe impl
9863        fidl::encoding::Encode<
9864            CapabilitiesDictionaryCreateRequest,
9865            fidl::encoding::DefaultFuchsiaResourceDialect,
9866        > for &mut CapabilitiesDictionaryCreateRequest
9867    {
9868        #[inline]
9869        unsafe fn encode(
9870            self,
9871            encoder: &mut fidl::encoding::Encoder<
9872                '_,
9873                fidl::encoding::DefaultFuchsiaResourceDialect,
9874            >,
9875            offset: usize,
9876            _depth: fidl::encoding::Depth,
9877        ) -> fidl::Result<()> {
9878            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9879            // Delegate to tuple encoding.
9880            fidl::encoding::Encode::<
9881                CapabilitiesDictionaryCreateRequest,
9882                fidl::encoding::DefaultFuchsiaResourceDialect,
9883            >::encode(
9884                (<fidl::encoding::HandleType<
9885                    fidl::EventPair,
9886                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9887                    2147483648,
9888                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9889                    &mut self.dictionary
9890                ),),
9891                encoder,
9892                offset,
9893                _depth,
9894            )
9895        }
9896    }
9897    unsafe impl<
9898        T0: fidl::encoding::Encode<
9899                fidl::encoding::HandleType<
9900                    fidl::EventPair,
9901                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9902                    2147483648,
9903                >,
9904                fidl::encoding::DefaultFuchsiaResourceDialect,
9905            >,
9906    >
9907        fidl::encoding::Encode<
9908            CapabilitiesDictionaryCreateRequest,
9909            fidl::encoding::DefaultFuchsiaResourceDialect,
9910        > for (T0,)
9911    {
9912        #[inline]
9913        unsafe fn encode(
9914            self,
9915            encoder: &mut fidl::encoding::Encoder<
9916                '_,
9917                fidl::encoding::DefaultFuchsiaResourceDialect,
9918            >,
9919            offset: usize,
9920            depth: fidl::encoding::Depth,
9921        ) -> fidl::Result<()> {
9922            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
9923            // Zero out padding regions. There's no need to apply masks
9924            // because the unmasked parts will be overwritten by fields.
9925            // Write the fields.
9926            self.0.encode(encoder, offset + 0, depth)?;
9927            Ok(())
9928        }
9929    }
9930
9931    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9932        for CapabilitiesDictionaryCreateRequest
9933    {
9934        #[inline(always)]
9935        fn new_empty() -> Self {
9936            Self {
9937                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9938            }
9939        }
9940
9941        #[inline]
9942        unsafe fn decode(
9943            &mut self,
9944            decoder: &mut fidl::encoding::Decoder<
9945                '_,
9946                fidl::encoding::DefaultFuchsiaResourceDialect,
9947            >,
9948            offset: usize,
9949            _depth: fidl::encoding::Depth,
9950        ) -> fidl::Result<()> {
9951            decoder.debug_check_bounds::<Self>(offset);
9952            // Verify that padding bytes are zero.
9953            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9954            Ok(())
9955        }
9956    }
9957
9958    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetRequest {
9959        type Borrowed<'a> = &'a mut Self;
9960        fn take_or_borrow<'a>(
9961            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9962        ) -> Self::Borrowed<'a> {
9963            value
9964        }
9965    }
9966
9967    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetRequest {
9968        type Owned = Self;
9969
9970        #[inline(always)]
9971        fn inline_align(_context: fidl::encoding::Context) -> usize {
9972            8
9973        }
9974
9975        #[inline(always)]
9976        fn inline_size(_context: fidl::encoding::Context) -> usize {
9977            32
9978        }
9979    }
9980
9981    unsafe impl
9982        fidl::encoding::Encode<
9983            CapabilitiesDictionaryGetRequest,
9984            fidl::encoding::DefaultFuchsiaResourceDialect,
9985        > for &mut CapabilitiesDictionaryGetRequest
9986    {
9987        #[inline]
9988        unsafe fn encode(
9989            self,
9990            encoder: &mut fidl::encoding::Encoder<
9991                '_,
9992                fidl::encoding::DefaultFuchsiaResourceDialect,
9993            >,
9994            offset: usize,
9995            _depth: fidl::encoding::Depth,
9996        ) -> fidl::Result<()> {
9997            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
9998            // Delegate to tuple encoding.
9999            fidl::encoding::Encode::<
10000                CapabilitiesDictionaryGetRequest,
10001                fidl::encoding::DefaultFuchsiaResourceDialect,
10002            >::encode(
10003                (
10004                    <fidl::encoding::HandleType<
10005                        fidl::EventPair,
10006                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10007                        2147483648,
10008                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10009                        &mut self.dictionary
10010                    ),
10011                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10012                        &self.key,
10013                    ),
10014                    <fidl::encoding::HandleType<
10015                        fidl::EventPair,
10016                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10017                        2147483648,
10018                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10019                        &mut self.value
10020                    ),
10021                ),
10022                encoder,
10023                offset,
10024                _depth,
10025            )
10026        }
10027    }
10028    unsafe impl<
10029        T0: fidl::encoding::Encode<
10030                fidl::encoding::HandleType<
10031                    fidl::EventPair,
10032                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10033                    2147483648,
10034                >,
10035                fidl::encoding::DefaultFuchsiaResourceDialect,
10036            >,
10037        T1: fidl::encoding::Encode<
10038                fidl::encoding::BoundedString<100>,
10039                fidl::encoding::DefaultFuchsiaResourceDialect,
10040            >,
10041        T2: fidl::encoding::Encode<
10042                fidl::encoding::HandleType<
10043                    fidl::EventPair,
10044                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10045                    2147483648,
10046                >,
10047                fidl::encoding::DefaultFuchsiaResourceDialect,
10048            >,
10049    >
10050        fidl::encoding::Encode<
10051            CapabilitiesDictionaryGetRequest,
10052            fidl::encoding::DefaultFuchsiaResourceDialect,
10053        > for (T0, T1, T2)
10054    {
10055        #[inline]
10056        unsafe fn encode(
10057            self,
10058            encoder: &mut fidl::encoding::Encoder<
10059                '_,
10060                fidl::encoding::DefaultFuchsiaResourceDialect,
10061            >,
10062            offset: usize,
10063            depth: fidl::encoding::Depth,
10064        ) -> fidl::Result<()> {
10065            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
10066            // Zero out padding regions. There's no need to apply masks
10067            // because the unmasked parts will be overwritten by fields.
10068            unsafe {
10069                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10070                (ptr as *mut u64).write_unaligned(0);
10071            }
10072            unsafe {
10073                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10074                (ptr as *mut u64).write_unaligned(0);
10075            }
10076            // Write the fields.
10077            self.0.encode(encoder, offset + 0, depth)?;
10078            self.1.encode(encoder, offset + 8, depth)?;
10079            self.2.encode(encoder, offset + 24, depth)?;
10080            Ok(())
10081        }
10082    }
10083
10084    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10085        for CapabilitiesDictionaryGetRequest
10086    {
10087        #[inline(always)]
10088        fn new_empty() -> Self {
10089            Self {
10090                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10091                key: fidl::new_empty!(
10092                    fidl::encoding::BoundedString<100>,
10093                    fidl::encoding::DefaultFuchsiaResourceDialect
10094                ),
10095                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10096            }
10097        }
10098
10099        #[inline]
10100        unsafe fn decode(
10101            &mut self,
10102            decoder: &mut fidl::encoding::Decoder<
10103                '_,
10104                fidl::encoding::DefaultFuchsiaResourceDialect,
10105            >,
10106            offset: usize,
10107            _depth: fidl::encoding::Depth,
10108        ) -> fidl::Result<()> {
10109            decoder.debug_check_bounds::<Self>(offset);
10110            // Verify that padding bytes are zero.
10111            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10112            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10113            let mask = 0xffffffff00000000u64;
10114            let maskedval = padval & mask;
10115            if maskedval != 0 {
10116                return Err(fidl::Error::NonZeroPadding {
10117                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10118                });
10119            }
10120            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10121            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10122            let mask = 0xffffffff00000000u64;
10123            let maskedval = padval & mask;
10124            if maskedval != 0 {
10125                return Err(fidl::Error::NonZeroPadding {
10126                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10127                });
10128            }
10129            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10130            fidl::decode!(
10131                fidl::encoding::BoundedString<100>,
10132                fidl::encoding::DefaultFuchsiaResourceDialect,
10133                &mut self.key,
10134                decoder,
10135                offset + 8,
10136                _depth
10137            )?;
10138            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10139            Ok(())
10140        }
10141    }
10142
10143    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryInsertRequest {
10144        type Borrowed<'a> = &'a mut Self;
10145        fn take_or_borrow<'a>(
10146            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10147        ) -> Self::Borrowed<'a> {
10148            value
10149        }
10150    }
10151
10152    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryInsertRequest {
10153        type Owned = Self;
10154
10155        #[inline(always)]
10156        fn inline_align(_context: fidl::encoding::Context) -> usize {
10157            8
10158        }
10159
10160        #[inline(always)]
10161        fn inline_size(_context: fidl::encoding::Context) -> usize {
10162            32
10163        }
10164    }
10165
10166    unsafe impl
10167        fidl::encoding::Encode<
10168            CapabilitiesDictionaryInsertRequest,
10169            fidl::encoding::DefaultFuchsiaResourceDialect,
10170        > for &mut CapabilitiesDictionaryInsertRequest
10171    {
10172        #[inline]
10173        unsafe fn encode(
10174            self,
10175            encoder: &mut fidl::encoding::Encoder<
10176                '_,
10177                fidl::encoding::DefaultFuchsiaResourceDialect,
10178            >,
10179            offset: usize,
10180            _depth: fidl::encoding::Depth,
10181        ) -> fidl::Result<()> {
10182            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10183            // Delegate to tuple encoding.
10184            fidl::encoding::Encode::<
10185                CapabilitiesDictionaryInsertRequest,
10186                fidl::encoding::DefaultFuchsiaResourceDialect,
10187            >::encode(
10188                (
10189                    <fidl::encoding::HandleType<
10190                        fidl::EventPair,
10191                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10192                        2147483648,
10193                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10194                        &mut self.dictionary
10195                    ),
10196                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
10197                        &self.key,
10198                    ),
10199                    <fidl::encoding::HandleType<
10200                        fidl::EventPair,
10201                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10202                        2147483648,
10203                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10204                        &mut self.value
10205                    ),
10206                ),
10207                encoder,
10208                offset,
10209                _depth,
10210            )
10211        }
10212    }
10213    unsafe impl<
10214        T0: fidl::encoding::Encode<
10215                fidl::encoding::HandleType<
10216                    fidl::EventPair,
10217                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10218                    2147483648,
10219                >,
10220                fidl::encoding::DefaultFuchsiaResourceDialect,
10221            >,
10222        T1: fidl::encoding::Encode<
10223                fidl::encoding::BoundedString<100>,
10224                fidl::encoding::DefaultFuchsiaResourceDialect,
10225            >,
10226        T2: fidl::encoding::Encode<
10227                fidl::encoding::HandleType<
10228                    fidl::EventPair,
10229                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10230                    2147483648,
10231                >,
10232                fidl::encoding::DefaultFuchsiaResourceDialect,
10233            >,
10234    >
10235        fidl::encoding::Encode<
10236            CapabilitiesDictionaryInsertRequest,
10237            fidl::encoding::DefaultFuchsiaResourceDialect,
10238        > for (T0, T1, T2)
10239    {
10240        #[inline]
10241        unsafe fn encode(
10242            self,
10243            encoder: &mut fidl::encoding::Encoder<
10244                '_,
10245                fidl::encoding::DefaultFuchsiaResourceDialect,
10246            >,
10247            offset: usize,
10248            depth: fidl::encoding::Depth,
10249        ) -> fidl::Result<()> {
10250            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
10251            // Zero out padding regions. There's no need to apply masks
10252            // because the unmasked parts will be overwritten by fields.
10253            unsafe {
10254                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10255                (ptr as *mut u64).write_unaligned(0);
10256            }
10257            unsafe {
10258                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10259                (ptr as *mut u64).write_unaligned(0);
10260            }
10261            // Write the fields.
10262            self.0.encode(encoder, offset + 0, depth)?;
10263            self.1.encode(encoder, offset + 8, depth)?;
10264            self.2.encode(encoder, offset + 24, depth)?;
10265            Ok(())
10266        }
10267    }
10268
10269    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10270        for CapabilitiesDictionaryInsertRequest
10271    {
10272        #[inline(always)]
10273        fn new_empty() -> Self {
10274            Self {
10275                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10276                key: fidl::new_empty!(
10277                    fidl::encoding::BoundedString<100>,
10278                    fidl::encoding::DefaultFuchsiaResourceDialect
10279                ),
10280                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10281            }
10282        }
10283
10284        #[inline]
10285        unsafe fn decode(
10286            &mut self,
10287            decoder: &mut fidl::encoding::Decoder<
10288                '_,
10289                fidl::encoding::DefaultFuchsiaResourceDialect,
10290            >,
10291            offset: usize,
10292            _depth: fidl::encoding::Depth,
10293        ) -> fidl::Result<()> {
10294            decoder.debug_check_bounds::<Self>(offset);
10295            // Verify that padding bytes are zero.
10296            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10297            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10298            let mask = 0xffffffff00000000u64;
10299            let maskedval = padval & mask;
10300            if maskedval != 0 {
10301                return Err(fidl::Error::NonZeroPadding {
10302                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10303                });
10304            }
10305            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10306            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10307            let mask = 0xffffffff00000000u64;
10308            let maskedval = padval & mask;
10309            if maskedval != 0 {
10310                return Err(fidl::Error::NonZeroPadding {
10311                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10312                });
10313            }
10314            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10315            fidl::decode!(
10316                fidl::encoding::BoundedString<100>,
10317                fidl::encoding::DefaultFuchsiaResourceDialect,
10318                &mut self.key,
10319                decoder,
10320                offset + 8,
10321                _depth
10322            )?;
10323            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
10324            Ok(())
10325        }
10326    }
10327
10328    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10329        type Borrowed<'a> = &'a mut Self;
10330        fn take_or_borrow<'a>(
10331            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10332        ) -> Self::Borrowed<'a> {
10333            value
10334        }
10335    }
10336
10337    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryIterateKeysRequest {
10338        type Owned = Self;
10339
10340        #[inline(always)]
10341        fn inline_align(_context: fidl::encoding::Context) -> usize {
10342            4
10343        }
10344
10345        #[inline(always)]
10346        fn inline_size(_context: fidl::encoding::Context) -> usize {
10347            8
10348        }
10349    }
10350
10351    unsafe impl
10352        fidl::encoding::Encode<
10353            CapabilitiesDictionaryIterateKeysRequest,
10354            fidl::encoding::DefaultFuchsiaResourceDialect,
10355        > for &mut CapabilitiesDictionaryIterateKeysRequest
10356    {
10357        #[inline]
10358        unsafe fn encode(
10359            self,
10360            encoder: &mut fidl::encoding::Encoder<
10361                '_,
10362                fidl::encoding::DefaultFuchsiaResourceDialect,
10363            >,
10364            offset: usize,
10365            _depth: fidl::encoding::Depth,
10366        ) -> fidl::Result<()> {
10367            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10368            // Delegate to tuple encoding.
10369            fidl::encoding::Encode::<
10370                CapabilitiesDictionaryIterateKeysRequest,
10371                fidl::encoding::DefaultFuchsiaResourceDialect,
10372            >::encode(
10373                (
10374                    <fidl::encoding::HandleType<
10375                        fidl::EventPair,
10376                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10377                        2147483648,
10378                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10379                        &mut self.dictionary
10380                    ),
10381                    <fidl::encoding::Endpoint<
10382                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10383                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10384                        &mut self.key_iterator,
10385                    ),
10386                ),
10387                encoder,
10388                offset,
10389                _depth,
10390            )
10391        }
10392    }
10393    unsafe impl<
10394        T0: fidl::encoding::Encode<
10395                fidl::encoding::HandleType<
10396                    fidl::EventPair,
10397                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10398                    2147483648,
10399                >,
10400                fidl::encoding::DefaultFuchsiaResourceDialect,
10401            >,
10402        T1: fidl::encoding::Encode<
10403                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10404                fidl::encoding::DefaultFuchsiaResourceDialect,
10405            >,
10406    >
10407        fidl::encoding::Encode<
10408            CapabilitiesDictionaryIterateKeysRequest,
10409            fidl::encoding::DefaultFuchsiaResourceDialect,
10410        > for (T0, T1)
10411    {
10412        #[inline]
10413        unsafe fn encode(
10414            self,
10415            encoder: &mut fidl::encoding::Encoder<
10416                '_,
10417                fidl::encoding::DefaultFuchsiaResourceDialect,
10418            >,
10419            offset: usize,
10420            depth: fidl::encoding::Depth,
10421        ) -> fidl::Result<()> {
10422            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
10423            // Zero out padding regions. There's no need to apply masks
10424            // because the unmasked parts will be overwritten by fields.
10425            // Write the fields.
10426            self.0.encode(encoder, offset + 0, depth)?;
10427            self.1.encode(encoder, offset + 4, depth)?;
10428            Ok(())
10429        }
10430    }
10431
10432    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10433        for CapabilitiesDictionaryIterateKeysRequest
10434    {
10435        #[inline(always)]
10436        fn new_empty() -> Self {
10437            Self {
10438                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10439                key_iterator: fidl::new_empty!(
10440                    fidl::encoding::Endpoint<
10441                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
10442                    >,
10443                    fidl::encoding::DefaultFuchsiaResourceDialect
10444                ),
10445            }
10446        }
10447
10448        #[inline]
10449        unsafe fn decode(
10450            &mut self,
10451            decoder: &mut fidl::encoding::Decoder<
10452                '_,
10453                fidl::encoding::DefaultFuchsiaResourceDialect,
10454            >,
10455            offset: usize,
10456            _depth: fidl::encoding::Depth,
10457        ) -> fidl::Result<()> {
10458            decoder.debug_check_bounds::<Self>(offset);
10459            // Verify that padding bytes are zero.
10460            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10461            fidl::decode!(
10462                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
10463                fidl::encoding::DefaultFuchsiaResourceDialect,
10464                &mut self.key_iterator,
10465                decoder,
10466                offset + 4,
10467                _depth
10468            )?;
10469            Ok(())
10470        }
10471    }
10472
10473    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10474        type Borrowed<'a> = &'a mut Self;
10475        fn take_or_borrow<'a>(
10476            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10477        ) -> Self::Borrowed<'a> {
10478            value
10479        }
10480    }
10481
10482    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterCreateRequest {
10483        type Owned = Self;
10484
10485        #[inline(always)]
10486        fn inline_align(_context: fidl::encoding::Context) -> usize {
10487            4
10488        }
10489
10490        #[inline(always)]
10491        fn inline_size(_context: fidl::encoding::Context) -> usize {
10492            8
10493        }
10494    }
10495
10496    unsafe impl
10497        fidl::encoding::Encode<
10498            CapabilitiesDictionaryRouterCreateRequest,
10499            fidl::encoding::DefaultFuchsiaResourceDialect,
10500        > for &mut CapabilitiesDictionaryRouterCreateRequest
10501    {
10502        #[inline]
10503        unsafe fn encode(
10504            self,
10505            encoder: &mut fidl::encoding::Encoder<
10506                '_,
10507                fidl::encoding::DefaultFuchsiaResourceDialect,
10508            >,
10509            offset: usize,
10510            _depth: fidl::encoding::Depth,
10511        ) -> fidl::Result<()> {
10512            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10513            // Delegate to tuple encoding.
10514            fidl::encoding::Encode::<CapabilitiesDictionaryRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10515                (
10516                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10517                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10518                ),
10519                encoder, offset, _depth
10520            )
10521        }
10522    }
10523    unsafe impl<
10524        T0: fidl::encoding::Encode<
10525                fidl::encoding::HandleType<
10526                    fidl::EventPair,
10527                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10528                    2147483648,
10529                >,
10530                fidl::encoding::DefaultFuchsiaResourceDialect,
10531            >,
10532        T1: fidl::encoding::Encode<
10533                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10534                fidl::encoding::DefaultFuchsiaResourceDialect,
10535            >,
10536    >
10537        fidl::encoding::Encode<
10538            CapabilitiesDictionaryRouterCreateRequest,
10539            fidl::encoding::DefaultFuchsiaResourceDialect,
10540        > for (T0, T1)
10541    {
10542        #[inline]
10543        unsafe fn encode(
10544            self,
10545            encoder: &mut fidl::encoding::Encoder<
10546                '_,
10547                fidl::encoding::DefaultFuchsiaResourceDialect,
10548            >,
10549            offset: usize,
10550            depth: fidl::encoding::Depth,
10551        ) -> fidl::Result<()> {
10552            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
10553            // Zero out padding regions. There's no need to apply masks
10554            // because the unmasked parts will be overwritten by fields.
10555            // Write the fields.
10556            self.0.encode(encoder, offset + 0, depth)?;
10557            self.1.encode(encoder, offset + 4, depth)?;
10558            Ok(())
10559        }
10560    }
10561
10562    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10563        for CapabilitiesDictionaryRouterCreateRequest
10564    {
10565        #[inline(always)]
10566        fn new_empty() -> Self {
10567            Self {
10568                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10569                router_client_end: fidl::new_empty!(
10570                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10571                    fidl::encoding::DefaultFuchsiaResourceDialect
10572                ),
10573            }
10574        }
10575
10576        #[inline]
10577        unsafe fn decode(
10578            &mut self,
10579            decoder: &mut fidl::encoding::Decoder<
10580                '_,
10581                fidl::encoding::DefaultFuchsiaResourceDialect,
10582            >,
10583            offset: usize,
10584            _depth: fidl::encoding::Depth,
10585        ) -> fidl::Result<()> {
10586            decoder.debug_check_bounds::<Self>(offset);
10587            // Verify that padding bytes are zero.
10588            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10589            fidl::decode!(
10590                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
10591                fidl::encoding::DefaultFuchsiaResourceDialect,
10592                &mut self.router_client_end,
10593                decoder,
10594                offset + 4,
10595                _depth
10596            )?;
10597            Ok(())
10598        }
10599    }
10600
10601    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10602        type Borrowed<'a> = &'a mut Self;
10603        fn take_or_borrow<'a>(
10604            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10605        ) -> Self::Borrowed<'a> {
10606            value
10607        }
10608    }
10609
10610    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteRequest {
10611        type Owned = Self;
10612
10613        #[inline(always)]
10614        fn inline_align(_context: fidl::encoding::Context) -> usize {
10615            8
10616        }
10617
10618        #[inline(always)]
10619        fn inline_size(_context: fidl::encoding::Context) -> usize {
10620            32
10621        }
10622    }
10623
10624    unsafe impl
10625        fidl::encoding::Encode<
10626            CapabilitiesDictionaryRouterRouteRequest,
10627            fidl::encoding::DefaultFuchsiaResourceDialect,
10628        > for &mut CapabilitiesDictionaryRouterRouteRequest
10629    {
10630        #[inline]
10631        unsafe fn encode(
10632            self,
10633            encoder: &mut fidl::encoding::Encoder<
10634                '_,
10635                fidl::encoding::DefaultFuchsiaResourceDialect,
10636            >,
10637            offset: usize,
10638            _depth: fidl::encoding::Depth,
10639        ) -> fidl::Result<()> {
10640            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10641            // Delegate to tuple encoding.
10642            fidl::encoding::Encode::<
10643                CapabilitiesDictionaryRouterRouteRequest,
10644                fidl::encoding::DefaultFuchsiaResourceDialect,
10645            >::encode(
10646                (
10647                    <fidl::encoding::HandleType<
10648                        fidl::EventPair,
10649                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10650                        2147483648,
10651                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10652                        &mut self.router
10653                    ),
10654                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
10655                    <fidl::encoding::HandleType<
10656                        fidl::EventPair,
10657                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10658                        2147483648,
10659                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10660                        &mut self.instance_token,
10661                    ),
10662                    <fidl::encoding::HandleType<
10663                        fidl::EventPair,
10664                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10665                        2147483648,
10666                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10667                        &mut self.dictionary
10668                    ),
10669                ),
10670                encoder,
10671                offset,
10672                _depth,
10673            )
10674        }
10675    }
10676    unsafe impl<
10677        T0: fidl::encoding::Encode<
10678                fidl::encoding::HandleType<
10679                    fidl::EventPair,
10680                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10681                    2147483648,
10682                >,
10683                fidl::encoding::DefaultFuchsiaResourceDialect,
10684            >,
10685        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
10686        T2: fidl::encoding::Encode<
10687                fidl::encoding::HandleType<
10688                    fidl::EventPair,
10689                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10690                    2147483648,
10691                >,
10692                fidl::encoding::DefaultFuchsiaResourceDialect,
10693            >,
10694        T3: fidl::encoding::Encode<
10695                fidl::encoding::HandleType<
10696                    fidl::EventPair,
10697                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10698                    2147483648,
10699                >,
10700                fidl::encoding::DefaultFuchsiaResourceDialect,
10701            >,
10702    >
10703        fidl::encoding::Encode<
10704            CapabilitiesDictionaryRouterRouteRequest,
10705            fidl::encoding::DefaultFuchsiaResourceDialect,
10706        > for (T0, T1, T2, T3)
10707    {
10708        #[inline]
10709        unsafe fn encode(
10710            self,
10711            encoder: &mut fidl::encoding::Encoder<
10712                '_,
10713                fidl::encoding::DefaultFuchsiaResourceDialect,
10714            >,
10715            offset: usize,
10716            depth: fidl::encoding::Depth,
10717        ) -> fidl::Result<()> {
10718            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
10719            // Zero out padding regions. There's no need to apply masks
10720            // because the unmasked parts will be overwritten by fields.
10721            unsafe {
10722                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10723                (ptr as *mut u64).write_unaligned(0);
10724            }
10725            // Write the fields.
10726            self.0.encode(encoder, offset + 0, depth)?;
10727            self.1.encode(encoder, offset + 8, depth)?;
10728            self.2.encode(encoder, offset + 24, depth)?;
10729            self.3.encode(encoder, offset + 28, depth)?;
10730            Ok(())
10731        }
10732    }
10733
10734    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10735        for CapabilitiesDictionaryRouterRouteRequest
10736    {
10737        #[inline(always)]
10738        fn new_empty() -> Self {
10739            Self {
10740                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10741                request: fidl::new_empty!(
10742                    RouteRequest,
10743                    fidl::encoding::DefaultFuchsiaResourceDialect
10744                ),
10745                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10746                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10747            }
10748        }
10749
10750        #[inline]
10751        unsafe fn decode(
10752            &mut self,
10753            decoder: &mut fidl::encoding::Decoder<
10754                '_,
10755                fidl::encoding::DefaultFuchsiaResourceDialect,
10756            >,
10757            offset: usize,
10758            _depth: fidl::encoding::Depth,
10759        ) -> fidl::Result<()> {
10760            decoder.debug_check_bounds::<Self>(offset);
10761            // Verify that padding bytes are zero.
10762            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10763            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10764            let mask = 0xffffffff00000000u64;
10765            let maskedval = padval & mask;
10766            if maskedval != 0 {
10767                return Err(fidl::Error::NonZeroPadding {
10768                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10769                });
10770            }
10771            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
10772            fidl::decode!(
10773                RouteRequest,
10774                fidl::encoding::DefaultFuchsiaResourceDialect,
10775                &mut self.request,
10776                decoder,
10777                offset + 8,
10778                _depth
10779            )?;
10780            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
10781            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 28, _depth)?;
10782            Ok(())
10783        }
10784    }
10785
10786    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorCreateRequest {
10787        type Borrowed<'a> = &'a mut Self;
10788        fn take_or_borrow<'a>(
10789            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10790        ) -> Self::Borrowed<'a> {
10791            value
10792        }
10793    }
10794
10795    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorCreateRequest {
10796        type Owned = Self;
10797
10798        #[inline(always)]
10799        fn inline_align(_context: fidl::encoding::Context) -> usize {
10800            4
10801        }
10802
10803        #[inline(always)]
10804        fn inline_size(_context: fidl::encoding::Context) -> usize {
10805            8
10806        }
10807    }
10808
10809    unsafe impl
10810        fidl::encoding::Encode<
10811            CapabilitiesDirConnectorCreateRequest,
10812            fidl::encoding::DefaultFuchsiaResourceDialect,
10813        > for &mut CapabilitiesDirConnectorCreateRequest
10814    {
10815        #[inline]
10816        unsafe fn encode(
10817            self,
10818            encoder: &mut fidl::encoding::Encoder<
10819                '_,
10820                fidl::encoding::DefaultFuchsiaResourceDialect,
10821            >,
10822            offset: usize,
10823            _depth: fidl::encoding::Depth,
10824        ) -> fidl::Result<()> {
10825            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10826            // Delegate to tuple encoding.
10827            fidl::encoding::Encode::<CapabilitiesDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10828                (
10829                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector),
10830                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
10831                ),
10832                encoder, offset, _depth
10833            )
10834        }
10835    }
10836    unsafe impl<
10837        T0: fidl::encoding::Encode<
10838                fidl::encoding::HandleType<
10839                    fidl::EventPair,
10840                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10841                    2147483648,
10842                >,
10843                fidl::encoding::DefaultFuchsiaResourceDialect,
10844            >,
10845        T1: fidl::encoding::Encode<
10846                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10847                fidl::encoding::DefaultFuchsiaResourceDialect,
10848            >,
10849    >
10850        fidl::encoding::Encode<
10851            CapabilitiesDirConnectorCreateRequest,
10852            fidl::encoding::DefaultFuchsiaResourceDialect,
10853        > for (T0, T1)
10854    {
10855        #[inline]
10856        unsafe fn encode(
10857            self,
10858            encoder: &mut fidl::encoding::Encoder<
10859                '_,
10860                fidl::encoding::DefaultFuchsiaResourceDialect,
10861            >,
10862            offset: usize,
10863            depth: fidl::encoding::Depth,
10864        ) -> fidl::Result<()> {
10865            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
10866            // Zero out padding regions. There's no need to apply masks
10867            // because the unmasked parts will be overwritten by fields.
10868            // Write the fields.
10869            self.0.encode(encoder, offset + 0, depth)?;
10870            self.1.encode(encoder, offset + 4, depth)?;
10871            Ok(())
10872        }
10873    }
10874
10875    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10876        for CapabilitiesDirConnectorCreateRequest
10877    {
10878        #[inline(always)]
10879        fn new_empty() -> Self {
10880            Self {
10881                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10882                receiver_client_end: fidl::new_empty!(
10883                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10884                    fidl::encoding::DefaultFuchsiaResourceDialect
10885                ),
10886            }
10887        }
10888
10889        #[inline]
10890        unsafe fn decode(
10891            &mut self,
10892            decoder: &mut fidl::encoding::Decoder<
10893                '_,
10894                fidl::encoding::DefaultFuchsiaResourceDialect,
10895            >,
10896            offset: usize,
10897            _depth: fidl::encoding::Depth,
10898        ) -> fidl::Result<()> {
10899            decoder.debug_check_bounds::<Self>(offset);
10900            // Verify that padding bytes are zero.
10901            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 0, _depth)?;
10902            fidl::decode!(
10903                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
10904                fidl::encoding::DefaultFuchsiaResourceDialect,
10905                &mut self.receiver_client_end,
10906                decoder,
10907                offset + 4,
10908                _depth
10909            )?;
10910            Ok(())
10911        }
10912    }
10913
10914    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10915        type Borrowed<'a> = &'a mut Self;
10916        fn take_or_borrow<'a>(
10917            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10918        ) -> Self::Borrowed<'a> {
10919            value
10920        }
10921    }
10922
10923    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
10924        type Owned = Self;
10925
10926        #[inline(always)]
10927        fn inline_align(_context: fidl::encoding::Context) -> usize {
10928            4
10929        }
10930
10931        #[inline(always)]
10932        fn inline_size(_context: fidl::encoding::Context) -> usize {
10933            8
10934        }
10935    }
10936
10937    unsafe impl
10938        fidl::encoding::Encode<
10939            CapabilitiesDirConnectorRouterCreateRequest,
10940            fidl::encoding::DefaultFuchsiaResourceDialect,
10941        > for &mut CapabilitiesDirConnectorRouterCreateRequest
10942    {
10943        #[inline]
10944        unsafe fn encode(
10945            self,
10946            encoder: &mut fidl::encoding::Encoder<
10947                '_,
10948                fidl::encoding::DefaultFuchsiaResourceDialect,
10949            >,
10950            offset: usize,
10951            _depth: fidl::encoding::Depth,
10952        ) -> fidl::Result<()> {
10953            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10954            // Delegate to tuple encoding.
10955            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10956                (
10957                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
10958                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
10959                ),
10960                encoder, offset, _depth
10961            )
10962        }
10963    }
10964    unsafe impl<
10965        T0: fidl::encoding::Encode<
10966                fidl::encoding::HandleType<
10967                    fidl::EventPair,
10968                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10969                    2147483648,
10970                >,
10971                fidl::encoding::DefaultFuchsiaResourceDialect,
10972            >,
10973        T1: fidl::encoding::Encode<
10974                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
10975                fidl::encoding::DefaultFuchsiaResourceDialect,
10976            >,
10977    >
10978        fidl::encoding::Encode<
10979            CapabilitiesDirConnectorRouterCreateRequest,
10980            fidl::encoding::DefaultFuchsiaResourceDialect,
10981        > for (T0, T1)
10982    {
10983        #[inline]
10984        unsafe fn encode(
10985            self,
10986            encoder: &mut fidl::encoding::Encoder<
10987                '_,
10988                fidl::encoding::DefaultFuchsiaResourceDialect,
10989            >,
10990            offset: usize,
10991            depth: fidl::encoding::Depth,
10992        ) -> fidl::Result<()> {
10993            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
10994            // Zero out padding regions. There's no need to apply masks
10995            // because the unmasked parts will be overwritten by fields.
10996            // Write the fields.
10997            self.0.encode(encoder, offset + 0, depth)?;
10998            self.1.encode(encoder, offset + 4, depth)?;
10999            Ok(())
11000        }
11001    }
11002
11003    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11004        for CapabilitiesDirConnectorRouterCreateRequest
11005    {
11006        #[inline(always)]
11007        fn new_empty() -> Self {
11008            Self {
11009                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11010                router_client_end: fidl::new_empty!(
11011                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
11012                    fidl::encoding::DefaultFuchsiaResourceDialect
11013                ),
11014            }
11015        }
11016
11017        #[inline]
11018        unsafe fn decode(
11019            &mut self,
11020            decoder: &mut fidl::encoding::Decoder<
11021                '_,
11022                fidl::encoding::DefaultFuchsiaResourceDialect,
11023            >,
11024            offset: usize,
11025            _depth: fidl::encoding::Depth,
11026        ) -> fidl::Result<()> {
11027            decoder.debug_check_bounds::<Self>(offset);
11028            // Verify that padding bytes are zero.
11029            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11030            fidl::decode!(
11031                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
11032                fidl::encoding::DefaultFuchsiaResourceDialect,
11033                &mut self.router_client_end,
11034                decoder,
11035                offset + 4,
11036                _depth
11037            )?;
11038            Ok(())
11039        }
11040    }
11041
11042    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11043        type Borrowed<'a> = &'a mut Self;
11044        fn take_or_borrow<'a>(
11045            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11046        ) -> Self::Borrowed<'a> {
11047            value
11048        }
11049    }
11050
11051    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
11052        type Owned = Self;
11053
11054        #[inline(always)]
11055        fn inline_align(_context: fidl::encoding::Context) -> usize {
11056            8
11057        }
11058
11059        #[inline(always)]
11060        fn inline_size(_context: fidl::encoding::Context) -> usize {
11061            32
11062        }
11063    }
11064
11065    unsafe impl
11066        fidl::encoding::Encode<
11067            CapabilitiesDirConnectorRouterRouteRequest,
11068            fidl::encoding::DefaultFuchsiaResourceDialect,
11069        > for &mut CapabilitiesDirConnectorRouterRouteRequest
11070    {
11071        #[inline]
11072        unsafe fn encode(
11073            self,
11074            encoder: &mut fidl::encoding::Encoder<
11075                '_,
11076                fidl::encoding::DefaultFuchsiaResourceDialect,
11077            >,
11078            offset: usize,
11079            _depth: fidl::encoding::Depth,
11080        ) -> fidl::Result<()> {
11081            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11082            // Delegate to tuple encoding.
11083            fidl::encoding::Encode::<
11084                CapabilitiesDirConnectorRouterRouteRequest,
11085                fidl::encoding::DefaultFuchsiaResourceDialect,
11086            >::encode(
11087                (
11088                    <fidl::encoding::HandleType<
11089                        fidl::EventPair,
11090                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11091                        2147483648,
11092                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11093                        &mut self.router
11094                    ),
11095                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11096                    <fidl::encoding::HandleType<
11097                        fidl::EventPair,
11098                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11099                        2147483648,
11100                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11101                        &mut self.instance_token,
11102                    ),
11103                    <fidl::encoding::HandleType<
11104                        fidl::EventPair,
11105                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11106                        2147483648,
11107                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11108                        &mut self.dir_connector,
11109                    ),
11110                ),
11111                encoder,
11112                offset,
11113                _depth,
11114            )
11115        }
11116    }
11117    unsafe impl<
11118        T0: fidl::encoding::Encode<
11119                fidl::encoding::HandleType<
11120                    fidl::EventPair,
11121                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11122                    2147483648,
11123                >,
11124                fidl::encoding::DefaultFuchsiaResourceDialect,
11125            >,
11126        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11127        T2: fidl::encoding::Encode<
11128                fidl::encoding::HandleType<
11129                    fidl::EventPair,
11130                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11131                    2147483648,
11132                >,
11133                fidl::encoding::DefaultFuchsiaResourceDialect,
11134            >,
11135        T3: fidl::encoding::Encode<
11136                fidl::encoding::HandleType<
11137                    fidl::EventPair,
11138                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11139                    2147483648,
11140                >,
11141                fidl::encoding::DefaultFuchsiaResourceDialect,
11142            >,
11143    >
11144        fidl::encoding::Encode<
11145            CapabilitiesDirConnectorRouterRouteRequest,
11146            fidl::encoding::DefaultFuchsiaResourceDialect,
11147        > for (T0, T1, T2, T3)
11148    {
11149        #[inline]
11150        unsafe fn encode(
11151            self,
11152            encoder: &mut fidl::encoding::Encoder<
11153                '_,
11154                fidl::encoding::DefaultFuchsiaResourceDialect,
11155            >,
11156            offset: usize,
11157            depth: fidl::encoding::Depth,
11158        ) -> fidl::Result<()> {
11159            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
11160            // Zero out padding regions. There's no need to apply masks
11161            // because the unmasked parts will be overwritten by fields.
11162            unsafe {
11163                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
11164                (ptr as *mut u64).write_unaligned(0);
11165            }
11166            // Write the fields.
11167            self.0.encode(encoder, offset + 0, depth)?;
11168            self.1.encode(encoder, offset + 8, depth)?;
11169            self.2.encode(encoder, offset + 24, depth)?;
11170            self.3.encode(encoder, offset + 28, depth)?;
11171            Ok(())
11172        }
11173    }
11174
11175    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11176        for CapabilitiesDirConnectorRouterRouteRequest
11177    {
11178        #[inline(always)]
11179        fn new_empty() -> Self {
11180            Self {
11181                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11182                request: fidl::new_empty!(
11183                    RouteRequest,
11184                    fidl::encoding::DefaultFuchsiaResourceDialect
11185                ),
11186                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11187                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11188            }
11189        }
11190
11191        #[inline]
11192        unsafe fn decode(
11193            &mut self,
11194            decoder: &mut fidl::encoding::Decoder<
11195                '_,
11196                fidl::encoding::DefaultFuchsiaResourceDialect,
11197            >,
11198            offset: usize,
11199            _depth: fidl::encoding::Depth,
11200        ) -> fidl::Result<()> {
11201            decoder.debug_check_bounds::<Self>(offset);
11202            // Verify that padding bytes are zero.
11203            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
11204            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11205            let mask = 0xffffffff00000000u64;
11206            let maskedval = padval & mask;
11207            if maskedval != 0 {
11208                return Err(fidl::Error::NonZeroPadding {
11209                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
11210                });
11211            }
11212            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
11213            fidl::decode!(
11214                RouteRequest,
11215                fidl::encoding::DefaultFuchsiaResourceDialect,
11216                &mut self.request,
11217                decoder,
11218                offset + 8,
11219                _depth
11220            )?;
11221            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 24, _depth)?;
11222            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 28, _depth)?;
11223            Ok(())
11224        }
11225    }
11226
11227    impl fidl::encoding::ResourceTypeMarker for CapabilitiesInstanceTokenCreateRequest {
11228        type Borrowed<'a> = &'a mut Self;
11229        fn take_or_borrow<'a>(
11230            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11231        ) -> Self::Borrowed<'a> {
11232            value
11233        }
11234    }
11235
11236    unsafe impl fidl::encoding::TypeMarker for CapabilitiesInstanceTokenCreateRequest {
11237        type Owned = Self;
11238
11239        #[inline(always)]
11240        fn inline_align(_context: fidl::encoding::Context) -> usize {
11241            4
11242        }
11243
11244        #[inline(always)]
11245        fn inline_size(_context: fidl::encoding::Context) -> usize {
11246            4
11247        }
11248    }
11249
11250    unsafe impl
11251        fidl::encoding::Encode<
11252            CapabilitiesInstanceTokenCreateRequest,
11253            fidl::encoding::DefaultFuchsiaResourceDialect,
11254        > for &mut CapabilitiesInstanceTokenCreateRequest
11255    {
11256        #[inline]
11257        unsafe fn encode(
11258            self,
11259            encoder: &mut fidl::encoding::Encoder<
11260                '_,
11261                fidl::encoding::DefaultFuchsiaResourceDialect,
11262            >,
11263            offset: usize,
11264            _depth: fidl::encoding::Depth,
11265        ) -> fidl::Result<()> {
11266            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11267            // Delegate to tuple encoding.
11268            fidl::encoding::Encode::<
11269                CapabilitiesInstanceTokenCreateRequest,
11270                fidl::encoding::DefaultFuchsiaResourceDialect,
11271            >::encode(
11272                (<fidl::encoding::HandleType<
11273                    fidl::EventPair,
11274                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11275                    2147483648,
11276                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11277                    &mut self.instance_token
11278                ),),
11279                encoder,
11280                offset,
11281                _depth,
11282            )
11283        }
11284    }
11285    unsafe impl<
11286        T0: fidl::encoding::Encode<
11287                fidl::encoding::HandleType<
11288                    fidl::EventPair,
11289                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11290                    2147483648,
11291                >,
11292                fidl::encoding::DefaultFuchsiaResourceDialect,
11293            >,
11294    >
11295        fidl::encoding::Encode<
11296            CapabilitiesInstanceTokenCreateRequest,
11297            fidl::encoding::DefaultFuchsiaResourceDialect,
11298        > for (T0,)
11299    {
11300        #[inline]
11301        unsafe fn encode(
11302            self,
11303            encoder: &mut fidl::encoding::Encoder<
11304                '_,
11305                fidl::encoding::DefaultFuchsiaResourceDialect,
11306            >,
11307            offset: usize,
11308            depth: fidl::encoding::Depth,
11309        ) -> fidl::Result<()> {
11310            encoder.debug_check_bounds::<CapabilitiesInstanceTokenCreateRequest>(offset);
11311            // Zero out padding regions. There's no need to apply masks
11312            // because the unmasked parts will be overwritten by fields.
11313            // Write the fields.
11314            self.0.encode(encoder, offset + 0, depth)?;
11315            Ok(())
11316        }
11317    }
11318
11319    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11320        for CapabilitiesInstanceTokenCreateRequest
11321    {
11322        #[inline(always)]
11323        fn new_empty() -> Self {
11324            Self {
11325                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11326            }
11327        }
11328
11329        #[inline]
11330        unsafe fn decode(
11331            &mut self,
11332            decoder: &mut fidl::encoding::Decoder<
11333                '_,
11334                fidl::encoding::DefaultFuchsiaResourceDialect,
11335            >,
11336            offset: usize,
11337            _depth: fidl::encoding::Depth,
11338        ) -> fidl::Result<()> {
11339            decoder.debug_check_bounds::<Self>(offset);
11340            // Verify that padding bytes are zero.
11341            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 0, _depth)?;
11342            Ok(())
11343        }
11344    }
11345
11346    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetResponse {
11347        type Borrowed<'a> = &'a mut Self;
11348        fn take_or_borrow<'a>(
11349            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11350        ) -> Self::Borrowed<'a> {
11351            value
11352        }
11353    }
11354
11355    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetResponse {
11356        type Owned = Self;
11357
11358        #[inline(always)]
11359        fn inline_align(_context: fidl::encoding::Context) -> usize {
11360            4
11361        }
11362
11363        #[inline(always)]
11364        fn inline_size(_context: fidl::encoding::Context) -> usize {
11365            4
11366        }
11367    }
11368
11369    unsafe impl
11370        fidl::encoding::Encode<
11371            CapabilitiesDictionaryGetResponse,
11372            fidl::encoding::DefaultFuchsiaResourceDialect,
11373        > for &mut CapabilitiesDictionaryGetResponse
11374    {
11375        #[inline]
11376        unsafe fn encode(
11377            self,
11378            encoder: &mut fidl::encoding::Encoder<
11379                '_,
11380                fidl::encoding::DefaultFuchsiaResourceDialect,
11381            >,
11382            offset: usize,
11383            _depth: fidl::encoding::Depth,
11384        ) -> fidl::Result<()> {
11385            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11386            // Delegate to tuple encoding.
11387            fidl::encoding::Encode::<
11388                CapabilitiesDictionaryGetResponse,
11389                fidl::encoding::DefaultFuchsiaResourceDialect,
11390            >::encode(
11391                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11392                    &self.capability_type,
11393                ),),
11394                encoder,
11395                offset,
11396                _depth,
11397            )
11398        }
11399    }
11400    unsafe impl<
11401        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11402    >
11403        fidl::encoding::Encode<
11404            CapabilitiesDictionaryGetResponse,
11405            fidl::encoding::DefaultFuchsiaResourceDialect,
11406        > for (T0,)
11407    {
11408        #[inline]
11409        unsafe fn encode(
11410            self,
11411            encoder: &mut fidl::encoding::Encoder<
11412                '_,
11413                fidl::encoding::DefaultFuchsiaResourceDialect,
11414            >,
11415            offset: usize,
11416            depth: fidl::encoding::Depth,
11417        ) -> fidl::Result<()> {
11418            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
11419            // Zero out padding regions. There's no need to apply masks
11420            // because the unmasked parts will be overwritten by fields.
11421            // Write the fields.
11422            self.0.encode(encoder, offset + 0, depth)?;
11423            Ok(())
11424        }
11425    }
11426
11427    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11428        for CapabilitiesDictionaryGetResponse
11429    {
11430        #[inline(always)]
11431        fn new_empty() -> Self {
11432            Self {
11433                capability_type: fidl::new_empty!(
11434                    CapabilityType,
11435                    fidl::encoding::DefaultFuchsiaResourceDialect
11436                ),
11437            }
11438        }
11439
11440        #[inline]
11441        unsafe fn decode(
11442            &mut self,
11443            decoder: &mut fidl::encoding::Decoder<
11444                '_,
11445                fidl::encoding::DefaultFuchsiaResourceDialect,
11446            >,
11447            offset: usize,
11448            _depth: fidl::encoding::Depth,
11449        ) -> fidl::Result<()> {
11450            decoder.debug_check_bounds::<Self>(offset);
11451            // Verify that padding bytes are zero.
11452            fidl::decode!(
11453                CapabilityType,
11454                fidl::encoding::DefaultFuchsiaResourceDialect,
11455                &mut self.capability_type,
11456                decoder,
11457                offset + 0,
11458                _depth
11459            )?;
11460            Ok(())
11461        }
11462    }
11463
11464    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveResponse {
11465        type Borrowed<'a> = &'a mut Self;
11466        fn take_or_borrow<'a>(
11467            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11468        ) -> Self::Borrowed<'a> {
11469            value
11470        }
11471    }
11472
11473    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveResponse {
11474        type Owned = Self;
11475
11476        #[inline(always)]
11477        fn inline_align(_context: fidl::encoding::Context) -> usize {
11478            4
11479        }
11480
11481        #[inline(always)]
11482        fn inline_size(_context: fidl::encoding::Context) -> usize {
11483            4
11484        }
11485    }
11486
11487    unsafe impl
11488        fidl::encoding::Encode<
11489            CapabilitiesDictionaryRemoveResponse,
11490            fidl::encoding::DefaultFuchsiaResourceDialect,
11491        > for &mut CapabilitiesDictionaryRemoveResponse
11492    {
11493        #[inline]
11494        unsafe fn encode(
11495            self,
11496            encoder: &mut fidl::encoding::Encoder<
11497                '_,
11498                fidl::encoding::DefaultFuchsiaResourceDialect,
11499            >,
11500            offset: usize,
11501            _depth: fidl::encoding::Depth,
11502        ) -> fidl::Result<()> {
11503            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11504            // Delegate to tuple encoding.
11505            fidl::encoding::Encode::<
11506                CapabilitiesDictionaryRemoveResponse,
11507                fidl::encoding::DefaultFuchsiaResourceDialect,
11508            >::encode(
11509                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
11510                    &self.capability_type,
11511                ),),
11512                encoder,
11513                offset,
11514                _depth,
11515            )
11516        }
11517    }
11518    unsafe impl<
11519        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
11520    >
11521        fidl::encoding::Encode<
11522            CapabilitiesDictionaryRemoveResponse,
11523            fidl::encoding::DefaultFuchsiaResourceDialect,
11524        > for (T0,)
11525    {
11526        #[inline]
11527        unsafe fn encode(
11528            self,
11529            encoder: &mut fidl::encoding::Encoder<
11530                '_,
11531                fidl::encoding::DefaultFuchsiaResourceDialect,
11532            >,
11533            offset: usize,
11534            depth: fidl::encoding::Depth,
11535        ) -> fidl::Result<()> {
11536            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
11537            // Zero out padding regions. There's no need to apply masks
11538            // because the unmasked parts will be overwritten by fields.
11539            // Write the fields.
11540            self.0.encode(encoder, offset + 0, depth)?;
11541            Ok(())
11542        }
11543    }
11544
11545    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11546        for CapabilitiesDictionaryRemoveResponse
11547    {
11548        #[inline(always)]
11549        fn new_empty() -> Self {
11550            Self {
11551                capability_type: fidl::new_empty!(
11552                    CapabilityType,
11553                    fidl::encoding::DefaultFuchsiaResourceDialect
11554                ),
11555            }
11556        }
11557
11558        #[inline]
11559        unsafe fn decode(
11560            &mut self,
11561            decoder: &mut fidl::encoding::Decoder<
11562                '_,
11563                fidl::encoding::DefaultFuchsiaResourceDialect,
11564            >,
11565            offset: usize,
11566            _depth: fidl::encoding::Depth,
11567        ) -> fidl::Result<()> {
11568            decoder.debug_check_bounds::<Self>(offset);
11569            // Verify that padding bytes are zero.
11570            fidl::decode!(
11571                CapabilityType,
11572                fidl::encoding::DefaultFuchsiaResourceDialect,
11573                &mut self.capability_type,
11574                decoder,
11575                offset + 0,
11576                _depth
11577            )?;
11578            Ok(())
11579        }
11580    }
11581
11582    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteRequest {
11583        type Borrowed<'a> = &'a mut Self;
11584        fn take_or_borrow<'a>(
11585            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11586        ) -> Self::Borrowed<'a> {
11587            value
11588        }
11589    }
11590
11591    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteRequest {
11592        type Owned = Self;
11593
11594        #[inline(always)]
11595        fn inline_align(_context: fidl::encoding::Context) -> usize {
11596            8
11597        }
11598
11599        #[inline(always)]
11600        fn inline_size(_context: fidl::encoding::Context) -> usize {
11601            24
11602        }
11603    }
11604
11605    unsafe impl
11606        fidl::encoding::Encode<
11607            ConnectorRouterRouteRequest,
11608            fidl::encoding::DefaultFuchsiaResourceDialect,
11609        > for &mut ConnectorRouterRouteRequest
11610    {
11611        #[inline]
11612        unsafe fn encode(
11613            self,
11614            encoder: &mut fidl::encoding::Encoder<
11615                '_,
11616                fidl::encoding::DefaultFuchsiaResourceDialect,
11617            >,
11618            offset: usize,
11619            _depth: fidl::encoding::Depth,
11620        ) -> fidl::Result<()> {
11621            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11622            // Delegate to tuple encoding.
11623            fidl::encoding::Encode::<
11624                ConnectorRouterRouteRequest,
11625                fidl::encoding::DefaultFuchsiaResourceDialect,
11626            >::encode(
11627                (
11628                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11629                    <fidl::encoding::HandleType<
11630                        fidl::EventPair,
11631                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11632                        2147483648,
11633                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11634                        &mut self.instance_token,
11635                    ),
11636                    <fidl::encoding::HandleType<
11637                        fidl::EventPair,
11638                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11639                        2147483648,
11640                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11641                        &mut self.handle
11642                    ),
11643                ),
11644                encoder,
11645                offset,
11646                _depth,
11647            )
11648        }
11649    }
11650    unsafe impl<
11651        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11652        T1: fidl::encoding::Encode<
11653                fidl::encoding::HandleType<
11654                    fidl::EventPair,
11655                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11656                    2147483648,
11657                >,
11658                fidl::encoding::DefaultFuchsiaResourceDialect,
11659            >,
11660        T2: fidl::encoding::Encode<
11661                fidl::encoding::HandleType<
11662                    fidl::EventPair,
11663                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11664                    2147483648,
11665                >,
11666                fidl::encoding::DefaultFuchsiaResourceDialect,
11667            >,
11668    >
11669        fidl::encoding::Encode<
11670            ConnectorRouterRouteRequest,
11671            fidl::encoding::DefaultFuchsiaResourceDialect,
11672        > for (T0, T1, T2)
11673    {
11674        #[inline]
11675        unsafe fn encode(
11676            self,
11677            encoder: &mut fidl::encoding::Encoder<
11678                '_,
11679                fidl::encoding::DefaultFuchsiaResourceDialect,
11680            >,
11681            offset: usize,
11682            depth: fidl::encoding::Depth,
11683        ) -> fidl::Result<()> {
11684            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
11685            // Zero out padding regions. There's no need to apply masks
11686            // because the unmasked parts will be overwritten by fields.
11687            // Write the fields.
11688            self.0.encode(encoder, offset + 0, depth)?;
11689            self.1.encode(encoder, offset + 16, depth)?;
11690            self.2.encode(encoder, offset + 20, depth)?;
11691            Ok(())
11692        }
11693    }
11694
11695    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11696        for ConnectorRouterRouteRequest
11697    {
11698        #[inline(always)]
11699        fn new_empty() -> Self {
11700            Self {
11701                request: fidl::new_empty!(
11702                    RouteRequest,
11703                    fidl::encoding::DefaultFuchsiaResourceDialect
11704                ),
11705                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11706                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11707            }
11708        }
11709
11710        #[inline]
11711        unsafe fn decode(
11712            &mut self,
11713            decoder: &mut fidl::encoding::Decoder<
11714                '_,
11715                fidl::encoding::DefaultFuchsiaResourceDialect,
11716            >,
11717            offset: usize,
11718            _depth: fidl::encoding::Depth,
11719        ) -> fidl::Result<()> {
11720            decoder.debug_check_bounds::<Self>(offset);
11721            // Verify that padding bytes are zero.
11722            fidl::decode!(
11723                RouteRequest,
11724                fidl::encoding::DefaultFuchsiaResourceDialect,
11725                &mut self.request,
11726                decoder,
11727                offset + 0,
11728                _depth
11729            )?;
11730            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11731            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11732            Ok(())
11733        }
11734    }
11735
11736    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteRequest {
11737        type Borrowed<'a> = &'a mut Self;
11738        fn take_or_borrow<'a>(
11739            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11740        ) -> Self::Borrowed<'a> {
11741            value
11742        }
11743    }
11744
11745    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteRequest {
11746        type Owned = Self;
11747
11748        #[inline(always)]
11749        fn inline_align(_context: fidl::encoding::Context) -> usize {
11750            8
11751        }
11752
11753        #[inline(always)]
11754        fn inline_size(_context: fidl::encoding::Context) -> usize {
11755            24
11756        }
11757    }
11758
11759    unsafe impl
11760        fidl::encoding::Encode<
11761            DataRouterRouteRequest,
11762            fidl::encoding::DefaultFuchsiaResourceDialect,
11763        > for &mut DataRouterRouteRequest
11764    {
11765        #[inline]
11766        unsafe fn encode(
11767            self,
11768            encoder: &mut fidl::encoding::Encoder<
11769                '_,
11770                fidl::encoding::DefaultFuchsiaResourceDialect,
11771            >,
11772            offset: usize,
11773            _depth: fidl::encoding::Depth,
11774        ) -> fidl::Result<()> {
11775            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11776            // Delegate to tuple encoding.
11777            fidl::encoding::Encode::<
11778                DataRouterRouteRequest,
11779                fidl::encoding::DefaultFuchsiaResourceDialect,
11780            >::encode(
11781                (
11782                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11783                    <fidl::encoding::HandleType<
11784                        fidl::EventPair,
11785                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11786                        2147483648,
11787                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11788                        &mut self.instance_token,
11789                    ),
11790                    <fidl::encoding::HandleType<
11791                        fidl::EventPair,
11792                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11793                        2147483648,
11794                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11795                        &mut self.handle
11796                    ),
11797                ),
11798                encoder,
11799                offset,
11800                _depth,
11801            )
11802        }
11803    }
11804    unsafe impl<
11805        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11806        T1: fidl::encoding::Encode<
11807                fidl::encoding::HandleType<
11808                    fidl::EventPair,
11809                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11810                    2147483648,
11811                >,
11812                fidl::encoding::DefaultFuchsiaResourceDialect,
11813            >,
11814        T2: fidl::encoding::Encode<
11815                fidl::encoding::HandleType<
11816                    fidl::EventPair,
11817                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11818                    2147483648,
11819                >,
11820                fidl::encoding::DefaultFuchsiaResourceDialect,
11821            >,
11822    >
11823        fidl::encoding::Encode<
11824            DataRouterRouteRequest,
11825            fidl::encoding::DefaultFuchsiaResourceDialect,
11826        > for (T0, T1, T2)
11827    {
11828        #[inline]
11829        unsafe fn encode(
11830            self,
11831            encoder: &mut fidl::encoding::Encoder<
11832                '_,
11833                fidl::encoding::DefaultFuchsiaResourceDialect,
11834            >,
11835            offset: usize,
11836            depth: fidl::encoding::Depth,
11837        ) -> fidl::Result<()> {
11838            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
11839            // Zero out padding regions. There's no need to apply masks
11840            // because the unmasked parts will be overwritten by fields.
11841            // Write the fields.
11842            self.0.encode(encoder, offset + 0, depth)?;
11843            self.1.encode(encoder, offset + 16, depth)?;
11844            self.2.encode(encoder, offset + 20, depth)?;
11845            Ok(())
11846        }
11847    }
11848
11849    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11850        for DataRouterRouteRequest
11851    {
11852        #[inline(always)]
11853        fn new_empty() -> Self {
11854            Self {
11855                request: fidl::new_empty!(
11856                    RouteRequest,
11857                    fidl::encoding::DefaultFuchsiaResourceDialect
11858                ),
11859                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11860                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11861            }
11862        }
11863
11864        #[inline]
11865        unsafe fn decode(
11866            &mut self,
11867            decoder: &mut fidl::encoding::Decoder<
11868                '_,
11869                fidl::encoding::DefaultFuchsiaResourceDialect,
11870            >,
11871            offset: usize,
11872            _depth: fidl::encoding::Depth,
11873        ) -> fidl::Result<()> {
11874            decoder.debug_check_bounds::<Self>(offset);
11875            // Verify that padding bytes are zero.
11876            fidl::decode!(
11877                RouteRequest,
11878                fidl::encoding::DefaultFuchsiaResourceDialect,
11879                &mut self.request,
11880                decoder,
11881                offset + 0,
11882                _depth
11883            )?;
11884            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
11885            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
11886            Ok(())
11887        }
11888    }
11889
11890    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteRequest {
11891        type Borrowed<'a> = &'a mut Self;
11892        fn take_or_borrow<'a>(
11893            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11894        ) -> Self::Borrowed<'a> {
11895            value
11896        }
11897    }
11898
11899    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteRequest {
11900        type Owned = Self;
11901
11902        #[inline(always)]
11903        fn inline_align(_context: fidl::encoding::Context) -> usize {
11904            8
11905        }
11906
11907        #[inline(always)]
11908        fn inline_size(_context: fidl::encoding::Context) -> usize {
11909            24
11910        }
11911    }
11912
11913    unsafe impl
11914        fidl::encoding::Encode<
11915            DictionaryRouterRouteRequest,
11916            fidl::encoding::DefaultFuchsiaResourceDialect,
11917        > for &mut DictionaryRouterRouteRequest
11918    {
11919        #[inline]
11920        unsafe fn encode(
11921            self,
11922            encoder: &mut fidl::encoding::Encoder<
11923                '_,
11924                fidl::encoding::DefaultFuchsiaResourceDialect,
11925            >,
11926            offset: usize,
11927            _depth: fidl::encoding::Depth,
11928        ) -> fidl::Result<()> {
11929            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11930            // Delegate to tuple encoding.
11931            fidl::encoding::Encode::<
11932                DictionaryRouterRouteRequest,
11933                fidl::encoding::DefaultFuchsiaResourceDialect,
11934            >::encode(
11935                (
11936                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
11937                    <fidl::encoding::HandleType<
11938                        fidl::EventPair,
11939                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11940                        2147483648,
11941                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11942                        &mut self.instance_token,
11943                    ),
11944                    <fidl::encoding::HandleType<
11945                        fidl::EventPair,
11946                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11947                        2147483648,
11948                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11949                        &mut self.handle
11950                    ),
11951                ),
11952                encoder,
11953                offset,
11954                _depth,
11955            )
11956        }
11957    }
11958    unsafe impl<
11959        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
11960        T1: fidl::encoding::Encode<
11961                fidl::encoding::HandleType<
11962                    fidl::EventPair,
11963                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11964                    2147483648,
11965                >,
11966                fidl::encoding::DefaultFuchsiaResourceDialect,
11967            >,
11968        T2: fidl::encoding::Encode<
11969                fidl::encoding::HandleType<
11970                    fidl::EventPair,
11971                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11972                    2147483648,
11973                >,
11974                fidl::encoding::DefaultFuchsiaResourceDialect,
11975            >,
11976    >
11977        fidl::encoding::Encode<
11978            DictionaryRouterRouteRequest,
11979            fidl::encoding::DefaultFuchsiaResourceDialect,
11980        > for (T0, T1, T2)
11981    {
11982        #[inline]
11983        unsafe fn encode(
11984            self,
11985            encoder: &mut fidl::encoding::Encoder<
11986                '_,
11987                fidl::encoding::DefaultFuchsiaResourceDialect,
11988            >,
11989            offset: usize,
11990            depth: fidl::encoding::Depth,
11991        ) -> fidl::Result<()> {
11992            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
11993            // Zero out padding regions. There's no need to apply masks
11994            // because the unmasked parts will be overwritten by fields.
11995            // Write the fields.
11996            self.0.encode(encoder, offset + 0, depth)?;
11997            self.1.encode(encoder, offset + 16, depth)?;
11998            self.2.encode(encoder, offset + 20, depth)?;
11999            Ok(())
12000        }
12001    }
12002
12003    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12004        for DictionaryRouterRouteRequest
12005    {
12006        #[inline(always)]
12007        fn new_empty() -> Self {
12008            Self {
12009                request: fidl::new_empty!(
12010                    RouteRequest,
12011                    fidl::encoding::DefaultFuchsiaResourceDialect
12012                ),
12013                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12014                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12015            }
12016        }
12017
12018        #[inline]
12019        unsafe fn decode(
12020            &mut self,
12021            decoder: &mut fidl::encoding::Decoder<
12022                '_,
12023                fidl::encoding::DefaultFuchsiaResourceDialect,
12024            >,
12025            offset: usize,
12026            _depth: fidl::encoding::Depth,
12027        ) -> fidl::Result<()> {
12028            decoder.debug_check_bounds::<Self>(offset);
12029            // Verify that padding bytes are zero.
12030            fidl::decode!(
12031                RouteRequest,
12032                fidl::encoding::DefaultFuchsiaResourceDialect,
12033                &mut self.request,
12034                decoder,
12035                offset + 0,
12036                _depth
12037            )?;
12038            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12039            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12040            Ok(())
12041        }
12042    }
12043
12044    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteRequest {
12045        type Borrowed<'a> = &'a mut Self;
12046        fn take_or_borrow<'a>(
12047            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12048        ) -> Self::Borrowed<'a> {
12049            value
12050        }
12051    }
12052
12053    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteRequest {
12054        type Owned = Self;
12055
12056        #[inline(always)]
12057        fn inline_align(_context: fidl::encoding::Context) -> usize {
12058            8
12059        }
12060
12061        #[inline(always)]
12062        fn inline_size(_context: fidl::encoding::Context) -> usize {
12063            24
12064        }
12065    }
12066
12067    unsafe impl
12068        fidl::encoding::Encode<
12069            DirConnectorRouterRouteRequest,
12070            fidl::encoding::DefaultFuchsiaResourceDialect,
12071        > for &mut DirConnectorRouterRouteRequest
12072    {
12073        #[inline]
12074        unsafe fn encode(
12075            self,
12076            encoder: &mut fidl::encoding::Encoder<
12077                '_,
12078                fidl::encoding::DefaultFuchsiaResourceDialect,
12079            >,
12080            offset: usize,
12081            _depth: fidl::encoding::Depth,
12082        ) -> fidl::Result<()> {
12083            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12084            // Delegate to tuple encoding.
12085            fidl::encoding::Encode::<
12086                DirConnectorRouterRouteRequest,
12087                fidl::encoding::DefaultFuchsiaResourceDialect,
12088            >::encode(
12089                (
12090                    <RouteRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),
12091                    <fidl::encoding::HandleType<
12092                        fidl::EventPair,
12093                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12094                        2147483648,
12095                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12096                        &mut self.instance_token,
12097                    ),
12098                    <fidl::encoding::HandleType<
12099                        fidl::EventPair,
12100                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12101                        2147483648,
12102                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12103                        &mut self.handle
12104                    ),
12105                ),
12106                encoder,
12107                offset,
12108                _depth,
12109            )
12110        }
12111    }
12112    unsafe impl<
12113        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
12114        T1: fidl::encoding::Encode<
12115                fidl::encoding::HandleType<
12116                    fidl::EventPair,
12117                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12118                    2147483648,
12119                >,
12120                fidl::encoding::DefaultFuchsiaResourceDialect,
12121            >,
12122        T2: fidl::encoding::Encode<
12123                fidl::encoding::HandleType<
12124                    fidl::EventPair,
12125                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12126                    2147483648,
12127                >,
12128                fidl::encoding::DefaultFuchsiaResourceDialect,
12129            >,
12130    >
12131        fidl::encoding::Encode<
12132            DirConnectorRouterRouteRequest,
12133            fidl::encoding::DefaultFuchsiaResourceDialect,
12134        > for (T0, T1, T2)
12135    {
12136        #[inline]
12137        unsafe fn encode(
12138            self,
12139            encoder: &mut fidl::encoding::Encoder<
12140                '_,
12141                fidl::encoding::DefaultFuchsiaResourceDialect,
12142            >,
12143            offset: usize,
12144            depth: fidl::encoding::Depth,
12145        ) -> fidl::Result<()> {
12146            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
12147            // Zero out padding regions. There's no need to apply masks
12148            // because the unmasked parts will be overwritten by fields.
12149            // Write the fields.
12150            self.0.encode(encoder, offset + 0, depth)?;
12151            self.1.encode(encoder, offset + 16, depth)?;
12152            self.2.encode(encoder, offset + 20, depth)?;
12153            Ok(())
12154        }
12155    }
12156
12157    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12158        for DirConnectorRouterRouteRequest
12159    {
12160        #[inline(always)]
12161        fn new_empty() -> Self {
12162            Self {
12163                request: fidl::new_empty!(
12164                    RouteRequest,
12165                    fidl::encoding::DefaultFuchsiaResourceDialect
12166                ),
12167                instance_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12168                handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12169            }
12170        }
12171
12172        #[inline]
12173        unsafe fn decode(
12174            &mut self,
12175            decoder: &mut fidl::encoding::Decoder<
12176                '_,
12177                fidl::encoding::DefaultFuchsiaResourceDialect,
12178            >,
12179            offset: usize,
12180            _depth: fidl::encoding::Depth,
12181        ) -> fidl::Result<()> {
12182            decoder.debug_check_bounds::<Self>(offset);
12183            // Verify that padding bytes are zero.
12184            fidl::decode!(
12185                RouteRequest,
12186                fidl::encoding::DefaultFuchsiaResourceDialect,
12187                &mut self.request,
12188                decoder,
12189                offset + 0,
12190                _depth
12191            )?;
12192            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.instance_token, decoder, offset + 16, _depth)?;
12193            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 20, _depth)?;
12194            Ok(())
12195        }
12196    }
12197
12198    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
12199        type Borrowed<'a> = &'a mut Self;
12200        fn take_or_borrow<'a>(
12201            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12202        ) -> Self::Borrowed<'a> {
12203            value
12204        }
12205    }
12206
12207    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
12208        type Owned = Self;
12209
12210        #[inline(always)]
12211        fn inline_align(_context: fidl::encoding::Context) -> usize {
12212            8
12213        }
12214
12215        #[inline(always)]
12216        fn inline_size(_context: fidl::encoding::Context) -> usize {
12217            32
12218        }
12219    }
12220
12221    unsafe impl
12222        fidl::encoding::Encode<
12223            DirReceiverReceiveRequest,
12224            fidl::encoding::DefaultFuchsiaResourceDialect,
12225        > for &mut DirReceiverReceiveRequest
12226    {
12227        #[inline]
12228        unsafe fn encode(
12229            self,
12230            encoder: &mut fidl::encoding::Encoder<
12231                '_,
12232                fidl::encoding::DefaultFuchsiaResourceDialect,
12233            >,
12234            offset: usize,
12235            _depth: fidl::encoding::Depth,
12236        ) -> fidl::Result<()> {
12237            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12238            // Delegate to tuple encoding.
12239            fidl::encoding::Encode::<DirReceiverReceiveRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12240                (
12241                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12242                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
12243                    <fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.rights),
12244                ),
12245                encoder, offset, _depth
12246            )
12247        }
12248    }
12249    unsafe impl<
12250        T0: fidl::encoding::Encode<
12251                fidl::encoding::Endpoint<
12252                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12253                >,
12254                fidl::encoding::DefaultFuchsiaResourceDialect,
12255            >,
12256        T1: fidl::encoding::Encode<
12257                fidl::encoding::BoundedString<4095>,
12258                fidl::encoding::DefaultFuchsiaResourceDialect,
12259            >,
12260        T2: fidl::encoding::Encode<
12261                fidl_fuchsia_io::Flags,
12262                fidl::encoding::DefaultFuchsiaResourceDialect,
12263            >,
12264    >
12265        fidl::encoding::Encode<
12266            DirReceiverReceiveRequest,
12267            fidl::encoding::DefaultFuchsiaResourceDialect,
12268        > for (T0, T1, T2)
12269    {
12270        #[inline]
12271        unsafe fn encode(
12272            self,
12273            encoder: &mut fidl::encoding::Encoder<
12274                '_,
12275                fidl::encoding::DefaultFuchsiaResourceDialect,
12276            >,
12277            offset: usize,
12278            depth: fidl::encoding::Depth,
12279        ) -> fidl::Result<()> {
12280            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
12281            // Zero out padding regions. There's no need to apply masks
12282            // because the unmasked parts will be overwritten by fields.
12283            unsafe {
12284                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12285                (ptr as *mut u64).write_unaligned(0);
12286            }
12287            // Write the fields.
12288            self.0.encode(encoder, offset + 0, depth)?;
12289            self.1.encode(encoder, offset + 8, depth)?;
12290            self.2.encode(encoder, offset + 24, depth)?;
12291            Ok(())
12292        }
12293    }
12294
12295    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12296        for DirReceiverReceiveRequest
12297    {
12298        #[inline(always)]
12299        fn new_empty() -> Self {
12300            Self {
12301                channel: fidl::new_empty!(
12302                    fidl::encoding::Endpoint<
12303                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12304                    >,
12305                    fidl::encoding::DefaultFuchsiaResourceDialect
12306                ),
12307                path: fidl::new_empty!(
12308                    fidl::encoding::BoundedString<4095>,
12309                    fidl::encoding::DefaultFuchsiaResourceDialect
12310                ),
12311                rights: fidl::new_empty!(
12312                    fidl_fuchsia_io::Flags,
12313                    fidl::encoding::DefaultFuchsiaResourceDialect
12314                ),
12315            }
12316        }
12317
12318        #[inline]
12319        unsafe fn decode(
12320            &mut self,
12321            decoder: &mut fidl::encoding::Decoder<
12322                '_,
12323                fidl::encoding::DefaultFuchsiaResourceDialect,
12324            >,
12325            offset: usize,
12326            _depth: fidl::encoding::Depth,
12327        ) -> fidl::Result<()> {
12328            decoder.debug_check_bounds::<Self>(offset);
12329            // Verify that padding bytes are zero.
12330            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12331            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12332            let mask = 0xffffffff00000000u64;
12333            let maskedval = padval & mask;
12334            if maskedval != 0 {
12335                return Err(fidl::Error::NonZeroPadding {
12336                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12337                });
12338            }
12339            fidl::decode!(
12340                fidl::encoding::Endpoint<
12341                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12342                >,
12343                fidl::encoding::DefaultFuchsiaResourceDialect,
12344                &mut self.channel,
12345                decoder,
12346                offset + 0,
12347                _depth
12348            )?;
12349            fidl::decode!(
12350                fidl::encoding::BoundedString<4095>,
12351                fidl::encoding::DefaultFuchsiaResourceDialect,
12352                &mut self.path,
12353                decoder,
12354                offset + 8,
12355                _depth
12356            )?;
12357            fidl::decode!(
12358                fidl_fuchsia_io::Flags,
12359                fidl::encoding::DefaultFuchsiaResourceDialect,
12360                &mut self.rights,
12361                decoder,
12362                offset + 24,
12363                _depth
12364            )?;
12365            Ok(())
12366        }
12367    }
12368
12369    impl fidl::encoding::ResourceTypeMarker for ReceiverReceiveRequest {
12370        type Borrowed<'a> = &'a mut Self;
12371        fn take_or_borrow<'a>(
12372            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12373        ) -> Self::Borrowed<'a> {
12374            value
12375        }
12376    }
12377
12378    unsafe impl fidl::encoding::TypeMarker for ReceiverReceiveRequest {
12379        type Owned = Self;
12380
12381        #[inline(always)]
12382        fn inline_align(_context: fidl::encoding::Context) -> usize {
12383            4
12384        }
12385
12386        #[inline(always)]
12387        fn inline_size(_context: fidl::encoding::Context) -> usize {
12388            4
12389        }
12390    }
12391
12392    unsafe impl
12393        fidl::encoding::Encode<
12394            ReceiverReceiveRequest,
12395            fidl::encoding::DefaultFuchsiaResourceDialect,
12396        > for &mut ReceiverReceiveRequest
12397    {
12398        #[inline]
12399        unsafe fn encode(
12400            self,
12401            encoder: &mut fidl::encoding::Encoder<
12402                '_,
12403                fidl::encoding::DefaultFuchsiaResourceDialect,
12404            >,
12405            offset: usize,
12406            _depth: fidl::encoding::Depth,
12407        ) -> fidl::Result<()> {
12408            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12409            // Delegate to tuple encoding.
12410            fidl::encoding::Encode::<
12411                ReceiverReceiveRequest,
12412                fidl::encoding::DefaultFuchsiaResourceDialect,
12413            >::encode(
12414                (<fidl::encoding::HandleType<
12415                    fidl::Channel,
12416                    { fidl::ObjectType::CHANNEL.into_raw() },
12417                    2147483648,
12418                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12419                    &mut self.channel
12420                ),),
12421                encoder,
12422                offset,
12423                _depth,
12424            )
12425        }
12426    }
12427    unsafe impl<
12428        T0: fidl::encoding::Encode<
12429                fidl::encoding::HandleType<
12430                    fidl::Channel,
12431                    { fidl::ObjectType::CHANNEL.into_raw() },
12432                    2147483648,
12433                >,
12434                fidl::encoding::DefaultFuchsiaResourceDialect,
12435            >,
12436    >
12437        fidl::encoding::Encode<
12438            ReceiverReceiveRequest,
12439            fidl::encoding::DefaultFuchsiaResourceDialect,
12440        > for (T0,)
12441    {
12442        #[inline]
12443        unsafe fn encode(
12444            self,
12445            encoder: &mut fidl::encoding::Encoder<
12446                '_,
12447                fidl::encoding::DefaultFuchsiaResourceDialect,
12448            >,
12449            offset: usize,
12450            depth: fidl::encoding::Depth,
12451        ) -> fidl::Result<()> {
12452            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
12453            // Zero out padding regions. There's no need to apply masks
12454            // because the unmasked parts will be overwritten by fields.
12455            // Write the fields.
12456            self.0.encode(encoder, offset + 0, depth)?;
12457            Ok(())
12458        }
12459    }
12460
12461    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12462        for ReceiverReceiveRequest
12463    {
12464        #[inline(always)]
12465        fn new_empty() -> Self {
12466            Self {
12467                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12468            }
12469        }
12470
12471        #[inline]
12472        unsafe fn decode(
12473            &mut self,
12474            decoder: &mut fidl::encoding::Decoder<
12475                '_,
12476                fidl::encoding::DefaultFuchsiaResourceDialect,
12477            >,
12478            offset: usize,
12479            _depth: fidl::encoding::Depth,
12480        ) -> fidl::Result<()> {
12481            decoder.debug_check_bounds::<Self>(offset);
12482            // Verify that padding bytes are zero.
12483            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12484            Ok(())
12485        }
12486    }
12487
12488    impl CapabilitiesDictionaryRemoveRequest {
12489        #[inline(always)]
12490        fn max_ordinal_present(&self) -> u64 {
12491            if let Some(_) = self.value {
12492                return 3;
12493            }
12494            if let Some(_) = self.key {
12495                return 2;
12496            }
12497            if let Some(_) = self.dictionary {
12498                return 1;
12499            }
12500            0
12501        }
12502    }
12503
12504    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveRequest {
12505        type Borrowed<'a> = &'a mut Self;
12506        fn take_or_borrow<'a>(
12507            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12508        ) -> Self::Borrowed<'a> {
12509            value
12510        }
12511    }
12512
12513    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveRequest {
12514        type Owned = Self;
12515
12516        #[inline(always)]
12517        fn inline_align(_context: fidl::encoding::Context) -> usize {
12518            8
12519        }
12520
12521        #[inline(always)]
12522        fn inline_size(_context: fidl::encoding::Context) -> usize {
12523            16
12524        }
12525    }
12526
12527    unsafe impl
12528        fidl::encoding::Encode<
12529            CapabilitiesDictionaryRemoveRequest,
12530            fidl::encoding::DefaultFuchsiaResourceDialect,
12531        > for &mut CapabilitiesDictionaryRemoveRequest
12532    {
12533        unsafe fn encode(
12534            self,
12535            encoder: &mut fidl::encoding::Encoder<
12536                '_,
12537                fidl::encoding::DefaultFuchsiaResourceDialect,
12538            >,
12539            offset: usize,
12540            mut depth: fidl::encoding::Depth,
12541        ) -> fidl::Result<()> {
12542            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveRequest>(offset);
12543            // Vector header
12544            let max_ordinal: u64 = self.max_ordinal_present();
12545            encoder.write_num(max_ordinal, offset);
12546            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12547            // Calling encoder.out_of_line_offset(0) is not allowed.
12548            if max_ordinal == 0 {
12549                return Ok(());
12550            }
12551            depth.increment()?;
12552            let envelope_size = 8;
12553            let bytes_len = max_ordinal as usize * envelope_size;
12554            #[allow(unused_variables)]
12555            let offset = encoder.out_of_line_offset(bytes_len);
12556            let mut _prev_end_offset: usize = 0;
12557            if 1 > max_ordinal {
12558                return Ok(());
12559            }
12560
12561            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12562            // are envelope_size bytes.
12563            let cur_offset: usize = (1 - 1) * envelope_size;
12564
12565            // Zero reserved fields.
12566            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12567
12568            // Safety:
12569            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12570            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12571            //   envelope_size bytes, there is always sufficient room.
12572            fidl::encoding::encode_in_envelope_optional::<
12573                fidl::encoding::HandleType<
12574                    fidl::EventPair,
12575                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12576                    2147483648,
12577                >,
12578                fidl::encoding::DefaultFuchsiaResourceDialect,
12579            >(
12580                self.dictionary.as_mut().map(
12581                    <fidl::encoding::HandleType<
12582                        fidl::EventPair,
12583                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12584                        2147483648,
12585                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12586                ),
12587                encoder,
12588                offset + cur_offset,
12589                depth,
12590            )?;
12591
12592            _prev_end_offset = cur_offset + envelope_size;
12593            if 2 > max_ordinal {
12594                return Ok(());
12595            }
12596
12597            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12598            // are envelope_size bytes.
12599            let cur_offset: usize = (2 - 1) * envelope_size;
12600
12601            // Zero reserved fields.
12602            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12603
12604            // Safety:
12605            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12606            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12607            //   envelope_size bytes, there is always sufficient room.
12608            fidl::encoding::encode_in_envelope_optional::<
12609                fidl::encoding::BoundedString<100>,
12610                fidl::encoding::DefaultFuchsiaResourceDialect,
12611            >(
12612                self.key.as_ref().map(
12613                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
12614                ),
12615                encoder,
12616                offset + cur_offset,
12617                depth,
12618            )?;
12619
12620            _prev_end_offset = cur_offset + envelope_size;
12621            if 3 > max_ordinal {
12622                return Ok(());
12623            }
12624
12625            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12626            // are envelope_size bytes.
12627            let cur_offset: usize = (3 - 1) * envelope_size;
12628
12629            // Zero reserved fields.
12630            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12631
12632            // Safety:
12633            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12634            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12635            //   envelope_size bytes, there is always sufficient room.
12636            fidl::encoding::encode_in_envelope_optional::<
12637                fidl::encoding::HandleType<
12638                    fidl::EventPair,
12639                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12640                    2147483648,
12641                >,
12642                fidl::encoding::DefaultFuchsiaResourceDialect,
12643            >(
12644                self.value.as_mut().map(
12645                    <fidl::encoding::HandleType<
12646                        fidl::EventPair,
12647                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12648                        2147483648,
12649                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12650                ),
12651                encoder,
12652                offset + cur_offset,
12653                depth,
12654            )?;
12655
12656            _prev_end_offset = cur_offset + envelope_size;
12657
12658            Ok(())
12659        }
12660    }
12661
12662    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12663        for CapabilitiesDictionaryRemoveRequest
12664    {
12665        #[inline(always)]
12666        fn new_empty() -> Self {
12667            Self::default()
12668        }
12669
12670        unsafe fn decode(
12671            &mut self,
12672            decoder: &mut fidl::encoding::Decoder<
12673                '_,
12674                fidl::encoding::DefaultFuchsiaResourceDialect,
12675            >,
12676            offset: usize,
12677            mut depth: fidl::encoding::Depth,
12678        ) -> fidl::Result<()> {
12679            decoder.debug_check_bounds::<Self>(offset);
12680            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12681                None => return Err(fidl::Error::NotNullable),
12682                Some(len) => len,
12683            };
12684            // Calling decoder.out_of_line_offset(0) is not allowed.
12685            if len == 0 {
12686                return Ok(());
12687            };
12688            depth.increment()?;
12689            let envelope_size = 8;
12690            let bytes_len = len * envelope_size;
12691            let offset = decoder.out_of_line_offset(bytes_len)?;
12692            // Decode the envelope for each type.
12693            let mut _next_ordinal_to_read = 0;
12694            let mut next_offset = offset;
12695            let end_offset = offset + bytes_len;
12696            _next_ordinal_to_read += 1;
12697            if next_offset >= end_offset {
12698                return Ok(());
12699            }
12700
12701            // Decode unknown envelopes for gaps in ordinals.
12702            while _next_ordinal_to_read < 1 {
12703                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12704                _next_ordinal_to_read += 1;
12705                next_offset += envelope_size;
12706            }
12707
12708            let next_out_of_line = decoder.next_out_of_line();
12709            let handles_before = decoder.remaining_handles();
12710            if let Some((inlined, num_bytes, num_handles)) =
12711                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12712            {
12713                let member_inline_size = <fidl::encoding::HandleType<
12714                    fidl::EventPair,
12715                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12716                    2147483648,
12717                > as fidl::encoding::TypeMarker>::inline_size(
12718                    decoder.context
12719                );
12720                if inlined != (member_inline_size <= 4) {
12721                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12722                }
12723                let inner_offset;
12724                let mut inner_depth = depth.clone();
12725                if inlined {
12726                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12727                    inner_offset = next_offset;
12728                } else {
12729                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12730                    inner_depth.increment()?;
12731                }
12732                let val_ref =
12733                self.dictionary.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12734                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12735                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12736                {
12737                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12738                }
12739                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12740                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12741                }
12742            }
12743
12744            next_offset += envelope_size;
12745            _next_ordinal_to_read += 1;
12746            if next_offset >= end_offset {
12747                return Ok(());
12748            }
12749
12750            // Decode unknown envelopes for gaps in ordinals.
12751            while _next_ordinal_to_read < 2 {
12752                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12753                _next_ordinal_to_read += 1;
12754                next_offset += envelope_size;
12755            }
12756
12757            let next_out_of_line = decoder.next_out_of_line();
12758            let handles_before = decoder.remaining_handles();
12759            if let Some((inlined, num_bytes, num_handles)) =
12760                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12761            {
12762                let member_inline_size =
12763                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
12764                        decoder.context,
12765                    );
12766                if inlined != (member_inline_size <= 4) {
12767                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12768                }
12769                let inner_offset;
12770                let mut inner_depth = depth.clone();
12771                if inlined {
12772                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12773                    inner_offset = next_offset;
12774                } else {
12775                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12776                    inner_depth.increment()?;
12777                }
12778                let val_ref = self.key.get_or_insert_with(|| {
12779                    fidl::new_empty!(
12780                        fidl::encoding::BoundedString<100>,
12781                        fidl::encoding::DefaultFuchsiaResourceDialect
12782                    )
12783                });
12784                fidl::decode!(
12785                    fidl::encoding::BoundedString<100>,
12786                    fidl::encoding::DefaultFuchsiaResourceDialect,
12787                    val_ref,
12788                    decoder,
12789                    inner_offset,
12790                    inner_depth
12791                )?;
12792                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12793                {
12794                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12795                }
12796                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12797                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12798                }
12799            }
12800
12801            next_offset += envelope_size;
12802            _next_ordinal_to_read += 1;
12803            if next_offset >= end_offset {
12804                return Ok(());
12805            }
12806
12807            // Decode unknown envelopes for gaps in ordinals.
12808            while _next_ordinal_to_read < 3 {
12809                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12810                _next_ordinal_to_read += 1;
12811                next_offset += envelope_size;
12812            }
12813
12814            let next_out_of_line = decoder.next_out_of_line();
12815            let handles_before = decoder.remaining_handles();
12816            if let Some((inlined, num_bytes, num_handles)) =
12817                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12818            {
12819                let member_inline_size = <fidl::encoding::HandleType<
12820                    fidl::EventPair,
12821                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12822                    2147483648,
12823                > as fidl::encoding::TypeMarker>::inline_size(
12824                    decoder.context
12825                );
12826                if inlined != (member_inline_size <= 4) {
12827                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12828                }
12829                let inner_offset;
12830                let mut inner_depth = depth.clone();
12831                if inlined {
12832                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12833                    inner_offset = next_offset;
12834                } else {
12835                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12836                    inner_depth.increment()?;
12837                }
12838                let val_ref =
12839                self.value.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12840                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12841                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12842                {
12843                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12844                }
12845                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12846                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12847                }
12848            }
12849
12850            next_offset += envelope_size;
12851
12852            // Decode the remaining unknown envelopes.
12853            while next_offset < end_offset {
12854                _next_ordinal_to_read += 1;
12855                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12856                next_offset += envelope_size;
12857            }
12858
12859            Ok(())
12860        }
12861    }
12862
12863    impl CapabilitiesDirConnectorOpenRequest {
12864        #[inline(always)]
12865        fn max_ordinal_present(&self) -> u64 {
12866            if let Some(_) = self.path {
12867                return 4;
12868            }
12869            if let Some(_) = self.flags {
12870                return 3;
12871            }
12872            if let Some(_) = self.channel {
12873                return 2;
12874            }
12875            if let Some(_) = self.dir_connector {
12876                return 1;
12877            }
12878            0
12879        }
12880    }
12881
12882    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorOpenRequest {
12883        type Borrowed<'a> = &'a mut Self;
12884        fn take_or_borrow<'a>(
12885            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12886        ) -> Self::Borrowed<'a> {
12887            value
12888        }
12889    }
12890
12891    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorOpenRequest {
12892        type Owned = Self;
12893
12894        #[inline(always)]
12895        fn inline_align(_context: fidl::encoding::Context) -> usize {
12896            8
12897        }
12898
12899        #[inline(always)]
12900        fn inline_size(_context: fidl::encoding::Context) -> usize {
12901            16
12902        }
12903    }
12904
12905    unsafe impl
12906        fidl::encoding::Encode<
12907            CapabilitiesDirConnectorOpenRequest,
12908            fidl::encoding::DefaultFuchsiaResourceDialect,
12909        > for &mut CapabilitiesDirConnectorOpenRequest
12910    {
12911        unsafe fn encode(
12912            self,
12913            encoder: &mut fidl::encoding::Encoder<
12914                '_,
12915                fidl::encoding::DefaultFuchsiaResourceDialect,
12916            >,
12917            offset: usize,
12918            mut depth: fidl::encoding::Depth,
12919        ) -> fidl::Result<()> {
12920            encoder.debug_check_bounds::<CapabilitiesDirConnectorOpenRequest>(offset);
12921            // Vector header
12922            let max_ordinal: u64 = self.max_ordinal_present();
12923            encoder.write_num(max_ordinal, offset);
12924            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12925            // Calling encoder.out_of_line_offset(0) is not allowed.
12926            if max_ordinal == 0 {
12927                return Ok(());
12928            }
12929            depth.increment()?;
12930            let envelope_size = 8;
12931            let bytes_len = max_ordinal as usize * envelope_size;
12932            #[allow(unused_variables)]
12933            let offset = encoder.out_of_line_offset(bytes_len);
12934            let mut _prev_end_offset: usize = 0;
12935            if 1 > max_ordinal {
12936                return Ok(());
12937            }
12938
12939            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12940            // are envelope_size bytes.
12941            let cur_offset: usize = (1 - 1) * envelope_size;
12942
12943            // Zero reserved fields.
12944            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12945
12946            // Safety:
12947            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12948            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12949            //   envelope_size bytes, there is always sufficient room.
12950            fidl::encoding::encode_in_envelope_optional::<
12951                fidl::encoding::HandleType<
12952                    fidl::EventPair,
12953                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12954                    2147483648,
12955                >,
12956                fidl::encoding::DefaultFuchsiaResourceDialect,
12957            >(
12958                self.dir_connector.as_mut().map(
12959                    <fidl::encoding::HandleType<
12960                        fidl::EventPair,
12961                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12962                        2147483648,
12963                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12964                ),
12965                encoder,
12966                offset + cur_offset,
12967                depth,
12968            )?;
12969
12970            _prev_end_offset = cur_offset + envelope_size;
12971            if 2 > max_ordinal {
12972                return Ok(());
12973            }
12974
12975            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12976            // are envelope_size bytes.
12977            let cur_offset: usize = (2 - 1) * envelope_size;
12978
12979            // Zero reserved fields.
12980            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12981
12982            // Safety:
12983            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12984            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12985            //   envelope_size bytes, there is always sufficient room.
12986            fidl::encoding::encode_in_envelope_optional::<
12987                fidl::encoding::Endpoint<
12988                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12989                >,
12990                fidl::encoding::DefaultFuchsiaResourceDialect,
12991            >(
12992                self.channel.as_mut().map(
12993                    <fidl::encoding::Endpoint<
12994                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12995                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12996                ),
12997                encoder,
12998                offset + cur_offset,
12999                depth,
13000            )?;
13001
13002            _prev_end_offset = cur_offset + envelope_size;
13003            if 3 > max_ordinal {
13004                return Ok(());
13005            }
13006
13007            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13008            // are envelope_size bytes.
13009            let cur_offset: usize = (3 - 1) * envelope_size;
13010
13011            // Zero reserved fields.
13012            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13013
13014            // Safety:
13015            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13016            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13017            //   envelope_size bytes, there is always sufficient room.
13018            fidl::encoding::encode_in_envelope_optional::<
13019                fidl_fuchsia_io::Flags,
13020                fidl::encoding::DefaultFuchsiaResourceDialect,
13021            >(
13022                self.flags
13023                    .as_ref()
13024                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13025                encoder,
13026                offset + cur_offset,
13027                depth,
13028            )?;
13029
13030            _prev_end_offset = cur_offset + envelope_size;
13031            if 4 > max_ordinal {
13032                return Ok(());
13033            }
13034
13035            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13036            // are envelope_size bytes.
13037            let cur_offset: usize = (4 - 1) * envelope_size;
13038
13039            // Zero reserved fields.
13040            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13041
13042            // Safety:
13043            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13044            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13045            //   envelope_size bytes, there is always sufficient room.
13046            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13047            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13048            encoder, offset + cur_offset, depth
13049        )?;
13050
13051            _prev_end_offset = cur_offset + envelope_size;
13052
13053            Ok(())
13054        }
13055    }
13056
13057    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13058        for CapabilitiesDirConnectorOpenRequest
13059    {
13060        #[inline(always)]
13061        fn new_empty() -> Self {
13062            Self::default()
13063        }
13064
13065        unsafe fn decode(
13066            &mut self,
13067            decoder: &mut fidl::encoding::Decoder<
13068                '_,
13069                fidl::encoding::DefaultFuchsiaResourceDialect,
13070            >,
13071            offset: usize,
13072            mut depth: fidl::encoding::Depth,
13073        ) -> fidl::Result<()> {
13074            decoder.debug_check_bounds::<Self>(offset);
13075            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13076                None => return Err(fidl::Error::NotNullable),
13077                Some(len) => len,
13078            };
13079            // Calling decoder.out_of_line_offset(0) is not allowed.
13080            if len == 0 {
13081                return Ok(());
13082            };
13083            depth.increment()?;
13084            let envelope_size = 8;
13085            let bytes_len = len * envelope_size;
13086            let offset = decoder.out_of_line_offset(bytes_len)?;
13087            // Decode the envelope for each type.
13088            let mut _next_ordinal_to_read = 0;
13089            let mut next_offset = offset;
13090            let end_offset = offset + bytes_len;
13091            _next_ordinal_to_read += 1;
13092            if next_offset >= end_offset {
13093                return Ok(());
13094            }
13095
13096            // Decode unknown envelopes for gaps in ordinals.
13097            while _next_ordinal_to_read < 1 {
13098                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13099                _next_ordinal_to_read += 1;
13100                next_offset += envelope_size;
13101            }
13102
13103            let next_out_of_line = decoder.next_out_of_line();
13104            let handles_before = decoder.remaining_handles();
13105            if let Some((inlined, num_bytes, num_handles)) =
13106                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13107            {
13108                let member_inline_size = <fidl::encoding::HandleType<
13109                    fidl::EventPair,
13110                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13111                    2147483648,
13112                > as fidl::encoding::TypeMarker>::inline_size(
13113                    decoder.context
13114                );
13115                if inlined != (member_inline_size <= 4) {
13116                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13117                }
13118                let inner_offset;
13119                let mut inner_depth = depth.clone();
13120                if inlined {
13121                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13122                    inner_offset = next_offset;
13123                } else {
13124                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13125                    inner_depth.increment()?;
13126                }
13127                let val_ref =
13128                self.dir_connector.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13129                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13130                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13131                {
13132                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13133                }
13134                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13135                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13136                }
13137            }
13138
13139            next_offset += envelope_size;
13140            _next_ordinal_to_read += 1;
13141            if next_offset >= end_offset {
13142                return Ok(());
13143            }
13144
13145            // Decode unknown envelopes for gaps in ordinals.
13146            while _next_ordinal_to_read < 2 {
13147                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13148                _next_ordinal_to_read += 1;
13149                next_offset += envelope_size;
13150            }
13151
13152            let next_out_of_line = decoder.next_out_of_line();
13153            let handles_before = decoder.remaining_handles();
13154            if let Some((inlined, num_bytes, num_handles)) =
13155                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13156            {
13157                let member_inline_size = <fidl::encoding::Endpoint<
13158                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13159                > as fidl::encoding::TypeMarker>::inline_size(
13160                    decoder.context
13161                );
13162                if inlined != (member_inline_size <= 4) {
13163                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13164                }
13165                let inner_offset;
13166                let mut inner_depth = depth.clone();
13167                if inlined {
13168                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13169                    inner_offset = next_offset;
13170                } else {
13171                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13172                    inner_depth.increment()?;
13173                }
13174                let val_ref = self.channel.get_or_insert_with(|| {
13175                    fidl::new_empty!(
13176                        fidl::encoding::Endpoint<
13177                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13178                        >,
13179                        fidl::encoding::DefaultFuchsiaResourceDialect
13180                    )
13181                });
13182                fidl::decode!(
13183                    fidl::encoding::Endpoint<
13184                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13185                    >,
13186                    fidl::encoding::DefaultFuchsiaResourceDialect,
13187                    val_ref,
13188                    decoder,
13189                    inner_offset,
13190                    inner_depth
13191                )?;
13192                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13193                {
13194                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13195                }
13196                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13197                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13198                }
13199            }
13200
13201            next_offset += envelope_size;
13202            _next_ordinal_to_read += 1;
13203            if next_offset >= end_offset {
13204                return Ok(());
13205            }
13206
13207            // Decode unknown envelopes for gaps in ordinals.
13208            while _next_ordinal_to_read < 3 {
13209                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13210                _next_ordinal_to_read += 1;
13211                next_offset += envelope_size;
13212            }
13213
13214            let next_out_of_line = decoder.next_out_of_line();
13215            let handles_before = decoder.remaining_handles();
13216            if let Some((inlined, num_bytes, num_handles)) =
13217                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13218            {
13219                let member_inline_size =
13220                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13221                        decoder.context,
13222                    );
13223                if inlined != (member_inline_size <= 4) {
13224                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13225                }
13226                let inner_offset;
13227                let mut inner_depth = depth.clone();
13228                if inlined {
13229                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13230                    inner_offset = next_offset;
13231                } else {
13232                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13233                    inner_depth.increment()?;
13234                }
13235                let val_ref = self.flags.get_or_insert_with(|| {
13236                    fidl::new_empty!(
13237                        fidl_fuchsia_io::Flags,
13238                        fidl::encoding::DefaultFuchsiaResourceDialect
13239                    )
13240                });
13241                fidl::decode!(
13242                    fidl_fuchsia_io::Flags,
13243                    fidl::encoding::DefaultFuchsiaResourceDialect,
13244                    val_ref,
13245                    decoder,
13246                    inner_offset,
13247                    inner_depth
13248                )?;
13249                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13250                {
13251                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13252                }
13253                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13254                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13255                }
13256            }
13257
13258            next_offset += envelope_size;
13259            _next_ordinal_to_read += 1;
13260            if next_offset >= end_offset {
13261                return Ok(());
13262            }
13263
13264            // Decode unknown envelopes for gaps in ordinals.
13265            while _next_ordinal_to_read < 4 {
13266                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13267                _next_ordinal_to_read += 1;
13268                next_offset += envelope_size;
13269            }
13270
13271            let next_out_of_line = decoder.next_out_of_line();
13272            let handles_before = decoder.remaining_handles();
13273            if let Some((inlined, num_bytes, num_handles)) =
13274                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13275            {
13276                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13277                if inlined != (member_inline_size <= 4) {
13278                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13279                }
13280                let inner_offset;
13281                let mut inner_depth = depth.clone();
13282                if inlined {
13283                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13284                    inner_offset = next_offset;
13285                } else {
13286                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13287                    inner_depth.increment()?;
13288                }
13289                let val_ref = self.path.get_or_insert_with(|| {
13290                    fidl::new_empty!(
13291                        fidl::encoding::BoundedString<4095>,
13292                        fidl::encoding::DefaultFuchsiaResourceDialect
13293                    )
13294                });
13295                fidl::decode!(
13296                    fidl::encoding::BoundedString<4095>,
13297                    fidl::encoding::DefaultFuchsiaResourceDialect,
13298                    val_ref,
13299                    decoder,
13300                    inner_offset,
13301                    inner_depth
13302                )?;
13303                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13304                {
13305                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13306                }
13307                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13308                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13309                }
13310            }
13311
13312            next_offset += envelope_size;
13313
13314            // Decode the remaining unknown envelopes.
13315            while next_offset < end_offset {
13316                _next_ordinal_to_read += 1;
13317                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13318                next_offset += envelope_size;
13319            }
13320
13321            Ok(())
13322        }
13323    }
13324}