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 CapabilitiesConnectorCreateRequest {
16    pub connector: fidl::EventPair,
17    pub receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for CapabilitiesConnectorCreateRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct CapabilitiesConnectorOpenRequest {
27    pub connector: fidl::EventPair,
28    pub channel: fidl::Channel,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32    for CapabilitiesConnectorOpenRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct CapabilitiesConnectorRouterCreateRequest {
38    pub router: fidl::EventPair,
39    pub router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43    for CapabilitiesConnectorRouterCreateRequest
44{
45}
46
47#[derive(Debug, PartialEq)]
48pub struct CapabilitiesConnectorRouterRouteRequest {
49    pub router: fidl::EventPair,
50    pub request: RouteRequest,
51    pub connector: fidl::EventPair,
52}
53
54impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
55    for CapabilitiesConnectorRouterRouteRequest
56{
57}
58
59#[derive(Debug, PartialEq)]
60pub struct CapabilitiesDataCreateRequest {
61    pub data_handle: fidl::EventPair,
62    pub data: Data,
63}
64
65impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
66    for CapabilitiesDataCreateRequest
67{
68}
69
70#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
71pub struct CapabilitiesDataGetRequest {
72    pub data_handle: fidl::EventPair,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76    for CapabilitiesDataGetRequest
77{
78}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
81pub struct CapabilitiesDataRouterCreateRequest {
82    pub router: fidl::EventPair,
83    pub router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
84}
85
86impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
87    for CapabilitiesDataRouterCreateRequest
88{
89}
90
91#[derive(Debug, PartialEq)]
92pub struct CapabilitiesDataRouterRouteRequest {
93    pub router: fidl::EventPair,
94    pub request: RouteRequest,
95    pub data_handle: i32,
96}
97
98impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
99    for CapabilitiesDataRouterRouteRequest
100{
101}
102
103#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
104pub struct CapabilitiesDictionaryCreateRequest {
105    pub dictionary: fidl::EventPair,
106}
107
108impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
109    for CapabilitiesDictionaryCreateRequest
110{
111}
112
113#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114pub struct CapabilitiesDictionaryGetRequest {
115    pub dictionary: fidl::EventPair,
116    pub key: String,
117    pub value: fidl::EventPair,
118}
119
120impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
121    for CapabilitiesDictionaryGetRequest
122{
123}
124
125#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct CapabilitiesDictionaryInsertRequest {
127    pub dictionary: fidl::EventPair,
128    pub key: String,
129    pub value: fidl::EventPair,
130}
131
132impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
133    for CapabilitiesDictionaryInsertRequest
134{
135}
136
137#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138pub struct CapabilitiesDictionaryIterateKeysRequest {
139    pub dictionary: fidl::EventPair,
140    pub key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
141}
142
143impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
144    for CapabilitiesDictionaryIterateKeysRequest
145{
146}
147
148#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
149pub struct CapabilitiesDictionaryRouterCreateRequest {
150    pub router: fidl::EventPair,
151    pub router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
152}
153
154impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
155    for CapabilitiesDictionaryRouterCreateRequest
156{
157}
158
159#[derive(Debug, PartialEq)]
160pub struct CapabilitiesDictionaryRouterRouteRequest {
161    pub router: fidl::EventPair,
162    pub request: RouteRequest,
163    pub dictionary: fidl::EventPair,
164}
165
166impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
167    for CapabilitiesDictionaryRouterRouteRequest
168{
169}
170
171#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
172pub struct CapabilitiesDirConnectorCreateRequest {
173    pub dir_connector: fidl::EventPair,
174    pub receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
175}
176
177impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
178    for CapabilitiesDirConnectorCreateRequest
179{
180}
181
182#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
183pub struct CapabilitiesDirConnectorRouterCreateRequest {
184    pub router: fidl::EventPair,
185    pub router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
186}
187
188impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
189    for CapabilitiesDirConnectorRouterCreateRequest
190{
191}
192
193#[derive(Debug, PartialEq)]
194pub struct CapabilitiesDirConnectorRouterRouteRequest {
195    pub router: fidl::EventPair,
196    pub request: RouteRequest,
197    pub dir_connector: fidl::EventPair,
198}
199
200impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
201    for CapabilitiesDirConnectorRouterRouteRequest
202{
203}
204
205#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
206pub struct CapabilitiesDictionaryGetResponse {
207    pub capability_type: CapabilityType,
208}
209
210impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
211    for CapabilitiesDictionaryGetResponse
212{
213}
214
215#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct CapabilitiesDictionaryRemoveResponse {
217    pub capability_type: CapabilityType,
218}
219
220impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
221    for CapabilitiesDictionaryRemoveResponse
222{
223}
224
225#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
226pub struct CapabilityFactoryCreateConnectorRequest {
227    pub receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
228    pub connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
229}
230
231impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
232    for CapabilityFactoryCreateConnectorRequest
233{
234}
235
236#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
237pub struct CapabilityFactoryCreateConnectorRouterRequest {
238    pub router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
239    pub router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
240}
241
242impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
243    for CapabilityFactoryCreateConnectorRouterRequest
244{
245}
246
247#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
248pub struct CapabilityFactoryCreateDataRouterRequest {
249    pub router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
250    pub router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
251}
252
253impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
254    for CapabilityFactoryCreateDataRouterRequest
255{
256}
257
258#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
259pub struct CapabilityFactoryCreateDictionaryRequest {
260    pub dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
261}
262
263impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
264    for CapabilityFactoryCreateDictionaryRequest
265{
266}
267
268#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
269pub struct CapabilityFactoryCreateDictionaryRouterRequest {
270    pub router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
271    pub router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
272}
273
274impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
275    for CapabilityFactoryCreateDictionaryRouterRequest
276{
277}
278
279#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
280pub struct CapabilityFactoryCreateDirConnectorRequest {
281    pub dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
282    pub dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
283}
284
285impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
286    for CapabilityFactoryCreateDirConnectorRequest
287{
288}
289
290#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
291pub struct CapabilityFactoryCreateDirConnectorRouterRequest {
292    pub router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
293    pub router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
294}
295
296impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
297    for CapabilityFactoryCreateDirConnectorRouterRequest
298{
299}
300
301#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
302pub struct ConnectorConnectRequest {
303    pub channel: fidl::Channel,
304}
305
306impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectorConnectRequest {}
307
308#[derive(Debug, PartialEq)]
309pub struct ConnectorRouterDeprecatedRouteRequest {
310    pub request: RouteRequest,
311    pub connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
312}
313
314impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
315    for ConnectorRouterDeprecatedRouteRequest
316{
317}
318
319#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
320pub struct ConnectorRouterDeprecatedRouteResponse {
321    pub response: RouterResponse,
322}
323
324impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
325    for ConnectorRouterDeprecatedRouteResponse
326{
327}
328
329#[derive(Debug, PartialEq)]
330pub struct ConnectorRouterRouteRequest {
331    pub request: RouteRequest,
332}
333
334impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
335    for ConnectorRouterRouteRequest
336{
337}
338
339#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
340pub struct ConnectorRouterRouteResponse {
341    pub handle: Option<fidl::EventPair>,
342}
343
344impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
345    for ConnectorRouterRouteResponse
346{
347}
348
349#[derive(Debug, PartialEq)]
350pub struct DataRouterDeprecatedRouteRequest {
351    pub request: RouteRequest,
352}
353
354impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
355    for DataRouterDeprecatedRouteRequest
356{
357}
358
359#[derive(Debug, PartialEq)]
360pub struct DataRouterDeprecatedRouteResponse {
361    pub response: RouterResponse,
362    pub data: Option<Box<Data>>,
363}
364
365impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
366    for DataRouterDeprecatedRouteResponse
367{
368}
369
370#[derive(Debug, PartialEq)]
371pub struct DataRouterRouteRequest {
372    pub request: RouteRequest,
373}
374
375impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteRequest {}
376
377#[derive(Debug, PartialEq)]
378pub struct DataRouterRouteResponse {
379    pub data: Option<Box<Data>>,
380}
381
382impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
383
384#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
385pub struct DictionaryGetRequest {
386    pub key: String,
387}
388
389impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryGetRequest {}
390
391#[derive(Debug, PartialEq)]
392pub struct DictionaryInsertRequest {
393    pub key: String,
394    pub capability: CapabilityDeprecated,
395}
396
397impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryInsertRequest {}
398
399#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
400pub struct DictionaryIterateKeysRequest {
401    pub key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
402}
403
404impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
405    for DictionaryIterateKeysRequest
406{
407}
408
409#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
410pub struct DictionaryRemoveRequest {
411    pub key: String,
412}
413
414impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRemoveRequest {}
415
416#[derive(Debug, PartialEq)]
417pub struct DictionaryRouterDeprecatedRouteRequest {
418    pub request: RouteRequest,
419    pub dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
420}
421
422impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
423    for DictionaryRouterDeprecatedRouteRequest
424{
425}
426
427#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
428pub struct DictionaryRouterDeprecatedRouteResponse {
429    pub response: RouterResponse,
430}
431
432impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
433    for DictionaryRouterDeprecatedRouteResponse
434{
435}
436
437#[derive(Debug, PartialEq)]
438pub struct DictionaryRouterRouteRequest {
439    pub request: RouteRequest,
440}
441
442impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
443    for DictionaryRouterRouteRequest
444{
445}
446
447#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
448pub struct DictionaryRouterRouteResponse {
449    pub handle: Option<fidl::EventPair>,
450}
451
452impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
453    for DictionaryRouterRouteResponse
454{
455}
456
457#[derive(Debug, PartialEq)]
458pub struct DictionaryGetResponse {
459    pub capability: Option<Box<CapabilityDeprecated>>,
460}
461
462impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryGetResponse {}
463
464#[derive(Debug, PartialEq)]
465pub struct DictionaryLegacyExportResponse {
466    pub dictionary_ref: fidl_fuchsia_component_sandbox::DictionaryRef,
467}
468
469impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
470    for DictionaryLegacyExportResponse
471{
472}
473
474#[derive(Debug, PartialEq)]
475pub struct DictionaryRemoveResponse {
476    pub capability: Option<Box<CapabilityDeprecated>>,
477}
478
479impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRemoveResponse {}
480
481#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
482pub struct DirConnectorConnectRequest {
483    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
484}
485
486impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
487    for DirConnectorConnectRequest
488{
489}
490
491#[derive(Debug, PartialEq)]
492pub struct DirConnectorRouterDeprecatedRouteRequest {
493    pub request: RouteRequest,
494    pub dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
495}
496
497impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
498    for DirConnectorRouterDeprecatedRouteRequest
499{
500}
501
502#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
503pub struct DirConnectorRouterDeprecatedRouteResponse {
504    pub response: RouterResponse,
505}
506
507impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
508    for DirConnectorRouterDeprecatedRouteResponse
509{
510}
511
512#[derive(Debug, PartialEq)]
513pub struct DirConnectorRouterRouteRequest {
514    pub request: RouteRequest,
515}
516
517impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
518    for DirConnectorRouterRouteRequest
519{
520}
521
522#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
523pub struct DirConnectorRouterRouteResponse {
524    pub handle: Option<fidl::EventPair>,
525}
526
527impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
528    for DirConnectorRouterRouteResponse
529{
530}
531
532#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
533pub struct DirReceiverDeprecatedReceiveRequest {
534    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
535}
536
537impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
538    for DirReceiverDeprecatedReceiveRequest
539{
540}
541
542#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
543pub struct DirReceiverReceiveRequest {
544    pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
545    pub rights: fidl_fuchsia_io::Flags,
546}
547
548impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
549
550#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
551pub struct ReceiverReceiveRequest {
552    pub channel: fidl::Channel,
553}
554
555impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ReceiverReceiveRequest {}
556
557/// A token representing a component instance.
558#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
559pub struct WeakInstanceToken {
560    pub token: fidl::EventPair,
561}
562
563impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WeakInstanceToken {}
564
565#[derive(Debug, Default, PartialEq)]
566pub struct CapabilitiesDictionaryRemoveRequest {
567    pub dictionary: Option<fidl::EventPair>,
568    pub key: Option<String>,
569    pub value: Option<fidl::EventPair>,
570    #[doc(hidden)]
571    pub __source_breaking: fidl::marker::SourceBreaking,
572}
573
574impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
575    for CapabilitiesDictionaryRemoveRequest
576{
577}
578
579#[derive(Debug, Default, PartialEq)]
580pub struct CapabilitiesDirConnectorOpenRequest {
581    pub dir_connector: Option<fidl::EventPair>,
582    pub channel: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
583    pub rights: Option<fidl_fuchsia_io::Flags>,
584    pub subdir: Option<String>,
585    #[doc(hidden)]
586    pub __source_breaking: fidl::marker::SourceBreaking,
587}
588
589impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
590    for CapabilitiesDirConnectorOpenRequest
591{
592}
593
594/// Contains metadata on how to route a capability, and a token representing the
595/// component that started the route.
596///
597/// The contents of `metadata` are data capabilities used by component manager
598/// to track things like the type of the route (e.g. protocol, storage, runner,
599/// ...), the rights on a directory route, and the scope on an event stream
600/// route. Generally an empty dictionary is safe to pass to component manager.
601///
602/// Either both fields must be set, or neither.
603#[derive(Debug, Default, PartialEq)]
604pub struct RouteRequest {
605    pub target: Option<WeakInstanceToken>,
606    pub metadata: Option<fidl::endpoints::ClientEnd<DictionaryMarker>>,
607    #[doc(hidden)]
608    pub __source_breaking: fidl::marker::SourceBreaking,
609}
610
611impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
612
613/// A runtime capability in the component framework. These are the fundamental
614/// types used by component manager to implement capability routing and access
615/// control.
616///
617/// Each of these client ends is a reference to an object owned by component
618/// manager.
619#[derive(Debug)]
620pub enum CapabilityDeprecated {
621    Connector(fidl::endpoints::ClientEnd<ConnectorMarker>),
622    DirConnector(fidl::endpoints::ClientEnd<DirConnectorMarker>),
623    Dictionary(fidl::endpoints::ClientEnd<DictionaryMarker>),
624    Data(Data),
625    ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>),
626    DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>),
627    DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>),
628    DataRouter(fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>),
629    #[doc(hidden)]
630    __SourceBreaking {
631        unknown_ordinal: u64,
632    },
633}
634
635/// Pattern that matches an unknown `CapabilityDeprecated` member.
636#[macro_export]
637macro_rules! CapabilityDeprecatedUnknown {
638    () => {
639        _
640    };
641}
642
643// Custom PartialEq so that unknown variants are not equal to themselves.
644impl PartialEq for CapabilityDeprecated {
645    fn eq(&self, other: &Self) -> bool {
646        match (self, other) {
647            (Self::Connector(x), Self::Connector(y)) => *x == *y,
648            (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
649            (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
650            (Self::Data(x), Self::Data(y)) => *x == *y,
651            (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
652            (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
653            (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
654            (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
655            _ => false,
656        }
657    }
658}
659
660impl CapabilityDeprecated {
661    #[inline]
662    pub fn ordinal(&self) -> u64 {
663        match *self {
664            Self::Connector(_) => 1,
665            Self::DirConnector(_) => 2,
666            Self::Dictionary(_) => 3,
667            Self::Data(_) => 4,
668            Self::ConnectorRouter(_) => 5,
669            Self::DirConnectorRouter(_) => 6,
670            Self::DictionaryRouter(_) => 7,
671            Self::DataRouter(_) => 8,
672            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
673        }
674    }
675
676    #[inline]
677    pub fn unknown_variant_for_testing() -> Self {
678        Self::__SourceBreaking { unknown_ordinal: 0 }
679    }
680
681    #[inline]
682    pub fn is_unknown(&self) -> bool {
683        match self {
684            Self::__SourceBreaking { .. } => true,
685            _ => false,
686        }
687    }
688}
689
690impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CapabilityDeprecated {}
691
692#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
693pub struct CapabilitiesMarker;
694
695impl fidl::endpoints::ProtocolMarker for CapabilitiesMarker {
696    type Proxy = CapabilitiesProxy;
697    type RequestStream = CapabilitiesRequestStream;
698    #[cfg(target_os = "fuchsia")]
699    type SynchronousProxy = CapabilitiesSynchronousProxy;
700
701    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.Capabilities";
702}
703impl fidl::endpoints::DiscoverableProtocolMarker for CapabilitiesMarker {}
704pub type CapabilitiesConnectorCreateResult = Result<(), CapabilitiesError>;
705pub type CapabilitiesDirConnectorCreateResult = Result<(), CapabilitiesError>;
706pub type CapabilitiesDictionaryCreateResult = Result<(), CapabilitiesError>;
707pub type CapabilitiesDataCreateResult = Result<(), CapabilitiesError>;
708pub type CapabilitiesConnectorRouterCreateResult = Result<(), CapabilitiesError>;
709pub type CapabilitiesDirConnectorRouterCreateResult = Result<(), CapabilitiesError>;
710pub type CapabilitiesDictionaryRouterCreateResult = Result<(), CapabilitiesError>;
711pub type CapabilitiesDataRouterCreateResult = Result<(), CapabilitiesError>;
712pub type CapabilitiesConnectorOpenResult = Result<(), CapabilitiesError>;
713pub type CapabilitiesDirConnectorOpenResult = Result<(), CapabilitiesError>;
714pub type CapabilitiesDictionaryInsertResult = Result<(), CapabilitiesError>;
715pub type CapabilitiesDictionaryGetResult = Result<CapabilityType, CapabilitiesError>;
716pub type CapabilitiesDictionaryRemoveResult = Result<CapabilityType, CapabilitiesError>;
717pub type CapabilitiesDictionaryIterateKeysResult = Result<(), CapabilitiesError>;
718pub type CapabilitiesDataGetResult = Result<Data, CapabilitiesError>;
719pub type CapabilitiesConnectorRouterRouteResult = Result<(), i32>;
720pub type CapabilitiesDirConnectorRouterRouteResult = Result<(), i32>;
721pub type CapabilitiesDictionaryRouterRouteResult = Result<(), i32>;
722pub type CapabilitiesDataRouterRouteResult = Result<(), i32>;
723
724pub trait CapabilitiesProxyInterface: Send + Sync {
725    type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorCreateResult, fidl::Error>>
726        + Send;
727    fn r#connector_create(
728        &self,
729        connector: fidl::EventPair,
730        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
731    ) -> Self::ConnectorCreateResponseFut;
732    type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorCreateResult, fidl::Error>>
733        + Send;
734    fn r#dir_connector_create(
735        &self,
736        dir_connector: fidl::EventPair,
737        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
738    ) -> Self::DirConnectorCreateResponseFut;
739    type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryCreateResult, fidl::Error>>
740        + Send;
741    fn r#dictionary_create(&self, dictionary: fidl::EventPair)
742    -> Self::DictionaryCreateResponseFut;
743    type DataCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataCreateResult, fidl::Error>>
744        + Send;
745    fn r#data_create(
746        &self,
747        data_handle: fidl::EventPair,
748        data: &Data,
749    ) -> Self::DataCreateResponseFut;
750    type ConnectorRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterCreateResult, fidl::Error>>
751        + Send;
752    fn r#connector_router_create(
753        &self,
754        router: fidl::EventPair,
755        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
756    ) -> Self::ConnectorRouterCreateResponseFut;
757    type DirConnectorRouterCreateResponseFut: std::future::Future<
758            Output = Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error>,
759        > + Send;
760    fn r#dir_connector_router_create(
761        &self,
762        router: fidl::EventPair,
763        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
764    ) -> Self::DirConnectorRouterCreateResponseFut;
765    type DictionaryRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error>>
766        + Send;
767    fn r#dictionary_router_create(
768        &self,
769        router: fidl::EventPair,
770        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
771    ) -> Self::DictionaryRouterCreateResponseFut;
772    type DataRouterCreateResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterCreateResult, fidl::Error>>
773        + Send;
774    fn r#data_router_create(
775        &self,
776        router: fidl::EventPair,
777        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
778    ) -> Self::DataRouterCreateResponseFut;
779    type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorOpenResult, fidl::Error>>
780        + Send;
781    fn r#connector_open(
782        &self,
783        connector: fidl::EventPair,
784        channel: fidl::Channel,
785    ) -> Self::ConnectorOpenResponseFut;
786    type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorOpenResult, fidl::Error>>
787        + Send;
788    fn r#dir_connector_open(
789        &self,
790        payload: CapabilitiesDirConnectorOpenRequest,
791    ) -> Self::DirConnectorOpenResponseFut;
792    type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryInsertResult, fidl::Error>>
793        + Send;
794    fn r#dictionary_insert(
795        &self,
796        dictionary: fidl::EventPair,
797        key: &str,
798        value: fidl::EventPair,
799    ) -> Self::DictionaryInsertResponseFut;
800    type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryGetResult, fidl::Error>>
801        + Send;
802    fn r#dictionary_get(
803        &self,
804        dictionary: fidl::EventPair,
805        key: &str,
806        value: fidl::EventPair,
807    ) -> Self::DictionaryGetResponseFut;
808    type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRemoveResult, fidl::Error>>
809        + Send;
810    fn r#dictionary_remove(
811        &self,
812        payload: CapabilitiesDictionaryRemoveRequest,
813    ) -> Self::DictionaryRemoveResponseFut;
814    type DictionaryIterateKeysResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error>>
815        + Send;
816    fn r#dictionary_iterate_keys(
817        &self,
818        dictionary: fidl::EventPair,
819        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
820    ) -> Self::DictionaryIterateKeysResponseFut;
821    type DataGetResponseFut: std::future::Future<Output = Result<CapabilitiesDataGetResult, fidl::Error>>
822        + Send;
823    fn r#data_get(&self, data_handle: fidl::EventPair) -> Self::DataGetResponseFut;
824    type ConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesConnectorRouterRouteResult, fidl::Error>>
825        + Send;
826    fn r#connector_router_route(
827        &self,
828        router: fidl::EventPair,
829        request: RouteRequest,
830        connector: fidl::EventPair,
831    ) -> Self::ConnectorRouterRouteResponseFut;
832    type DirConnectorRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error>>
833        + Send;
834    fn r#dir_connector_router_route(
835        &self,
836        router: fidl::EventPair,
837        request: RouteRequest,
838        dir_connector: fidl::EventPair,
839    ) -> Self::DirConnectorRouterRouteResponseFut;
840    type DictionaryRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error>>
841        + Send;
842    fn r#dictionary_router_route(
843        &self,
844        router: fidl::EventPair,
845        request: RouteRequest,
846        dictionary: fidl::EventPair,
847    ) -> Self::DictionaryRouterRouteResponseFut;
848    type DataRouterRouteResponseFut: std::future::Future<Output = Result<CapabilitiesDataRouterRouteResult, fidl::Error>>
849        + Send;
850    fn r#data_router_route(
851        &self,
852        router: fidl::EventPair,
853        request: RouteRequest,
854        data_handle: i32,
855    ) -> Self::DataRouterRouteResponseFut;
856}
857#[derive(Debug)]
858#[cfg(target_os = "fuchsia")]
859pub struct CapabilitiesSynchronousProxy {
860    client: fidl::client::sync::Client,
861}
862
863#[cfg(target_os = "fuchsia")]
864impl fidl::endpoints::SynchronousProxy for CapabilitiesSynchronousProxy {
865    type Proxy = CapabilitiesProxy;
866    type Protocol = CapabilitiesMarker;
867
868    fn from_channel(inner: fidl::Channel) -> Self {
869        Self::new(inner)
870    }
871
872    fn into_channel(self) -> fidl::Channel {
873        self.client.into_channel()
874    }
875
876    fn as_channel(&self) -> &fidl::Channel {
877        self.client.as_channel()
878    }
879}
880
881#[cfg(target_os = "fuchsia")]
882impl CapabilitiesSynchronousProxy {
883    pub fn new(channel: fidl::Channel) -> Self {
884        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
885        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
886    }
887
888    pub fn into_channel(self) -> fidl::Channel {
889        self.client.into_channel()
890    }
891
892    /// Waits until an event arrives and returns it. It is safe for other
893    /// threads to make concurrent requests while waiting for an event.
894    pub fn wait_for_event(
895        &self,
896        deadline: zx::MonotonicInstant,
897    ) -> Result<CapabilitiesEvent, fidl::Error> {
898        CapabilitiesEvent::decode(self.client.wait_for_event(deadline)?)
899    }
900
901    /// Creates a reference to a new connector capability. When the connector is
902    /// opened, the channel given to the open call will be sent over
903    /// `receiver_client_end`.
904    ///
905    /// Make sure this method returns before passing the handle's peer to other
906    /// methods in this API. The creation may not be complete before then.
907    pub fn r#connector_create(
908        &self,
909        mut connector: fidl::EventPair,
910        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
911        ___deadline: zx::MonotonicInstant,
912    ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
913        let _response = self.client.send_query::<
914            CapabilitiesConnectorCreateRequest,
915            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
916        >(
917            (connector, receiver_client_end,),
918            0xac2bc2dbd7033d1,
919            fidl::encoding::DynamicFlags::FLEXIBLE,
920            ___deadline,
921        )?
922        .into_result::<CapabilitiesMarker>("connector_create")?;
923        Ok(_response.map(|x| x))
924    }
925
926    /// Creates a reference to a new directory connector capability. When the
927    /// directory connector is opened, the channel given to the open call will
928    /// be sent over `receiver_client_end`.
929    ///
930    /// Make sure this method returns before passing the handle's peer to other
931    /// methods in this API. The creation may not be complete before then.
932    pub fn r#dir_connector_create(
933        &self,
934        mut dir_connector: fidl::EventPair,
935        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
936        ___deadline: zx::MonotonicInstant,
937    ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
938        let _response = self.client.send_query::<
939            CapabilitiesDirConnectorCreateRequest,
940            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
941        >(
942            (dir_connector, receiver_client_end,),
943            0x721911e05da2a3bf,
944            fidl::encoding::DynamicFlags::FLEXIBLE,
945            ___deadline,
946        )?
947        .into_result::<CapabilitiesMarker>("dir_connector_create")?;
948        Ok(_response.map(|x| x))
949    }
950
951    /// Creates a reference to a new dictionary capability.
952    ///
953    /// Make sure this method returns before passing the handle's peer to other
954    /// methods in this API. The creation may not be complete before then.
955    pub fn r#dictionary_create(
956        &self,
957        mut dictionary: fidl::EventPair,
958        ___deadline: zx::MonotonicInstant,
959    ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
960        let _response = self.client.send_query::<
961            CapabilitiesDictionaryCreateRequest,
962            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
963        >(
964            (dictionary,),
965            0x7f8bd91f0942a36e,
966            fidl::encoding::DynamicFlags::FLEXIBLE,
967            ___deadline,
968        )?
969        .into_result::<CapabilitiesMarker>("dictionary_create")?;
970        Ok(_response.map(|x| x))
971    }
972
973    /// Creates a reference to a new data capability with the given value.
974    ///
975    /// Make sure this method returns before passing the handle's peer to other
976    /// methods in this API. The creation may not be complete before then.
977    pub fn r#data_create(
978        &self,
979        mut data_handle: fidl::EventPair,
980        mut data: &Data,
981        ___deadline: zx::MonotonicInstant,
982    ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
983        let _response = self.client.send_query::<
984            CapabilitiesDataCreateRequest,
985            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
986        >(
987            (data_handle, data,),
988            0x40ef43e45372ee6a,
989            fidl::encoding::DynamicFlags::FLEXIBLE,
990            ___deadline,
991        )?
992        .into_result::<CapabilitiesMarker>("data_create")?;
993        Ok(_response.map(|x| x))
994    }
995
996    /// Creates a reference to a new router capability that will return a
997    /// connector capability when used.
998    ///
999    /// Make sure this method returns before passing the handle's peer to other
1000    /// methods in this API. The creation may not be complete before then.
1001    pub fn r#connector_router_create(
1002        &self,
1003        mut router: fidl::EventPair,
1004        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1005        ___deadline: zx::MonotonicInstant,
1006    ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
1007        let _response = self.client.send_query::<
1008            CapabilitiesConnectorRouterCreateRequest,
1009            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1010        >(
1011            (router, router_client_end,),
1012            0x7f7e7fbafcdf1761,
1013            fidl::encoding::DynamicFlags::FLEXIBLE,
1014            ___deadline,
1015        )?
1016        .into_result::<CapabilitiesMarker>("connector_router_create")?;
1017        Ok(_response.map(|x| x))
1018    }
1019
1020    /// Creates a reference to a new router capability that will return a
1021    /// directory connector capability when used.
1022    ///
1023    /// Make sure this method returns before passing the handle's peer to other
1024    /// methods in this API. The creation may not be complete before then.
1025    pub fn r#dir_connector_router_create(
1026        &self,
1027        mut router: fidl::EventPair,
1028        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1029        ___deadline: zx::MonotonicInstant,
1030    ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
1031        let _response = self.client.send_query::<
1032            CapabilitiesDirConnectorRouterCreateRequest,
1033            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1034        >(
1035            (router, router_client_end,),
1036            0x56520da453fad19f,
1037            fidl::encoding::DynamicFlags::FLEXIBLE,
1038            ___deadline,
1039        )?
1040        .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
1041        Ok(_response.map(|x| x))
1042    }
1043
1044    /// Creates a reference to a new router capability that will return a
1045    /// dictionary capability when used.
1046    ///
1047    /// Make sure this method returns before passing the handle's peer to other
1048    /// methods in this API. The creation may not be complete before then.
1049    pub fn r#dictionary_router_create(
1050        &self,
1051        mut router: fidl::EventPair,
1052        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1053        ___deadline: zx::MonotonicInstant,
1054    ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
1055        let _response = self.client.send_query::<
1056            CapabilitiesDictionaryRouterCreateRequest,
1057            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1058        >(
1059            (router, router_client_end,),
1060            0x37acef18cd423d42,
1061            fidl::encoding::DynamicFlags::FLEXIBLE,
1062            ___deadline,
1063        )?
1064        .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
1065        Ok(_response.map(|x| x))
1066    }
1067
1068    /// Creates a reference to a new router capability that will return a data
1069    /// value when used.
1070    ///
1071    /// Make sure this method returns before passing the handle's peer to other
1072    /// methods in this API. The creation may not be complete before then.
1073    pub fn r#data_router_create(
1074        &self,
1075        mut router: fidl::EventPair,
1076        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1077        ___deadline: zx::MonotonicInstant,
1078    ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
1079        let _response = self.client.send_query::<
1080            CapabilitiesDataRouterCreateRequest,
1081            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1082        >(
1083            (router, router_client_end,),
1084            0x24e471395b95088,
1085            fidl::encoding::DynamicFlags::FLEXIBLE,
1086            ___deadline,
1087        )?
1088        .into_result::<CapabilitiesMarker>("data_router_create")?;
1089        Ok(_response.map(|x| x))
1090    }
1091
1092    /// Uses the provided `connector` to open a new connection by delivering
1093    /// this channel to whoever created the connector.
1094    ///
1095    /// If there is an error, it will be reported as a zx.Status epitaph on
1096    /// `channel`.
1097    ///
1098    /// If the `connector` event pair handle is not correlated with a handle
1099    /// given to `ConnectorCreate`, this connection will be closed.
1100    pub fn r#connector_open(
1101        &self,
1102        mut connector: fidl::EventPair,
1103        mut channel: fidl::Channel,
1104        ___deadline: zx::MonotonicInstant,
1105    ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
1106        let _response = self.client.send_query::<
1107            CapabilitiesConnectorOpenRequest,
1108            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1109        >(
1110            (connector, channel,),
1111            0xc0646965f1884eb,
1112            fidl::encoding::DynamicFlags::FLEXIBLE,
1113            ___deadline,
1114        )?
1115        .into_result::<CapabilitiesMarker>("connector_open")?;
1116        Ok(_response.map(|x| x))
1117    }
1118
1119    /// Uses the provided `dir_connector` to open a new directory connection by
1120    /// delivering this channel to whoever created the directory connector.
1121    ///
1122    /// If there is an error, it will be reported as a zx.Status epitaph on
1123    /// `channel`.
1124    ///
1125    /// If the `dir_connector` event pair handle is not correlated with a handle
1126    /// given to `DirConnectorCreate`, this connection will be closed.
1127    ///
1128    /// `dir_connector` and `channel` are both required. `rights` and `subdir`
1129    /// may be omitted.
1130    pub fn r#dir_connector_open(
1131        &self,
1132        mut payload: CapabilitiesDirConnectorOpenRequest,
1133        ___deadline: zx::MonotonicInstant,
1134    ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
1135        let _response = self.client.send_query::<
1136            CapabilitiesDirConnectorOpenRequest,
1137            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1138        >(
1139            &mut payload,
1140            0x1332bbf5debd6c20,
1141            fidl::encoding::DynamicFlags::FLEXIBLE,
1142            ___deadline,
1143        )?
1144        .into_result::<CapabilitiesMarker>("dir_connector_open")?;
1145        Ok(_response.map(|x| x))
1146    }
1147
1148    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
1149    /// Overwrites any existing entry.
1150    pub fn r#dictionary_insert(
1151        &self,
1152        mut dictionary: fidl::EventPair,
1153        mut key: &str,
1154        mut value: fidl::EventPair,
1155        ___deadline: zx::MonotonicInstant,
1156    ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
1157        let _response = self.client.send_query::<
1158            CapabilitiesDictionaryInsertRequest,
1159            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1160        >(
1161            (dictionary, key, value,),
1162            0x5972e3061a760e7a,
1163            fidl::encoding::DynamicFlags::FLEXIBLE,
1164            ___deadline,
1165        )?
1166        .into_result::<CapabilitiesMarker>("dictionary_insert")?;
1167        Ok(_response.map(|x| x))
1168    }
1169
1170    /// Creates a new reference to the `capability` named `key` in this
1171    /// dictionary, if that capability exists. That capability will remain in
1172    /// the dictionary. To take a capability out of the dictionary, use
1173    /// `DictionaryRemove`.
1174    ///
1175    /// If `key` does not exist, `value` will not reference any capability and
1176    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1177    ///
1178    /// Make sure this method returns before passing the handle's peer to other
1179    /// methods in this API. The creation may not be complete before then.
1180    pub fn r#dictionary_get(
1181        &self,
1182        mut dictionary: fidl::EventPair,
1183        mut key: &str,
1184        mut value: fidl::EventPair,
1185        ___deadline: zx::MonotonicInstant,
1186    ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
1187        let _response = self
1188            .client
1189            .send_query::<CapabilitiesDictionaryGetRequest, fidl::encoding::FlexibleResultType<
1190                CapabilitiesDictionaryGetResponse,
1191                CapabilitiesError,
1192            >>(
1193                (dictionary, key, value),
1194                0x31fafe2280a283d5,
1195                fidl::encoding::DynamicFlags::FLEXIBLE,
1196                ___deadline,
1197            )?
1198            .into_result::<CapabilitiesMarker>("dictionary_get")?;
1199        Ok(_response.map(|x| x.capability_type))
1200    }
1201
1202    /// Removes the `capability` named `key` from this dictionary and returns a
1203    /// reference to it, if that capability exists.
1204    ///
1205    /// `dictionary` and `key` are required. `capability` is optional, and when
1206    /// set will become associated with the capability that was removed from the
1207    /// dictionary.
1208    ///
1209    /// If `key` does not exist, `value` will not reference any capability and
1210    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1211    ///
1212    /// Make sure this method returns before passing the peer of `capability` to
1213    /// other methods in this API. The creation may not be complete before then.
1214    pub fn r#dictionary_remove(
1215        &self,
1216        mut payload: CapabilitiesDictionaryRemoveRequest,
1217        ___deadline: zx::MonotonicInstant,
1218    ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
1219        let _response = self
1220            .client
1221            .send_query::<CapabilitiesDictionaryRemoveRequest, fidl::encoding::FlexibleResultType<
1222                CapabilitiesDictionaryRemoveResponse,
1223                CapabilitiesError,
1224            >>(
1225                &mut payload,
1226                0x6827c83106ac5a2c,
1227                fidl::encoding::DynamicFlags::FLEXIBLE,
1228                ___deadline,
1229            )?
1230            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
1231        Ok(_response.map(|x| x.capability_type))
1232    }
1233
1234    /// Opens an iterator which can be used to iterate over the keys of this
1235    /// dictionary.
1236    pub fn r#dictionary_iterate_keys(
1237        &self,
1238        mut dictionary: fidl::EventPair,
1239        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
1240        ___deadline: zx::MonotonicInstant,
1241    ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
1242        let _response = self.client.send_query::<
1243            CapabilitiesDictionaryIterateKeysRequest,
1244            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1245        >(
1246            (dictionary, key_iterator,),
1247            0x3d4ea59c80df9bb8,
1248            fidl::encoding::DynamicFlags::FLEXIBLE,
1249            ___deadline,
1250        )?
1251        .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
1252        Ok(_response.map(|x| x))
1253    }
1254
1255    /// Returns the `Data` value that was provided to the `DataCreate` call used with
1256    /// `data_handle`.
1257    pub fn r#data_get(
1258        &self,
1259        mut data_handle: fidl::EventPair,
1260        ___deadline: zx::MonotonicInstant,
1261    ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
1262        let _response = self.client.send_query::<
1263            CapabilitiesDataGetRequest,
1264            fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
1265        >(
1266            (data_handle,),
1267            0x65ae25b59f9e0daf,
1268            fidl::encoding::DynamicFlags::FLEXIBLE,
1269            ___deadline,
1270        )?
1271        .into_result::<CapabilitiesMarker>("data_get")?;
1272        Ok(_response.map(|x| x))
1273    }
1274
1275    /// Attempts to produce a `Connector` capability from this `ConnectorRouter`.
1276    ///
1277    /// Make sure this method returns before passing the peer of `capability` to other methods in
1278    /// this API. The creation may not be complete before then.
1279    pub fn r#connector_router_route(
1280        &self,
1281        mut router: fidl::EventPair,
1282        mut request: RouteRequest,
1283        mut connector: fidl::EventPair,
1284        ___deadline: zx::MonotonicInstant,
1285    ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
1286        let _response = self.client.send_query::<
1287            CapabilitiesConnectorRouterRouteRequest,
1288            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1289        >(
1290            (router, &mut request, connector,),
1291            0x1bd9c6e7e3dd487e,
1292            fidl::encoding::DynamicFlags::FLEXIBLE,
1293            ___deadline,
1294        )?
1295        .into_result::<CapabilitiesMarker>("connector_router_route")?;
1296        Ok(_response.map(|x| x))
1297    }
1298
1299    /// Attempts to produce a `DirConnector` capability from this
1300    /// `DirConnectorRouter`. This will return:
1301    ///
1302    /// - A `DirConnector` if the operation is successful.
1303    /// - An empty value if there is no issue found but the capability is not
1304    ///   being provided (for example, an optional route ended in an offer from
1305    ///   void).
1306    /// - An error, if the operation failed.
1307    pub fn r#dir_connector_router_route(
1308        &self,
1309        mut router: fidl::EventPair,
1310        mut request: RouteRequest,
1311        mut dir_connector: fidl::EventPair,
1312        ___deadline: zx::MonotonicInstant,
1313    ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
1314        let _response = self.client.send_query::<
1315            CapabilitiesDirConnectorRouterRouteRequest,
1316            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1317        >(
1318            (router, &mut request, dir_connector,),
1319            0x3afdcc1b79e0799d,
1320            fidl::encoding::DynamicFlags::FLEXIBLE,
1321            ___deadline,
1322        )?
1323        .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
1324        Ok(_response.map(|x| x))
1325    }
1326
1327    /// Attempts to produce a `Dictionary` capability from this
1328    /// `DictionaryRouter`. This will return:
1329    ///
1330    /// - A `Dictionary` if the operation is successful.
1331    /// - An empty value if there is no issue found but the capability is not
1332    ///   being provided (for example, an optional route ended in an offer from
1333    ///   void).
1334    /// - An error, if the operation failed.
1335    pub fn r#dictionary_router_route(
1336        &self,
1337        mut router: fidl::EventPair,
1338        mut request: RouteRequest,
1339        mut dictionary: fidl::EventPair,
1340        ___deadline: zx::MonotonicInstant,
1341    ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
1342        let _response = self.client.send_query::<
1343            CapabilitiesDictionaryRouterRouteRequest,
1344            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1345        >(
1346            (router, &mut request, dictionary,),
1347            0xcf72de10714a708,
1348            fidl::encoding::DynamicFlags::FLEXIBLE,
1349            ___deadline,
1350        )?
1351        .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
1352        Ok(_response.map(|x| x))
1353    }
1354
1355    /// Attempts to produce a `Data` value from this
1356    /// `DataRouter`. This will return:
1357    ///
1358    /// - A `Data` value if the operation is successful.
1359    /// - An empty value if there is no issue found but the capability is not
1360    ///   being provided (for example, an optional route ended in an offer from
1361    ///   void).
1362    /// - An error, if the operation failed.
1363    pub fn r#data_router_route(
1364        &self,
1365        mut router: fidl::EventPair,
1366        mut request: RouteRequest,
1367        mut data_handle: i32,
1368        ___deadline: zx::MonotonicInstant,
1369    ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
1370        let _response = self.client.send_query::<
1371            CapabilitiesDataRouterRouteRequest,
1372            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
1373        >(
1374            (router, &mut request, data_handle,),
1375            0x61ab188455ed0643,
1376            fidl::encoding::DynamicFlags::FLEXIBLE,
1377            ___deadline,
1378        )?
1379        .into_result::<CapabilitiesMarker>("data_router_route")?;
1380        Ok(_response.map(|x| x))
1381    }
1382}
1383
1384#[cfg(target_os = "fuchsia")]
1385impl From<CapabilitiesSynchronousProxy> for zx::Handle {
1386    fn from(value: CapabilitiesSynchronousProxy) -> Self {
1387        value.into_channel().into()
1388    }
1389}
1390
1391#[cfg(target_os = "fuchsia")]
1392impl From<fidl::Channel> for CapabilitiesSynchronousProxy {
1393    fn from(value: fidl::Channel) -> Self {
1394        Self::new(value)
1395    }
1396}
1397
1398#[cfg(target_os = "fuchsia")]
1399impl fidl::endpoints::FromClient for CapabilitiesSynchronousProxy {
1400    type Protocol = CapabilitiesMarker;
1401
1402    fn from_client(value: fidl::endpoints::ClientEnd<CapabilitiesMarker>) -> Self {
1403        Self::new(value.into_channel())
1404    }
1405}
1406
1407#[derive(Debug, Clone)]
1408pub struct CapabilitiesProxy {
1409    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1410}
1411
1412impl fidl::endpoints::Proxy for CapabilitiesProxy {
1413    type Protocol = CapabilitiesMarker;
1414
1415    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1416        Self::new(inner)
1417    }
1418
1419    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1420        self.client.into_channel().map_err(|client| Self { client })
1421    }
1422
1423    fn as_channel(&self) -> &::fidl::AsyncChannel {
1424        self.client.as_channel()
1425    }
1426}
1427
1428impl CapabilitiesProxy {
1429    /// Create a new Proxy for fuchsia.component.runtime/Capabilities.
1430    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1431        let protocol_name = <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1432        Self { client: fidl::client::Client::new(channel, protocol_name) }
1433    }
1434
1435    /// Get a Stream of events from the remote end of the protocol.
1436    ///
1437    /// # Panics
1438    ///
1439    /// Panics if the event stream was already taken.
1440    pub fn take_event_stream(&self) -> CapabilitiesEventStream {
1441        CapabilitiesEventStream { event_receiver: self.client.take_event_receiver() }
1442    }
1443
1444    /// Creates a reference to a new connector capability. When the connector is
1445    /// opened, the channel given to the open call will be sent over
1446    /// `receiver_client_end`.
1447    ///
1448    /// Make sure this method returns before passing the handle's peer to other
1449    /// methods in this API. The creation may not be complete before then.
1450    pub fn r#connector_create(
1451        &self,
1452        mut connector: fidl::EventPair,
1453        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1454    ) -> fidl::client::QueryResponseFut<
1455        CapabilitiesConnectorCreateResult,
1456        fidl::encoding::DefaultFuchsiaResourceDialect,
1457    > {
1458        CapabilitiesProxyInterface::r#connector_create(self, connector, receiver_client_end)
1459    }
1460
1461    /// Creates a reference to a new directory connector capability. When the
1462    /// directory connector is opened, the channel given to the open call will
1463    /// be sent over `receiver_client_end`.
1464    ///
1465    /// Make sure this method returns before passing the handle's peer to other
1466    /// methods in this API. The creation may not be complete before then.
1467    pub fn r#dir_connector_create(
1468        &self,
1469        mut dir_connector: fidl::EventPair,
1470        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1471    ) -> fidl::client::QueryResponseFut<
1472        CapabilitiesDirConnectorCreateResult,
1473        fidl::encoding::DefaultFuchsiaResourceDialect,
1474    > {
1475        CapabilitiesProxyInterface::r#dir_connector_create(self, dir_connector, receiver_client_end)
1476    }
1477
1478    /// Creates a reference to a new dictionary capability.
1479    ///
1480    /// Make sure this method returns before passing the handle's peer to other
1481    /// methods in this API. The creation may not be complete before then.
1482    pub fn r#dictionary_create(
1483        &self,
1484        mut dictionary: fidl::EventPair,
1485    ) -> fidl::client::QueryResponseFut<
1486        CapabilitiesDictionaryCreateResult,
1487        fidl::encoding::DefaultFuchsiaResourceDialect,
1488    > {
1489        CapabilitiesProxyInterface::r#dictionary_create(self, dictionary)
1490    }
1491
1492    /// Creates a reference to a new data capability with the given value.
1493    ///
1494    /// Make sure this method returns before passing the handle's peer to other
1495    /// methods in this API. The creation may not be complete before then.
1496    pub fn r#data_create(
1497        &self,
1498        mut data_handle: fidl::EventPair,
1499        mut data: &Data,
1500    ) -> fidl::client::QueryResponseFut<
1501        CapabilitiesDataCreateResult,
1502        fidl::encoding::DefaultFuchsiaResourceDialect,
1503    > {
1504        CapabilitiesProxyInterface::r#data_create(self, data_handle, data)
1505    }
1506
1507    /// Creates a reference to a new router capability that will return a
1508    /// connector capability when used.
1509    ///
1510    /// Make sure this method returns before passing the handle's peer to other
1511    /// methods in this API. The creation may not be complete before then.
1512    pub fn r#connector_router_create(
1513        &self,
1514        mut router: fidl::EventPair,
1515        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1516    ) -> fidl::client::QueryResponseFut<
1517        CapabilitiesConnectorRouterCreateResult,
1518        fidl::encoding::DefaultFuchsiaResourceDialect,
1519    > {
1520        CapabilitiesProxyInterface::r#connector_router_create(self, router, router_client_end)
1521    }
1522
1523    /// Creates a reference to a new router capability that will return a
1524    /// directory connector capability when used.
1525    ///
1526    /// Make sure this method returns before passing the handle's peer to other
1527    /// methods in this API. The creation may not be complete before then.
1528    pub fn r#dir_connector_router_create(
1529        &self,
1530        mut router: fidl::EventPair,
1531        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1532    ) -> fidl::client::QueryResponseFut<
1533        CapabilitiesDirConnectorRouterCreateResult,
1534        fidl::encoding::DefaultFuchsiaResourceDialect,
1535    > {
1536        CapabilitiesProxyInterface::r#dir_connector_router_create(self, router, router_client_end)
1537    }
1538
1539    /// Creates a reference to a new router capability that will return a
1540    /// dictionary capability when used.
1541    ///
1542    /// Make sure this method returns before passing the handle's peer to other
1543    /// methods in this API. The creation may not be complete before then.
1544    pub fn r#dictionary_router_create(
1545        &self,
1546        mut router: fidl::EventPair,
1547        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1548    ) -> fidl::client::QueryResponseFut<
1549        CapabilitiesDictionaryRouterCreateResult,
1550        fidl::encoding::DefaultFuchsiaResourceDialect,
1551    > {
1552        CapabilitiesProxyInterface::r#dictionary_router_create(self, router, router_client_end)
1553    }
1554
1555    /// Creates a reference to a new router capability that will return a data
1556    /// value when used.
1557    ///
1558    /// Make sure this method returns before passing the handle's peer to other
1559    /// methods in this API. The creation may not be complete before then.
1560    pub fn r#data_router_create(
1561        &self,
1562        mut router: fidl::EventPair,
1563        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1564    ) -> fidl::client::QueryResponseFut<
1565        CapabilitiesDataRouterCreateResult,
1566        fidl::encoding::DefaultFuchsiaResourceDialect,
1567    > {
1568        CapabilitiesProxyInterface::r#data_router_create(self, router, router_client_end)
1569    }
1570
1571    /// Uses the provided `connector` to open a new connection by delivering
1572    /// this channel to whoever created the connector.
1573    ///
1574    /// If there is an error, it will be reported as a zx.Status epitaph on
1575    /// `channel`.
1576    ///
1577    /// If the `connector` event pair handle is not correlated with a handle
1578    /// given to `ConnectorCreate`, this connection will be closed.
1579    pub fn r#connector_open(
1580        &self,
1581        mut connector: fidl::EventPair,
1582        mut channel: fidl::Channel,
1583    ) -> fidl::client::QueryResponseFut<
1584        CapabilitiesConnectorOpenResult,
1585        fidl::encoding::DefaultFuchsiaResourceDialect,
1586    > {
1587        CapabilitiesProxyInterface::r#connector_open(self, connector, channel)
1588    }
1589
1590    /// Uses the provided `dir_connector` to open a new directory connection by
1591    /// delivering this channel to whoever created the directory connector.
1592    ///
1593    /// If there is an error, it will be reported as a zx.Status epitaph on
1594    /// `channel`.
1595    ///
1596    /// If the `dir_connector` event pair handle is not correlated with a handle
1597    /// given to `DirConnectorCreate`, this connection will be closed.
1598    ///
1599    /// `dir_connector` and `channel` are both required. `rights` and `subdir`
1600    /// may be omitted.
1601    pub fn r#dir_connector_open(
1602        &self,
1603        mut payload: CapabilitiesDirConnectorOpenRequest,
1604    ) -> fidl::client::QueryResponseFut<
1605        CapabilitiesDirConnectorOpenResult,
1606        fidl::encoding::DefaultFuchsiaResourceDialect,
1607    > {
1608        CapabilitiesProxyInterface::r#dir_connector_open(self, payload)
1609    }
1610
1611    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
1612    /// Overwrites any existing entry.
1613    pub fn r#dictionary_insert(
1614        &self,
1615        mut dictionary: fidl::EventPair,
1616        mut key: &str,
1617        mut value: fidl::EventPair,
1618    ) -> fidl::client::QueryResponseFut<
1619        CapabilitiesDictionaryInsertResult,
1620        fidl::encoding::DefaultFuchsiaResourceDialect,
1621    > {
1622        CapabilitiesProxyInterface::r#dictionary_insert(self, dictionary, key, value)
1623    }
1624
1625    /// Creates a new reference to the `capability` named `key` in this
1626    /// dictionary, if that capability exists. That capability will remain in
1627    /// the dictionary. To take a capability out of the dictionary, use
1628    /// `DictionaryRemove`.
1629    ///
1630    /// If `key` does not exist, `value` will not reference any capability and
1631    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1632    ///
1633    /// Make sure this method returns before passing the handle's peer to other
1634    /// methods in this API. The creation may not be complete before then.
1635    pub fn r#dictionary_get(
1636        &self,
1637        mut dictionary: fidl::EventPair,
1638        mut key: &str,
1639        mut value: fidl::EventPair,
1640    ) -> fidl::client::QueryResponseFut<
1641        CapabilitiesDictionaryGetResult,
1642        fidl::encoding::DefaultFuchsiaResourceDialect,
1643    > {
1644        CapabilitiesProxyInterface::r#dictionary_get(self, dictionary, key, value)
1645    }
1646
1647    /// Removes the `capability` named `key` from this dictionary and returns a
1648    /// reference to it, if that capability exists.
1649    ///
1650    /// `dictionary` and `key` are required. `capability` is optional, and when
1651    /// set will become associated with the capability that was removed from the
1652    /// dictionary.
1653    ///
1654    /// If `key` does not exist, `value` will not reference any capability and
1655    /// the `NO_SUCH_CAPABILITY` error value will be returned.
1656    ///
1657    /// Make sure this method returns before passing the peer of `capability` to
1658    /// other methods in this API. The creation may not be complete before then.
1659    pub fn r#dictionary_remove(
1660        &self,
1661        mut payload: CapabilitiesDictionaryRemoveRequest,
1662    ) -> fidl::client::QueryResponseFut<
1663        CapabilitiesDictionaryRemoveResult,
1664        fidl::encoding::DefaultFuchsiaResourceDialect,
1665    > {
1666        CapabilitiesProxyInterface::r#dictionary_remove(self, payload)
1667    }
1668
1669    /// Opens an iterator which can be used to iterate over the keys of this
1670    /// dictionary.
1671    pub fn r#dictionary_iterate_keys(
1672        &self,
1673        mut dictionary: fidl::EventPair,
1674        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
1675    ) -> fidl::client::QueryResponseFut<
1676        CapabilitiesDictionaryIterateKeysResult,
1677        fidl::encoding::DefaultFuchsiaResourceDialect,
1678    > {
1679        CapabilitiesProxyInterface::r#dictionary_iterate_keys(self, dictionary, key_iterator)
1680    }
1681
1682    /// Returns the `Data` value that was provided to the `DataCreate` call used with
1683    /// `data_handle`.
1684    pub fn r#data_get(
1685        &self,
1686        mut data_handle: fidl::EventPair,
1687    ) -> fidl::client::QueryResponseFut<
1688        CapabilitiesDataGetResult,
1689        fidl::encoding::DefaultFuchsiaResourceDialect,
1690    > {
1691        CapabilitiesProxyInterface::r#data_get(self, data_handle)
1692    }
1693
1694    /// Attempts to produce a `Connector` capability from this `ConnectorRouter`.
1695    ///
1696    /// Make sure this method returns before passing the peer of `capability` to other methods in
1697    /// this API. The creation may not be complete before then.
1698    pub fn r#connector_router_route(
1699        &self,
1700        mut router: fidl::EventPair,
1701        mut request: RouteRequest,
1702        mut connector: fidl::EventPair,
1703    ) -> fidl::client::QueryResponseFut<
1704        CapabilitiesConnectorRouterRouteResult,
1705        fidl::encoding::DefaultFuchsiaResourceDialect,
1706    > {
1707        CapabilitiesProxyInterface::r#connector_router_route(self, router, request, connector)
1708    }
1709
1710    /// Attempts to produce a `DirConnector` capability from this
1711    /// `DirConnectorRouter`. This will return:
1712    ///
1713    /// - A `DirConnector` if the operation is successful.
1714    /// - An empty value if there is no issue found but the capability is not
1715    ///   being provided (for example, an optional route ended in an offer from
1716    ///   void).
1717    /// - An error, if the operation failed.
1718    pub fn r#dir_connector_router_route(
1719        &self,
1720        mut router: fidl::EventPair,
1721        mut request: RouteRequest,
1722        mut dir_connector: fidl::EventPair,
1723    ) -> fidl::client::QueryResponseFut<
1724        CapabilitiesDirConnectorRouterRouteResult,
1725        fidl::encoding::DefaultFuchsiaResourceDialect,
1726    > {
1727        CapabilitiesProxyInterface::r#dir_connector_router_route(
1728            self,
1729            router,
1730            request,
1731            dir_connector,
1732        )
1733    }
1734
1735    /// Attempts to produce a `Dictionary` capability from this
1736    /// `DictionaryRouter`. This will return:
1737    ///
1738    /// - A `Dictionary` if the operation is successful.
1739    /// - An empty value if there is no issue found but the capability is not
1740    ///   being provided (for example, an optional route ended in an offer from
1741    ///   void).
1742    /// - An error, if the operation failed.
1743    pub fn r#dictionary_router_route(
1744        &self,
1745        mut router: fidl::EventPair,
1746        mut request: RouteRequest,
1747        mut dictionary: fidl::EventPair,
1748    ) -> fidl::client::QueryResponseFut<
1749        CapabilitiesDictionaryRouterRouteResult,
1750        fidl::encoding::DefaultFuchsiaResourceDialect,
1751    > {
1752        CapabilitiesProxyInterface::r#dictionary_router_route(self, router, request, dictionary)
1753    }
1754
1755    /// Attempts to produce a `Data` value from this
1756    /// `DataRouter`. This will return:
1757    ///
1758    /// - A `Data` value if the operation is successful.
1759    /// - An empty value if there is no issue found but the capability is not
1760    ///   being provided (for example, an optional route ended in an offer from
1761    ///   void).
1762    /// - An error, if the operation failed.
1763    pub fn r#data_router_route(
1764        &self,
1765        mut router: fidl::EventPair,
1766        mut request: RouteRequest,
1767        mut data_handle: i32,
1768    ) -> fidl::client::QueryResponseFut<
1769        CapabilitiesDataRouterRouteResult,
1770        fidl::encoding::DefaultFuchsiaResourceDialect,
1771    > {
1772        CapabilitiesProxyInterface::r#data_router_route(self, router, request, data_handle)
1773    }
1774}
1775
1776impl CapabilitiesProxyInterface for CapabilitiesProxy {
1777    type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1778        CapabilitiesConnectorCreateResult,
1779        fidl::encoding::DefaultFuchsiaResourceDialect,
1780    >;
1781    fn r#connector_create(
1782        &self,
1783        mut connector: fidl::EventPair,
1784        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
1785    ) -> Self::ConnectorCreateResponseFut {
1786        fn _decode(
1787            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1788        ) -> Result<CapabilitiesConnectorCreateResult, fidl::Error> {
1789            let _response = fidl::client::decode_transaction_body::<
1790                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1791                fidl::encoding::DefaultFuchsiaResourceDialect,
1792                0xac2bc2dbd7033d1,
1793            >(_buf?)?
1794            .into_result::<CapabilitiesMarker>("connector_create")?;
1795            Ok(_response.map(|x| x))
1796        }
1797        self.client.send_query_and_decode::<
1798            CapabilitiesConnectorCreateRequest,
1799            CapabilitiesConnectorCreateResult,
1800        >(
1801            (connector, receiver_client_end,),
1802            0xac2bc2dbd7033d1,
1803            fidl::encoding::DynamicFlags::FLEXIBLE,
1804            _decode,
1805        )
1806    }
1807
1808    type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1809        CapabilitiesDirConnectorCreateResult,
1810        fidl::encoding::DefaultFuchsiaResourceDialect,
1811    >;
1812    fn r#dir_connector_create(
1813        &self,
1814        mut dir_connector: fidl::EventPair,
1815        mut receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1816    ) -> Self::DirConnectorCreateResponseFut {
1817        fn _decode(
1818            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1819        ) -> Result<CapabilitiesDirConnectorCreateResult, fidl::Error> {
1820            let _response = fidl::client::decode_transaction_body::<
1821                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1822                fidl::encoding::DefaultFuchsiaResourceDialect,
1823                0x721911e05da2a3bf,
1824            >(_buf?)?
1825            .into_result::<CapabilitiesMarker>("dir_connector_create")?;
1826            Ok(_response.map(|x| x))
1827        }
1828        self.client.send_query_and_decode::<
1829            CapabilitiesDirConnectorCreateRequest,
1830            CapabilitiesDirConnectorCreateResult,
1831        >(
1832            (dir_connector, receiver_client_end,),
1833            0x721911e05da2a3bf,
1834            fidl::encoding::DynamicFlags::FLEXIBLE,
1835            _decode,
1836        )
1837    }
1838
1839    type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1840        CapabilitiesDictionaryCreateResult,
1841        fidl::encoding::DefaultFuchsiaResourceDialect,
1842    >;
1843    fn r#dictionary_create(
1844        &self,
1845        mut dictionary: fidl::EventPair,
1846    ) -> Self::DictionaryCreateResponseFut {
1847        fn _decode(
1848            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1849        ) -> Result<CapabilitiesDictionaryCreateResult, fidl::Error> {
1850            let _response = fidl::client::decode_transaction_body::<
1851                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1852                fidl::encoding::DefaultFuchsiaResourceDialect,
1853                0x7f8bd91f0942a36e,
1854            >(_buf?)?
1855            .into_result::<CapabilitiesMarker>("dictionary_create")?;
1856            Ok(_response.map(|x| x))
1857        }
1858        self.client.send_query_and_decode::<
1859            CapabilitiesDictionaryCreateRequest,
1860            CapabilitiesDictionaryCreateResult,
1861        >(
1862            (dictionary,),
1863            0x7f8bd91f0942a36e,
1864            fidl::encoding::DynamicFlags::FLEXIBLE,
1865            _decode,
1866        )
1867    }
1868
1869    type DataCreateResponseFut = fidl::client::QueryResponseFut<
1870        CapabilitiesDataCreateResult,
1871        fidl::encoding::DefaultFuchsiaResourceDialect,
1872    >;
1873    fn r#data_create(
1874        &self,
1875        mut data_handle: fidl::EventPair,
1876        mut data: &Data,
1877    ) -> Self::DataCreateResponseFut {
1878        fn _decode(
1879            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1880        ) -> Result<CapabilitiesDataCreateResult, fidl::Error> {
1881            let _response = fidl::client::decode_transaction_body::<
1882                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1883                fidl::encoding::DefaultFuchsiaResourceDialect,
1884                0x40ef43e45372ee6a,
1885            >(_buf?)?
1886            .into_result::<CapabilitiesMarker>("data_create")?;
1887            Ok(_response.map(|x| x))
1888        }
1889        self.client
1890            .send_query_and_decode::<CapabilitiesDataCreateRequest, CapabilitiesDataCreateResult>(
1891                (data_handle, data),
1892                0x40ef43e45372ee6a,
1893                fidl::encoding::DynamicFlags::FLEXIBLE,
1894                _decode,
1895            )
1896    }
1897
1898    type ConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1899        CapabilitiesConnectorRouterCreateResult,
1900        fidl::encoding::DefaultFuchsiaResourceDialect,
1901    >;
1902    fn r#connector_router_create(
1903        &self,
1904        mut router: fidl::EventPair,
1905        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
1906    ) -> Self::ConnectorRouterCreateResponseFut {
1907        fn _decode(
1908            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1909        ) -> Result<CapabilitiesConnectorRouterCreateResult, fidl::Error> {
1910            let _response = fidl::client::decode_transaction_body::<
1911                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1912                fidl::encoding::DefaultFuchsiaResourceDialect,
1913                0x7f7e7fbafcdf1761,
1914            >(_buf?)?
1915            .into_result::<CapabilitiesMarker>("connector_router_create")?;
1916            Ok(_response.map(|x| x))
1917        }
1918        self.client.send_query_and_decode::<
1919            CapabilitiesConnectorRouterCreateRequest,
1920            CapabilitiesConnectorRouterCreateResult,
1921        >(
1922            (router, router_client_end,),
1923            0x7f7e7fbafcdf1761,
1924            fidl::encoding::DynamicFlags::FLEXIBLE,
1925            _decode,
1926        )
1927    }
1928
1929    type DirConnectorRouterCreateResponseFut = fidl::client::QueryResponseFut<
1930        CapabilitiesDirConnectorRouterCreateResult,
1931        fidl::encoding::DefaultFuchsiaResourceDialect,
1932    >;
1933    fn r#dir_connector_router_create(
1934        &self,
1935        mut router: fidl::EventPair,
1936        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
1937    ) -> Self::DirConnectorRouterCreateResponseFut {
1938        fn _decode(
1939            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1940        ) -> Result<CapabilitiesDirConnectorRouterCreateResult, fidl::Error> {
1941            let _response = fidl::client::decode_transaction_body::<
1942                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1943                fidl::encoding::DefaultFuchsiaResourceDialect,
1944                0x56520da453fad19f,
1945            >(_buf?)?
1946            .into_result::<CapabilitiesMarker>("dir_connector_router_create")?;
1947            Ok(_response.map(|x| x))
1948        }
1949        self.client.send_query_and_decode::<
1950            CapabilitiesDirConnectorRouterCreateRequest,
1951            CapabilitiesDirConnectorRouterCreateResult,
1952        >(
1953            (router, router_client_end,),
1954            0x56520da453fad19f,
1955            fidl::encoding::DynamicFlags::FLEXIBLE,
1956            _decode,
1957        )
1958    }
1959
1960    type DictionaryRouterCreateResponseFut = fidl::client::QueryResponseFut<
1961        CapabilitiesDictionaryRouterCreateResult,
1962        fidl::encoding::DefaultFuchsiaResourceDialect,
1963    >;
1964    fn r#dictionary_router_create(
1965        &self,
1966        mut router: fidl::EventPair,
1967        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
1968    ) -> Self::DictionaryRouterCreateResponseFut {
1969        fn _decode(
1970            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1971        ) -> Result<CapabilitiesDictionaryRouterCreateResult, fidl::Error> {
1972            let _response = fidl::client::decode_transaction_body::<
1973                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
1974                fidl::encoding::DefaultFuchsiaResourceDialect,
1975                0x37acef18cd423d42,
1976            >(_buf?)?
1977            .into_result::<CapabilitiesMarker>("dictionary_router_create")?;
1978            Ok(_response.map(|x| x))
1979        }
1980        self.client.send_query_and_decode::<
1981            CapabilitiesDictionaryRouterCreateRequest,
1982            CapabilitiesDictionaryRouterCreateResult,
1983        >(
1984            (router, router_client_end,),
1985            0x37acef18cd423d42,
1986            fidl::encoding::DynamicFlags::FLEXIBLE,
1987            _decode,
1988        )
1989    }
1990
1991    type DataRouterCreateResponseFut = fidl::client::QueryResponseFut<
1992        CapabilitiesDataRouterCreateResult,
1993        fidl::encoding::DefaultFuchsiaResourceDialect,
1994    >;
1995    fn r#data_router_create(
1996        &self,
1997        mut router: fidl::EventPair,
1998        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
1999    ) -> Self::DataRouterCreateResponseFut {
2000        fn _decode(
2001            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2002        ) -> Result<CapabilitiesDataRouterCreateResult, fidl::Error> {
2003            let _response = fidl::client::decode_transaction_body::<
2004                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2005                fidl::encoding::DefaultFuchsiaResourceDialect,
2006                0x24e471395b95088,
2007            >(_buf?)?
2008            .into_result::<CapabilitiesMarker>("data_router_create")?;
2009            Ok(_response.map(|x| x))
2010        }
2011        self.client.send_query_and_decode::<
2012            CapabilitiesDataRouterCreateRequest,
2013            CapabilitiesDataRouterCreateResult,
2014        >(
2015            (router, router_client_end,),
2016            0x24e471395b95088,
2017            fidl::encoding::DynamicFlags::FLEXIBLE,
2018            _decode,
2019        )
2020    }
2021
2022    type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
2023        CapabilitiesConnectorOpenResult,
2024        fidl::encoding::DefaultFuchsiaResourceDialect,
2025    >;
2026    fn r#connector_open(
2027        &self,
2028        mut connector: fidl::EventPair,
2029        mut channel: fidl::Channel,
2030    ) -> Self::ConnectorOpenResponseFut {
2031        fn _decode(
2032            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2033        ) -> Result<CapabilitiesConnectorOpenResult, fidl::Error> {
2034            let _response = fidl::client::decode_transaction_body::<
2035                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2036                fidl::encoding::DefaultFuchsiaResourceDialect,
2037                0xc0646965f1884eb,
2038            >(_buf?)?
2039            .into_result::<CapabilitiesMarker>("connector_open")?;
2040            Ok(_response.map(|x| x))
2041        }
2042        self.client.send_query_and_decode::<
2043            CapabilitiesConnectorOpenRequest,
2044            CapabilitiesConnectorOpenResult,
2045        >(
2046            (connector, channel,),
2047            0xc0646965f1884eb,
2048            fidl::encoding::DynamicFlags::FLEXIBLE,
2049            _decode,
2050        )
2051    }
2052
2053    type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
2054        CapabilitiesDirConnectorOpenResult,
2055        fidl::encoding::DefaultFuchsiaResourceDialect,
2056    >;
2057    fn r#dir_connector_open(
2058        &self,
2059        mut payload: CapabilitiesDirConnectorOpenRequest,
2060    ) -> Self::DirConnectorOpenResponseFut {
2061        fn _decode(
2062            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2063        ) -> Result<CapabilitiesDirConnectorOpenResult, fidl::Error> {
2064            let _response = fidl::client::decode_transaction_body::<
2065                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2066                fidl::encoding::DefaultFuchsiaResourceDialect,
2067                0x1332bbf5debd6c20,
2068            >(_buf?)?
2069            .into_result::<CapabilitiesMarker>("dir_connector_open")?;
2070            Ok(_response.map(|x| x))
2071        }
2072        self.client.send_query_and_decode::<
2073            CapabilitiesDirConnectorOpenRequest,
2074            CapabilitiesDirConnectorOpenResult,
2075        >(
2076            &mut payload,
2077            0x1332bbf5debd6c20,
2078            fidl::encoding::DynamicFlags::FLEXIBLE,
2079            _decode,
2080        )
2081    }
2082
2083    type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
2084        CapabilitiesDictionaryInsertResult,
2085        fidl::encoding::DefaultFuchsiaResourceDialect,
2086    >;
2087    fn r#dictionary_insert(
2088        &self,
2089        mut dictionary: fidl::EventPair,
2090        mut key: &str,
2091        mut value: fidl::EventPair,
2092    ) -> Self::DictionaryInsertResponseFut {
2093        fn _decode(
2094            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2095        ) -> Result<CapabilitiesDictionaryInsertResult, fidl::Error> {
2096            let _response = fidl::client::decode_transaction_body::<
2097                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2098                fidl::encoding::DefaultFuchsiaResourceDialect,
2099                0x5972e3061a760e7a,
2100            >(_buf?)?
2101            .into_result::<CapabilitiesMarker>("dictionary_insert")?;
2102            Ok(_response.map(|x| x))
2103        }
2104        self.client.send_query_and_decode::<
2105            CapabilitiesDictionaryInsertRequest,
2106            CapabilitiesDictionaryInsertResult,
2107        >(
2108            (dictionary, key, value,),
2109            0x5972e3061a760e7a,
2110            fidl::encoding::DynamicFlags::FLEXIBLE,
2111            _decode,
2112        )
2113    }
2114
2115    type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
2116        CapabilitiesDictionaryGetResult,
2117        fidl::encoding::DefaultFuchsiaResourceDialect,
2118    >;
2119    fn r#dictionary_get(
2120        &self,
2121        mut dictionary: fidl::EventPair,
2122        mut key: &str,
2123        mut value: fidl::EventPair,
2124    ) -> Self::DictionaryGetResponseFut {
2125        fn _decode(
2126            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2127        ) -> Result<CapabilitiesDictionaryGetResult, fidl::Error> {
2128            let _response = fidl::client::decode_transaction_body::<
2129                fidl::encoding::FlexibleResultType<
2130                    CapabilitiesDictionaryGetResponse,
2131                    CapabilitiesError,
2132                >,
2133                fidl::encoding::DefaultFuchsiaResourceDialect,
2134                0x31fafe2280a283d5,
2135            >(_buf?)?
2136            .into_result::<CapabilitiesMarker>("dictionary_get")?;
2137            Ok(_response.map(|x| x.capability_type))
2138        }
2139        self.client.send_query_and_decode::<
2140            CapabilitiesDictionaryGetRequest,
2141            CapabilitiesDictionaryGetResult,
2142        >(
2143            (dictionary, key, value,),
2144            0x31fafe2280a283d5,
2145            fidl::encoding::DynamicFlags::FLEXIBLE,
2146            _decode,
2147        )
2148    }
2149
2150    type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
2151        CapabilitiesDictionaryRemoveResult,
2152        fidl::encoding::DefaultFuchsiaResourceDialect,
2153    >;
2154    fn r#dictionary_remove(
2155        &self,
2156        mut payload: CapabilitiesDictionaryRemoveRequest,
2157    ) -> Self::DictionaryRemoveResponseFut {
2158        fn _decode(
2159            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2160        ) -> Result<CapabilitiesDictionaryRemoveResult, fidl::Error> {
2161            let _response = fidl::client::decode_transaction_body::<
2162                fidl::encoding::FlexibleResultType<
2163                    CapabilitiesDictionaryRemoveResponse,
2164                    CapabilitiesError,
2165                >,
2166                fidl::encoding::DefaultFuchsiaResourceDialect,
2167                0x6827c83106ac5a2c,
2168            >(_buf?)?
2169            .into_result::<CapabilitiesMarker>("dictionary_remove")?;
2170            Ok(_response.map(|x| x.capability_type))
2171        }
2172        self.client.send_query_and_decode::<
2173            CapabilitiesDictionaryRemoveRequest,
2174            CapabilitiesDictionaryRemoveResult,
2175        >(
2176            &mut payload,
2177            0x6827c83106ac5a2c,
2178            fidl::encoding::DynamicFlags::FLEXIBLE,
2179            _decode,
2180        )
2181    }
2182
2183    type DictionaryIterateKeysResponseFut = fidl::client::QueryResponseFut<
2184        CapabilitiesDictionaryIterateKeysResult,
2185        fidl::encoding::DefaultFuchsiaResourceDialect,
2186    >;
2187    fn r#dictionary_iterate_keys(
2188        &self,
2189        mut dictionary: fidl::EventPair,
2190        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
2191    ) -> Self::DictionaryIterateKeysResponseFut {
2192        fn _decode(
2193            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2194        ) -> Result<CapabilitiesDictionaryIterateKeysResult, fidl::Error> {
2195            let _response = fidl::client::decode_transaction_body::<
2196                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilitiesError>,
2197                fidl::encoding::DefaultFuchsiaResourceDialect,
2198                0x3d4ea59c80df9bb8,
2199            >(_buf?)?
2200            .into_result::<CapabilitiesMarker>("dictionary_iterate_keys")?;
2201            Ok(_response.map(|x| x))
2202        }
2203        self.client.send_query_and_decode::<
2204            CapabilitiesDictionaryIterateKeysRequest,
2205            CapabilitiesDictionaryIterateKeysResult,
2206        >(
2207            (dictionary, key_iterator,),
2208            0x3d4ea59c80df9bb8,
2209            fidl::encoding::DynamicFlags::FLEXIBLE,
2210            _decode,
2211        )
2212    }
2213
2214    type DataGetResponseFut = fidl::client::QueryResponseFut<
2215        CapabilitiesDataGetResult,
2216        fidl::encoding::DefaultFuchsiaResourceDialect,
2217    >;
2218    fn r#data_get(&self, mut data_handle: fidl::EventPair) -> Self::DataGetResponseFut {
2219        fn _decode(
2220            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2221        ) -> Result<CapabilitiesDataGetResult, fidl::Error> {
2222            let _response = fidl::client::decode_transaction_body::<
2223                fidl::encoding::FlexibleResultType<Data, CapabilitiesError>,
2224                fidl::encoding::DefaultFuchsiaResourceDialect,
2225                0x65ae25b59f9e0daf,
2226            >(_buf?)?
2227            .into_result::<CapabilitiesMarker>("data_get")?;
2228            Ok(_response.map(|x| x))
2229        }
2230        self.client.send_query_and_decode::<CapabilitiesDataGetRequest, CapabilitiesDataGetResult>(
2231            (data_handle,),
2232            0x65ae25b59f9e0daf,
2233            fidl::encoding::DynamicFlags::FLEXIBLE,
2234            _decode,
2235        )
2236    }
2237
2238    type ConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2239        CapabilitiesConnectorRouterRouteResult,
2240        fidl::encoding::DefaultFuchsiaResourceDialect,
2241    >;
2242    fn r#connector_router_route(
2243        &self,
2244        mut router: fidl::EventPair,
2245        mut request: RouteRequest,
2246        mut connector: fidl::EventPair,
2247    ) -> Self::ConnectorRouterRouteResponseFut {
2248        fn _decode(
2249            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2250        ) -> Result<CapabilitiesConnectorRouterRouteResult, fidl::Error> {
2251            let _response = fidl::client::decode_transaction_body::<
2252                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2253                fidl::encoding::DefaultFuchsiaResourceDialect,
2254                0x1bd9c6e7e3dd487e,
2255            >(_buf?)?
2256            .into_result::<CapabilitiesMarker>("connector_router_route")?;
2257            Ok(_response.map(|x| x))
2258        }
2259        self.client.send_query_and_decode::<
2260            CapabilitiesConnectorRouterRouteRequest,
2261            CapabilitiesConnectorRouterRouteResult,
2262        >(
2263            (router, &mut request, connector,),
2264            0x1bd9c6e7e3dd487e,
2265            fidl::encoding::DynamicFlags::FLEXIBLE,
2266            _decode,
2267        )
2268    }
2269
2270    type DirConnectorRouterRouteResponseFut = fidl::client::QueryResponseFut<
2271        CapabilitiesDirConnectorRouterRouteResult,
2272        fidl::encoding::DefaultFuchsiaResourceDialect,
2273    >;
2274    fn r#dir_connector_router_route(
2275        &self,
2276        mut router: fidl::EventPair,
2277        mut request: RouteRequest,
2278        mut dir_connector: fidl::EventPair,
2279    ) -> Self::DirConnectorRouterRouteResponseFut {
2280        fn _decode(
2281            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2282        ) -> Result<CapabilitiesDirConnectorRouterRouteResult, fidl::Error> {
2283            let _response = fidl::client::decode_transaction_body::<
2284                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2285                fidl::encoding::DefaultFuchsiaResourceDialect,
2286                0x3afdcc1b79e0799d,
2287            >(_buf?)?
2288            .into_result::<CapabilitiesMarker>("dir_connector_router_route")?;
2289            Ok(_response.map(|x| x))
2290        }
2291        self.client.send_query_and_decode::<
2292            CapabilitiesDirConnectorRouterRouteRequest,
2293            CapabilitiesDirConnectorRouterRouteResult,
2294        >(
2295            (router, &mut request, dir_connector,),
2296            0x3afdcc1b79e0799d,
2297            fidl::encoding::DynamicFlags::FLEXIBLE,
2298            _decode,
2299        )
2300    }
2301
2302    type DictionaryRouterRouteResponseFut = fidl::client::QueryResponseFut<
2303        CapabilitiesDictionaryRouterRouteResult,
2304        fidl::encoding::DefaultFuchsiaResourceDialect,
2305    >;
2306    fn r#dictionary_router_route(
2307        &self,
2308        mut router: fidl::EventPair,
2309        mut request: RouteRequest,
2310        mut dictionary: fidl::EventPair,
2311    ) -> Self::DictionaryRouterRouteResponseFut {
2312        fn _decode(
2313            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2314        ) -> Result<CapabilitiesDictionaryRouterRouteResult, fidl::Error> {
2315            let _response = fidl::client::decode_transaction_body::<
2316                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2317                fidl::encoding::DefaultFuchsiaResourceDialect,
2318                0xcf72de10714a708,
2319            >(_buf?)?
2320            .into_result::<CapabilitiesMarker>("dictionary_router_route")?;
2321            Ok(_response.map(|x| x))
2322        }
2323        self.client.send_query_and_decode::<
2324            CapabilitiesDictionaryRouterRouteRequest,
2325            CapabilitiesDictionaryRouterRouteResult,
2326        >(
2327            (router, &mut request, dictionary,),
2328            0xcf72de10714a708,
2329            fidl::encoding::DynamicFlags::FLEXIBLE,
2330            _decode,
2331        )
2332    }
2333
2334    type DataRouterRouteResponseFut = fidl::client::QueryResponseFut<
2335        CapabilitiesDataRouterRouteResult,
2336        fidl::encoding::DefaultFuchsiaResourceDialect,
2337    >;
2338    fn r#data_router_route(
2339        &self,
2340        mut router: fidl::EventPair,
2341        mut request: RouteRequest,
2342        mut data_handle: i32,
2343    ) -> Self::DataRouterRouteResponseFut {
2344        fn _decode(
2345            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2346        ) -> Result<CapabilitiesDataRouterRouteResult, fidl::Error> {
2347            let _response = fidl::client::decode_transaction_body::<
2348                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2349                fidl::encoding::DefaultFuchsiaResourceDialect,
2350                0x61ab188455ed0643,
2351            >(_buf?)?
2352            .into_result::<CapabilitiesMarker>("data_router_route")?;
2353            Ok(_response.map(|x| x))
2354        }
2355        self.client.send_query_and_decode::<
2356            CapabilitiesDataRouterRouteRequest,
2357            CapabilitiesDataRouterRouteResult,
2358        >(
2359            (router, &mut request, data_handle,),
2360            0x61ab188455ed0643,
2361            fidl::encoding::DynamicFlags::FLEXIBLE,
2362            _decode,
2363        )
2364    }
2365}
2366
2367pub struct CapabilitiesEventStream {
2368    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2369}
2370
2371impl std::marker::Unpin for CapabilitiesEventStream {}
2372
2373impl futures::stream::FusedStream for CapabilitiesEventStream {
2374    fn is_terminated(&self) -> bool {
2375        self.event_receiver.is_terminated()
2376    }
2377}
2378
2379impl futures::Stream for CapabilitiesEventStream {
2380    type Item = Result<CapabilitiesEvent, fidl::Error>;
2381
2382    fn poll_next(
2383        mut self: std::pin::Pin<&mut Self>,
2384        cx: &mut std::task::Context<'_>,
2385    ) -> std::task::Poll<Option<Self::Item>> {
2386        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2387            &mut self.event_receiver,
2388            cx
2389        )?) {
2390            Some(buf) => std::task::Poll::Ready(Some(CapabilitiesEvent::decode(buf))),
2391            None => std::task::Poll::Ready(None),
2392        }
2393    }
2394}
2395
2396#[derive(Debug)]
2397pub enum CapabilitiesEvent {
2398    #[non_exhaustive]
2399    _UnknownEvent {
2400        /// Ordinal of the event that was sent.
2401        ordinal: u64,
2402    },
2403}
2404
2405impl CapabilitiesEvent {
2406    /// Decodes a message buffer as a [`CapabilitiesEvent`].
2407    fn decode(
2408        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2409    ) -> Result<CapabilitiesEvent, fidl::Error> {
2410        let (bytes, _handles) = buf.split_mut();
2411        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2412        debug_assert_eq!(tx_header.tx_id, 0);
2413        match tx_header.ordinal {
2414            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2415                Ok(CapabilitiesEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2416            }
2417            _ => Err(fidl::Error::UnknownOrdinal {
2418                ordinal: tx_header.ordinal,
2419                protocol_name: <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2420            }),
2421        }
2422    }
2423}
2424
2425/// A Stream of incoming requests for fuchsia.component.runtime/Capabilities.
2426pub struct CapabilitiesRequestStream {
2427    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2428    is_terminated: bool,
2429}
2430
2431impl std::marker::Unpin for CapabilitiesRequestStream {}
2432
2433impl futures::stream::FusedStream for CapabilitiesRequestStream {
2434    fn is_terminated(&self) -> bool {
2435        self.is_terminated
2436    }
2437}
2438
2439impl fidl::endpoints::RequestStream for CapabilitiesRequestStream {
2440    type Protocol = CapabilitiesMarker;
2441    type ControlHandle = CapabilitiesControlHandle;
2442
2443    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2444        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2445    }
2446
2447    fn control_handle(&self) -> Self::ControlHandle {
2448        CapabilitiesControlHandle { inner: self.inner.clone() }
2449    }
2450
2451    fn into_inner(
2452        self,
2453    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2454    {
2455        (self.inner, self.is_terminated)
2456    }
2457
2458    fn from_inner(
2459        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2460        is_terminated: bool,
2461    ) -> Self {
2462        Self { inner, is_terminated }
2463    }
2464}
2465
2466impl futures::Stream for CapabilitiesRequestStream {
2467    type Item = Result<CapabilitiesRequest, fidl::Error>;
2468
2469    fn poll_next(
2470        mut self: std::pin::Pin<&mut Self>,
2471        cx: &mut std::task::Context<'_>,
2472    ) -> std::task::Poll<Option<Self::Item>> {
2473        let this = &mut *self;
2474        if this.inner.check_shutdown(cx) {
2475            this.is_terminated = true;
2476            return std::task::Poll::Ready(None);
2477        }
2478        if this.is_terminated {
2479            panic!("polled CapabilitiesRequestStream after completion");
2480        }
2481        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2482            |bytes, handles| {
2483                match this.inner.channel().read_etc(cx, bytes, handles) {
2484                    std::task::Poll::Ready(Ok(())) => {}
2485                    std::task::Poll::Pending => return std::task::Poll::Pending,
2486                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2487                        this.is_terminated = true;
2488                        return std::task::Poll::Ready(None);
2489                    }
2490                    std::task::Poll::Ready(Err(e)) => {
2491                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2492                            e.into(),
2493                        ))));
2494                    }
2495                }
2496
2497                // A message has been received from the channel
2498                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2499
2500                std::task::Poll::Ready(Some(match header.ordinal {
2501                    0xac2bc2dbd7033d1 => {
2502                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2503                        let mut req = fidl::new_empty!(
2504                            CapabilitiesConnectorCreateRequest,
2505                            fidl::encoding::DefaultFuchsiaResourceDialect
2506                        );
2507                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2508                        let control_handle =
2509                            CapabilitiesControlHandle { inner: this.inner.clone() };
2510                        Ok(CapabilitiesRequest::ConnectorCreate {
2511                            connector: req.connector,
2512                            receiver_client_end: req.receiver_client_end,
2513
2514                            responder: CapabilitiesConnectorCreateResponder {
2515                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2516                                tx_id: header.tx_id,
2517                            },
2518                        })
2519                    }
2520                    0x721911e05da2a3bf => {
2521                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2522                        let mut req = fidl::new_empty!(
2523                            CapabilitiesDirConnectorCreateRequest,
2524                            fidl::encoding::DefaultFuchsiaResourceDialect
2525                        );
2526                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2527                        let control_handle =
2528                            CapabilitiesControlHandle { inner: this.inner.clone() };
2529                        Ok(CapabilitiesRequest::DirConnectorCreate {
2530                            dir_connector: req.dir_connector,
2531                            receiver_client_end: req.receiver_client_end,
2532
2533                            responder: CapabilitiesDirConnectorCreateResponder {
2534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2535                                tx_id: header.tx_id,
2536                            },
2537                        })
2538                    }
2539                    0x7f8bd91f0942a36e => {
2540                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2541                        let mut req = fidl::new_empty!(
2542                            CapabilitiesDictionaryCreateRequest,
2543                            fidl::encoding::DefaultFuchsiaResourceDialect
2544                        );
2545                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2546                        let control_handle =
2547                            CapabilitiesControlHandle { inner: this.inner.clone() };
2548                        Ok(CapabilitiesRequest::DictionaryCreate {
2549                            dictionary: req.dictionary,
2550
2551                            responder: CapabilitiesDictionaryCreateResponder {
2552                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2553                                tx_id: header.tx_id,
2554                            },
2555                        })
2556                    }
2557                    0x40ef43e45372ee6a => {
2558                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2559                        let mut req = fidl::new_empty!(
2560                            CapabilitiesDataCreateRequest,
2561                            fidl::encoding::DefaultFuchsiaResourceDialect
2562                        );
2563                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2564                        let control_handle =
2565                            CapabilitiesControlHandle { inner: this.inner.clone() };
2566                        Ok(CapabilitiesRequest::DataCreate {
2567                            data_handle: req.data_handle,
2568                            data: req.data,
2569
2570                            responder: CapabilitiesDataCreateResponder {
2571                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2572                                tx_id: header.tx_id,
2573                            },
2574                        })
2575                    }
2576                    0x7f7e7fbafcdf1761 => {
2577                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2578                        let mut req = fidl::new_empty!(
2579                            CapabilitiesConnectorRouterCreateRequest,
2580                            fidl::encoding::DefaultFuchsiaResourceDialect
2581                        );
2582                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2583                        let control_handle =
2584                            CapabilitiesControlHandle { inner: this.inner.clone() };
2585                        Ok(CapabilitiesRequest::ConnectorRouterCreate {
2586                            router: req.router,
2587                            router_client_end: req.router_client_end,
2588
2589                            responder: CapabilitiesConnectorRouterCreateResponder {
2590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2591                                tx_id: header.tx_id,
2592                            },
2593                        })
2594                    }
2595                    0x56520da453fad19f => {
2596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2597                        let mut req = fidl::new_empty!(
2598                            CapabilitiesDirConnectorRouterCreateRequest,
2599                            fidl::encoding::DefaultFuchsiaResourceDialect
2600                        );
2601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2602                        let control_handle =
2603                            CapabilitiesControlHandle { inner: this.inner.clone() };
2604                        Ok(CapabilitiesRequest::DirConnectorRouterCreate {
2605                            router: req.router,
2606                            router_client_end: req.router_client_end,
2607
2608                            responder: CapabilitiesDirConnectorRouterCreateResponder {
2609                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2610                                tx_id: header.tx_id,
2611                            },
2612                        })
2613                    }
2614                    0x37acef18cd423d42 => {
2615                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2616                        let mut req = fidl::new_empty!(
2617                            CapabilitiesDictionaryRouterCreateRequest,
2618                            fidl::encoding::DefaultFuchsiaResourceDialect
2619                        );
2620                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2621                        let control_handle =
2622                            CapabilitiesControlHandle { inner: this.inner.clone() };
2623                        Ok(CapabilitiesRequest::DictionaryRouterCreate {
2624                            router: req.router,
2625                            router_client_end: req.router_client_end,
2626
2627                            responder: CapabilitiesDictionaryRouterCreateResponder {
2628                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2629                                tx_id: header.tx_id,
2630                            },
2631                        })
2632                    }
2633                    0x24e471395b95088 => {
2634                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2635                        let mut req = fidl::new_empty!(
2636                            CapabilitiesDataRouterCreateRequest,
2637                            fidl::encoding::DefaultFuchsiaResourceDialect
2638                        );
2639                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2640                        let control_handle =
2641                            CapabilitiesControlHandle { inner: this.inner.clone() };
2642                        Ok(CapabilitiesRequest::DataRouterCreate {
2643                            router: req.router,
2644                            router_client_end: req.router_client_end,
2645
2646                            responder: CapabilitiesDataRouterCreateResponder {
2647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2648                                tx_id: header.tx_id,
2649                            },
2650                        })
2651                    }
2652                    0xc0646965f1884eb => {
2653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2654                        let mut req = fidl::new_empty!(
2655                            CapabilitiesConnectorOpenRequest,
2656                            fidl::encoding::DefaultFuchsiaResourceDialect
2657                        );
2658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2659                        let control_handle =
2660                            CapabilitiesControlHandle { inner: this.inner.clone() };
2661                        Ok(CapabilitiesRequest::ConnectorOpen {
2662                            connector: req.connector,
2663                            channel: req.channel,
2664
2665                            responder: CapabilitiesConnectorOpenResponder {
2666                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2667                                tx_id: header.tx_id,
2668                            },
2669                        })
2670                    }
2671                    0x1332bbf5debd6c20 => {
2672                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2673                        let mut req = fidl::new_empty!(
2674                            CapabilitiesDirConnectorOpenRequest,
2675                            fidl::encoding::DefaultFuchsiaResourceDialect
2676                        );
2677                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2678                        let control_handle =
2679                            CapabilitiesControlHandle { inner: this.inner.clone() };
2680                        Ok(CapabilitiesRequest::DirConnectorOpen {
2681                            payload: req,
2682                            responder: CapabilitiesDirConnectorOpenResponder {
2683                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2684                                tx_id: header.tx_id,
2685                            },
2686                        })
2687                    }
2688                    0x5972e3061a760e7a => {
2689                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2690                        let mut req = fidl::new_empty!(
2691                            CapabilitiesDictionaryInsertRequest,
2692                            fidl::encoding::DefaultFuchsiaResourceDialect
2693                        );
2694                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2695                        let control_handle =
2696                            CapabilitiesControlHandle { inner: this.inner.clone() };
2697                        Ok(CapabilitiesRequest::DictionaryInsert {
2698                            dictionary: req.dictionary,
2699                            key: req.key,
2700                            value: req.value,
2701
2702                            responder: CapabilitiesDictionaryInsertResponder {
2703                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2704                                tx_id: header.tx_id,
2705                            },
2706                        })
2707                    }
2708                    0x31fafe2280a283d5 => {
2709                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2710                        let mut req = fidl::new_empty!(
2711                            CapabilitiesDictionaryGetRequest,
2712                            fidl::encoding::DefaultFuchsiaResourceDialect
2713                        );
2714                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2715                        let control_handle =
2716                            CapabilitiesControlHandle { inner: this.inner.clone() };
2717                        Ok(CapabilitiesRequest::DictionaryGet {
2718                            dictionary: req.dictionary,
2719                            key: req.key,
2720                            value: req.value,
2721
2722                            responder: CapabilitiesDictionaryGetResponder {
2723                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2724                                tx_id: header.tx_id,
2725                            },
2726                        })
2727                    }
2728                    0x6827c83106ac5a2c => {
2729                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2730                        let mut req = fidl::new_empty!(
2731                            CapabilitiesDictionaryRemoveRequest,
2732                            fidl::encoding::DefaultFuchsiaResourceDialect
2733                        );
2734                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2735                        let control_handle =
2736                            CapabilitiesControlHandle { inner: this.inner.clone() };
2737                        Ok(CapabilitiesRequest::DictionaryRemove {
2738                            payload: req,
2739                            responder: CapabilitiesDictionaryRemoveResponder {
2740                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2741                                tx_id: header.tx_id,
2742                            },
2743                        })
2744                    }
2745                    0x3d4ea59c80df9bb8 => {
2746                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2747                        let mut req = fidl::new_empty!(
2748                            CapabilitiesDictionaryIterateKeysRequest,
2749                            fidl::encoding::DefaultFuchsiaResourceDialect
2750                        );
2751                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryIterateKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2752                        let control_handle =
2753                            CapabilitiesControlHandle { inner: this.inner.clone() };
2754                        Ok(CapabilitiesRequest::DictionaryIterateKeys {
2755                            dictionary: req.dictionary,
2756                            key_iterator: req.key_iterator,
2757
2758                            responder: CapabilitiesDictionaryIterateKeysResponder {
2759                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2760                                tx_id: header.tx_id,
2761                            },
2762                        })
2763                    }
2764                    0x65ae25b59f9e0daf => {
2765                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2766                        let mut req = fidl::new_empty!(
2767                            CapabilitiesDataGetRequest,
2768                            fidl::encoding::DefaultFuchsiaResourceDialect
2769                        );
2770                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataGetRequest>(&header, _body_bytes, handles, &mut req)?;
2771                        let control_handle =
2772                            CapabilitiesControlHandle { inner: this.inner.clone() };
2773                        Ok(CapabilitiesRequest::DataGet {
2774                            data_handle: req.data_handle,
2775
2776                            responder: CapabilitiesDataGetResponder {
2777                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2778                                tx_id: header.tx_id,
2779                            },
2780                        })
2781                    }
2782                    0x1bd9c6e7e3dd487e => {
2783                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2784                        let mut req = fidl::new_empty!(
2785                            CapabilitiesConnectorRouterRouteRequest,
2786                            fidl::encoding::DefaultFuchsiaResourceDialect
2787                        );
2788                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2789                        let control_handle =
2790                            CapabilitiesControlHandle { inner: this.inner.clone() };
2791                        Ok(CapabilitiesRequest::ConnectorRouterRoute {
2792                            router: req.router,
2793                            request: req.request,
2794                            connector: req.connector,
2795
2796                            responder: CapabilitiesConnectorRouterRouteResponder {
2797                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2798                                tx_id: header.tx_id,
2799                            },
2800                        })
2801                    }
2802                    0x3afdcc1b79e0799d => {
2803                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2804                        let mut req = fidl::new_empty!(
2805                            CapabilitiesDirConnectorRouterRouteRequest,
2806                            fidl::encoding::DefaultFuchsiaResourceDialect
2807                        );
2808                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2809                        let control_handle =
2810                            CapabilitiesControlHandle { inner: this.inner.clone() };
2811                        Ok(CapabilitiesRequest::DirConnectorRouterRoute {
2812                            router: req.router,
2813                            request: req.request,
2814                            dir_connector: req.dir_connector,
2815
2816                            responder: CapabilitiesDirConnectorRouterRouteResponder {
2817                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2818                                tx_id: header.tx_id,
2819                            },
2820                        })
2821                    }
2822                    0xcf72de10714a708 => {
2823                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2824                        let mut req = fidl::new_empty!(
2825                            CapabilitiesDictionaryRouterRouteRequest,
2826                            fidl::encoding::DefaultFuchsiaResourceDialect
2827                        );
2828                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2829                        let control_handle =
2830                            CapabilitiesControlHandle { inner: this.inner.clone() };
2831                        Ok(CapabilitiesRequest::DictionaryRouterRoute {
2832                            router: req.router,
2833                            request: req.request,
2834                            dictionary: req.dictionary,
2835
2836                            responder: CapabilitiesDictionaryRouterRouteResponder {
2837                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2838                                tx_id: header.tx_id,
2839                            },
2840                        })
2841                    }
2842                    0x61ab188455ed0643 => {
2843                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2844                        let mut req = fidl::new_empty!(
2845                            CapabilitiesDataRouterRouteRequest,
2846                            fidl::encoding::DefaultFuchsiaResourceDialect
2847                        );
2848                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilitiesDataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2849                        let control_handle =
2850                            CapabilitiesControlHandle { inner: this.inner.clone() };
2851                        Ok(CapabilitiesRequest::DataRouterRoute {
2852                            router: req.router,
2853                            request: req.request,
2854                            data_handle: req.data_handle,
2855
2856                            responder: CapabilitiesDataRouterRouteResponder {
2857                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2858                                tx_id: header.tx_id,
2859                            },
2860                        })
2861                    }
2862                    _ if header.tx_id == 0
2863                        && header
2864                            .dynamic_flags()
2865                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2866                    {
2867                        Ok(CapabilitiesRequest::_UnknownMethod {
2868                            ordinal: header.ordinal,
2869                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2870                            method_type: fidl::MethodType::OneWay,
2871                        })
2872                    }
2873                    _ if header
2874                        .dynamic_flags()
2875                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2876                    {
2877                        this.inner.send_framework_err(
2878                            fidl::encoding::FrameworkErr::UnknownMethod,
2879                            header.tx_id,
2880                            header.ordinal,
2881                            header.dynamic_flags(),
2882                            (bytes, handles),
2883                        )?;
2884                        Ok(CapabilitiesRequest::_UnknownMethod {
2885                            ordinal: header.ordinal,
2886                            control_handle: CapabilitiesControlHandle { inner: this.inner.clone() },
2887                            method_type: fidl::MethodType::TwoWay,
2888                        })
2889                    }
2890                    _ => Err(fidl::Error::UnknownOrdinal {
2891                        ordinal: header.ordinal,
2892                        protocol_name:
2893                            <CapabilitiesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2894                    }),
2895                }))
2896            },
2897        )
2898    }
2899}
2900
2901/// An API for creating and manipulating references to runtime capabilities in
2902/// the component framework. These capabilities are all reference counted by
2903/// component manager, and when accessed with this protocol the references are
2904/// implemented as event pair handles.
2905#[derive(Debug)]
2906pub enum CapabilitiesRequest {
2907    /// Creates a reference to a new connector capability. When the connector is
2908    /// opened, the channel given to the open call will be sent over
2909    /// `receiver_client_end`.
2910    ///
2911    /// Make sure this method returns before passing the handle's peer to other
2912    /// methods in this API. The creation may not be complete before then.
2913    ConnectorCreate {
2914        connector: fidl::EventPair,
2915        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
2916        responder: CapabilitiesConnectorCreateResponder,
2917    },
2918    /// Creates a reference to a new directory connector capability. When the
2919    /// directory connector is opened, the channel given to the open call will
2920    /// be sent over `receiver_client_end`.
2921    ///
2922    /// Make sure this method returns before passing the handle's peer to other
2923    /// methods in this API. The creation may not be complete before then.
2924    DirConnectorCreate {
2925        dir_connector: fidl::EventPair,
2926        receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2927        responder: CapabilitiesDirConnectorCreateResponder,
2928    },
2929    /// Creates a reference to a new dictionary capability.
2930    ///
2931    /// Make sure this method returns before passing the handle's peer to other
2932    /// methods in this API. The creation may not be complete before then.
2933    DictionaryCreate {
2934        dictionary: fidl::EventPair,
2935        responder: CapabilitiesDictionaryCreateResponder,
2936    },
2937    /// Creates a reference to a new data capability with the given value.
2938    ///
2939    /// Make sure this method returns before passing the handle's peer to other
2940    /// methods in this API. The creation may not be complete before then.
2941    DataCreate {
2942        data_handle: fidl::EventPair,
2943        data: Data,
2944        responder: CapabilitiesDataCreateResponder,
2945    },
2946    /// Creates a reference to a new router capability that will return a
2947    /// connector capability when used.
2948    ///
2949    /// Make sure this method returns before passing the handle's peer to other
2950    /// methods in this API. The creation may not be complete before then.
2951    ConnectorRouterCreate {
2952        router: fidl::EventPair,
2953        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
2954        responder: CapabilitiesConnectorRouterCreateResponder,
2955    },
2956    /// Creates a reference to a new router capability that will return a
2957    /// directory connector capability when used.
2958    ///
2959    /// Make sure this method returns before passing the handle's peer to other
2960    /// methods in this API. The creation may not be complete before then.
2961    DirConnectorRouterCreate {
2962        router: fidl::EventPair,
2963        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
2964        responder: CapabilitiesDirConnectorRouterCreateResponder,
2965    },
2966    /// Creates a reference to a new router capability that will return a
2967    /// dictionary capability when used.
2968    ///
2969    /// Make sure this method returns before passing the handle's peer to other
2970    /// methods in this API. The creation may not be complete before then.
2971    DictionaryRouterCreate {
2972        router: fidl::EventPair,
2973        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
2974        responder: CapabilitiesDictionaryRouterCreateResponder,
2975    },
2976    /// Creates a reference to a new router capability that will return a data
2977    /// value when used.
2978    ///
2979    /// Make sure this method returns before passing the handle's peer to other
2980    /// methods in this API. The creation may not be complete before then.
2981    DataRouterCreate {
2982        router: fidl::EventPair,
2983        router_client_end: fidl::endpoints::ClientEnd<DataRouterMarker>,
2984        responder: CapabilitiesDataRouterCreateResponder,
2985    },
2986    /// Uses the provided `connector` to open a new connection by delivering
2987    /// this channel to whoever created the connector.
2988    ///
2989    /// If there is an error, it will be reported as a zx.Status epitaph on
2990    /// `channel`.
2991    ///
2992    /// If the `connector` event pair handle is not correlated with a handle
2993    /// given to `ConnectorCreate`, this connection will be closed.
2994    ConnectorOpen {
2995        connector: fidl::EventPair,
2996        channel: fidl::Channel,
2997        responder: CapabilitiesConnectorOpenResponder,
2998    },
2999    /// Uses the provided `dir_connector` to open a new directory connection by
3000    /// delivering this channel to whoever created the directory connector.
3001    ///
3002    /// If there is an error, it will be reported as a zx.Status epitaph on
3003    /// `channel`.
3004    ///
3005    /// If the `dir_connector` event pair handle is not correlated with a handle
3006    /// given to `DirConnectorCreate`, this connection will be closed.
3007    ///
3008    /// `dir_connector` and `channel` are both required. `rights` and `subdir`
3009    /// may be omitted.
3010    DirConnectorOpen {
3011        payload: CapabilitiesDirConnectorOpenRequest,
3012        responder: CapabilitiesDirConnectorOpenResponder,
3013    },
3014    /// Inserts a new `capability` into this `Dictionary` under the name `key`.
3015    /// Overwrites any existing entry.
3016    DictionaryInsert {
3017        dictionary: fidl::EventPair,
3018        key: String,
3019        value: fidl::EventPair,
3020        responder: CapabilitiesDictionaryInsertResponder,
3021    },
3022    /// Creates a new reference to the `capability` named `key` in this
3023    /// dictionary, if that capability exists. That capability will remain in
3024    /// the dictionary. To take a capability out of the dictionary, use
3025    /// `DictionaryRemove`.
3026    ///
3027    /// If `key` does not exist, `value` will not reference any capability and
3028    /// the `NO_SUCH_CAPABILITY` error value will be returned.
3029    ///
3030    /// Make sure this method returns before passing the handle's peer to other
3031    /// methods in this API. The creation may not be complete before then.
3032    DictionaryGet {
3033        dictionary: fidl::EventPair,
3034        key: String,
3035        value: fidl::EventPair,
3036        responder: CapabilitiesDictionaryGetResponder,
3037    },
3038    /// Removes the `capability` named `key` from this dictionary and returns a
3039    /// reference to it, if that capability exists.
3040    ///
3041    /// `dictionary` and `key` are required. `capability` is optional, and when
3042    /// set will become associated with the capability that was removed from the
3043    /// dictionary.
3044    ///
3045    /// If `key` does not exist, `value` will not reference any capability and
3046    /// the `NO_SUCH_CAPABILITY` error value will be returned.
3047    ///
3048    /// Make sure this method returns before passing the peer of `capability` to
3049    /// other methods in this API. The creation may not be complete before then.
3050    DictionaryRemove {
3051        payload: CapabilitiesDictionaryRemoveRequest,
3052        responder: CapabilitiesDictionaryRemoveResponder,
3053    },
3054    /// Opens an iterator which can be used to iterate over the keys of this
3055    /// dictionary.
3056    DictionaryIterateKeys {
3057        dictionary: fidl::EventPair,
3058        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3059        responder: CapabilitiesDictionaryIterateKeysResponder,
3060    },
3061    /// Returns the `Data` value that was provided to the `DataCreate` call used with
3062    /// `data_handle`.
3063    DataGet { data_handle: fidl::EventPair, responder: CapabilitiesDataGetResponder },
3064    /// Attempts to produce a `Connector` capability from this `ConnectorRouter`.
3065    ///
3066    /// Make sure this method returns before passing the peer of `capability` to other methods in
3067    /// this API. The creation may not be complete before then.
3068    ConnectorRouterRoute {
3069        router: fidl::EventPair,
3070        request: RouteRequest,
3071        connector: fidl::EventPair,
3072        responder: CapabilitiesConnectorRouterRouteResponder,
3073    },
3074    /// Attempts to produce a `DirConnector` capability from this
3075    /// `DirConnectorRouter`. This will return:
3076    ///
3077    /// - A `DirConnector` if the operation is successful.
3078    /// - An empty value if there is no issue found but the capability is not
3079    ///   being provided (for example, an optional route ended in an offer from
3080    ///   void).
3081    /// - An error, if the operation failed.
3082    DirConnectorRouterRoute {
3083        router: fidl::EventPair,
3084        request: RouteRequest,
3085        dir_connector: fidl::EventPair,
3086        responder: CapabilitiesDirConnectorRouterRouteResponder,
3087    },
3088    /// Attempts to produce a `Dictionary` capability from this
3089    /// `DictionaryRouter`. This will return:
3090    ///
3091    /// - A `Dictionary` if the operation is successful.
3092    /// - An empty value if there is no issue found but the capability is not
3093    ///   being provided (for example, an optional route ended in an offer from
3094    ///   void).
3095    /// - An error, if the operation failed.
3096    DictionaryRouterRoute {
3097        router: fidl::EventPair,
3098        request: RouteRequest,
3099        dictionary: fidl::EventPair,
3100        responder: CapabilitiesDictionaryRouterRouteResponder,
3101    },
3102    /// Attempts to produce a `Data` value from this
3103    /// `DataRouter`. This will return:
3104    ///
3105    /// - A `Data` value if the operation is successful.
3106    /// - An empty value if there is no issue found but the capability is not
3107    ///   being provided (for example, an optional route ended in an offer from
3108    ///   void).
3109    /// - An error, if the operation failed.
3110    DataRouterRoute {
3111        router: fidl::EventPair,
3112        request: RouteRequest,
3113        data_handle: i32,
3114        responder: CapabilitiesDataRouterRouteResponder,
3115    },
3116    /// An interaction was received which does not match any known method.
3117    #[non_exhaustive]
3118    _UnknownMethod {
3119        /// Ordinal of the method that was called.
3120        ordinal: u64,
3121        control_handle: CapabilitiesControlHandle,
3122        method_type: fidl::MethodType,
3123    },
3124}
3125
3126impl CapabilitiesRequest {
3127    #[allow(irrefutable_let_patterns)]
3128    pub fn into_connector_create(
3129        self,
3130    ) -> Option<(
3131        fidl::EventPair,
3132        fidl::endpoints::ClientEnd<ReceiverMarker>,
3133        CapabilitiesConnectorCreateResponder,
3134    )> {
3135        if let CapabilitiesRequest::ConnectorCreate { connector, receiver_client_end, responder } =
3136            self
3137        {
3138            Some((connector, receiver_client_end, responder))
3139        } else {
3140            None
3141        }
3142    }
3143
3144    #[allow(irrefutable_let_patterns)]
3145    pub fn into_dir_connector_create(
3146        self,
3147    ) -> Option<(
3148        fidl::EventPair,
3149        fidl::endpoints::ClientEnd<DirReceiverMarker>,
3150        CapabilitiesDirConnectorCreateResponder,
3151    )> {
3152        if let CapabilitiesRequest::DirConnectorCreate {
3153            dir_connector,
3154            receiver_client_end,
3155            responder,
3156        } = self
3157        {
3158            Some((dir_connector, receiver_client_end, responder))
3159        } else {
3160            None
3161        }
3162    }
3163
3164    #[allow(irrefutable_let_patterns)]
3165    pub fn into_dictionary_create(
3166        self,
3167    ) -> Option<(fidl::EventPair, CapabilitiesDictionaryCreateResponder)> {
3168        if let CapabilitiesRequest::DictionaryCreate { dictionary, responder } = self {
3169            Some((dictionary, responder))
3170        } else {
3171            None
3172        }
3173    }
3174
3175    #[allow(irrefutable_let_patterns)]
3176    pub fn into_data_create(
3177        self,
3178    ) -> Option<(fidl::EventPair, Data, CapabilitiesDataCreateResponder)> {
3179        if let CapabilitiesRequest::DataCreate { data_handle, data, responder } = self {
3180            Some((data_handle, data, responder))
3181        } else {
3182            None
3183        }
3184    }
3185
3186    #[allow(irrefutable_let_patterns)]
3187    pub fn into_connector_router_create(
3188        self,
3189    ) -> Option<(
3190        fidl::EventPair,
3191        fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
3192        CapabilitiesConnectorRouterCreateResponder,
3193    )> {
3194        if let CapabilitiesRequest::ConnectorRouterCreate { router, router_client_end, responder } =
3195            self
3196        {
3197            Some((router, router_client_end, responder))
3198        } else {
3199            None
3200        }
3201    }
3202
3203    #[allow(irrefutable_let_patterns)]
3204    pub fn into_dir_connector_router_create(
3205        self,
3206    ) -> Option<(
3207        fidl::EventPair,
3208        fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
3209        CapabilitiesDirConnectorRouterCreateResponder,
3210    )> {
3211        if let CapabilitiesRequest::DirConnectorRouterCreate {
3212            router,
3213            router_client_end,
3214            responder,
3215        } = self
3216        {
3217            Some((router, router_client_end, responder))
3218        } else {
3219            None
3220        }
3221    }
3222
3223    #[allow(irrefutable_let_patterns)]
3224    pub fn into_dictionary_router_create(
3225        self,
3226    ) -> Option<(
3227        fidl::EventPair,
3228        fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
3229        CapabilitiesDictionaryRouterCreateResponder,
3230    )> {
3231        if let CapabilitiesRequest::DictionaryRouterCreate {
3232            router,
3233            router_client_end,
3234            responder,
3235        } = self
3236        {
3237            Some((router, router_client_end, responder))
3238        } else {
3239            None
3240        }
3241    }
3242
3243    #[allow(irrefutable_let_patterns)]
3244    pub fn into_data_router_create(
3245        self,
3246    ) -> Option<(
3247        fidl::EventPair,
3248        fidl::endpoints::ClientEnd<DataRouterMarker>,
3249        CapabilitiesDataRouterCreateResponder,
3250    )> {
3251        if let CapabilitiesRequest::DataRouterCreate { router, router_client_end, responder } = self
3252        {
3253            Some((router, router_client_end, responder))
3254        } else {
3255            None
3256        }
3257    }
3258
3259    #[allow(irrefutable_let_patterns)]
3260    pub fn into_connector_open(
3261        self,
3262    ) -> Option<(fidl::EventPair, fidl::Channel, CapabilitiesConnectorOpenResponder)> {
3263        if let CapabilitiesRequest::ConnectorOpen { connector, channel, responder } = self {
3264            Some((connector, channel, responder))
3265        } else {
3266            None
3267        }
3268    }
3269
3270    #[allow(irrefutable_let_patterns)]
3271    pub fn into_dir_connector_open(
3272        self,
3273    ) -> Option<(CapabilitiesDirConnectorOpenRequest, CapabilitiesDirConnectorOpenResponder)> {
3274        if let CapabilitiesRequest::DirConnectorOpen { payload, responder } = self {
3275            Some((payload, responder))
3276        } else {
3277            None
3278        }
3279    }
3280
3281    #[allow(irrefutable_let_patterns)]
3282    pub fn into_dictionary_insert(
3283        self,
3284    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryInsertResponder)>
3285    {
3286        if let CapabilitiesRequest::DictionaryInsert { dictionary, key, value, responder } = self {
3287            Some((dictionary, key, value, responder))
3288        } else {
3289            None
3290        }
3291    }
3292
3293    #[allow(irrefutable_let_patterns)]
3294    pub fn into_dictionary_get(
3295        self,
3296    ) -> Option<(fidl::EventPair, String, fidl::EventPair, CapabilitiesDictionaryGetResponder)>
3297    {
3298        if let CapabilitiesRequest::DictionaryGet { dictionary, key, value, responder } = self {
3299            Some((dictionary, key, value, responder))
3300        } else {
3301            None
3302        }
3303    }
3304
3305    #[allow(irrefutable_let_patterns)]
3306    pub fn into_dictionary_remove(
3307        self,
3308    ) -> Option<(CapabilitiesDictionaryRemoveRequest, CapabilitiesDictionaryRemoveResponder)> {
3309        if let CapabilitiesRequest::DictionaryRemove { payload, responder } = self {
3310            Some((payload, responder))
3311        } else {
3312            None
3313        }
3314    }
3315
3316    #[allow(irrefutable_let_patterns)]
3317    pub fn into_dictionary_iterate_keys(
3318        self,
3319    ) -> Option<(
3320        fidl::EventPair,
3321        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
3322        CapabilitiesDictionaryIterateKeysResponder,
3323    )> {
3324        if let CapabilitiesRequest::DictionaryIterateKeys { dictionary, key_iterator, responder } =
3325            self
3326        {
3327            Some((dictionary, key_iterator, responder))
3328        } else {
3329            None
3330        }
3331    }
3332
3333    #[allow(irrefutable_let_patterns)]
3334    pub fn into_data_get(self) -> Option<(fidl::EventPair, CapabilitiesDataGetResponder)> {
3335        if let CapabilitiesRequest::DataGet { data_handle, responder } = self {
3336            Some((data_handle, responder))
3337        } else {
3338            None
3339        }
3340    }
3341
3342    #[allow(irrefutable_let_patterns)]
3343    pub fn into_connector_router_route(
3344        self,
3345    ) -> Option<(
3346        fidl::EventPair,
3347        RouteRequest,
3348        fidl::EventPair,
3349        CapabilitiesConnectorRouterRouteResponder,
3350    )> {
3351        if let CapabilitiesRequest::ConnectorRouterRoute { router, request, connector, responder } =
3352            self
3353        {
3354            Some((router, request, connector, responder))
3355        } else {
3356            None
3357        }
3358    }
3359
3360    #[allow(irrefutable_let_patterns)]
3361    pub fn into_dir_connector_router_route(
3362        self,
3363    ) -> Option<(
3364        fidl::EventPair,
3365        RouteRequest,
3366        fidl::EventPair,
3367        CapabilitiesDirConnectorRouterRouteResponder,
3368    )> {
3369        if let CapabilitiesRequest::DirConnectorRouterRoute {
3370            router,
3371            request,
3372            dir_connector,
3373            responder,
3374        } = self
3375        {
3376            Some((router, request, dir_connector, responder))
3377        } else {
3378            None
3379        }
3380    }
3381
3382    #[allow(irrefutable_let_patterns)]
3383    pub fn into_dictionary_router_route(
3384        self,
3385    ) -> Option<(
3386        fidl::EventPair,
3387        RouteRequest,
3388        fidl::EventPair,
3389        CapabilitiesDictionaryRouterRouteResponder,
3390    )> {
3391        if let CapabilitiesRequest::DictionaryRouterRoute {
3392            router,
3393            request,
3394            dictionary,
3395            responder,
3396        } = self
3397        {
3398            Some((router, request, dictionary, responder))
3399        } else {
3400            None
3401        }
3402    }
3403
3404    #[allow(irrefutable_let_patterns)]
3405    pub fn into_data_router_route(
3406        self,
3407    ) -> Option<(fidl::EventPair, RouteRequest, i32, CapabilitiesDataRouterRouteResponder)> {
3408        if let CapabilitiesRequest::DataRouterRoute { router, request, data_handle, responder } =
3409            self
3410        {
3411            Some((router, request, data_handle, responder))
3412        } else {
3413            None
3414        }
3415    }
3416
3417    /// Name of the method defined in FIDL
3418    pub fn method_name(&self) -> &'static str {
3419        match *self {
3420            CapabilitiesRequest::ConnectorCreate { .. } => "connector_create",
3421            CapabilitiesRequest::DirConnectorCreate { .. } => "dir_connector_create",
3422            CapabilitiesRequest::DictionaryCreate { .. } => "dictionary_create",
3423            CapabilitiesRequest::DataCreate { .. } => "data_create",
3424            CapabilitiesRequest::ConnectorRouterCreate { .. } => "connector_router_create",
3425            CapabilitiesRequest::DirConnectorRouterCreate { .. } => "dir_connector_router_create",
3426            CapabilitiesRequest::DictionaryRouterCreate { .. } => "dictionary_router_create",
3427            CapabilitiesRequest::DataRouterCreate { .. } => "data_router_create",
3428            CapabilitiesRequest::ConnectorOpen { .. } => "connector_open",
3429            CapabilitiesRequest::DirConnectorOpen { .. } => "dir_connector_open",
3430            CapabilitiesRequest::DictionaryInsert { .. } => "dictionary_insert",
3431            CapabilitiesRequest::DictionaryGet { .. } => "dictionary_get",
3432            CapabilitiesRequest::DictionaryRemove { .. } => "dictionary_remove",
3433            CapabilitiesRequest::DictionaryIterateKeys { .. } => "dictionary_iterate_keys",
3434            CapabilitiesRequest::DataGet { .. } => "data_get",
3435            CapabilitiesRequest::ConnectorRouterRoute { .. } => "connector_router_route",
3436            CapabilitiesRequest::DirConnectorRouterRoute { .. } => "dir_connector_router_route",
3437            CapabilitiesRequest::DictionaryRouterRoute { .. } => "dictionary_router_route",
3438            CapabilitiesRequest::DataRouterRoute { .. } => "data_router_route",
3439            CapabilitiesRequest::_UnknownMethod {
3440                method_type: fidl::MethodType::OneWay, ..
3441            } => "unknown one-way method",
3442            CapabilitiesRequest::_UnknownMethod {
3443                method_type: fidl::MethodType::TwoWay, ..
3444            } => "unknown two-way method",
3445        }
3446    }
3447}
3448
3449#[derive(Debug, Clone)]
3450pub struct CapabilitiesControlHandle {
3451    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3452}
3453
3454impl fidl::endpoints::ControlHandle for CapabilitiesControlHandle {
3455    fn shutdown(&self) {
3456        self.inner.shutdown()
3457    }
3458    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3459        self.inner.shutdown_with_epitaph(status)
3460    }
3461
3462    fn is_closed(&self) -> bool {
3463        self.inner.channel().is_closed()
3464    }
3465    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3466        self.inner.channel().on_closed()
3467    }
3468
3469    #[cfg(target_os = "fuchsia")]
3470    fn signal_peer(
3471        &self,
3472        clear_mask: zx::Signals,
3473        set_mask: zx::Signals,
3474    ) -> Result<(), zx_status::Status> {
3475        use fidl::Peered;
3476        self.inner.channel().signal_peer(clear_mask, set_mask)
3477    }
3478}
3479
3480impl CapabilitiesControlHandle {}
3481
3482#[must_use = "FIDL methods require a response to be sent"]
3483#[derive(Debug)]
3484pub struct CapabilitiesConnectorCreateResponder {
3485    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3486    tx_id: u32,
3487}
3488
3489/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3490/// if the responder is dropped without sending a response, so that the client
3491/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3492impl std::ops::Drop for CapabilitiesConnectorCreateResponder {
3493    fn drop(&mut self) {
3494        self.control_handle.shutdown();
3495        // Safety: drops once, never accessed again
3496        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3497    }
3498}
3499
3500impl fidl::endpoints::Responder for CapabilitiesConnectorCreateResponder {
3501    type ControlHandle = CapabilitiesControlHandle;
3502
3503    fn control_handle(&self) -> &CapabilitiesControlHandle {
3504        &self.control_handle
3505    }
3506
3507    fn drop_without_shutdown(mut self) {
3508        // Safety: drops once, never accessed again due to mem::forget
3509        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3510        // Prevent Drop from running (which would shut down the channel)
3511        std::mem::forget(self);
3512    }
3513}
3514
3515impl CapabilitiesConnectorCreateResponder {
3516    /// Sends a response to the FIDL transaction.
3517    ///
3518    /// Sets the channel to shutdown if an error occurs.
3519    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3520        let _result = self.send_raw(result);
3521        if _result.is_err() {
3522            self.control_handle.shutdown();
3523        }
3524        self.drop_without_shutdown();
3525        _result
3526    }
3527
3528    /// Similar to "send" but does not shutdown the channel if an error occurs.
3529    pub fn send_no_shutdown_on_err(
3530        self,
3531        mut result: Result<(), CapabilitiesError>,
3532    ) -> Result<(), fidl::Error> {
3533        let _result = self.send_raw(result);
3534        self.drop_without_shutdown();
3535        _result
3536    }
3537
3538    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3539        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3540            fidl::encoding::EmptyStruct,
3541            CapabilitiesError,
3542        >>(
3543            fidl::encoding::FlexibleResult::new(result),
3544            self.tx_id,
3545            0xac2bc2dbd7033d1,
3546            fidl::encoding::DynamicFlags::FLEXIBLE,
3547        )
3548    }
3549}
3550
3551#[must_use = "FIDL methods require a response to be sent"]
3552#[derive(Debug)]
3553pub struct CapabilitiesDirConnectorCreateResponder {
3554    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3555    tx_id: u32,
3556}
3557
3558/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3559/// if the responder is dropped without sending a response, so that the client
3560/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3561impl std::ops::Drop for CapabilitiesDirConnectorCreateResponder {
3562    fn drop(&mut self) {
3563        self.control_handle.shutdown();
3564        // Safety: drops once, never accessed again
3565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3566    }
3567}
3568
3569impl fidl::endpoints::Responder for CapabilitiesDirConnectorCreateResponder {
3570    type ControlHandle = CapabilitiesControlHandle;
3571
3572    fn control_handle(&self) -> &CapabilitiesControlHandle {
3573        &self.control_handle
3574    }
3575
3576    fn drop_without_shutdown(mut self) {
3577        // Safety: drops once, never accessed again due to mem::forget
3578        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3579        // Prevent Drop from running (which would shut down the channel)
3580        std::mem::forget(self);
3581    }
3582}
3583
3584impl CapabilitiesDirConnectorCreateResponder {
3585    /// Sends a response to the FIDL transaction.
3586    ///
3587    /// Sets the channel to shutdown if an error occurs.
3588    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3589        let _result = self.send_raw(result);
3590        if _result.is_err() {
3591            self.control_handle.shutdown();
3592        }
3593        self.drop_without_shutdown();
3594        _result
3595    }
3596
3597    /// Similar to "send" but does not shutdown the channel if an error occurs.
3598    pub fn send_no_shutdown_on_err(
3599        self,
3600        mut result: Result<(), CapabilitiesError>,
3601    ) -> Result<(), fidl::Error> {
3602        let _result = self.send_raw(result);
3603        self.drop_without_shutdown();
3604        _result
3605    }
3606
3607    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3608        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3609            fidl::encoding::EmptyStruct,
3610            CapabilitiesError,
3611        >>(
3612            fidl::encoding::FlexibleResult::new(result),
3613            self.tx_id,
3614            0x721911e05da2a3bf,
3615            fidl::encoding::DynamicFlags::FLEXIBLE,
3616        )
3617    }
3618}
3619
3620#[must_use = "FIDL methods require a response to be sent"]
3621#[derive(Debug)]
3622pub struct CapabilitiesDictionaryCreateResponder {
3623    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3624    tx_id: u32,
3625}
3626
3627/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3628/// if the responder is dropped without sending a response, so that the client
3629/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3630impl std::ops::Drop for CapabilitiesDictionaryCreateResponder {
3631    fn drop(&mut self) {
3632        self.control_handle.shutdown();
3633        // Safety: drops once, never accessed again
3634        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3635    }
3636}
3637
3638impl fidl::endpoints::Responder for CapabilitiesDictionaryCreateResponder {
3639    type ControlHandle = CapabilitiesControlHandle;
3640
3641    fn control_handle(&self) -> &CapabilitiesControlHandle {
3642        &self.control_handle
3643    }
3644
3645    fn drop_without_shutdown(mut self) {
3646        // Safety: drops once, never accessed again due to mem::forget
3647        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3648        // Prevent Drop from running (which would shut down the channel)
3649        std::mem::forget(self);
3650    }
3651}
3652
3653impl CapabilitiesDictionaryCreateResponder {
3654    /// Sends a response to the FIDL transaction.
3655    ///
3656    /// Sets the channel to shutdown if an error occurs.
3657    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3658        let _result = self.send_raw(result);
3659        if _result.is_err() {
3660            self.control_handle.shutdown();
3661        }
3662        self.drop_without_shutdown();
3663        _result
3664    }
3665
3666    /// Similar to "send" but does not shutdown the channel if an error occurs.
3667    pub fn send_no_shutdown_on_err(
3668        self,
3669        mut result: Result<(), CapabilitiesError>,
3670    ) -> Result<(), fidl::Error> {
3671        let _result = self.send_raw(result);
3672        self.drop_without_shutdown();
3673        _result
3674    }
3675
3676    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3677        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3678            fidl::encoding::EmptyStruct,
3679            CapabilitiesError,
3680        >>(
3681            fidl::encoding::FlexibleResult::new(result),
3682            self.tx_id,
3683            0x7f8bd91f0942a36e,
3684            fidl::encoding::DynamicFlags::FLEXIBLE,
3685        )
3686    }
3687}
3688
3689#[must_use = "FIDL methods require a response to be sent"]
3690#[derive(Debug)]
3691pub struct CapabilitiesDataCreateResponder {
3692    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3693    tx_id: u32,
3694}
3695
3696/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3697/// if the responder is dropped without sending a response, so that the client
3698/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3699impl std::ops::Drop for CapabilitiesDataCreateResponder {
3700    fn drop(&mut self) {
3701        self.control_handle.shutdown();
3702        // Safety: drops once, never accessed again
3703        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3704    }
3705}
3706
3707impl fidl::endpoints::Responder for CapabilitiesDataCreateResponder {
3708    type ControlHandle = CapabilitiesControlHandle;
3709
3710    fn control_handle(&self) -> &CapabilitiesControlHandle {
3711        &self.control_handle
3712    }
3713
3714    fn drop_without_shutdown(mut self) {
3715        // Safety: drops once, never accessed again due to mem::forget
3716        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3717        // Prevent Drop from running (which would shut down the channel)
3718        std::mem::forget(self);
3719    }
3720}
3721
3722impl CapabilitiesDataCreateResponder {
3723    /// Sends a response to the FIDL transaction.
3724    ///
3725    /// Sets the channel to shutdown if an error occurs.
3726    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3727        let _result = self.send_raw(result);
3728        if _result.is_err() {
3729            self.control_handle.shutdown();
3730        }
3731        self.drop_without_shutdown();
3732        _result
3733    }
3734
3735    /// Similar to "send" but does not shutdown the channel if an error occurs.
3736    pub fn send_no_shutdown_on_err(
3737        self,
3738        mut result: Result<(), CapabilitiesError>,
3739    ) -> Result<(), fidl::Error> {
3740        let _result = self.send_raw(result);
3741        self.drop_without_shutdown();
3742        _result
3743    }
3744
3745    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3746        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3747            fidl::encoding::EmptyStruct,
3748            CapabilitiesError,
3749        >>(
3750            fidl::encoding::FlexibleResult::new(result),
3751            self.tx_id,
3752            0x40ef43e45372ee6a,
3753            fidl::encoding::DynamicFlags::FLEXIBLE,
3754        )
3755    }
3756}
3757
3758#[must_use = "FIDL methods require a response to be sent"]
3759#[derive(Debug)]
3760pub struct CapabilitiesConnectorRouterCreateResponder {
3761    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3762    tx_id: u32,
3763}
3764
3765/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3766/// if the responder is dropped without sending a response, so that the client
3767/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3768impl std::ops::Drop for CapabilitiesConnectorRouterCreateResponder {
3769    fn drop(&mut self) {
3770        self.control_handle.shutdown();
3771        // Safety: drops once, never accessed again
3772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3773    }
3774}
3775
3776impl fidl::endpoints::Responder for CapabilitiesConnectorRouterCreateResponder {
3777    type ControlHandle = CapabilitiesControlHandle;
3778
3779    fn control_handle(&self) -> &CapabilitiesControlHandle {
3780        &self.control_handle
3781    }
3782
3783    fn drop_without_shutdown(mut self) {
3784        // Safety: drops once, never accessed again due to mem::forget
3785        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3786        // Prevent Drop from running (which would shut down the channel)
3787        std::mem::forget(self);
3788    }
3789}
3790
3791impl CapabilitiesConnectorRouterCreateResponder {
3792    /// Sends a response to the FIDL transaction.
3793    ///
3794    /// Sets the channel to shutdown if an error occurs.
3795    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3796        let _result = self.send_raw(result);
3797        if _result.is_err() {
3798            self.control_handle.shutdown();
3799        }
3800        self.drop_without_shutdown();
3801        _result
3802    }
3803
3804    /// Similar to "send" but does not shutdown the channel if an error occurs.
3805    pub fn send_no_shutdown_on_err(
3806        self,
3807        mut result: Result<(), CapabilitiesError>,
3808    ) -> Result<(), fidl::Error> {
3809        let _result = self.send_raw(result);
3810        self.drop_without_shutdown();
3811        _result
3812    }
3813
3814    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3815        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3816            fidl::encoding::EmptyStruct,
3817            CapabilitiesError,
3818        >>(
3819            fidl::encoding::FlexibleResult::new(result),
3820            self.tx_id,
3821            0x7f7e7fbafcdf1761,
3822            fidl::encoding::DynamicFlags::FLEXIBLE,
3823        )
3824    }
3825}
3826
3827#[must_use = "FIDL methods require a response to be sent"]
3828#[derive(Debug)]
3829pub struct CapabilitiesDirConnectorRouterCreateResponder {
3830    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3831    tx_id: u32,
3832}
3833
3834/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3835/// if the responder is dropped without sending a response, so that the client
3836/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3837impl std::ops::Drop for CapabilitiesDirConnectorRouterCreateResponder {
3838    fn drop(&mut self) {
3839        self.control_handle.shutdown();
3840        // Safety: drops once, never accessed again
3841        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3842    }
3843}
3844
3845impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterCreateResponder {
3846    type ControlHandle = CapabilitiesControlHandle;
3847
3848    fn control_handle(&self) -> &CapabilitiesControlHandle {
3849        &self.control_handle
3850    }
3851
3852    fn drop_without_shutdown(mut self) {
3853        // Safety: drops once, never accessed again due to mem::forget
3854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3855        // Prevent Drop from running (which would shut down the channel)
3856        std::mem::forget(self);
3857    }
3858}
3859
3860impl CapabilitiesDirConnectorRouterCreateResponder {
3861    /// Sends a response to the FIDL transaction.
3862    ///
3863    /// Sets the channel to shutdown if an error occurs.
3864    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3865        let _result = self.send_raw(result);
3866        if _result.is_err() {
3867            self.control_handle.shutdown();
3868        }
3869        self.drop_without_shutdown();
3870        _result
3871    }
3872
3873    /// Similar to "send" but does not shutdown the channel if an error occurs.
3874    pub fn send_no_shutdown_on_err(
3875        self,
3876        mut result: Result<(), CapabilitiesError>,
3877    ) -> Result<(), fidl::Error> {
3878        let _result = self.send_raw(result);
3879        self.drop_without_shutdown();
3880        _result
3881    }
3882
3883    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3884        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3885            fidl::encoding::EmptyStruct,
3886            CapabilitiesError,
3887        >>(
3888            fidl::encoding::FlexibleResult::new(result),
3889            self.tx_id,
3890            0x56520da453fad19f,
3891            fidl::encoding::DynamicFlags::FLEXIBLE,
3892        )
3893    }
3894}
3895
3896#[must_use = "FIDL methods require a response to be sent"]
3897#[derive(Debug)]
3898pub struct CapabilitiesDictionaryRouterCreateResponder {
3899    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3900    tx_id: u32,
3901}
3902
3903/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3904/// if the responder is dropped without sending a response, so that the client
3905/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3906impl std::ops::Drop for CapabilitiesDictionaryRouterCreateResponder {
3907    fn drop(&mut self) {
3908        self.control_handle.shutdown();
3909        // Safety: drops once, never accessed again
3910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3911    }
3912}
3913
3914impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterCreateResponder {
3915    type ControlHandle = CapabilitiesControlHandle;
3916
3917    fn control_handle(&self) -> &CapabilitiesControlHandle {
3918        &self.control_handle
3919    }
3920
3921    fn drop_without_shutdown(mut self) {
3922        // Safety: drops once, never accessed again due to mem::forget
3923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3924        // Prevent Drop from running (which would shut down the channel)
3925        std::mem::forget(self);
3926    }
3927}
3928
3929impl CapabilitiesDictionaryRouterCreateResponder {
3930    /// Sends a response to the FIDL transaction.
3931    ///
3932    /// Sets the channel to shutdown if an error occurs.
3933    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3934        let _result = self.send_raw(result);
3935        if _result.is_err() {
3936            self.control_handle.shutdown();
3937        }
3938        self.drop_without_shutdown();
3939        _result
3940    }
3941
3942    /// Similar to "send" but does not shutdown the channel if an error occurs.
3943    pub fn send_no_shutdown_on_err(
3944        self,
3945        mut result: Result<(), CapabilitiesError>,
3946    ) -> Result<(), fidl::Error> {
3947        let _result = self.send_raw(result);
3948        self.drop_without_shutdown();
3949        _result
3950    }
3951
3952    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
3953        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3954            fidl::encoding::EmptyStruct,
3955            CapabilitiesError,
3956        >>(
3957            fidl::encoding::FlexibleResult::new(result),
3958            self.tx_id,
3959            0x37acef18cd423d42,
3960            fidl::encoding::DynamicFlags::FLEXIBLE,
3961        )
3962    }
3963}
3964
3965#[must_use = "FIDL methods require a response to be sent"]
3966#[derive(Debug)]
3967pub struct CapabilitiesDataRouterCreateResponder {
3968    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
3969    tx_id: u32,
3970}
3971
3972/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
3973/// if the responder is dropped without sending a response, so that the client
3974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3975impl std::ops::Drop for CapabilitiesDataRouterCreateResponder {
3976    fn drop(&mut self) {
3977        self.control_handle.shutdown();
3978        // Safety: drops once, never accessed again
3979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3980    }
3981}
3982
3983impl fidl::endpoints::Responder for CapabilitiesDataRouterCreateResponder {
3984    type ControlHandle = CapabilitiesControlHandle;
3985
3986    fn control_handle(&self) -> &CapabilitiesControlHandle {
3987        &self.control_handle
3988    }
3989
3990    fn drop_without_shutdown(mut self) {
3991        // Safety: drops once, never accessed again due to mem::forget
3992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3993        // Prevent Drop from running (which would shut down the channel)
3994        std::mem::forget(self);
3995    }
3996}
3997
3998impl CapabilitiesDataRouterCreateResponder {
3999    /// Sends a response to the FIDL transaction.
4000    ///
4001    /// Sets the channel to shutdown if an error occurs.
4002    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4003        let _result = self.send_raw(result);
4004        if _result.is_err() {
4005            self.control_handle.shutdown();
4006        }
4007        self.drop_without_shutdown();
4008        _result
4009    }
4010
4011    /// Similar to "send" but does not shutdown the channel if an error occurs.
4012    pub fn send_no_shutdown_on_err(
4013        self,
4014        mut result: Result<(), CapabilitiesError>,
4015    ) -> Result<(), fidl::Error> {
4016        let _result = self.send_raw(result);
4017        self.drop_without_shutdown();
4018        _result
4019    }
4020
4021    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4022        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4023            fidl::encoding::EmptyStruct,
4024            CapabilitiesError,
4025        >>(
4026            fidl::encoding::FlexibleResult::new(result),
4027            self.tx_id,
4028            0x24e471395b95088,
4029            fidl::encoding::DynamicFlags::FLEXIBLE,
4030        )
4031    }
4032}
4033
4034#[must_use = "FIDL methods require a response to be sent"]
4035#[derive(Debug)]
4036pub struct CapabilitiesConnectorOpenResponder {
4037    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4038    tx_id: u32,
4039}
4040
4041/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4042/// if the responder is dropped without sending a response, so that the client
4043/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4044impl std::ops::Drop for CapabilitiesConnectorOpenResponder {
4045    fn drop(&mut self) {
4046        self.control_handle.shutdown();
4047        // Safety: drops once, never accessed again
4048        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4049    }
4050}
4051
4052impl fidl::endpoints::Responder for CapabilitiesConnectorOpenResponder {
4053    type ControlHandle = CapabilitiesControlHandle;
4054
4055    fn control_handle(&self) -> &CapabilitiesControlHandle {
4056        &self.control_handle
4057    }
4058
4059    fn drop_without_shutdown(mut self) {
4060        // Safety: drops once, never accessed again due to mem::forget
4061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4062        // Prevent Drop from running (which would shut down the channel)
4063        std::mem::forget(self);
4064    }
4065}
4066
4067impl CapabilitiesConnectorOpenResponder {
4068    /// Sends a response to the FIDL transaction.
4069    ///
4070    /// Sets the channel to shutdown if an error occurs.
4071    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4072        let _result = self.send_raw(result);
4073        if _result.is_err() {
4074            self.control_handle.shutdown();
4075        }
4076        self.drop_without_shutdown();
4077        _result
4078    }
4079
4080    /// Similar to "send" but does not shutdown the channel if an error occurs.
4081    pub fn send_no_shutdown_on_err(
4082        self,
4083        mut result: Result<(), CapabilitiesError>,
4084    ) -> Result<(), fidl::Error> {
4085        let _result = self.send_raw(result);
4086        self.drop_without_shutdown();
4087        _result
4088    }
4089
4090    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4091        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4092            fidl::encoding::EmptyStruct,
4093            CapabilitiesError,
4094        >>(
4095            fidl::encoding::FlexibleResult::new(result),
4096            self.tx_id,
4097            0xc0646965f1884eb,
4098            fidl::encoding::DynamicFlags::FLEXIBLE,
4099        )
4100    }
4101}
4102
4103#[must_use = "FIDL methods require a response to be sent"]
4104#[derive(Debug)]
4105pub struct CapabilitiesDirConnectorOpenResponder {
4106    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4107    tx_id: u32,
4108}
4109
4110/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4111/// if the responder is dropped without sending a response, so that the client
4112/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4113impl std::ops::Drop for CapabilitiesDirConnectorOpenResponder {
4114    fn drop(&mut self) {
4115        self.control_handle.shutdown();
4116        // Safety: drops once, never accessed again
4117        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4118    }
4119}
4120
4121impl fidl::endpoints::Responder for CapabilitiesDirConnectorOpenResponder {
4122    type ControlHandle = CapabilitiesControlHandle;
4123
4124    fn control_handle(&self) -> &CapabilitiesControlHandle {
4125        &self.control_handle
4126    }
4127
4128    fn drop_without_shutdown(mut self) {
4129        // Safety: drops once, never accessed again due to mem::forget
4130        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4131        // Prevent Drop from running (which would shut down the channel)
4132        std::mem::forget(self);
4133    }
4134}
4135
4136impl CapabilitiesDirConnectorOpenResponder {
4137    /// Sends a response to the FIDL transaction.
4138    ///
4139    /// Sets the channel to shutdown if an error occurs.
4140    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4141        let _result = self.send_raw(result);
4142        if _result.is_err() {
4143            self.control_handle.shutdown();
4144        }
4145        self.drop_without_shutdown();
4146        _result
4147    }
4148
4149    /// Similar to "send" but does not shutdown the channel if an error occurs.
4150    pub fn send_no_shutdown_on_err(
4151        self,
4152        mut result: Result<(), CapabilitiesError>,
4153    ) -> Result<(), fidl::Error> {
4154        let _result = self.send_raw(result);
4155        self.drop_without_shutdown();
4156        _result
4157    }
4158
4159    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4160        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4161            fidl::encoding::EmptyStruct,
4162            CapabilitiesError,
4163        >>(
4164            fidl::encoding::FlexibleResult::new(result),
4165            self.tx_id,
4166            0x1332bbf5debd6c20,
4167            fidl::encoding::DynamicFlags::FLEXIBLE,
4168        )
4169    }
4170}
4171
4172#[must_use = "FIDL methods require a response to be sent"]
4173#[derive(Debug)]
4174pub struct CapabilitiesDictionaryInsertResponder {
4175    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4176    tx_id: u32,
4177}
4178
4179/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4180/// if the responder is dropped without sending a response, so that the client
4181/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4182impl std::ops::Drop for CapabilitiesDictionaryInsertResponder {
4183    fn drop(&mut self) {
4184        self.control_handle.shutdown();
4185        // Safety: drops once, never accessed again
4186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4187    }
4188}
4189
4190impl fidl::endpoints::Responder for CapabilitiesDictionaryInsertResponder {
4191    type ControlHandle = CapabilitiesControlHandle;
4192
4193    fn control_handle(&self) -> &CapabilitiesControlHandle {
4194        &self.control_handle
4195    }
4196
4197    fn drop_without_shutdown(mut self) {
4198        // Safety: drops once, never accessed again due to mem::forget
4199        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4200        // Prevent Drop from running (which would shut down the channel)
4201        std::mem::forget(self);
4202    }
4203}
4204
4205impl CapabilitiesDictionaryInsertResponder {
4206    /// Sends a response to the FIDL transaction.
4207    ///
4208    /// Sets the channel to shutdown if an error occurs.
4209    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4210        let _result = self.send_raw(result);
4211        if _result.is_err() {
4212            self.control_handle.shutdown();
4213        }
4214        self.drop_without_shutdown();
4215        _result
4216    }
4217
4218    /// Similar to "send" but does not shutdown the channel if an error occurs.
4219    pub fn send_no_shutdown_on_err(
4220        self,
4221        mut result: Result<(), CapabilitiesError>,
4222    ) -> Result<(), fidl::Error> {
4223        let _result = self.send_raw(result);
4224        self.drop_without_shutdown();
4225        _result
4226    }
4227
4228    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4229        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4230            fidl::encoding::EmptyStruct,
4231            CapabilitiesError,
4232        >>(
4233            fidl::encoding::FlexibleResult::new(result),
4234            self.tx_id,
4235            0x5972e3061a760e7a,
4236            fidl::encoding::DynamicFlags::FLEXIBLE,
4237        )
4238    }
4239}
4240
4241#[must_use = "FIDL methods require a response to be sent"]
4242#[derive(Debug)]
4243pub struct CapabilitiesDictionaryGetResponder {
4244    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4245    tx_id: u32,
4246}
4247
4248/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4249/// if the responder is dropped without sending a response, so that the client
4250/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4251impl std::ops::Drop for CapabilitiesDictionaryGetResponder {
4252    fn drop(&mut self) {
4253        self.control_handle.shutdown();
4254        // Safety: drops once, never accessed again
4255        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4256    }
4257}
4258
4259impl fidl::endpoints::Responder for CapabilitiesDictionaryGetResponder {
4260    type ControlHandle = CapabilitiesControlHandle;
4261
4262    fn control_handle(&self) -> &CapabilitiesControlHandle {
4263        &self.control_handle
4264    }
4265
4266    fn drop_without_shutdown(mut self) {
4267        // Safety: drops once, never accessed again due to mem::forget
4268        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4269        // Prevent Drop from running (which would shut down the channel)
4270        std::mem::forget(self);
4271    }
4272}
4273
4274impl CapabilitiesDictionaryGetResponder {
4275    /// Sends a response to the FIDL transaction.
4276    ///
4277    /// Sets the channel to shutdown if an error occurs.
4278    pub fn send(
4279        self,
4280        mut result: Result<CapabilityType, CapabilitiesError>,
4281    ) -> Result<(), fidl::Error> {
4282        let _result = self.send_raw(result);
4283        if _result.is_err() {
4284            self.control_handle.shutdown();
4285        }
4286        self.drop_without_shutdown();
4287        _result
4288    }
4289
4290    /// Similar to "send" but does not shutdown the channel if an error occurs.
4291    pub fn send_no_shutdown_on_err(
4292        self,
4293        mut result: Result<CapabilityType, CapabilitiesError>,
4294    ) -> Result<(), fidl::Error> {
4295        let _result = self.send_raw(result);
4296        self.drop_without_shutdown();
4297        _result
4298    }
4299
4300    fn send_raw(
4301        &self,
4302        mut result: Result<CapabilityType, CapabilitiesError>,
4303    ) -> Result<(), fidl::Error> {
4304        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4305            CapabilitiesDictionaryGetResponse,
4306            CapabilitiesError,
4307        >>(
4308            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4309            self.tx_id,
4310            0x31fafe2280a283d5,
4311            fidl::encoding::DynamicFlags::FLEXIBLE,
4312        )
4313    }
4314}
4315
4316#[must_use = "FIDL methods require a response to be sent"]
4317#[derive(Debug)]
4318pub struct CapabilitiesDictionaryRemoveResponder {
4319    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4320    tx_id: u32,
4321}
4322
4323/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4324/// if the responder is dropped without sending a response, so that the client
4325/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4326impl std::ops::Drop for CapabilitiesDictionaryRemoveResponder {
4327    fn drop(&mut self) {
4328        self.control_handle.shutdown();
4329        // Safety: drops once, never accessed again
4330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4331    }
4332}
4333
4334impl fidl::endpoints::Responder for CapabilitiesDictionaryRemoveResponder {
4335    type ControlHandle = CapabilitiesControlHandle;
4336
4337    fn control_handle(&self) -> &CapabilitiesControlHandle {
4338        &self.control_handle
4339    }
4340
4341    fn drop_without_shutdown(mut self) {
4342        // Safety: drops once, never accessed again due to mem::forget
4343        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4344        // Prevent Drop from running (which would shut down the channel)
4345        std::mem::forget(self);
4346    }
4347}
4348
4349impl CapabilitiesDictionaryRemoveResponder {
4350    /// Sends a response to the FIDL transaction.
4351    ///
4352    /// Sets the channel to shutdown if an error occurs.
4353    pub fn send(
4354        self,
4355        mut result: Result<CapabilityType, CapabilitiesError>,
4356    ) -> Result<(), fidl::Error> {
4357        let _result = self.send_raw(result);
4358        if _result.is_err() {
4359            self.control_handle.shutdown();
4360        }
4361        self.drop_without_shutdown();
4362        _result
4363    }
4364
4365    /// Similar to "send" but does not shutdown the channel if an error occurs.
4366    pub fn send_no_shutdown_on_err(
4367        self,
4368        mut result: Result<CapabilityType, CapabilitiesError>,
4369    ) -> Result<(), fidl::Error> {
4370        let _result = self.send_raw(result);
4371        self.drop_without_shutdown();
4372        _result
4373    }
4374
4375    fn send_raw(
4376        &self,
4377        mut result: Result<CapabilityType, CapabilitiesError>,
4378    ) -> Result<(), fidl::Error> {
4379        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4380            CapabilitiesDictionaryRemoveResponse,
4381            CapabilitiesError,
4382        >>(
4383            fidl::encoding::FlexibleResult::new(result.map(|capability_type| (capability_type,))),
4384            self.tx_id,
4385            0x6827c83106ac5a2c,
4386            fidl::encoding::DynamicFlags::FLEXIBLE,
4387        )
4388    }
4389}
4390
4391#[must_use = "FIDL methods require a response to be sent"]
4392#[derive(Debug)]
4393pub struct CapabilitiesDictionaryIterateKeysResponder {
4394    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4395    tx_id: u32,
4396}
4397
4398/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4399/// if the responder is dropped without sending a response, so that the client
4400/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4401impl std::ops::Drop for CapabilitiesDictionaryIterateKeysResponder {
4402    fn drop(&mut self) {
4403        self.control_handle.shutdown();
4404        // Safety: drops once, never accessed again
4405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4406    }
4407}
4408
4409impl fidl::endpoints::Responder for CapabilitiesDictionaryIterateKeysResponder {
4410    type ControlHandle = CapabilitiesControlHandle;
4411
4412    fn control_handle(&self) -> &CapabilitiesControlHandle {
4413        &self.control_handle
4414    }
4415
4416    fn drop_without_shutdown(mut self) {
4417        // Safety: drops once, never accessed again due to mem::forget
4418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4419        // Prevent Drop from running (which would shut down the channel)
4420        std::mem::forget(self);
4421    }
4422}
4423
4424impl CapabilitiesDictionaryIterateKeysResponder {
4425    /// Sends a response to the FIDL transaction.
4426    ///
4427    /// Sets the channel to shutdown if an error occurs.
4428    pub fn send(self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4429        let _result = self.send_raw(result);
4430        if _result.is_err() {
4431            self.control_handle.shutdown();
4432        }
4433        self.drop_without_shutdown();
4434        _result
4435    }
4436
4437    /// Similar to "send" but does not shutdown the channel if an error occurs.
4438    pub fn send_no_shutdown_on_err(
4439        self,
4440        mut result: Result<(), CapabilitiesError>,
4441    ) -> Result<(), fidl::Error> {
4442        let _result = self.send_raw(result);
4443        self.drop_without_shutdown();
4444        _result
4445    }
4446
4447    fn send_raw(&self, mut result: Result<(), CapabilitiesError>) -> Result<(), fidl::Error> {
4448        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4449            fidl::encoding::EmptyStruct,
4450            CapabilitiesError,
4451        >>(
4452            fidl::encoding::FlexibleResult::new(result),
4453            self.tx_id,
4454            0x3d4ea59c80df9bb8,
4455            fidl::encoding::DynamicFlags::FLEXIBLE,
4456        )
4457    }
4458}
4459
4460#[must_use = "FIDL methods require a response to be sent"]
4461#[derive(Debug)]
4462pub struct CapabilitiesDataGetResponder {
4463    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4464    tx_id: u32,
4465}
4466
4467/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4468/// if the responder is dropped without sending a response, so that the client
4469/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4470impl std::ops::Drop for CapabilitiesDataGetResponder {
4471    fn drop(&mut self) {
4472        self.control_handle.shutdown();
4473        // Safety: drops once, never accessed again
4474        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4475    }
4476}
4477
4478impl fidl::endpoints::Responder for CapabilitiesDataGetResponder {
4479    type ControlHandle = CapabilitiesControlHandle;
4480
4481    fn control_handle(&self) -> &CapabilitiesControlHandle {
4482        &self.control_handle
4483    }
4484
4485    fn drop_without_shutdown(mut self) {
4486        // Safety: drops once, never accessed again due to mem::forget
4487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4488        // Prevent Drop from running (which would shut down the channel)
4489        std::mem::forget(self);
4490    }
4491}
4492
4493impl CapabilitiesDataGetResponder {
4494    /// Sends a response to the FIDL transaction.
4495    ///
4496    /// Sets the channel to shutdown if an error occurs.
4497    pub fn send(self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4498        let _result = self.send_raw(result);
4499        if _result.is_err() {
4500            self.control_handle.shutdown();
4501        }
4502        self.drop_without_shutdown();
4503        _result
4504    }
4505
4506    /// Similar to "send" but does not shutdown the channel if an error occurs.
4507    pub fn send_no_shutdown_on_err(
4508        self,
4509        mut result: Result<&Data, CapabilitiesError>,
4510    ) -> Result<(), fidl::Error> {
4511        let _result = self.send_raw(result);
4512        self.drop_without_shutdown();
4513        _result
4514    }
4515
4516    fn send_raw(&self, mut result: Result<&Data, CapabilitiesError>) -> Result<(), fidl::Error> {
4517        self.control_handle
4518            .inner
4519            .send::<fidl::encoding::FlexibleResultType<Data, CapabilitiesError>>(
4520                fidl::encoding::FlexibleResult::new(result),
4521                self.tx_id,
4522                0x65ae25b59f9e0daf,
4523                fidl::encoding::DynamicFlags::FLEXIBLE,
4524            )
4525    }
4526}
4527
4528#[must_use = "FIDL methods require a response to be sent"]
4529#[derive(Debug)]
4530pub struct CapabilitiesConnectorRouterRouteResponder {
4531    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4532    tx_id: u32,
4533}
4534
4535/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4536/// if the responder is dropped without sending a response, so that the client
4537/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4538impl std::ops::Drop for CapabilitiesConnectorRouterRouteResponder {
4539    fn drop(&mut self) {
4540        self.control_handle.shutdown();
4541        // Safety: drops once, never accessed again
4542        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4543    }
4544}
4545
4546impl fidl::endpoints::Responder for CapabilitiesConnectorRouterRouteResponder {
4547    type ControlHandle = CapabilitiesControlHandle;
4548
4549    fn control_handle(&self) -> &CapabilitiesControlHandle {
4550        &self.control_handle
4551    }
4552
4553    fn drop_without_shutdown(mut self) {
4554        // Safety: drops once, never accessed again due to mem::forget
4555        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4556        // Prevent Drop from running (which would shut down the channel)
4557        std::mem::forget(self);
4558    }
4559}
4560
4561impl CapabilitiesConnectorRouterRouteResponder {
4562    /// Sends a response to the FIDL transaction.
4563    ///
4564    /// Sets the channel to shutdown if an error occurs.
4565    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4566        let _result = self.send_raw(result);
4567        if _result.is_err() {
4568            self.control_handle.shutdown();
4569        }
4570        self.drop_without_shutdown();
4571        _result
4572    }
4573
4574    /// Similar to "send" but does not shutdown the channel if an error occurs.
4575    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4576        let _result = self.send_raw(result);
4577        self.drop_without_shutdown();
4578        _result
4579    }
4580
4581    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4582        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4583            fidl::encoding::EmptyStruct,
4584            i32,
4585        >>(
4586            fidl::encoding::FlexibleResult::new(result),
4587            self.tx_id,
4588            0x1bd9c6e7e3dd487e,
4589            fidl::encoding::DynamicFlags::FLEXIBLE,
4590        )
4591    }
4592}
4593
4594#[must_use = "FIDL methods require a response to be sent"]
4595#[derive(Debug)]
4596pub struct CapabilitiesDirConnectorRouterRouteResponder {
4597    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4598    tx_id: u32,
4599}
4600
4601/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4602/// if the responder is dropped without sending a response, so that the client
4603/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4604impl std::ops::Drop for CapabilitiesDirConnectorRouterRouteResponder {
4605    fn drop(&mut self) {
4606        self.control_handle.shutdown();
4607        // Safety: drops once, never accessed again
4608        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4609    }
4610}
4611
4612impl fidl::endpoints::Responder for CapabilitiesDirConnectorRouterRouteResponder {
4613    type ControlHandle = CapabilitiesControlHandle;
4614
4615    fn control_handle(&self) -> &CapabilitiesControlHandle {
4616        &self.control_handle
4617    }
4618
4619    fn drop_without_shutdown(mut self) {
4620        // Safety: drops once, never accessed again due to mem::forget
4621        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4622        // Prevent Drop from running (which would shut down the channel)
4623        std::mem::forget(self);
4624    }
4625}
4626
4627impl CapabilitiesDirConnectorRouterRouteResponder {
4628    /// Sends a response to the FIDL transaction.
4629    ///
4630    /// Sets the channel to shutdown if an error occurs.
4631    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4632        let _result = self.send_raw(result);
4633        if _result.is_err() {
4634            self.control_handle.shutdown();
4635        }
4636        self.drop_without_shutdown();
4637        _result
4638    }
4639
4640    /// Similar to "send" but does not shutdown the channel if an error occurs.
4641    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4642        let _result = self.send_raw(result);
4643        self.drop_without_shutdown();
4644        _result
4645    }
4646
4647    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4648        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4649            fidl::encoding::EmptyStruct,
4650            i32,
4651        >>(
4652            fidl::encoding::FlexibleResult::new(result),
4653            self.tx_id,
4654            0x3afdcc1b79e0799d,
4655            fidl::encoding::DynamicFlags::FLEXIBLE,
4656        )
4657    }
4658}
4659
4660#[must_use = "FIDL methods require a response to be sent"]
4661#[derive(Debug)]
4662pub struct CapabilitiesDictionaryRouterRouteResponder {
4663    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4664    tx_id: u32,
4665}
4666
4667/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4668/// if the responder is dropped without sending a response, so that the client
4669/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4670impl std::ops::Drop for CapabilitiesDictionaryRouterRouteResponder {
4671    fn drop(&mut self) {
4672        self.control_handle.shutdown();
4673        // Safety: drops once, never accessed again
4674        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4675    }
4676}
4677
4678impl fidl::endpoints::Responder for CapabilitiesDictionaryRouterRouteResponder {
4679    type ControlHandle = CapabilitiesControlHandle;
4680
4681    fn control_handle(&self) -> &CapabilitiesControlHandle {
4682        &self.control_handle
4683    }
4684
4685    fn drop_without_shutdown(mut self) {
4686        // Safety: drops once, never accessed again due to mem::forget
4687        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4688        // Prevent Drop from running (which would shut down the channel)
4689        std::mem::forget(self);
4690    }
4691}
4692
4693impl CapabilitiesDictionaryRouterRouteResponder {
4694    /// Sends a response to the FIDL transaction.
4695    ///
4696    /// Sets the channel to shutdown if an error occurs.
4697    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4698        let _result = self.send_raw(result);
4699        if _result.is_err() {
4700            self.control_handle.shutdown();
4701        }
4702        self.drop_without_shutdown();
4703        _result
4704    }
4705
4706    /// Similar to "send" but does not shutdown the channel if an error occurs.
4707    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4708        let _result = self.send_raw(result);
4709        self.drop_without_shutdown();
4710        _result
4711    }
4712
4713    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4714        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4715            fidl::encoding::EmptyStruct,
4716            i32,
4717        >>(
4718            fidl::encoding::FlexibleResult::new(result),
4719            self.tx_id,
4720            0xcf72de10714a708,
4721            fidl::encoding::DynamicFlags::FLEXIBLE,
4722        )
4723    }
4724}
4725
4726#[must_use = "FIDL methods require a response to be sent"]
4727#[derive(Debug)]
4728pub struct CapabilitiesDataRouterRouteResponder {
4729    control_handle: std::mem::ManuallyDrop<CapabilitiesControlHandle>,
4730    tx_id: u32,
4731}
4732
4733/// Set the the channel to be shutdown (see [`CapabilitiesControlHandle::shutdown`])
4734/// if the responder is dropped without sending a response, so that the client
4735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4736impl std::ops::Drop for CapabilitiesDataRouterRouteResponder {
4737    fn drop(&mut self) {
4738        self.control_handle.shutdown();
4739        // Safety: drops once, never accessed again
4740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4741    }
4742}
4743
4744impl fidl::endpoints::Responder for CapabilitiesDataRouterRouteResponder {
4745    type ControlHandle = CapabilitiesControlHandle;
4746
4747    fn control_handle(&self) -> &CapabilitiesControlHandle {
4748        &self.control_handle
4749    }
4750
4751    fn drop_without_shutdown(mut self) {
4752        // Safety: drops once, never accessed again due to mem::forget
4753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4754        // Prevent Drop from running (which would shut down the channel)
4755        std::mem::forget(self);
4756    }
4757}
4758
4759impl CapabilitiesDataRouterRouteResponder {
4760    /// Sends a response to the FIDL transaction.
4761    ///
4762    /// Sets the channel to shutdown if an error occurs.
4763    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4764        let _result = self.send_raw(result);
4765        if _result.is_err() {
4766            self.control_handle.shutdown();
4767        }
4768        self.drop_without_shutdown();
4769        _result
4770    }
4771
4772    /// Similar to "send" but does not shutdown the channel if an error occurs.
4773    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> 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<(), i32>) -> Result<(), fidl::Error> {
4780        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4781            fidl::encoding::EmptyStruct,
4782            i32,
4783        >>(
4784            fidl::encoding::FlexibleResult::new(result),
4785            self.tx_id,
4786            0x61ab188455ed0643,
4787            fidl::encoding::DynamicFlags::FLEXIBLE,
4788        )
4789    }
4790}
4791
4792#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4793pub struct CapabilityFactoryMarker;
4794
4795impl fidl::endpoints::ProtocolMarker for CapabilityFactoryMarker {
4796    type Proxy = CapabilityFactoryProxy;
4797    type RequestStream = CapabilityFactoryRequestStream;
4798    #[cfg(target_os = "fuchsia")]
4799    type SynchronousProxy = CapabilityFactorySynchronousProxy;
4800
4801    const DEBUG_NAME: &'static str = "fuchsia.component.runtime.CapabilityFactory";
4802}
4803impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityFactoryMarker {}
4804
4805pub trait CapabilityFactoryProxyInterface: Send + Sync {
4806    fn r#create_connector(
4807        &self,
4808        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
4809        connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
4810    ) -> Result<(), fidl::Error>;
4811    fn r#create_dir_connector(
4812        &self,
4813        dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
4814        dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
4815    ) -> Result<(), fidl::Error>;
4816    fn r#create_dictionary(
4817        &self,
4818        dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
4819    ) -> Result<(), fidl::Error>;
4820    fn r#create_connector_router(
4821        &self,
4822        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
4823        router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
4824    ) -> Result<(), fidl::Error>;
4825    fn r#create_dir_connector_router(
4826        &self,
4827        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
4828        router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
4829    ) -> Result<(), fidl::Error>;
4830    fn r#create_dictionary_router(
4831        &self,
4832        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
4833        router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
4834    ) -> Result<(), fidl::Error>;
4835    fn r#create_data_router(
4836        &self,
4837        router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
4838        router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
4839    ) -> Result<(), fidl::Error>;
4840}
4841#[derive(Debug)]
4842#[cfg(target_os = "fuchsia")]
4843pub struct CapabilityFactorySynchronousProxy {
4844    client: fidl::client::sync::Client,
4845}
4846
4847#[cfg(target_os = "fuchsia")]
4848impl fidl::endpoints::SynchronousProxy for CapabilityFactorySynchronousProxy {
4849    type Proxy = CapabilityFactoryProxy;
4850    type Protocol = CapabilityFactoryMarker;
4851
4852    fn from_channel(inner: fidl::Channel) -> Self {
4853        Self::new(inner)
4854    }
4855
4856    fn into_channel(self) -> fidl::Channel {
4857        self.client.into_channel()
4858    }
4859
4860    fn as_channel(&self) -> &fidl::Channel {
4861        self.client.as_channel()
4862    }
4863}
4864
4865#[cfg(target_os = "fuchsia")]
4866impl CapabilityFactorySynchronousProxy {
4867    pub fn new(channel: fidl::Channel) -> Self {
4868        let protocol_name =
4869            <CapabilityFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4870        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4871    }
4872
4873    pub fn into_channel(self) -> fidl::Channel {
4874        self.client.into_channel()
4875    }
4876
4877    /// Waits until an event arrives and returns it. It is safe for other
4878    /// threads to make concurrent requests while waiting for an event.
4879    pub fn wait_for_event(
4880        &self,
4881        deadline: zx::MonotonicInstant,
4882    ) -> Result<CapabilityFactoryEvent, fidl::Error> {
4883        CapabilityFactoryEvent::decode(self.client.wait_for_event(deadline)?)
4884    }
4885
4886    pub fn r#create_connector(
4887        &self,
4888        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
4889        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
4890    ) -> Result<(), fidl::Error> {
4891        self.client.send::<CapabilityFactoryCreateConnectorRequest>(
4892            (receiver_client_end, connector_server_end),
4893            0x58be7506ad9c0d1b,
4894            fidl::encoding::DynamicFlags::FLEXIBLE,
4895        )
4896    }
4897
4898    pub fn r#create_dir_connector(
4899        &self,
4900        mut dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
4901        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
4902    ) -> Result<(), fidl::Error> {
4903        self.client.send::<CapabilityFactoryCreateDirConnectorRequest>(
4904            (dir_receiver_client_end, dir_connector_server_end),
4905            0x47e63805e1a638fa,
4906            fidl::encoding::DynamicFlags::FLEXIBLE,
4907        )
4908    }
4909
4910    pub fn r#create_dictionary(
4911        &self,
4912        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
4913    ) -> Result<(), fidl::Error> {
4914        self.client.send::<CapabilityFactoryCreateDictionaryRequest>(
4915            (dictionary_server_end,),
4916            0x1d9473d8c1e82b02,
4917            fidl::encoding::DynamicFlags::FLEXIBLE,
4918        )
4919    }
4920
4921    pub fn r#create_connector_router(
4922        &self,
4923        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
4924        mut router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
4925    ) -> Result<(), fidl::Error> {
4926        self.client.send::<CapabilityFactoryCreateConnectorRouterRequest>(
4927            (router_client_end, router_server_end),
4928            0x10a5577bdd065d17,
4929            fidl::encoding::DynamicFlags::FLEXIBLE,
4930        )
4931    }
4932
4933    pub fn r#create_dir_connector_router(
4934        &self,
4935        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
4936        mut router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
4937    ) -> Result<(), fidl::Error> {
4938        self.client.send::<CapabilityFactoryCreateDirConnectorRouterRequest>(
4939            (router_client_end, router_server_end),
4940            0x6da0f55bc0cb6916,
4941            fidl::encoding::DynamicFlags::FLEXIBLE,
4942        )
4943    }
4944
4945    pub fn r#create_dictionary_router(
4946        &self,
4947        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
4948        mut router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
4949    ) -> Result<(), fidl::Error> {
4950        self.client.send::<CapabilityFactoryCreateDictionaryRouterRequest>(
4951            (router_client_end, router_server_end),
4952            0x22f371a3e3cbdf05,
4953            fidl::encoding::DynamicFlags::FLEXIBLE,
4954        )
4955    }
4956
4957    pub fn r#create_data_router(
4958        &self,
4959        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
4960        mut router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
4961    ) -> Result<(), fidl::Error> {
4962        self.client.send::<CapabilityFactoryCreateDataRouterRequest>(
4963            (router_client_end, router_server_end),
4964            0x42ca43500520bd20,
4965            fidl::encoding::DynamicFlags::FLEXIBLE,
4966        )
4967    }
4968}
4969
4970#[cfg(target_os = "fuchsia")]
4971impl From<CapabilityFactorySynchronousProxy> for zx::Handle {
4972    fn from(value: CapabilityFactorySynchronousProxy) -> Self {
4973        value.into_channel().into()
4974    }
4975}
4976
4977#[cfg(target_os = "fuchsia")]
4978impl From<fidl::Channel> for CapabilityFactorySynchronousProxy {
4979    fn from(value: fidl::Channel) -> Self {
4980        Self::new(value)
4981    }
4982}
4983
4984#[cfg(target_os = "fuchsia")]
4985impl fidl::endpoints::FromClient for CapabilityFactorySynchronousProxy {
4986    type Protocol = CapabilityFactoryMarker;
4987
4988    fn from_client(value: fidl::endpoints::ClientEnd<CapabilityFactoryMarker>) -> Self {
4989        Self::new(value.into_channel())
4990    }
4991}
4992
4993#[derive(Debug, Clone)]
4994pub struct CapabilityFactoryProxy {
4995    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4996}
4997
4998impl fidl::endpoints::Proxy for CapabilityFactoryProxy {
4999    type Protocol = CapabilityFactoryMarker;
5000
5001    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5002        Self::new(inner)
5003    }
5004
5005    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5006        self.client.into_channel().map_err(|client| Self { client })
5007    }
5008
5009    fn as_channel(&self) -> &::fidl::AsyncChannel {
5010        self.client.as_channel()
5011    }
5012}
5013
5014impl CapabilityFactoryProxy {
5015    /// Create a new Proxy for fuchsia.component.runtime/CapabilityFactory.
5016    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5017        let protocol_name =
5018            <CapabilityFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5019        Self { client: fidl::client::Client::new(channel, protocol_name) }
5020    }
5021
5022    /// Get a Stream of events from the remote end of the protocol.
5023    ///
5024    /// # Panics
5025    ///
5026    /// Panics if the event stream was already taken.
5027    pub fn take_event_stream(&self) -> CapabilityFactoryEventStream {
5028        CapabilityFactoryEventStream { event_receiver: self.client.take_event_receiver() }
5029    }
5030
5031    pub fn r#create_connector(
5032        &self,
5033        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
5034        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
5035    ) -> Result<(), fidl::Error> {
5036        CapabilityFactoryProxyInterface::r#create_connector(
5037            self,
5038            receiver_client_end,
5039            connector_server_end,
5040        )
5041    }
5042
5043    pub fn r#create_dir_connector(
5044        &self,
5045        mut dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
5046        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
5047    ) -> Result<(), fidl::Error> {
5048        CapabilityFactoryProxyInterface::r#create_dir_connector(
5049            self,
5050            dir_receiver_client_end,
5051            dir_connector_server_end,
5052        )
5053    }
5054
5055    pub fn r#create_dictionary(
5056        &self,
5057        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
5058    ) -> Result<(), fidl::Error> {
5059        CapabilityFactoryProxyInterface::r#create_dictionary(self, dictionary_server_end)
5060    }
5061
5062    pub fn r#create_connector_router(
5063        &self,
5064        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
5065        mut router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
5066    ) -> Result<(), fidl::Error> {
5067        CapabilityFactoryProxyInterface::r#create_connector_router(
5068            self,
5069            router_client_end,
5070            router_server_end,
5071        )
5072    }
5073
5074    pub fn r#create_dir_connector_router(
5075        &self,
5076        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
5077        mut router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
5078    ) -> Result<(), fidl::Error> {
5079        CapabilityFactoryProxyInterface::r#create_dir_connector_router(
5080            self,
5081            router_client_end,
5082            router_server_end,
5083        )
5084    }
5085
5086    pub fn r#create_dictionary_router(
5087        &self,
5088        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
5089        mut router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
5090    ) -> Result<(), fidl::Error> {
5091        CapabilityFactoryProxyInterface::r#create_dictionary_router(
5092            self,
5093            router_client_end,
5094            router_server_end,
5095        )
5096    }
5097
5098    pub fn r#create_data_router(
5099        &self,
5100        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
5101        mut router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
5102    ) -> Result<(), fidl::Error> {
5103        CapabilityFactoryProxyInterface::r#create_data_router(
5104            self,
5105            router_client_end,
5106            router_server_end,
5107        )
5108    }
5109}
5110
5111impl CapabilityFactoryProxyInterface for CapabilityFactoryProxy {
5112    fn r#create_connector(
5113        &self,
5114        mut receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
5115        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
5116    ) -> Result<(), fidl::Error> {
5117        self.client.send::<CapabilityFactoryCreateConnectorRequest>(
5118            (receiver_client_end, connector_server_end),
5119            0x58be7506ad9c0d1b,
5120            fidl::encoding::DynamicFlags::FLEXIBLE,
5121        )
5122    }
5123
5124    fn r#create_dir_connector(
5125        &self,
5126        mut dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
5127        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
5128    ) -> Result<(), fidl::Error> {
5129        self.client.send::<CapabilityFactoryCreateDirConnectorRequest>(
5130            (dir_receiver_client_end, dir_connector_server_end),
5131            0x47e63805e1a638fa,
5132            fidl::encoding::DynamicFlags::FLEXIBLE,
5133        )
5134    }
5135
5136    fn r#create_dictionary(
5137        &self,
5138        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
5139    ) -> Result<(), fidl::Error> {
5140        self.client.send::<CapabilityFactoryCreateDictionaryRequest>(
5141            (dictionary_server_end,),
5142            0x1d9473d8c1e82b02,
5143            fidl::encoding::DynamicFlags::FLEXIBLE,
5144        )
5145    }
5146
5147    fn r#create_connector_router(
5148        &self,
5149        mut router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
5150        mut router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
5151    ) -> Result<(), fidl::Error> {
5152        self.client.send::<CapabilityFactoryCreateConnectorRouterRequest>(
5153            (router_client_end, router_server_end),
5154            0x10a5577bdd065d17,
5155            fidl::encoding::DynamicFlags::FLEXIBLE,
5156        )
5157    }
5158
5159    fn r#create_dir_connector_router(
5160        &self,
5161        mut router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
5162        mut router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
5163    ) -> Result<(), fidl::Error> {
5164        self.client.send::<CapabilityFactoryCreateDirConnectorRouterRequest>(
5165            (router_client_end, router_server_end),
5166            0x6da0f55bc0cb6916,
5167            fidl::encoding::DynamicFlags::FLEXIBLE,
5168        )
5169    }
5170
5171    fn r#create_dictionary_router(
5172        &self,
5173        mut router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
5174        mut router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
5175    ) -> Result<(), fidl::Error> {
5176        self.client.send::<CapabilityFactoryCreateDictionaryRouterRequest>(
5177            (router_client_end, router_server_end),
5178            0x22f371a3e3cbdf05,
5179            fidl::encoding::DynamicFlags::FLEXIBLE,
5180        )
5181    }
5182
5183    fn r#create_data_router(
5184        &self,
5185        mut router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
5186        mut router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
5187    ) -> Result<(), fidl::Error> {
5188        self.client.send::<CapabilityFactoryCreateDataRouterRequest>(
5189            (router_client_end, router_server_end),
5190            0x42ca43500520bd20,
5191            fidl::encoding::DynamicFlags::FLEXIBLE,
5192        )
5193    }
5194}
5195
5196pub struct CapabilityFactoryEventStream {
5197    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5198}
5199
5200impl std::marker::Unpin for CapabilityFactoryEventStream {}
5201
5202impl futures::stream::FusedStream for CapabilityFactoryEventStream {
5203    fn is_terminated(&self) -> bool {
5204        self.event_receiver.is_terminated()
5205    }
5206}
5207
5208impl futures::Stream for CapabilityFactoryEventStream {
5209    type Item = Result<CapabilityFactoryEvent, fidl::Error>;
5210
5211    fn poll_next(
5212        mut self: std::pin::Pin<&mut Self>,
5213        cx: &mut std::task::Context<'_>,
5214    ) -> std::task::Poll<Option<Self::Item>> {
5215        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5216            &mut self.event_receiver,
5217            cx
5218        )?) {
5219            Some(buf) => std::task::Poll::Ready(Some(CapabilityFactoryEvent::decode(buf))),
5220            None => std::task::Poll::Ready(None),
5221        }
5222    }
5223}
5224
5225#[derive(Debug)]
5226pub enum CapabilityFactoryEvent {
5227    #[non_exhaustive]
5228    _UnknownEvent {
5229        /// Ordinal of the event that was sent.
5230        ordinal: u64,
5231    },
5232}
5233
5234impl CapabilityFactoryEvent {
5235    /// Decodes a message buffer as a [`CapabilityFactoryEvent`].
5236    fn decode(
5237        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5238    ) -> Result<CapabilityFactoryEvent, fidl::Error> {
5239        let (bytes, _handles) = buf.split_mut();
5240        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5241        debug_assert_eq!(tx_header.tx_id, 0);
5242        match tx_header.ordinal {
5243            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5244                Ok(CapabilityFactoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5245            }
5246            _ => Err(fidl::Error::UnknownOrdinal {
5247                ordinal: tx_header.ordinal,
5248                protocol_name:
5249                    <CapabilityFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5250            }),
5251        }
5252    }
5253}
5254
5255/// A Stream of incoming requests for fuchsia.component.runtime/CapabilityFactory.
5256pub struct CapabilityFactoryRequestStream {
5257    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5258    is_terminated: bool,
5259}
5260
5261impl std::marker::Unpin for CapabilityFactoryRequestStream {}
5262
5263impl futures::stream::FusedStream for CapabilityFactoryRequestStream {
5264    fn is_terminated(&self) -> bool {
5265        self.is_terminated
5266    }
5267}
5268
5269impl fidl::endpoints::RequestStream for CapabilityFactoryRequestStream {
5270    type Protocol = CapabilityFactoryMarker;
5271    type ControlHandle = CapabilityFactoryControlHandle;
5272
5273    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5274        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5275    }
5276
5277    fn control_handle(&self) -> Self::ControlHandle {
5278        CapabilityFactoryControlHandle { inner: self.inner.clone() }
5279    }
5280
5281    fn into_inner(
5282        self,
5283    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5284    {
5285        (self.inner, self.is_terminated)
5286    }
5287
5288    fn from_inner(
5289        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5290        is_terminated: bool,
5291    ) -> Self {
5292        Self { inner, is_terminated }
5293    }
5294}
5295
5296impl futures::Stream for CapabilityFactoryRequestStream {
5297    type Item = Result<CapabilityFactoryRequest, fidl::Error>;
5298
5299    fn poll_next(
5300        mut self: std::pin::Pin<&mut Self>,
5301        cx: &mut std::task::Context<'_>,
5302    ) -> std::task::Poll<Option<Self::Item>> {
5303        let this = &mut *self;
5304        if this.inner.check_shutdown(cx) {
5305            this.is_terminated = true;
5306            return std::task::Poll::Ready(None);
5307        }
5308        if this.is_terminated {
5309            panic!("polled CapabilityFactoryRequestStream after completion");
5310        }
5311        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5312            |bytes, handles| {
5313                match this.inner.channel().read_etc(cx, bytes, handles) {
5314                    std::task::Poll::Ready(Ok(())) => {}
5315                    std::task::Poll::Pending => return std::task::Poll::Pending,
5316                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5317                        this.is_terminated = true;
5318                        return std::task::Poll::Ready(None);
5319                    }
5320                    std::task::Poll::Ready(Err(e)) => {
5321                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5322                            e.into(),
5323                        ))));
5324                    }
5325                }
5326
5327                // A message has been received from the channel
5328                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5329
5330                std::task::Poll::Ready(Some(match header.ordinal {
5331                    0x58be7506ad9c0d1b => {
5332                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5333                        let mut req = fidl::new_empty!(
5334                            CapabilityFactoryCreateConnectorRequest,
5335                            fidl::encoding::DefaultFuchsiaResourceDialect
5336                        );
5337                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateConnectorRequest>(&header, _body_bytes, handles, &mut req)?;
5338                        let control_handle =
5339                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5340                        Ok(CapabilityFactoryRequest::CreateConnector {
5341                            receiver_client_end: req.receiver_client_end,
5342                            connector_server_end: req.connector_server_end,
5343
5344                            control_handle,
5345                        })
5346                    }
5347                    0x47e63805e1a638fa => {
5348                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5349                        let mut req = fidl::new_empty!(
5350                            CapabilityFactoryCreateDirConnectorRequest,
5351                            fidl::encoding::DefaultFuchsiaResourceDialect
5352                        );
5353                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateDirConnectorRequest>(&header, _body_bytes, handles, &mut req)?;
5354                        let control_handle =
5355                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5356                        Ok(CapabilityFactoryRequest::CreateDirConnector {
5357                            dir_receiver_client_end: req.dir_receiver_client_end,
5358                            dir_connector_server_end: req.dir_connector_server_end,
5359
5360                            control_handle,
5361                        })
5362                    }
5363                    0x1d9473d8c1e82b02 => {
5364                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5365                        let mut req = fidl::new_empty!(
5366                            CapabilityFactoryCreateDictionaryRequest,
5367                            fidl::encoding::DefaultFuchsiaResourceDialect
5368                        );
5369                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
5370                        let control_handle =
5371                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5372                        Ok(CapabilityFactoryRequest::CreateDictionary {
5373                            dictionary_server_end: req.dictionary_server_end,
5374
5375                            control_handle,
5376                        })
5377                    }
5378                    0x10a5577bdd065d17 => {
5379                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5380                        let mut req = fidl::new_empty!(
5381                            CapabilityFactoryCreateConnectorRouterRequest,
5382                            fidl::encoding::DefaultFuchsiaResourceDialect
5383                        );
5384                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateConnectorRouterRequest>(&header, _body_bytes, handles, &mut req)?;
5385                        let control_handle =
5386                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5387                        Ok(CapabilityFactoryRequest::CreateConnectorRouter {
5388                            router_client_end: req.router_client_end,
5389                            router_server_end: req.router_server_end,
5390
5391                            control_handle,
5392                        })
5393                    }
5394                    0x6da0f55bc0cb6916 => {
5395                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5396                        let mut req = fidl::new_empty!(
5397                            CapabilityFactoryCreateDirConnectorRouterRequest,
5398                            fidl::encoding::DefaultFuchsiaResourceDialect
5399                        );
5400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateDirConnectorRouterRequest>(&header, _body_bytes, handles, &mut req)?;
5401                        let control_handle =
5402                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5403                        Ok(CapabilityFactoryRequest::CreateDirConnectorRouter {
5404                            router_client_end: req.router_client_end,
5405                            router_server_end: req.router_server_end,
5406
5407                            control_handle,
5408                        })
5409                    }
5410                    0x22f371a3e3cbdf05 => {
5411                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5412                        let mut req = fidl::new_empty!(
5413                            CapabilityFactoryCreateDictionaryRouterRequest,
5414                            fidl::encoding::DefaultFuchsiaResourceDialect
5415                        );
5416                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateDictionaryRouterRequest>(&header, _body_bytes, handles, &mut req)?;
5417                        let control_handle =
5418                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5419                        Ok(CapabilityFactoryRequest::CreateDictionaryRouter {
5420                            router_client_end: req.router_client_end,
5421                            router_server_end: req.router_server_end,
5422
5423                            control_handle,
5424                        })
5425                    }
5426                    0x42ca43500520bd20 => {
5427                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5428                        let mut req = fidl::new_empty!(
5429                            CapabilityFactoryCreateDataRouterRequest,
5430                            fidl::encoding::DefaultFuchsiaResourceDialect
5431                        );
5432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityFactoryCreateDataRouterRequest>(&header, _body_bytes, handles, &mut req)?;
5433                        let control_handle =
5434                            CapabilityFactoryControlHandle { inner: this.inner.clone() };
5435                        Ok(CapabilityFactoryRequest::CreateDataRouter {
5436                            router_client_end: req.router_client_end,
5437                            router_server_end: req.router_server_end,
5438
5439                            control_handle,
5440                        })
5441                    }
5442                    _ if header.tx_id == 0
5443                        && header
5444                            .dynamic_flags()
5445                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5446                    {
5447                        Ok(CapabilityFactoryRequest::_UnknownMethod {
5448                            ordinal: header.ordinal,
5449                            control_handle: CapabilityFactoryControlHandle {
5450                                inner: this.inner.clone(),
5451                            },
5452                            method_type: fidl::MethodType::OneWay,
5453                        })
5454                    }
5455                    _ if header
5456                        .dynamic_flags()
5457                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5458                    {
5459                        this.inner.send_framework_err(
5460                            fidl::encoding::FrameworkErr::UnknownMethod,
5461                            header.tx_id,
5462                            header.ordinal,
5463                            header.dynamic_flags(),
5464                            (bytes, handles),
5465                        )?;
5466                        Ok(CapabilityFactoryRequest::_UnknownMethod {
5467                            ordinal: header.ordinal,
5468                            control_handle: CapabilityFactoryControlHandle {
5469                                inner: this.inner.clone(),
5470                            },
5471                            method_type: fidl::MethodType::TwoWay,
5472                        })
5473                    }
5474                    _ => Err(fidl::Error::UnknownOrdinal {
5475                        ordinal: header.ordinal,
5476                        protocol_name:
5477                            <CapabilityFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5478                    }),
5479                }))
5480            },
5481        )
5482    }
5483}
5484
5485/// The `CapabilityFactory` can be used to create new runtime capabilities.
5486#[derive(Debug)]
5487pub enum CapabilityFactoryRequest {
5488    CreateConnector {
5489        receiver_client_end: fidl::endpoints::ClientEnd<ReceiverMarker>,
5490        connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
5491        control_handle: CapabilityFactoryControlHandle,
5492    },
5493    CreateDirConnector {
5494        dir_receiver_client_end: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
5495        dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
5496        control_handle: CapabilityFactoryControlHandle,
5497    },
5498    CreateDictionary {
5499        dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
5500        control_handle: CapabilityFactoryControlHandle,
5501    },
5502    CreateConnectorRouter {
5503        router_client_end: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
5504        router_server_end: fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
5505        control_handle: CapabilityFactoryControlHandle,
5506    },
5507    CreateDirConnectorRouter {
5508        router_client_end: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
5509        router_server_end: fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
5510        control_handle: CapabilityFactoryControlHandle,
5511    },
5512    CreateDictionaryRouter {
5513        router_client_end: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
5514        router_server_end: fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
5515        control_handle: CapabilityFactoryControlHandle,
5516    },
5517    CreateDataRouter {
5518        router_client_end: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
5519        router_server_end: fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
5520        control_handle: CapabilityFactoryControlHandle,
5521    },
5522    /// An interaction was received which does not match any known method.
5523    #[non_exhaustive]
5524    _UnknownMethod {
5525        /// Ordinal of the method that was called.
5526        ordinal: u64,
5527        control_handle: CapabilityFactoryControlHandle,
5528        method_type: fidl::MethodType,
5529    },
5530}
5531
5532impl CapabilityFactoryRequest {
5533    #[allow(irrefutable_let_patterns)]
5534    pub fn into_create_connector(
5535        self,
5536    ) -> Option<(
5537        fidl::endpoints::ClientEnd<ReceiverMarker>,
5538        fidl::endpoints::ServerEnd<ConnectorMarker>,
5539        CapabilityFactoryControlHandle,
5540    )> {
5541        if let CapabilityFactoryRequest::CreateConnector {
5542            receiver_client_end,
5543            connector_server_end,
5544            control_handle,
5545        } = self
5546        {
5547            Some((receiver_client_end, connector_server_end, control_handle))
5548        } else {
5549            None
5550        }
5551    }
5552
5553    #[allow(irrefutable_let_patterns)]
5554    pub fn into_create_dir_connector(
5555        self,
5556    ) -> Option<(
5557        fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
5558        fidl::endpoints::ServerEnd<DirConnectorMarker>,
5559        CapabilityFactoryControlHandle,
5560    )> {
5561        if let CapabilityFactoryRequest::CreateDirConnector {
5562            dir_receiver_client_end,
5563            dir_connector_server_end,
5564            control_handle,
5565        } = self
5566        {
5567            Some((dir_receiver_client_end, dir_connector_server_end, control_handle))
5568        } else {
5569            None
5570        }
5571    }
5572
5573    #[allow(irrefutable_let_patterns)]
5574    pub fn into_create_dictionary(
5575        self,
5576    ) -> Option<(fidl::endpoints::ServerEnd<DictionaryMarker>, CapabilityFactoryControlHandle)>
5577    {
5578        if let CapabilityFactoryRequest::CreateDictionary {
5579            dictionary_server_end,
5580            control_handle,
5581        } = self
5582        {
5583            Some((dictionary_server_end, control_handle))
5584        } else {
5585            None
5586        }
5587    }
5588
5589    #[allow(irrefutable_let_patterns)]
5590    pub fn into_create_connector_router(
5591        self,
5592    ) -> Option<(
5593        fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
5594        fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
5595        CapabilityFactoryControlHandle,
5596    )> {
5597        if let CapabilityFactoryRequest::CreateConnectorRouter {
5598            router_client_end,
5599            router_server_end,
5600            control_handle,
5601        } = self
5602        {
5603            Some((router_client_end, router_server_end, control_handle))
5604        } else {
5605            None
5606        }
5607    }
5608
5609    #[allow(irrefutable_let_patterns)]
5610    pub fn into_create_dir_connector_router(
5611        self,
5612    ) -> Option<(
5613        fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
5614        fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
5615        CapabilityFactoryControlHandle,
5616    )> {
5617        if let CapabilityFactoryRequest::CreateDirConnectorRouter {
5618            router_client_end,
5619            router_server_end,
5620            control_handle,
5621        } = self
5622        {
5623            Some((router_client_end, router_server_end, control_handle))
5624        } else {
5625            None
5626        }
5627    }
5628
5629    #[allow(irrefutable_let_patterns)]
5630    pub fn into_create_dictionary_router(
5631        self,
5632    ) -> Option<(
5633        fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
5634        fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
5635        CapabilityFactoryControlHandle,
5636    )> {
5637        if let CapabilityFactoryRequest::CreateDictionaryRouter {
5638            router_client_end,
5639            router_server_end,
5640            control_handle,
5641        } = self
5642        {
5643            Some((router_client_end, router_server_end, control_handle))
5644        } else {
5645            None
5646        }
5647    }
5648
5649    #[allow(irrefutable_let_patterns)]
5650    pub fn into_create_data_router(
5651        self,
5652    ) -> Option<(
5653        fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
5654        fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
5655        CapabilityFactoryControlHandle,
5656    )> {
5657        if let CapabilityFactoryRequest::CreateDataRouter {
5658            router_client_end,
5659            router_server_end,
5660            control_handle,
5661        } = self
5662        {
5663            Some((router_client_end, router_server_end, control_handle))
5664        } else {
5665            None
5666        }
5667    }
5668
5669    /// Name of the method defined in FIDL
5670    pub fn method_name(&self) -> &'static str {
5671        match *self {
5672            CapabilityFactoryRequest::CreateConnector { .. } => "create_connector",
5673            CapabilityFactoryRequest::CreateDirConnector { .. } => "create_dir_connector",
5674            CapabilityFactoryRequest::CreateDictionary { .. } => "create_dictionary",
5675            CapabilityFactoryRequest::CreateConnectorRouter { .. } => "create_connector_router",
5676            CapabilityFactoryRequest::CreateDirConnectorRouter { .. } => {
5677                "create_dir_connector_router"
5678            }
5679            CapabilityFactoryRequest::CreateDictionaryRouter { .. } => "create_dictionary_router",
5680            CapabilityFactoryRequest::CreateDataRouter { .. } => "create_data_router",
5681            CapabilityFactoryRequest::_UnknownMethod {
5682                method_type: fidl::MethodType::OneWay,
5683                ..
5684            } => "unknown one-way method",
5685            CapabilityFactoryRequest::_UnknownMethod {
5686                method_type: fidl::MethodType::TwoWay,
5687                ..
5688            } => "unknown two-way method",
5689        }
5690    }
5691}
5692
5693#[derive(Debug, Clone)]
5694pub struct CapabilityFactoryControlHandle {
5695    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5696}
5697
5698impl fidl::endpoints::ControlHandle for CapabilityFactoryControlHandle {
5699    fn shutdown(&self) {
5700        self.inner.shutdown()
5701    }
5702    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5703        self.inner.shutdown_with_epitaph(status)
5704    }
5705
5706    fn is_closed(&self) -> bool {
5707        self.inner.channel().is_closed()
5708    }
5709    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5710        self.inner.channel().on_closed()
5711    }
5712
5713    #[cfg(target_os = "fuchsia")]
5714    fn signal_peer(
5715        &self,
5716        clear_mask: zx::Signals,
5717        set_mask: zx::Signals,
5718    ) -> Result<(), zx_status::Status> {
5719        use fidl::Peered;
5720        self.inner.channel().signal_peer(clear_mask, set_mask)
5721    }
5722}
5723
5724impl CapabilityFactoryControlHandle {}
5725
5726#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5727pub struct ConnectorMarker;
5728
5729impl fidl::endpoints::ProtocolMarker for ConnectorMarker {
5730    type Proxy = ConnectorProxy;
5731    type RequestStream = ConnectorRequestStream;
5732    #[cfg(target_os = "fuchsia")]
5733    type SynchronousProxy = ConnectorSynchronousProxy;
5734
5735    const DEBUG_NAME: &'static str = "(anonymous) Connector";
5736}
5737
5738pub trait ConnectorProxyInterface: Send + Sync {
5739    fn r#clone(
5740        &self,
5741        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
5742    ) -> Result<(), fidl::Error>;
5743    fn r#connect(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
5744}
5745#[derive(Debug)]
5746#[cfg(target_os = "fuchsia")]
5747pub struct ConnectorSynchronousProxy {
5748    client: fidl::client::sync::Client,
5749}
5750
5751#[cfg(target_os = "fuchsia")]
5752impl fidl::endpoints::SynchronousProxy for ConnectorSynchronousProxy {
5753    type Proxy = ConnectorProxy;
5754    type Protocol = ConnectorMarker;
5755
5756    fn from_channel(inner: fidl::Channel) -> Self {
5757        Self::new(inner)
5758    }
5759
5760    fn into_channel(self) -> fidl::Channel {
5761        self.client.into_channel()
5762    }
5763
5764    fn as_channel(&self) -> &fidl::Channel {
5765        self.client.as_channel()
5766    }
5767}
5768
5769#[cfg(target_os = "fuchsia")]
5770impl ConnectorSynchronousProxy {
5771    pub fn new(channel: fidl::Channel) -> Self {
5772        let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5773        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5774    }
5775
5776    pub fn into_channel(self) -> fidl::Channel {
5777        self.client.into_channel()
5778    }
5779
5780    /// Waits until an event arrives and returns it. It is safe for other
5781    /// threads to make concurrent requests while waiting for an event.
5782    pub fn wait_for_event(
5783        &self,
5784        deadline: zx::MonotonicInstant,
5785    ) -> Result<ConnectorEvent, fidl::Error> {
5786        ConnectorEvent::decode(self.client.wait_for_event(deadline)?)
5787    }
5788
5789    pub fn r#clone(
5790        &self,
5791        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
5792    ) -> Result<(), fidl::Error> {
5793        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
5794            (request,),
5795            0x20d8a7aba2168a79,
5796            fidl::encoding::DynamicFlags::empty(),
5797        )
5798    }
5799
5800    /// Sends a channel to the `Receiver` associated with this `Connector`.
5801    pub fn r#connect(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
5802        self.client.send::<ConnectorConnectRequest>(
5803            (channel,),
5804            0x1c0c1727bd474e02,
5805            fidl::encoding::DynamicFlags::FLEXIBLE,
5806        )
5807    }
5808}
5809
5810#[cfg(target_os = "fuchsia")]
5811impl From<ConnectorSynchronousProxy> for zx::Handle {
5812    fn from(value: ConnectorSynchronousProxy) -> Self {
5813        value.into_channel().into()
5814    }
5815}
5816
5817#[cfg(target_os = "fuchsia")]
5818impl From<fidl::Channel> for ConnectorSynchronousProxy {
5819    fn from(value: fidl::Channel) -> Self {
5820        Self::new(value)
5821    }
5822}
5823
5824#[cfg(target_os = "fuchsia")]
5825impl fidl::endpoints::FromClient for ConnectorSynchronousProxy {
5826    type Protocol = ConnectorMarker;
5827
5828    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorMarker>) -> Self {
5829        Self::new(value.into_channel())
5830    }
5831}
5832
5833#[derive(Debug, Clone)]
5834pub struct ConnectorProxy {
5835    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5836}
5837
5838impl fidl::endpoints::Proxy for ConnectorProxy {
5839    type Protocol = ConnectorMarker;
5840
5841    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5842        Self::new(inner)
5843    }
5844
5845    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5846        self.client.into_channel().map_err(|client| Self { client })
5847    }
5848
5849    fn as_channel(&self) -> &::fidl::AsyncChannel {
5850        self.client.as_channel()
5851    }
5852}
5853
5854impl ConnectorProxy {
5855    /// Create a new Proxy for fuchsia.component.runtime/Connector.
5856    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5857        let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5858        Self { client: fidl::client::Client::new(channel, protocol_name) }
5859    }
5860
5861    /// Get a Stream of events from the remote end of the protocol.
5862    ///
5863    /// # Panics
5864    ///
5865    /// Panics if the event stream was already taken.
5866    pub fn take_event_stream(&self) -> ConnectorEventStream {
5867        ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
5868    }
5869
5870    pub fn r#clone(
5871        &self,
5872        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
5873    ) -> Result<(), fidl::Error> {
5874        ConnectorProxyInterface::r#clone(self, request)
5875    }
5876
5877    /// Sends a channel to the `Receiver` associated with this `Connector`.
5878    pub fn r#connect(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
5879        ConnectorProxyInterface::r#connect(self, channel)
5880    }
5881}
5882
5883impl ConnectorProxyInterface for ConnectorProxy {
5884    fn r#clone(
5885        &self,
5886        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
5887    ) -> Result<(), fidl::Error> {
5888        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
5889            (request,),
5890            0x20d8a7aba2168a79,
5891            fidl::encoding::DynamicFlags::empty(),
5892        )
5893    }
5894
5895    fn r#connect(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
5896        self.client.send::<ConnectorConnectRequest>(
5897            (channel,),
5898            0x1c0c1727bd474e02,
5899            fidl::encoding::DynamicFlags::FLEXIBLE,
5900        )
5901    }
5902}
5903
5904pub struct ConnectorEventStream {
5905    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5906}
5907
5908impl std::marker::Unpin for ConnectorEventStream {}
5909
5910impl futures::stream::FusedStream for ConnectorEventStream {
5911    fn is_terminated(&self) -> bool {
5912        self.event_receiver.is_terminated()
5913    }
5914}
5915
5916impl futures::Stream for ConnectorEventStream {
5917    type Item = Result<ConnectorEvent, fidl::Error>;
5918
5919    fn poll_next(
5920        mut self: std::pin::Pin<&mut Self>,
5921        cx: &mut std::task::Context<'_>,
5922    ) -> std::task::Poll<Option<Self::Item>> {
5923        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5924            &mut self.event_receiver,
5925            cx
5926        )?) {
5927            Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
5928            None => std::task::Poll::Ready(None),
5929        }
5930    }
5931}
5932
5933#[derive(Debug)]
5934pub enum ConnectorEvent {
5935    #[non_exhaustive]
5936    _UnknownEvent {
5937        /// Ordinal of the event that was sent.
5938        ordinal: u64,
5939    },
5940}
5941
5942impl ConnectorEvent {
5943    /// Decodes a message buffer as a [`ConnectorEvent`].
5944    fn decode(
5945        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5946    ) -> Result<ConnectorEvent, fidl::Error> {
5947        let (bytes, _handles) = buf.split_mut();
5948        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5949        debug_assert_eq!(tx_header.tx_id, 0);
5950        match tx_header.ordinal {
5951            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5952                Ok(ConnectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5953            }
5954            _ => Err(fidl::Error::UnknownOrdinal {
5955                ordinal: tx_header.ordinal,
5956                protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5957            }),
5958        }
5959    }
5960}
5961
5962/// A Stream of incoming requests for fuchsia.component.runtime/Connector.
5963pub struct ConnectorRequestStream {
5964    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5965    is_terminated: bool,
5966}
5967
5968impl std::marker::Unpin for ConnectorRequestStream {}
5969
5970impl futures::stream::FusedStream for ConnectorRequestStream {
5971    fn is_terminated(&self) -> bool {
5972        self.is_terminated
5973    }
5974}
5975
5976impl fidl::endpoints::RequestStream for ConnectorRequestStream {
5977    type Protocol = ConnectorMarker;
5978    type ControlHandle = ConnectorControlHandle;
5979
5980    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5981        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5982    }
5983
5984    fn control_handle(&self) -> Self::ControlHandle {
5985        ConnectorControlHandle { inner: self.inner.clone() }
5986    }
5987
5988    fn into_inner(
5989        self,
5990    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5991    {
5992        (self.inner, self.is_terminated)
5993    }
5994
5995    fn from_inner(
5996        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5997        is_terminated: bool,
5998    ) -> Self {
5999        Self { inner, is_terminated }
6000    }
6001}
6002
6003impl futures::Stream for ConnectorRequestStream {
6004    type Item = Result<ConnectorRequest, fidl::Error>;
6005
6006    fn poll_next(
6007        mut self: std::pin::Pin<&mut Self>,
6008        cx: &mut std::task::Context<'_>,
6009    ) -> std::task::Poll<Option<Self::Item>> {
6010        let this = &mut *self;
6011        if this.inner.check_shutdown(cx) {
6012            this.is_terminated = true;
6013            return std::task::Poll::Ready(None);
6014        }
6015        if this.is_terminated {
6016            panic!("polled ConnectorRequestStream after completion");
6017        }
6018        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6019            |bytes, handles| {
6020                match this.inner.channel().read_etc(cx, bytes, handles) {
6021                    std::task::Poll::Ready(Ok(())) => {}
6022                    std::task::Poll::Pending => return std::task::Poll::Pending,
6023                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6024                        this.is_terminated = true;
6025                        return std::task::Poll::Ready(None);
6026                    }
6027                    std::task::Poll::Ready(Err(e)) => {
6028                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6029                            e.into(),
6030                        ))));
6031                    }
6032                }
6033
6034                // A message has been received from the channel
6035                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6036
6037                std::task::Poll::Ready(Some(match header.ordinal {
6038                    0x20d8a7aba2168a79 => {
6039                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6040                        let mut req = fidl::new_empty!(
6041                            fidl_fuchsia_unknown::CloneableCloneRequest,
6042                            fidl::encoding::DefaultFuchsiaResourceDialect
6043                        );
6044                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
6045                        let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
6046                        Ok(ConnectorRequest::Clone { request: req.request, control_handle })
6047                    }
6048                    0x1c0c1727bd474e02 => {
6049                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6050                        let mut req = fidl::new_empty!(
6051                            ConnectorConnectRequest,
6052                            fidl::encoding::DefaultFuchsiaResourceDialect
6053                        );
6054                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
6055                        let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
6056                        Ok(ConnectorRequest::Connect { channel: req.channel, control_handle })
6057                    }
6058                    _ if header.tx_id == 0
6059                        && header
6060                            .dynamic_flags()
6061                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6062                    {
6063                        Ok(ConnectorRequest::_UnknownMethod {
6064                            ordinal: header.ordinal,
6065                            control_handle: ConnectorControlHandle { inner: this.inner.clone() },
6066                            method_type: fidl::MethodType::OneWay,
6067                        })
6068                    }
6069                    _ if header
6070                        .dynamic_flags()
6071                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6072                    {
6073                        this.inner.send_framework_err(
6074                            fidl::encoding::FrameworkErr::UnknownMethod,
6075                            header.tx_id,
6076                            header.ordinal,
6077                            header.dynamic_flags(),
6078                            (bytes, handles),
6079                        )?;
6080                        Ok(ConnectorRequest::_UnknownMethod {
6081                            ordinal: header.ordinal,
6082                            control_handle: ConnectorControlHandle { inner: this.inner.clone() },
6083                            method_type: fidl::MethodType::TwoWay,
6084                        })
6085                    }
6086                    _ => Err(fidl::Error::UnknownOrdinal {
6087                        ordinal: header.ordinal,
6088                        protocol_name:
6089                            <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6090                    }),
6091                }))
6092            },
6093        )
6094    }
6095}
6096
6097/// A `Connector` represents the sending end of a connection to a capability. A
6098/// `Connector` presents as a service node when inserted into a
6099/// `fuchsia.io.Directory`.
6100#[derive(Debug)]
6101pub enum ConnectorRequest {
6102    Clone {
6103        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6104        control_handle: ConnectorControlHandle,
6105    },
6106    /// Sends a channel to the `Receiver` associated with this `Connector`.
6107    Connect { channel: fidl::Channel, control_handle: ConnectorControlHandle },
6108    /// An interaction was received which does not match any known method.
6109    #[non_exhaustive]
6110    _UnknownMethod {
6111        /// Ordinal of the method that was called.
6112        ordinal: u64,
6113        control_handle: ConnectorControlHandle,
6114        method_type: fidl::MethodType,
6115    },
6116}
6117
6118impl ConnectorRequest {
6119    #[allow(irrefutable_let_patterns)]
6120    pub fn into_clone(
6121        self,
6122    ) -> Option<(
6123        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6124        ConnectorControlHandle,
6125    )> {
6126        if let ConnectorRequest::Clone { request, control_handle } = self {
6127            Some((request, control_handle))
6128        } else {
6129            None
6130        }
6131    }
6132
6133    #[allow(irrefutable_let_patterns)]
6134    pub fn into_connect(self) -> Option<(fidl::Channel, ConnectorControlHandle)> {
6135        if let ConnectorRequest::Connect { channel, control_handle } = self {
6136            Some((channel, control_handle))
6137        } else {
6138            None
6139        }
6140    }
6141
6142    /// Name of the method defined in FIDL
6143    pub fn method_name(&self) -> &'static str {
6144        match *self {
6145            ConnectorRequest::Clone { .. } => "clone",
6146            ConnectorRequest::Connect { .. } => "connect",
6147            ConnectorRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6148                "unknown one-way method"
6149            }
6150            ConnectorRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6151                "unknown two-way method"
6152            }
6153        }
6154    }
6155}
6156
6157#[derive(Debug, Clone)]
6158pub struct ConnectorControlHandle {
6159    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6160}
6161
6162impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
6163    fn shutdown(&self) {
6164        self.inner.shutdown()
6165    }
6166    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6167        self.inner.shutdown_with_epitaph(status)
6168    }
6169
6170    fn is_closed(&self) -> bool {
6171        self.inner.channel().is_closed()
6172    }
6173    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6174        self.inner.channel().on_closed()
6175    }
6176
6177    #[cfg(target_os = "fuchsia")]
6178    fn signal_peer(
6179        &self,
6180        clear_mask: zx::Signals,
6181        set_mask: zx::Signals,
6182    ) -> Result<(), zx_status::Status> {
6183        use fidl::Peered;
6184        self.inner.channel().signal_peer(clear_mask, set_mask)
6185    }
6186}
6187
6188impl ConnectorControlHandle {}
6189
6190#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6191pub struct ConnectorRouterMarker;
6192
6193impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
6194    type Proxy = ConnectorRouterProxy;
6195    type RequestStream = ConnectorRouterRequestStream;
6196    #[cfg(target_os = "fuchsia")]
6197    type SynchronousProxy = ConnectorRouterSynchronousProxy;
6198
6199    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouter";
6200}
6201pub type ConnectorRouterRouteResult = Result<Option<fidl::EventPair>, RouterError>;
6202
6203pub trait ConnectorRouterProxyInterface: Send + Sync {
6204    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
6205        + Send;
6206    fn r#route(&self, request: RouteRequest) -> Self::RouteResponseFut;
6207}
6208#[derive(Debug)]
6209#[cfg(target_os = "fuchsia")]
6210pub struct ConnectorRouterSynchronousProxy {
6211    client: fidl::client::sync::Client,
6212}
6213
6214#[cfg(target_os = "fuchsia")]
6215impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
6216    type Proxy = ConnectorRouterProxy;
6217    type Protocol = ConnectorRouterMarker;
6218
6219    fn from_channel(inner: fidl::Channel) -> Self {
6220        Self::new(inner)
6221    }
6222
6223    fn into_channel(self) -> fidl::Channel {
6224        self.client.into_channel()
6225    }
6226
6227    fn as_channel(&self) -> &fidl::Channel {
6228        self.client.as_channel()
6229    }
6230}
6231
6232#[cfg(target_os = "fuchsia")]
6233impl ConnectorRouterSynchronousProxy {
6234    pub fn new(channel: fidl::Channel) -> Self {
6235        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6236        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6237    }
6238
6239    pub fn into_channel(self) -> fidl::Channel {
6240        self.client.into_channel()
6241    }
6242
6243    /// Waits until an event arrives and returns it. It is safe for other
6244    /// threads to make concurrent requests while waiting for an event.
6245    pub fn wait_for_event(
6246        &self,
6247        deadline: zx::MonotonicInstant,
6248    ) -> Result<ConnectorRouterEvent, fidl::Error> {
6249        ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
6250    }
6251
6252    /// Attempts to produce a `Connector` capability from this
6253    /// `ConnectorRouter`. This will return:
6254    ///
6255    /// - A `Connector` if the operation is successful.
6256    /// - An empty value if there is no issue found but the capability is not
6257    ///   being provided (for example, an optional route ended in an offer from
6258    ///   void).
6259    /// - An error, if the operation failed.
6260    pub fn r#route(
6261        &self,
6262        mut request: RouteRequest,
6263        ___deadline: zx::MonotonicInstant,
6264    ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
6265        let _response = self.client.send_query::<
6266            ConnectorRouterRouteRequest,
6267            fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
6268        >(
6269            (&mut request,),
6270            0x57a912c92a38f9f8,
6271            fidl::encoding::DynamicFlags::FLEXIBLE,
6272            ___deadline,
6273        )?
6274        .into_result::<ConnectorRouterMarker>("route")?;
6275        Ok(_response.map(|x| x.handle))
6276    }
6277}
6278
6279#[cfg(target_os = "fuchsia")]
6280impl From<ConnectorRouterSynchronousProxy> for zx::Handle {
6281    fn from(value: ConnectorRouterSynchronousProxy) -> Self {
6282        value.into_channel().into()
6283    }
6284}
6285
6286#[cfg(target_os = "fuchsia")]
6287impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
6288    fn from(value: fidl::Channel) -> Self {
6289        Self::new(value)
6290    }
6291}
6292
6293#[cfg(target_os = "fuchsia")]
6294impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
6295    type Protocol = ConnectorRouterMarker;
6296
6297    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
6298        Self::new(value.into_channel())
6299    }
6300}
6301
6302#[derive(Debug, Clone)]
6303pub struct ConnectorRouterProxy {
6304    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6305}
6306
6307impl fidl::endpoints::Proxy for ConnectorRouterProxy {
6308    type Protocol = ConnectorRouterMarker;
6309
6310    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6311        Self::new(inner)
6312    }
6313
6314    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6315        self.client.into_channel().map_err(|client| Self { client })
6316    }
6317
6318    fn as_channel(&self) -> &::fidl::AsyncChannel {
6319        self.client.as_channel()
6320    }
6321}
6322
6323impl ConnectorRouterProxy {
6324    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouter.
6325    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6326        let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6327        Self { client: fidl::client::Client::new(channel, protocol_name) }
6328    }
6329
6330    /// Get a Stream of events from the remote end of the protocol.
6331    ///
6332    /// # Panics
6333    ///
6334    /// Panics if the event stream was already taken.
6335    pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
6336        ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
6337    }
6338
6339    /// Attempts to produce a `Connector` capability from this
6340    /// `ConnectorRouter`. This will return:
6341    ///
6342    /// - A `Connector` if the operation is successful.
6343    /// - An empty value if there is no issue found but the capability is not
6344    ///   being provided (for example, an optional route ended in an offer from
6345    ///   void).
6346    /// - An error, if the operation failed.
6347    pub fn r#route(
6348        &self,
6349        mut request: RouteRequest,
6350    ) -> fidl::client::QueryResponseFut<
6351        ConnectorRouterRouteResult,
6352        fidl::encoding::DefaultFuchsiaResourceDialect,
6353    > {
6354        ConnectorRouterProxyInterface::r#route(self, request)
6355    }
6356}
6357
6358impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
6359    type RouteResponseFut = fidl::client::QueryResponseFut<
6360        ConnectorRouterRouteResult,
6361        fidl::encoding::DefaultFuchsiaResourceDialect,
6362    >;
6363    fn r#route(&self, mut request: RouteRequest) -> Self::RouteResponseFut {
6364        fn _decode(
6365            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6366        ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
6367            let _response = fidl::client::decode_transaction_body::<
6368                fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
6369                fidl::encoding::DefaultFuchsiaResourceDialect,
6370                0x57a912c92a38f9f8,
6371            >(_buf?)?
6372            .into_result::<ConnectorRouterMarker>("route")?;
6373            Ok(_response.map(|x| x.handle))
6374        }
6375        self.client
6376            .send_query_and_decode::<ConnectorRouterRouteRequest, ConnectorRouterRouteResult>(
6377                (&mut request,),
6378                0x57a912c92a38f9f8,
6379                fidl::encoding::DynamicFlags::FLEXIBLE,
6380                _decode,
6381            )
6382    }
6383}
6384
6385pub struct ConnectorRouterEventStream {
6386    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6387}
6388
6389impl std::marker::Unpin for ConnectorRouterEventStream {}
6390
6391impl futures::stream::FusedStream for ConnectorRouterEventStream {
6392    fn is_terminated(&self) -> bool {
6393        self.event_receiver.is_terminated()
6394    }
6395}
6396
6397impl futures::Stream for ConnectorRouterEventStream {
6398    type Item = Result<ConnectorRouterEvent, fidl::Error>;
6399
6400    fn poll_next(
6401        mut self: std::pin::Pin<&mut Self>,
6402        cx: &mut std::task::Context<'_>,
6403    ) -> std::task::Poll<Option<Self::Item>> {
6404        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6405            &mut self.event_receiver,
6406            cx
6407        )?) {
6408            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
6409            None => std::task::Poll::Ready(None),
6410        }
6411    }
6412}
6413
6414#[derive(Debug)]
6415pub enum ConnectorRouterEvent {
6416    #[non_exhaustive]
6417    _UnknownEvent {
6418        /// Ordinal of the event that was sent.
6419        ordinal: u64,
6420    },
6421}
6422
6423impl ConnectorRouterEvent {
6424    /// Decodes a message buffer as a [`ConnectorRouterEvent`].
6425    fn decode(
6426        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6427    ) -> Result<ConnectorRouterEvent, fidl::Error> {
6428        let (bytes, _handles) = buf.split_mut();
6429        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6430        debug_assert_eq!(tx_header.tx_id, 0);
6431        match tx_header.ordinal {
6432            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6433                Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6434            }
6435            _ => Err(fidl::Error::UnknownOrdinal {
6436                ordinal: tx_header.ordinal,
6437                protocol_name:
6438                    <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6439            }),
6440        }
6441    }
6442}
6443
6444/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouter.
6445pub struct ConnectorRouterRequestStream {
6446    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6447    is_terminated: bool,
6448}
6449
6450impl std::marker::Unpin for ConnectorRouterRequestStream {}
6451
6452impl futures::stream::FusedStream for ConnectorRouterRequestStream {
6453    fn is_terminated(&self) -> bool {
6454        self.is_terminated
6455    }
6456}
6457
6458impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
6459    type Protocol = ConnectorRouterMarker;
6460    type ControlHandle = ConnectorRouterControlHandle;
6461
6462    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6463        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6464    }
6465
6466    fn control_handle(&self) -> Self::ControlHandle {
6467        ConnectorRouterControlHandle { inner: self.inner.clone() }
6468    }
6469
6470    fn into_inner(
6471        self,
6472    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6473    {
6474        (self.inner, self.is_terminated)
6475    }
6476
6477    fn from_inner(
6478        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6479        is_terminated: bool,
6480    ) -> Self {
6481        Self { inner, is_terminated }
6482    }
6483}
6484
6485impl futures::Stream for ConnectorRouterRequestStream {
6486    type Item = Result<ConnectorRouterRequest, fidl::Error>;
6487
6488    fn poll_next(
6489        mut self: std::pin::Pin<&mut Self>,
6490        cx: &mut std::task::Context<'_>,
6491    ) -> std::task::Poll<Option<Self::Item>> {
6492        let this = &mut *self;
6493        if this.inner.check_shutdown(cx) {
6494            this.is_terminated = true;
6495            return std::task::Poll::Ready(None);
6496        }
6497        if this.is_terminated {
6498            panic!("polled ConnectorRouterRequestStream after completion");
6499        }
6500        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6501            |bytes, handles| {
6502                match this.inner.channel().read_etc(cx, bytes, handles) {
6503                    std::task::Poll::Ready(Ok(())) => {}
6504                    std::task::Poll::Pending => return std::task::Poll::Pending,
6505                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6506                        this.is_terminated = true;
6507                        return std::task::Poll::Ready(None);
6508                    }
6509                    std::task::Poll::Ready(Err(e)) => {
6510                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6511                            e.into(),
6512                        ))));
6513                    }
6514                }
6515
6516                // A message has been received from the channel
6517                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6518
6519                std::task::Poll::Ready(Some(match header.ordinal {
6520                    0x57a912c92a38f9f8 => {
6521                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6522                        let mut req = fidl::new_empty!(
6523                            ConnectorRouterRouteRequest,
6524                            fidl::encoding::DefaultFuchsiaResourceDialect
6525                        );
6526                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6527                        let control_handle =
6528                            ConnectorRouterControlHandle { inner: this.inner.clone() };
6529                        Ok(ConnectorRouterRequest::Route {
6530                            request: req.request,
6531
6532                            responder: ConnectorRouterRouteResponder {
6533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6534                                tx_id: header.tx_id,
6535                            },
6536                        })
6537                    }
6538                    _ if header.tx_id == 0
6539                        && header
6540                            .dynamic_flags()
6541                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6542                    {
6543                        Ok(ConnectorRouterRequest::_UnknownMethod {
6544                            ordinal: header.ordinal,
6545                            control_handle: ConnectorRouterControlHandle {
6546                                inner: this.inner.clone(),
6547                            },
6548                            method_type: fidl::MethodType::OneWay,
6549                        })
6550                    }
6551                    _ if header
6552                        .dynamic_flags()
6553                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6554                    {
6555                        this.inner.send_framework_err(
6556                            fidl::encoding::FrameworkErr::UnknownMethod,
6557                            header.tx_id,
6558                            header.ordinal,
6559                            header.dynamic_flags(),
6560                            (bytes, handles),
6561                        )?;
6562                        Ok(ConnectorRouterRequest::_UnknownMethod {
6563                            ordinal: header.ordinal,
6564                            control_handle: ConnectorRouterControlHandle {
6565                                inner: this.inner.clone(),
6566                            },
6567                            method_type: fidl::MethodType::TwoWay,
6568                        })
6569                    }
6570                    _ => Err(fidl::Error::UnknownOrdinal {
6571                        ordinal: header.ordinal,
6572                        protocol_name:
6573                            <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6574                    }),
6575                }))
6576            },
6577        )
6578    }
6579}
6580
6581/// A factory for `Connector` capabilities.
6582#[derive(Debug)]
6583pub enum ConnectorRouterRequest {
6584    /// Attempts to produce a `Connector` capability from this
6585    /// `ConnectorRouter`. This will return:
6586    ///
6587    /// - A `Connector` if the operation is successful.
6588    /// - An empty value if there is no issue found but the capability is not
6589    ///   being provided (for example, an optional route ended in an offer from
6590    ///   void).
6591    /// - An error, if the operation failed.
6592    Route { request: RouteRequest, responder: ConnectorRouterRouteResponder },
6593    /// An interaction was received which does not match any known method.
6594    #[non_exhaustive]
6595    _UnknownMethod {
6596        /// Ordinal of the method that was called.
6597        ordinal: u64,
6598        control_handle: ConnectorRouterControlHandle,
6599        method_type: fidl::MethodType,
6600    },
6601}
6602
6603impl ConnectorRouterRequest {
6604    #[allow(irrefutable_let_patterns)]
6605    pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
6606        if let ConnectorRouterRequest::Route { request, responder } = self {
6607            Some((request, responder))
6608        } else {
6609            None
6610        }
6611    }
6612
6613    /// Name of the method defined in FIDL
6614    pub fn method_name(&self) -> &'static str {
6615        match *self {
6616            ConnectorRouterRequest::Route { .. } => "route",
6617            ConnectorRouterRequest::_UnknownMethod {
6618                method_type: fidl::MethodType::OneWay,
6619                ..
6620            } => "unknown one-way method",
6621            ConnectorRouterRequest::_UnknownMethod {
6622                method_type: fidl::MethodType::TwoWay,
6623                ..
6624            } => "unknown two-way method",
6625        }
6626    }
6627}
6628
6629#[derive(Debug, Clone)]
6630pub struct ConnectorRouterControlHandle {
6631    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6632}
6633
6634impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
6635    fn shutdown(&self) {
6636        self.inner.shutdown()
6637    }
6638    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6639        self.inner.shutdown_with_epitaph(status)
6640    }
6641
6642    fn is_closed(&self) -> bool {
6643        self.inner.channel().is_closed()
6644    }
6645    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6646        self.inner.channel().on_closed()
6647    }
6648
6649    #[cfg(target_os = "fuchsia")]
6650    fn signal_peer(
6651        &self,
6652        clear_mask: zx::Signals,
6653        set_mask: zx::Signals,
6654    ) -> Result<(), zx_status::Status> {
6655        use fidl::Peered;
6656        self.inner.channel().signal_peer(clear_mask, set_mask)
6657    }
6658}
6659
6660impl ConnectorRouterControlHandle {}
6661
6662#[must_use = "FIDL methods require a response to be sent"]
6663#[derive(Debug)]
6664pub struct ConnectorRouterRouteResponder {
6665    control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
6666    tx_id: u32,
6667}
6668
6669/// Set the the channel to be shutdown (see [`ConnectorRouterControlHandle::shutdown`])
6670/// if the responder is dropped without sending a response, so that the client
6671/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6672impl std::ops::Drop for ConnectorRouterRouteResponder {
6673    fn drop(&mut self) {
6674        self.control_handle.shutdown();
6675        // Safety: drops once, never accessed again
6676        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6677    }
6678}
6679
6680impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
6681    type ControlHandle = ConnectorRouterControlHandle;
6682
6683    fn control_handle(&self) -> &ConnectorRouterControlHandle {
6684        &self.control_handle
6685    }
6686
6687    fn drop_without_shutdown(mut self) {
6688        // Safety: drops once, never accessed again due to mem::forget
6689        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6690        // Prevent Drop from running (which would shut down the channel)
6691        std::mem::forget(self);
6692    }
6693}
6694
6695impl ConnectorRouterRouteResponder {
6696    /// Sends a response to the FIDL transaction.
6697    ///
6698    /// Sets the channel to shutdown if an error occurs.
6699    pub fn send(
6700        self,
6701        mut result: Result<Option<fidl::EventPair>, RouterError>,
6702    ) -> Result<(), fidl::Error> {
6703        let _result = self.send_raw(result);
6704        if _result.is_err() {
6705            self.control_handle.shutdown();
6706        }
6707        self.drop_without_shutdown();
6708        _result
6709    }
6710
6711    /// Similar to "send" but does not shutdown the channel if an error occurs.
6712    pub fn send_no_shutdown_on_err(
6713        self,
6714        mut result: Result<Option<fidl::EventPair>, RouterError>,
6715    ) -> Result<(), fidl::Error> {
6716        let _result = self.send_raw(result);
6717        self.drop_without_shutdown();
6718        _result
6719    }
6720
6721    fn send_raw(
6722        &self,
6723        mut result: Result<Option<fidl::EventPair>, RouterError>,
6724    ) -> Result<(), fidl::Error> {
6725        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6726            ConnectorRouterRouteResponse,
6727            RouterError,
6728        >>(
6729            fidl::encoding::FlexibleResult::new(result.map(|handle| (handle,))),
6730            self.tx_id,
6731            0x57a912c92a38f9f8,
6732            fidl::encoding::DynamicFlags::FLEXIBLE,
6733        )
6734    }
6735}
6736
6737#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6738pub struct ConnectorRouterDeprecatedMarker;
6739
6740impl fidl::endpoints::ProtocolMarker for ConnectorRouterDeprecatedMarker {
6741    type Proxy = ConnectorRouterDeprecatedProxy;
6742    type RequestStream = ConnectorRouterDeprecatedRequestStream;
6743    #[cfg(target_os = "fuchsia")]
6744    type SynchronousProxy = ConnectorRouterDeprecatedSynchronousProxy;
6745
6746    const DEBUG_NAME: &'static str = "(anonymous) ConnectorRouterDeprecated";
6747}
6748pub type ConnectorRouterDeprecatedRouteResult = Result<RouterResponse, RouterError>;
6749
6750pub trait ConnectorRouterDeprecatedProxyInterface: Send + Sync {
6751    fn r#clone(
6752        &self,
6753        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6754    ) -> Result<(), fidl::Error>;
6755    type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterDeprecatedRouteResult, fidl::Error>>
6756        + Send;
6757    fn r#route(
6758        &self,
6759        request: RouteRequest,
6760        connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
6761    ) -> Self::RouteResponseFut;
6762}
6763#[derive(Debug)]
6764#[cfg(target_os = "fuchsia")]
6765pub struct ConnectorRouterDeprecatedSynchronousProxy {
6766    client: fidl::client::sync::Client,
6767}
6768
6769#[cfg(target_os = "fuchsia")]
6770impl fidl::endpoints::SynchronousProxy for ConnectorRouterDeprecatedSynchronousProxy {
6771    type Proxy = ConnectorRouterDeprecatedProxy;
6772    type Protocol = ConnectorRouterDeprecatedMarker;
6773
6774    fn from_channel(inner: fidl::Channel) -> Self {
6775        Self::new(inner)
6776    }
6777
6778    fn into_channel(self) -> fidl::Channel {
6779        self.client.into_channel()
6780    }
6781
6782    fn as_channel(&self) -> &fidl::Channel {
6783        self.client.as_channel()
6784    }
6785}
6786
6787#[cfg(target_os = "fuchsia")]
6788impl ConnectorRouterDeprecatedSynchronousProxy {
6789    pub fn new(channel: fidl::Channel) -> Self {
6790        let protocol_name =
6791            <ConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6792        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6793    }
6794
6795    pub fn into_channel(self) -> fidl::Channel {
6796        self.client.into_channel()
6797    }
6798
6799    /// Waits until an event arrives and returns it. It is safe for other
6800    /// threads to make concurrent requests while waiting for an event.
6801    pub fn wait_for_event(
6802        &self,
6803        deadline: zx::MonotonicInstant,
6804    ) -> Result<ConnectorRouterDeprecatedEvent, fidl::Error> {
6805        ConnectorRouterDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
6806    }
6807
6808    pub fn r#clone(
6809        &self,
6810        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6811    ) -> Result<(), fidl::Error> {
6812        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
6813            (request,),
6814            0x20d8a7aba2168a79,
6815            fidl::encoding::DynamicFlags::empty(),
6816        )
6817    }
6818
6819    /// Attempts to produce a `Connector` capability from this
6820    /// `ConnectorRouter`. This will return:
6821    ///
6822    /// - A `Connector` if the operation is successful.
6823    /// - An empty value if there is no issue found but the capability is not
6824    ///   being provided (for example, an optional route ended in an offer from
6825    ///   void).
6826    /// - An error, if the operation failed.
6827    pub fn r#route(
6828        &self,
6829        mut request: RouteRequest,
6830        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
6831        ___deadline: zx::MonotonicInstant,
6832    ) -> Result<ConnectorRouterDeprecatedRouteResult, fidl::Error> {
6833        let _response = self.client.send_query::<
6834            ConnectorRouterDeprecatedRouteRequest,
6835            fidl::encoding::FlexibleResultType<ConnectorRouterDeprecatedRouteResponse, RouterError>,
6836        >(
6837            (&mut request, connector_server_end,),
6838            0x1b7810fe6a37ff32,
6839            fidl::encoding::DynamicFlags::FLEXIBLE,
6840            ___deadline,
6841        )?
6842        .into_result::<ConnectorRouterDeprecatedMarker>("route")?;
6843        Ok(_response.map(|x| x.response))
6844    }
6845}
6846
6847#[cfg(target_os = "fuchsia")]
6848impl From<ConnectorRouterDeprecatedSynchronousProxy> for zx::Handle {
6849    fn from(value: ConnectorRouterDeprecatedSynchronousProxy) -> Self {
6850        value.into_channel().into()
6851    }
6852}
6853
6854#[cfg(target_os = "fuchsia")]
6855impl From<fidl::Channel> for ConnectorRouterDeprecatedSynchronousProxy {
6856    fn from(value: fidl::Channel) -> Self {
6857        Self::new(value)
6858    }
6859}
6860
6861#[cfg(target_os = "fuchsia")]
6862impl fidl::endpoints::FromClient for ConnectorRouterDeprecatedSynchronousProxy {
6863    type Protocol = ConnectorRouterDeprecatedMarker;
6864
6865    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>) -> Self {
6866        Self::new(value.into_channel())
6867    }
6868}
6869
6870#[derive(Debug, Clone)]
6871pub struct ConnectorRouterDeprecatedProxy {
6872    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6873}
6874
6875impl fidl::endpoints::Proxy for ConnectorRouterDeprecatedProxy {
6876    type Protocol = ConnectorRouterDeprecatedMarker;
6877
6878    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6879        Self::new(inner)
6880    }
6881
6882    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6883        self.client.into_channel().map_err(|client| Self { client })
6884    }
6885
6886    fn as_channel(&self) -> &::fidl::AsyncChannel {
6887        self.client.as_channel()
6888    }
6889}
6890
6891impl ConnectorRouterDeprecatedProxy {
6892    /// Create a new Proxy for fuchsia.component.runtime/ConnectorRouterDeprecated.
6893    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6894        let protocol_name =
6895            <ConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6896        Self { client: fidl::client::Client::new(channel, protocol_name) }
6897    }
6898
6899    /// Get a Stream of events from the remote end of the protocol.
6900    ///
6901    /// # Panics
6902    ///
6903    /// Panics if the event stream was already taken.
6904    pub fn take_event_stream(&self) -> ConnectorRouterDeprecatedEventStream {
6905        ConnectorRouterDeprecatedEventStream { event_receiver: self.client.take_event_receiver() }
6906    }
6907
6908    pub fn r#clone(
6909        &self,
6910        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6911    ) -> Result<(), fidl::Error> {
6912        ConnectorRouterDeprecatedProxyInterface::r#clone(self, request)
6913    }
6914
6915    /// Attempts to produce a `Connector` capability from this
6916    /// `ConnectorRouter`. This will return:
6917    ///
6918    /// - A `Connector` if the operation is successful.
6919    /// - An empty value if there is no issue found but the capability is not
6920    ///   being provided (for example, an optional route ended in an offer from
6921    ///   void).
6922    /// - An error, if the operation failed.
6923    pub fn r#route(
6924        &self,
6925        mut request: RouteRequest,
6926        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
6927    ) -> fidl::client::QueryResponseFut<
6928        ConnectorRouterDeprecatedRouteResult,
6929        fidl::encoding::DefaultFuchsiaResourceDialect,
6930    > {
6931        ConnectorRouterDeprecatedProxyInterface::r#route(self, request, connector_server_end)
6932    }
6933}
6934
6935impl ConnectorRouterDeprecatedProxyInterface for ConnectorRouterDeprecatedProxy {
6936    fn r#clone(
6937        &self,
6938        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
6939    ) -> Result<(), fidl::Error> {
6940        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
6941            (request,),
6942            0x20d8a7aba2168a79,
6943            fidl::encoding::DynamicFlags::empty(),
6944        )
6945    }
6946
6947    type RouteResponseFut = fidl::client::QueryResponseFut<
6948        ConnectorRouterDeprecatedRouteResult,
6949        fidl::encoding::DefaultFuchsiaResourceDialect,
6950    >;
6951    fn r#route(
6952        &self,
6953        mut request: RouteRequest,
6954        mut connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
6955    ) -> Self::RouteResponseFut {
6956        fn _decode(
6957            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6958        ) -> Result<ConnectorRouterDeprecatedRouteResult, fidl::Error> {
6959            let _response = fidl::client::decode_transaction_body::<
6960                fidl::encoding::FlexibleResultType<
6961                    ConnectorRouterDeprecatedRouteResponse,
6962                    RouterError,
6963                >,
6964                fidl::encoding::DefaultFuchsiaResourceDialect,
6965                0x1b7810fe6a37ff32,
6966            >(_buf?)?
6967            .into_result::<ConnectorRouterDeprecatedMarker>("route")?;
6968            Ok(_response.map(|x| x.response))
6969        }
6970        self.client.send_query_and_decode::<
6971            ConnectorRouterDeprecatedRouteRequest,
6972            ConnectorRouterDeprecatedRouteResult,
6973        >(
6974            (&mut request, connector_server_end,),
6975            0x1b7810fe6a37ff32,
6976            fidl::encoding::DynamicFlags::FLEXIBLE,
6977            _decode,
6978        )
6979    }
6980}
6981
6982pub struct ConnectorRouterDeprecatedEventStream {
6983    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6984}
6985
6986impl std::marker::Unpin for ConnectorRouterDeprecatedEventStream {}
6987
6988impl futures::stream::FusedStream for ConnectorRouterDeprecatedEventStream {
6989    fn is_terminated(&self) -> bool {
6990        self.event_receiver.is_terminated()
6991    }
6992}
6993
6994impl futures::Stream for ConnectorRouterDeprecatedEventStream {
6995    type Item = Result<ConnectorRouterDeprecatedEvent, fidl::Error>;
6996
6997    fn poll_next(
6998        mut self: std::pin::Pin<&mut Self>,
6999        cx: &mut std::task::Context<'_>,
7000    ) -> std::task::Poll<Option<Self::Item>> {
7001        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7002            &mut self.event_receiver,
7003            cx
7004        )?) {
7005            Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterDeprecatedEvent::decode(buf))),
7006            None => std::task::Poll::Ready(None),
7007        }
7008    }
7009}
7010
7011#[derive(Debug)]
7012pub enum ConnectorRouterDeprecatedEvent {
7013    #[non_exhaustive]
7014    _UnknownEvent {
7015        /// Ordinal of the event that was sent.
7016        ordinal: u64,
7017    },
7018}
7019
7020impl ConnectorRouterDeprecatedEvent {
7021    /// Decodes a message buffer as a [`ConnectorRouterDeprecatedEvent`].
7022    fn decode(
7023        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7024    ) -> Result<ConnectorRouterDeprecatedEvent, fidl::Error> {
7025        let (bytes, _handles) = buf.split_mut();
7026        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7027        debug_assert_eq!(tx_header.tx_id, 0);
7028        match tx_header.ordinal {
7029            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7030                Ok(ConnectorRouterDeprecatedEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7031            }
7032            _ => Err(fidl::Error::UnknownOrdinal {
7033                ordinal: tx_header.ordinal,
7034                protocol_name:
7035                    <ConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7036            }),
7037        }
7038    }
7039}
7040
7041/// A Stream of incoming requests for fuchsia.component.runtime/ConnectorRouterDeprecated.
7042pub struct ConnectorRouterDeprecatedRequestStream {
7043    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7044    is_terminated: bool,
7045}
7046
7047impl std::marker::Unpin for ConnectorRouterDeprecatedRequestStream {}
7048
7049impl futures::stream::FusedStream for ConnectorRouterDeprecatedRequestStream {
7050    fn is_terminated(&self) -> bool {
7051        self.is_terminated
7052    }
7053}
7054
7055impl fidl::endpoints::RequestStream for ConnectorRouterDeprecatedRequestStream {
7056    type Protocol = ConnectorRouterDeprecatedMarker;
7057    type ControlHandle = ConnectorRouterDeprecatedControlHandle;
7058
7059    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7060        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7061    }
7062
7063    fn control_handle(&self) -> Self::ControlHandle {
7064        ConnectorRouterDeprecatedControlHandle { inner: self.inner.clone() }
7065    }
7066
7067    fn into_inner(
7068        self,
7069    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7070    {
7071        (self.inner, self.is_terminated)
7072    }
7073
7074    fn from_inner(
7075        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7076        is_terminated: bool,
7077    ) -> Self {
7078        Self { inner, is_terminated }
7079    }
7080}
7081
7082impl futures::Stream for ConnectorRouterDeprecatedRequestStream {
7083    type Item = Result<ConnectorRouterDeprecatedRequest, fidl::Error>;
7084
7085    fn poll_next(
7086        mut self: std::pin::Pin<&mut Self>,
7087        cx: &mut std::task::Context<'_>,
7088    ) -> std::task::Poll<Option<Self::Item>> {
7089        let this = &mut *self;
7090        if this.inner.check_shutdown(cx) {
7091            this.is_terminated = true;
7092            return std::task::Poll::Ready(None);
7093        }
7094        if this.is_terminated {
7095            panic!("polled ConnectorRouterDeprecatedRequestStream after completion");
7096        }
7097        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7098            |bytes, handles| {
7099                match this.inner.channel().read_etc(cx, bytes, handles) {
7100                    std::task::Poll::Ready(Ok(())) => {}
7101                    std::task::Poll::Pending => return std::task::Poll::Pending,
7102                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7103                        this.is_terminated = true;
7104                        return std::task::Poll::Ready(None);
7105                    }
7106                    std::task::Poll::Ready(Err(e)) => {
7107                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7108                            e.into(),
7109                        ))));
7110                    }
7111                }
7112
7113                // A message has been received from the channel
7114                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7115
7116                std::task::Poll::Ready(Some(match header.ordinal {
7117                0x20d8a7aba2168a79 => {
7118                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7119                    let mut req = fidl::new_empty!(fidl_fuchsia_unknown::CloneableCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7120                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
7121                    let control_handle = ConnectorRouterDeprecatedControlHandle {
7122                        inner: this.inner.clone(),
7123                    };
7124                    Ok(ConnectorRouterDeprecatedRequest::Clone {request: req.request,
7125
7126                        control_handle,
7127                    })
7128                }
7129                0x1b7810fe6a37ff32 => {
7130                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7131                    let mut req = fidl::new_empty!(ConnectorRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
7132                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorRouterDeprecatedRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7133                    let control_handle = ConnectorRouterDeprecatedControlHandle {
7134                        inner: this.inner.clone(),
7135                    };
7136                    Ok(ConnectorRouterDeprecatedRequest::Route {request: req.request,
7137connector_server_end: req.connector_server_end,
7138
7139                        responder: ConnectorRouterDeprecatedRouteResponder {
7140                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7141                            tx_id: header.tx_id,
7142                        },
7143                    })
7144                }
7145                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7146                    Ok(ConnectorRouterDeprecatedRequest::_UnknownMethod {
7147                        ordinal: header.ordinal,
7148                        control_handle: ConnectorRouterDeprecatedControlHandle { inner: this.inner.clone() },
7149                        method_type: fidl::MethodType::OneWay,
7150                    })
7151                }
7152                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7153                    this.inner.send_framework_err(
7154                        fidl::encoding::FrameworkErr::UnknownMethod,
7155                        header.tx_id,
7156                        header.ordinal,
7157                        header.dynamic_flags(),
7158                        (bytes, handles),
7159                    )?;
7160                    Ok(ConnectorRouterDeprecatedRequest::_UnknownMethod {
7161                        ordinal: header.ordinal,
7162                        control_handle: ConnectorRouterDeprecatedControlHandle { inner: this.inner.clone() },
7163                        method_type: fidl::MethodType::TwoWay,
7164                    })
7165                }
7166                _ => Err(fidl::Error::UnknownOrdinal {
7167                    ordinal: header.ordinal,
7168                    protocol_name: <ConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7169                }),
7170            }))
7171            },
7172        )
7173    }
7174}
7175
7176/// A factory for `Connector` capabilities.
7177#[derive(Debug)]
7178pub enum ConnectorRouterDeprecatedRequest {
7179    Clone {
7180        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7181        control_handle: ConnectorRouterDeprecatedControlHandle,
7182    },
7183    /// Attempts to produce a `Connector` capability from this
7184    /// `ConnectorRouter`. This will return:
7185    ///
7186    /// - A `Connector` if the operation is successful.
7187    /// - An empty value if there is no issue found but the capability is not
7188    ///   being provided (for example, an optional route ended in an offer from
7189    ///   void).
7190    /// - An error, if the operation failed.
7191    Route {
7192        request: RouteRequest,
7193        connector_server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
7194        responder: ConnectorRouterDeprecatedRouteResponder,
7195    },
7196    /// An interaction was received which does not match any known method.
7197    #[non_exhaustive]
7198    _UnknownMethod {
7199        /// Ordinal of the method that was called.
7200        ordinal: u64,
7201        control_handle: ConnectorRouterDeprecatedControlHandle,
7202        method_type: fidl::MethodType,
7203    },
7204}
7205
7206impl ConnectorRouterDeprecatedRequest {
7207    #[allow(irrefutable_let_patterns)]
7208    pub fn into_clone(
7209        self,
7210    ) -> Option<(
7211        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7212        ConnectorRouterDeprecatedControlHandle,
7213    )> {
7214        if let ConnectorRouterDeprecatedRequest::Clone { request, control_handle } = self {
7215            Some((request, control_handle))
7216        } else {
7217            None
7218        }
7219    }
7220
7221    #[allow(irrefutable_let_patterns)]
7222    pub fn into_route(
7223        self,
7224    ) -> Option<(
7225        RouteRequest,
7226        fidl::endpoints::ServerEnd<ConnectorMarker>,
7227        ConnectorRouterDeprecatedRouteResponder,
7228    )> {
7229        if let ConnectorRouterDeprecatedRequest::Route {
7230            request,
7231            connector_server_end,
7232            responder,
7233        } = self
7234        {
7235            Some((request, connector_server_end, responder))
7236        } else {
7237            None
7238        }
7239    }
7240
7241    /// Name of the method defined in FIDL
7242    pub fn method_name(&self) -> &'static str {
7243        match *self {
7244            ConnectorRouterDeprecatedRequest::Clone { .. } => "clone",
7245            ConnectorRouterDeprecatedRequest::Route { .. } => "route",
7246            ConnectorRouterDeprecatedRequest::_UnknownMethod {
7247                method_type: fidl::MethodType::OneWay,
7248                ..
7249            } => "unknown one-way method",
7250            ConnectorRouterDeprecatedRequest::_UnknownMethod {
7251                method_type: fidl::MethodType::TwoWay,
7252                ..
7253            } => "unknown two-way method",
7254        }
7255    }
7256}
7257
7258#[derive(Debug, Clone)]
7259pub struct ConnectorRouterDeprecatedControlHandle {
7260    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7261}
7262
7263impl fidl::endpoints::ControlHandle for ConnectorRouterDeprecatedControlHandle {
7264    fn shutdown(&self) {
7265        self.inner.shutdown()
7266    }
7267    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7268        self.inner.shutdown_with_epitaph(status)
7269    }
7270
7271    fn is_closed(&self) -> bool {
7272        self.inner.channel().is_closed()
7273    }
7274    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7275        self.inner.channel().on_closed()
7276    }
7277
7278    #[cfg(target_os = "fuchsia")]
7279    fn signal_peer(
7280        &self,
7281        clear_mask: zx::Signals,
7282        set_mask: zx::Signals,
7283    ) -> Result<(), zx_status::Status> {
7284        use fidl::Peered;
7285        self.inner.channel().signal_peer(clear_mask, set_mask)
7286    }
7287}
7288
7289impl ConnectorRouterDeprecatedControlHandle {}
7290
7291#[must_use = "FIDL methods require a response to be sent"]
7292#[derive(Debug)]
7293pub struct ConnectorRouterDeprecatedRouteResponder {
7294    control_handle: std::mem::ManuallyDrop<ConnectorRouterDeprecatedControlHandle>,
7295    tx_id: u32,
7296}
7297
7298/// Set the the channel to be shutdown (see [`ConnectorRouterDeprecatedControlHandle::shutdown`])
7299/// if the responder is dropped without sending a response, so that the client
7300/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7301impl std::ops::Drop for ConnectorRouterDeprecatedRouteResponder {
7302    fn drop(&mut self) {
7303        self.control_handle.shutdown();
7304        // Safety: drops once, never accessed again
7305        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7306    }
7307}
7308
7309impl fidl::endpoints::Responder for ConnectorRouterDeprecatedRouteResponder {
7310    type ControlHandle = ConnectorRouterDeprecatedControlHandle;
7311
7312    fn control_handle(&self) -> &ConnectorRouterDeprecatedControlHandle {
7313        &self.control_handle
7314    }
7315
7316    fn drop_without_shutdown(mut self) {
7317        // Safety: drops once, never accessed again due to mem::forget
7318        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7319        // Prevent Drop from running (which would shut down the channel)
7320        std::mem::forget(self);
7321    }
7322}
7323
7324impl ConnectorRouterDeprecatedRouteResponder {
7325    /// Sends a response to the FIDL transaction.
7326    ///
7327    /// Sets the channel to shutdown if an error occurs.
7328    pub fn send(self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
7329        let _result = self.send_raw(result);
7330        if _result.is_err() {
7331            self.control_handle.shutdown();
7332        }
7333        self.drop_without_shutdown();
7334        _result
7335    }
7336
7337    /// Similar to "send" but does not shutdown the channel if an error occurs.
7338    pub fn send_no_shutdown_on_err(
7339        self,
7340        mut result: Result<RouterResponse, RouterError>,
7341    ) -> Result<(), fidl::Error> {
7342        let _result = self.send_raw(result);
7343        self.drop_without_shutdown();
7344        _result
7345    }
7346
7347    fn send_raw(&self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
7348        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7349            ConnectorRouterDeprecatedRouteResponse,
7350            RouterError,
7351        >>(
7352            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
7353            self.tx_id,
7354            0x1b7810fe6a37ff32,
7355            fidl::encoding::DynamicFlags::FLEXIBLE,
7356        )
7357    }
7358}
7359
7360#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7361pub struct DataRouterMarker;
7362
7363impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
7364    type Proxy = DataRouterProxy;
7365    type RequestStream = DataRouterRequestStream;
7366    #[cfg(target_os = "fuchsia")]
7367    type SynchronousProxy = DataRouterSynchronousProxy;
7368
7369    const DEBUG_NAME: &'static str = "(anonymous) DataRouter";
7370}
7371pub type DataRouterRouteResult = Result<Option<Box<Data>>, RouterError>;
7372
7373pub trait DataRouterProxyInterface: Send + Sync {
7374    type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
7375        + Send;
7376    fn r#route(&self, request: RouteRequest) -> Self::RouteResponseFut;
7377}
7378#[derive(Debug)]
7379#[cfg(target_os = "fuchsia")]
7380pub struct DataRouterSynchronousProxy {
7381    client: fidl::client::sync::Client,
7382}
7383
7384#[cfg(target_os = "fuchsia")]
7385impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
7386    type Proxy = DataRouterProxy;
7387    type Protocol = DataRouterMarker;
7388
7389    fn from_channel(inner: fidl::Channel) -> Self {
7390        Self::new(inner)
7391    }
7392
7393    fn into_channel(self) -> fidl::Channel {
7394        self.client.into_channel()
7395    }
7396
7397    fn as_channel(&self) -> &fidl::Channel {
7398        self.client.as_channel()
7399    }
7400}
7401
7402#[cfg(target_os = "fuchsia")]
7403impl DataRouterSynchronousProxy {
7404    pub fn new(channel: fidl::Channel) -> Self {
7405        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7406        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7407    }
7408
7409    pub fn into_channel(self) -> fidl::Channel {
7410        self.client.into_channel()
7411    }
7412
7413    /// Waits until an event arrives and returns it. It is safe for other
7414    /// threads to make concurrent requests while waiting for an event.
7415    pub fn wait_for_event(
7416        &self,
7417        deadline: zx::MonotonicInstant,
7418    ) -> Result<DataRouterEvent, fidl::Error> {
7419        DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
7420    }
7421
7422    /// Attempts to produce a `Data` capability from this
7423    /// `DataRouter`. This will return:
7424    ///
7425    /// - A `Data` value if the operation is successful.
7426    /// - An empty value if there is no issue found but the capability is not
7427    ///   being provided (for example, an optional route ended in an offer from
7428    ///   void).
7429    /// - An error, if the operation failed.
7430    pub fn r#route(
7431        &self,
7432        mut request: RouteRequest,
7433        ___deadline: zx::MonotonicInstant,
7434    ) -> Result<DataRouterRouteResult, fidl::Error> {
7435        let _response = self.client.send_query::<
7436            DataRouterRouteRequest,
7437            fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
7438        >(
7439            (&mut request,),
7440            0x646885ba7e10ceeb,
7441            fidl::encoding::DynamicFlags::FLEXIBLE,
7442            ___deadline,
7443        )?
7444        .into_result::<DataRouterMarker>("route")?;
7445        Ok(_response.map(|x| x.data))
7446    }
7447}
7448
7449#[cfg(target_os = "fuchsia")]
7450impl From<DataRouterSynchronousProxy> for zx::Handle {
7451    fn from(value: DataRouterSynchronousProxy) -> Self {
7452        value.into_channel().into()
7453    }
7454}
7455
7456#[cfg(target_os = "fuchsia")]
7457impl From<fidl::Channel> for DataRouterSynchronousProxy {
7458    fn from(value: fidl::Channel) -> Self {
7459        Self::new(value)
7460    }
7461}
7462
7463#[cfg(target_os = "fuchsia")]
7464impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
7465    type Protocol = DataRouterMarker;
7466
7467    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
7468        Self::new(value.into_channel())
7469    }
7470}
7471
7472#[derive(Debug, Clone)]
7473pub struct DataRouterProxy {
7474    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7475}
7476
7477impl fidl::endpoints::Proxy for DataRouterProxy {
7478    type Protocol = DataRouterMarker;
7479
7480    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7481        Self::new(inner)
7482    }
7483
7484    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7485        self.client.into_channel().map_err(|client| Self { client })
7486    }
7487
7488    fn as_channel(&self) -> &::fidl::AsyncChannel {
7489        self.client.as_channel()
7490    }
7491}
7492
7493impl DataRouterProxy {
7494    /// Create a new Proxy for fuchsia.component.runtime/DataRouter.
7495    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7496        let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7497        Self { client: fidl::client::Client::new(channel, protocol_name) }
7498    }
7499
7500    /// Get a Stream of events from the remote end of the protocol.
7501    ///
7502    /// # Panics
7503    ///
7504    /// Panics if the event stream was already taken.
7505    pub fn take_event_stream(&self) -> DataRouterEventStream {
7506        DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
7507    }
7508
7509    /// Attempts to produce a `Data` capability from this
7510    /// `DataRouter`. This will return:
7511    ///
7512    /// - A `Data` value if the operation is successful.
7513    /// - An empty value if there is no issue found but the capability is not
7514    ///   being provided (for example, an optional route ended in an offer from
7515    ///   void).
7516    /// - An error, if the operation failed.
7517    pub fn r#route(
7518        &self,
7519        mut request: RouteRequest,
7520    ) -> fidl::client::QueryResponseFut<
7521        DataRouterRouteResult,
7522        fidl::encoding::DefaultFuchsiaResourceDialect,
7523    > {
7524        DataRouterProxyInterface::r#route(self, request)
7525    }
7526}
7527
7528impl DataRouterProxyInterface for DataRouterProxy {
7529    type RouteResponseFut = fidl::client::QueryResponseFut<
7530        DataRouterRouteResult,
7531        fidl::encoding::DefaultFuchsiaResourceDialect,
7532    >;
7533    fn r#route(&self, mut request: RouteRequest) -> Self::RouteResponseFut {
7534        fn _decode(
7535            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7536        ) -> Result<DataRouterRouteResult, fidl::Error> {
7537            let _response = fidl::client::decode_transaction_body::<
7538                fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
7539                fidl::encoding::DefaultFuchsiaResourceDialect,
7540                0x646885ba7e10ceeb,
7541            >(_buf?)?
7542            .into_result::<DataRouterMarker>("route")?;
7543            Ok(_response.map(|x| x.data))
7544        }
7545        self.client.send_query_and_decode::<DataRouterRouteRequest, DataRouterRouteResult>(
7546            (&mut request,),
7547            0x646885ba7e10ceeb,
7548            fidl::encoding::DynamicFlags::FLEXIBLE,
7549            _decode,
7550        )
7551    }
7552}
7553
7554pub struct DataRouterEventStream {
7555    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7556}
7557
7558impl std::marker::Unpin for DataRouterEventStream {}
7559
7560impl futures::stream::FusedStream for DataRouterEventStream {
7561    fn is_terminated(&self) -> bool {
7562        self.event_receiver.is_terminated()
7563    }
7564}
7565
7566impl futures::Stream for DataRouterEventStream {
7567    type Item = Result<DataRouterEvent, fidl::Error>;
7568
7569    fn poll_next(
7570        mut self: std::pin::Pin<&mut Self>,
7571        cx: &mut std::task::Context<'_>,
7572    ) -> std::task::Poll<Option<Self::Item>> {
7573        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7574            &mut self.event_receiver,
7575            cx
7576        )?) {
7577            Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
7578            None => std::task::Poll::Ready(None),
7579        }
7580    }
7581}
7582
7583#[derive(Debug)]
7584pub enum DataRouterEvent {
7585    #[non_exhaustive]
7586    _UnknownEvent {
7587        /// Ordinal of the event that was sent.
7588        ordinal: u64,
7589    },
7590}
7591
7592impl DataRouterEvent {
7593    /// Decodes a message buffer as a [`DataRouterEvent`].
7594    fn decode(
7595        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7596    ) -> Result<DataRouterEvent, fidl::Error> {
7597        let (bytes, _handles) = buf.split_mut();
7598        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7599        debug_assert_eq!(tx_header.tx_id, 0);
7600        match tx_header.ordinal {
7601            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7602                Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7603            }
7604            _ => Err(fidl::Error::UnknownOrdinal {
7605                ordinal: tx_header.ordinal,
7606                protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7607            }),
7608        }
7609    }
7610}
7611
7612/// A Stream of incoming requests for fuchsia.component.runtime/DataRouter.
7613pub struct DataRouterRequestStream {
7614    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7615    is_terminated: bool,
7616}
7617
7618impl std::marker::Unpin for DataRouterRequestStream {}
7619
7620impl futures::stream::FusedStream for DataRouterRequestStream {
7621    fn is_terminated(&self) -> bool {
7622        self.is_terminated
7623    }
7624}
7625
7626impl fidl::endpoints::RequestStream for DataRouterRequestStream {
7627    type Protocol = DataRouterMarker;
7628    type ControlHandle = DataRouterControlHandle;
7629
7630    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7631        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7632    }
7633
7634    fn control_handle(&self) -> Self::ControlHandle {
7635        DataRouterControlHandle { inner: self.inner.clone() }
7636    }
7637
7638    fn into_inner(
7639        self,
7640    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7641    {
7642        (self.inner, self.is_terminated)
7643    }
7644
7645    fn from_inner(
7646        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7647        is_terminated: bool,
7648    ) -> Self {
7649        Self { inner, is_terminated }
7650    }
7651}
7652
7653impl futures::Stream for DataRouterRequestStream {
7654    type Item = Result<DataRouterRequest, fidl::Error>;
7655
7656    fn poll_next(
7657        mut self: std::pin::Pin<&mut Self>,
7658        cx: &mut std::task::Context<'_>,
7659    ) -> std::task::Poll<Option<Self::Item>> {
7660        let this = &mut *self;
7661        if this.inner.check_shutdown(cx) {
7662            this.is_terminated = true;
7663            return std::task::Poll::Ready(None);
7664        }
7665        if this.is_terminated {
7666            panic!("polled DataRouterRequestStream after completion");
7667        }
7668        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7669            |bytes, handles| {
7670                match this.inner.channel().read_etc(cx, bytes, handles) {
7671                    std::task::Poll::Ready(Ok(())) => {}
7672                    std::task::Poll::Pending => return std::task::Poll::Pending,
7673                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7674                        this.is_terminated = true;
7675                        return std::task::Poll::Ready(None);
7676                    }
7677                    std::task::Poll::Ready(Err(e)) => {
7678                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7679                            e.into(),
7680                        ))));
7681                    }
7682                }
7683
7684                // A message has been received from the channel
7685                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7686
7687                std::task::Poll::Ready(Some(match header.ordinal {
7688                    0x646885ba7e10ceeb => {
7689                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7690                        let mut req = fidl::new_empty!(
7691                            DataRouterRouteRequest,
7692                            fidl::encoding::DefaultFuchsiaResourceDialect
7693                        );
7694                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
7695                        let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
7696                        Ok(DataRouterRequest::Route {
7697                            request: req.request,
7698
7699                            responder: DataRouterRouteResponder {
7700                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7701                                tx_id: header.tx_id,
7702                            },
7703                        })
7704                    }
7705                    _ if header.tx_id == 0
7706                        && header
7707                            .dynamic_flags()
7708                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7709                    {
7710                        Ok(DataRouterRequest::_UnknownMethod {
7711                            ordinal: header.ordinal,
7712                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
7713                            method_type: fidl::MethodType::OneWay,
7714                        })
7715                    }
7716                    _ if header
7717                        .dynamic_flags()
7718                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7719                    {
7720                        this.inner.send_framework_err(
7721                            fidl::encoding::FrameworkErr::UnknownMethod,
7722                            header.tx_id,
7723                            header.ordinal,
7724                            header.dynamic_flags(),
7725                            (bytes, handles),
7726                        )?;
7727                        Ok(DataRouterRequest::_UnknownMethod {
7728                            ordinal: header.ordinal,
7729                            control_handle: DataRouterControlHandle { inner: this.inner.clone() },
7730                            method_type: fidl::MethodType::TwoWay,
7731                        })
7732                    }
7733                    _ => Err(fidl::Error::UnknownOrdinal {
7734                        ordinal: header.ordinal,
7735                        protocol_name:
7736                            <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7737                    }),
7738                }))
7739            },
7740        )
7741    }
7742}
7743
7744/// A factory for `Data` capabilities.
7745#[derive(Debug)]
7746pub enum DataRouterRequest {
7747    /// Attempts to produce a `Data` capability from this
7748    /// `DataRouter`. This will return:
7749    ///
7750    /// - A `Data` value if the operation is successful.
7751    /// - An empty value if there is no issue found but the capability is not
7752    ///   being provided (for example, an optional route ended in an offer from
7753    ///   void).
7754    /// - An error, if the operation failed.
7755    Route { request: RouteRequest, responder: DataRouterRouteResponder },
7756    /// An interaction was received which does not match any known method.
7757    #[non_exhaustive]
7758    _UnknownMethod {
7759        /// Ordinal of the method that was called.
7760        ordinal: u64,
7761        control_handle: DataRouterControlHandle,
7762        method_type: fidl::MethodType,
7763    },
7764}
7765
7766impl DataRouterRequest {
7767    #[allow(irrefutable_let_patterns)]
7768    pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
7769        if let DataRouterRequest::Route { request, responder } = self {
7770            Some((request, responder))
7771        } else {
7772            None
7773        }
7774    }
7775
7776    /// Name of the method defined in FIDL
7777    pub fn method_name(&self) -> &'static str {
7778        match *self {
7779            DataRouterRequest::Route { .. } => "route",
7780            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7781                "unknown one-way method"
7782            }
7783            DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7784                "unknown two-way method"
7785            }
7786        }
7787    }
7788}
7789
7790#[derive(Debug, Clone)]
7791pub struct DataRouterControlHandle {
7792    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7793}
7794
7795impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
7796    fn shutdown(&self) {
7797        self.inner.shutdown()
7798    }
7799    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7800        self.inner.shutdown_with_epitaph(status)
7801    }
7802
7803    fn is_closed(&self) -> bool {
7804        self.inner.channel().is_closed()
7805    }
7806    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7807        self.inner.channel().on_closed()
7808    }
7809
7810    #[cfg(target_os = "fuchsia")]
7811    fn signal_peer(
7812        &self,
7813        clear_mask: zx::Signals,
7814        set_mask: zx::Signals,
7815    ) -> Result<(), zx_status::Status> {
7816        use fidl::Peered;
7817        self.inner.channel().signal_peer(clear_mask, set_mask)
7818    }
7819}
7820
7821impl DataRouterControlHandle {}
7822
7823#[must_use = "FIDL methods require a response to be sent"]
7824#[derive(Debug)]
7825pub struct DataRouterRouteResponder {
7826    control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
7827    tx_id: u32,
7828}
7829
7830/// Set the the channel to be shutdown (see [`DataRouterControlHandle::shutdown`])
7831/// if the responder is dropped without sending a response, so that the client
7832/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7833impl std::ops::Drop for DataRouterRouteResponder {
7834    fn drop(&mut self) {
7835        self.control_handle.shutdown();
7836        // Safety: drops once, never accessed again
7837        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7838    }
7839}
7840
7841impl fidl::endpoints::Responder for DataRouterRouteResponder {
7842    type ControlHandle = DataRouterControlHandle;
7843
7844    fn control_handle(&self) -> &DataRouterControlHandle {
7845        &self.control_handle
7846    }
7847
7848    fn drop_without_shutdown(mut self) {
7849        // Safety: drops once, never accessed again due to mem::forget
7850        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7851        // Prevent Drop from running (which would shut down the channel)
7852        std::mem::forget(self);
7853    }
7854}
7855
7856impl DataRouterRouteResponder {
7857    /// Sends a response to the FIDL transaction.
7858    ///
7859    /// Sets the channel to shutdown if an error occurs.
7860    pub fn send(self, mut result: Result<Option<&Data>, RouterError>) -> Result<(), fidl::Error> {
7861        let _result = self.send_raw(result);
7862        if _result.is_err() {
7863            self.control_handle.shutdown();
7864        }
7865        self.drop_without_shutdown();
7866        _result
7867    }
7868
7869    /// Similar to "send" but does not shutdown the channel if an error occurs.
7870    pub fn send_no_shutdown_on_err(
7871        self,
7872        mut result: Result<Option<&Data>, RouterError>,
7873    ) -> Result<(), fidl::Error> {
7874        let _result = self.send_raw(result);
7875        self.drop_without_shutdown();
7876        _result
7877    }
7878
7879    fn send_raw(&self, mut result: Result<Option<&Data>, RouterError>) -> Result<(), fidl::Error> {
7880        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7881            DataRouterRouteResponse,
7882            RouterError,
7883        >>(
7884            fidl::encoding::FlexibleResult::new(result.map(|data| (data,))),
7885            self.tx_id,
7886            0x646885ba7e10ceeb,
7887            fidl::encoding::DynamicFlags::FLEXIBLE,
7888        )
7889    }
7890}
7891
7892#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7893pub struct DataRouterDeprecatedMarker;
7894
7895impl fidl::endpoints::ProtocolMarker for DataRouterDeprecatedMarker {
7896    type Proxy = DataRouterDeprecatedProxy;
7897    type RequestStream = DataRouterDeprecatedRequestStream;
7898    #[cfg(target_os = "fuchsia")]
7899    type SynchronousProxy = DataRouterDeprecatedSynchronousProxy;
7900
7901    const DEBUG_NAME: &'static str = "(anonymous) DataRouterDeprecated";
7902}
7903pub type DataRouterDeprecatedRouteResult = Result<(RouterResponse, Option<Box<Data>>), RouterError>;
7904
7905pub trait DataRouterDeprecatedProxyInterface: Send + Sync {
7906    fn r#clone(
7907        &self,
7908        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7909    ) -> Result<(), fidl::Error>;
7910    type RouteResponseFut: std::future::Future<Output = Result<DataRouterDeprecatedRouteResult, fidl::Error>>
7911        + Send;
7912    fn r#route(&self, request: RouteRequest) -> Self::RouteResponseFut;
7913}
7914#[derive(Debug)]
7915#[cfg(target_os = "fuchsia")]
7916pub struct DataRouterDeprecatedSynchronousProxy {
7917    client: fidl::client::sync::Client,
7918}
7919
7920#[cfg(target_os = "fuchsia")]
7921impl fidl::endpoints::SynchronousProxy for DataRouterDeprecatedSynchronousProxy {
7922    type Proxy = DataRouterDeprecatedProxy;
7923    type Protocol = DataRouterDeprecatedMarker;
7924
7925    fn from_channel(inner: fidl::Channel) -> Self {
7926        Self::new(inner)
7927    }
7928
7929    fn into_channel(self) -> fidl::Channel {
7930        self.client.into_channel()
7931    }
7932
7933    fn as_channel(&self) -> &fidl::Channel {
7934        self.client.as_channel()
7935    }
7936}
7937
7938#[cfg(target_os = "fuchsia")]
7939impl DataRouterDeprecatedSynchronousProxy {
7940    pub fn new(channel: fidl::Channel) -> Self {
7941        let protocol_name =
7942            <DataRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7943        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7944    }
7945
7946    pub fn into_channel(self) -> fidl::Channel {
7947        self.client.into_channel()
7948    }
7949
7950    /// Waits until an event arrives and returns it. It is safe for other
7951    /// threads to make concurrent requests while waiting for an event.
7952    pub fn wait_for_event(
7953        &self,
7954        deadline: zx::MonotonicInstant,
7955    ) -> Result<DataRouterDeprecatedEvent, fidl::Error> {
7956        DataRouterDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
7957    }
7958
7959    pub fn r#clone(
7960        &self,
7961        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
7962    ) -> Result<(), fidl::Error> {
7963        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
7964            (request,),
7965            0x20d8a7aba2168a79,
7966            fidl::encoding::DynamicFlags::empty(),
7967        )
7968    }
7969
7970    /// Attempts to produce a `Data` capability from this
7971    /// `DataRouter`. This will return:
7972    ///
7973    /// - A `Data` value if the operation is successful.
7974    /// - An empty value if there is no issue found but the capability is not
7975    ///   being provided (for example, an optional route ended in an offer from
7976    ///   void).
7977    /// - An error, if the operation failed.
7978    pub fn r#route(
7979        &self,
7980        mut request: RouteRequest,
7981        ___deadline: zx::MonotonicInstant,
7982    ) -> Result<DataRouterDeprecatedRouteResult, fidl::Error> {
7983        let _response = self.client.send_query::<
7984            DataRouterDeprecatedRouteRequest,
7985            fidl::encoding::FlexibleResultType<DataRouterDeprecatedRouteResponse, RouterError>,
7986        >(
7987            (&mut request,),
7988            0x9a0b381e65e9ed3,
7989            fidl::encoding::DynamicFlags::FLEXIBLE,
7990            ___deadline,
7991        )?
7992        .into_result::<DataRouterDeprecatedMarker>("route")?;
7993        Ok(_response.map(|x| (x.response, x.data)))
7994    }
7995}
7996
7997#[cfg(target_os = "fuchsia")]
7998impl From<DataRouterDeprecatedSynchronousProxy> for zx::Handle {
7999    fn from(value: DataRouterDeprecatedSynchronousProxy) -> Self {
8000        value.into_channel().into()
8001    }
8002}
8003
8004#[cfg(target_os = "fuchsia")]
8005impl From<fidl::Channel> for DataRouterDeprecatedSynchronousProxy {
8006    fn from(value: fidl::Channel) -> Self {
8007        Self::new(value)
8008    }
8009}
8010
8011#[cfg(target_os = "fuchsia")]
8012impl fidl::endpoints::FromClient for DataRouterDeprecatedSynchronousProxy {
8013    type Protocol = DataRouterDeprecatedMarker;
8014
8015    fn from_client(value: fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>) -> Self {
8016        Self::new(value.into_channel())
8017    }
8018}
8019
8020#[derive(Debug, Clone)]
8021pub struct DataRouterDeprecatedProxy {
8022    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8023}
8024
8025impl fidl::endpoints::Proxy for DataRouterDeprecatedProxy {
8026    type Protocol = DataRouterDeprecatedMarker;
8027
8028    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8029        Self::new(inner)
8030    }
8031
8032    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8033        self.client.into_channel().map_err(|client| Self { client })
8034    }
8035
8036    fn as_channel(&self) -> &::fidl::AsyncChannel {
8037        self.client.as_channel()
8038    }
8039}
8040
8041impl DataRouterDeprecatedProxy {
8042    /// Create a new Proxy for fuchsia.component.runtime/DataRouterDeprecated.
8043    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8044        let protocol_name =
8045            <DataRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8046        Self { client: fidl::client::Client::new(channel, protocol_name) }
8047    }
8048
8049    /// Get a Stream of events from the remote end of the protocol.
8050    ///
8051    /// # Panics
8052    ///
8053    /// Panics if the event stream was already taken.
8054    pub fn take_event_stream(&self) -> DataRouterDeprecatedEventStream {
8055        DataRouterDeprecatedEventStream { event_receiver: self.client.take_event_receiver() }
8056    }
8057
8058    pub fn r#clone(
8059        &self,
8060        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8061    ) -> Result<(), fidl::Error> {
8062        DataRouterDeprecatedProxyInterface::r#clone(self, request)
8063    }
8064
8065    /// Attempts to produce a `Data` capability from this
8066    /// `DataRouter`. This will return:
8067    ///
8068    /// - A `Data` value if the operation is successful.
8069    /// - An empty value if there is no issue found but the capability is not
8070    ///   being provided (for example, an optional route ended in an offer from
8071    ///   void).
8072    /// - An error, if the operation failed.
8073    pub fn r#route(
8074        &self,
8075        mut request: RouteRequest,
8076    ) -> fidl::client::QueryResponseFut<
8077        DataRouterDeprecatedRouteResult,
8078        fidl::encoding::DefaultFuchsiaResourceDialect,
8079    > {
8080        DataRouterDeprecatedProxyInterface::r#route(self, request)
8081    }
8082}
8083
8084impl DataRouterDeprecatedProxyInterface for DataRouterDeprecatedProxy {
8085    fn r#clone(
8086        &self,
8087        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8088    ) -> Result<(), fidl::Error> {
8089        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8090            (request,),
8091            0x20d8a7aba2168a79,
8092            fidl::encoding::DynamicFlags::empty(),
8093        )
8094    }
8095
8096    type RouteResponseFut = fidl::client::QueryResponseFut<
8097        DataRouterDeprecatedRouteResult,
8098        fidl::encoding::DefaultFuchsiaResourceDialect,
8099    >;
8100    fn r#route(&self, mut request: RouteRequest) -> Self::RouteResponseFut {
8101        fn _decode(
8102            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8103        ) -> Result<DataRouterDeprecatedRouteResult, fidl::Error> {
8104            let _response = fidl::client::decode_transaction_body::<
8105                fidl::encoding::FlexibleResultType<DataRouterDeprecatedRouteResponse, RouterError>,
8106                fidl::encoding::DefaultFuchsiaResourceDialect,
8107                0x9a0b381e65e9ed3,
8108            >(_buf?)?
8109            .into_result::<DataRouterDeprecatedMarker>("route")?;
8110            Ok(_response.map(|x| (x.response, x.data)))
8111        }
8112        self.client.send_query_and_decode::<
8113            DataRouterDeprecatedRouteRequest,
8114            DataRouterDeprecatedRouteResult,
8115        >(
8116            (&mut request,),
8117            0x9a0b381e65e9ed3,
8118            fidl::encoding::DynamicFlags::FLEXIBLE,
8119            _decode,
8120        )
8121    }
8122}
8123
8124pub struct DataRouterDeprecatedEventStream {
8125    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8126}
8127
8128impl std::marker::Unpin for DataRouterDeprecatedEventStream {}
8129
8130impl futures::stream::FusedStream for DataRouterDeprecatedEventStream {
8131    fn is_terminated(&self) -> bool {
8132        self.event_receiver.is_terminated()
8133    }
8134}
8135
8136impl futures::Stream for DataRouterDeprecatedEventStream {
8137    type Item = Result<DataRouterDeprecatedEvent, fidl::Error>;
8138
8139    fn poll_next(
8140        mut self: std::pin::Pin<&mut Self>,
8141        cx: &mut std::task::Context<'_>,
8142    ) -> std::task::Poll<Option<Self::Item>> {
8143        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8144            &mut self.event_receiver,
8145            cx
8146        )?) {
8147            Some(buf) => std::task::Poll::Ready(Some(DataRouterDeprecatedEvent::decode(buf))),
8148            None => std::task::Poll::Ready(None),
8149        }
8150    }
8151}
8152
8153#[derive(Debug)]
8154pub enum DataRouterDeprecatedEvent {
8155    #[non_exhaustive]
8156    _UnknownEvent {
8157        /// Ordinal of the event that was sent.
8158        ordinal: u64,
8159    },
8160}
8161
8162impl DataRouterDeprecatedEvent {
8163    /// Decodes a message buffer as a [`DataRouterDeprecatedEvent`].
8164    fn decode(
8165        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8166    ) -> Result<DataRouterDeprecatedEvent, fidl::Error> {
8167        let (bytes, _handles) = buf.split_mut();
8168        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8169        debug_assert_eq!(tx_header.tx_id, 0);
8170        match tx_header.ordinal {
8171            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8172                Ok(DataRouterDeprecatedEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8173            }
8174            _ => Err(fidl::Error::UnknownOrdinal {
8175                ordinal: tx_header.ordinal,
8176                protocol_name:
8177                    <DataRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8178            }),
8179        }
8180    }
8181}
8182
8183/// A Stream of incoming requests for fuchsia.component.runtime/DataRouterDeprecated.
8184pub struct DataRouterDeprecatedRequestStream {
8185    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8186    is_terminated: bool,
8187}
8188
8189impl std::marker::Unpin for DataRouterDeprecatedRequestStream {}
8190
8191impl futures::stream::FusedStream for DataRouterDeprecatedRequestStream {
8192    fn is_terminated(&self) -> bool {
8193        self.is_terminated
8194    }
8195}
8196
8197impl fidl::endpoints::RequestStream for DataRouterDeprecatedRequestStream {
8198    type Protocol = DataRouterDeprecatedMarker;
8199    type ControlHandle = DataRouterDeprecatedControlHandle;
8200
8201    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8202        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8203    }
8204
8205    fn control_handle(&self) -> Self::ControlHandle {
8206        DataRouterDeprecatedControlHandle { inner: self.inner.clone() }
8207    }
8208
8209    fn into_inner(
8210        self,
8211    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8212    {
8213        (self.inner, self.is_terminated)
8214    }
8215
8216    fn from_inner(
8217        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8218        is_terminated: bool,
8219    ) -> Self {
8220        Self { inner, is_terminated }
8221    }
8222}
8223
8224impl futures::Stream for DataRouterDeprecatedRequestStream {
8225    type Item = Result<DataRouterDeprecatedRequest, fidl::Error>;
8226
8227    fn poll_next(
8228        mut self: std::pin::Pin<&mut Self>,
8229        cx: &mut std::task::Context<'_>,
8230    ) -> std::task::Poll<Option<Self::Item>> {
8231        let this = &mut *self;
8232        if this.inner.check_shutdown(cx) {
8233            this.is_terminated = true;
8234            return std::task::Poll::Ready(None);
8235        }
8236        if this.is_terminated {
8237            panic!("polled DataRouterDeprecatedRequestStream after completion");
8238        }
8239        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8240            |bytes, handles| {
8241                match this.inner.channel().read_etc(cx, bytes, handles) {
8242                    std::task::Poll::Ready(Ok(())) => {}
8243                    std::task::Poll::Pending => return std::task::Poll::Pending,
8244                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8245                        this.is_terminated = true;
8246                        return std::task::Poll::Ready(None);
8247                    }
8248                    std::task::Poll::Ready(Err(e)) => {
8249                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8250                            e.into(),
8251                        ))));
8252                    }
8253                }
8254
8255                // A message has been received from the channel
8256                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8257
8258                std::task::Poll::Ready(Some(match header.ordinal {
8259                0x20d8a7aba2168a79 => {
8260                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8261                    let mut req = fidl::new_empty!(fidl_fuchsia_unknown::CloneableCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8262                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
8263                    let control_handle = DataRouterDeprecatedControlHandle {
8264                        inner: this.inner.clone(),
8265                    };
8266                    Ok(DataRouterDeprecatedRequest::Clone {request: req.request,
8267
8268                        control_handle,
8269                    })
8270                }
8271                0x9a0b381e65e9ed3 => {
8272                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8273                    let mut req = fidl::new_empty!(DataRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8274                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DataRouterDeprecatedRouteRequest>(&header, _body_bytes, handles, &mut req)?;
8275                    let control_handle = DataRouterDeprecatedControlHandle {
8276                        inner: this.inner.clone(),
8277                    };
8278                    Ok(DataRouterDeprecatedRequest::Route {request: req.request,
8279
8280                        responder: DataRouterDeprecatedRouteResponder {
8281                            control_handle: std::mem::ManuallyDrop::new(control_handle),
8282                            tx_id: header.tx_id,
8283                        },
8284                    })
8285                }
8286                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8287                    Ok(DataRouterDeprecatedRequest::_UnknownMethod {
8288                        ordinal: header.ordinal,
8289                        control_handle: DataRouterDeprecatedControlHandle { inner: this.inner.clone() },
8290                        method_type: fidl::MethodType::OneWay,
8291                    })
8292                }
8293                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8294                    this.inner.send_framework_err(
8295                        fidl::encoding::FrameworkErr::UnknownMethod,
8296                        header.tx_id,
8297                        header.ordinal,
8298                        header.dynamic_flags(),
8299                        (bytes, handles),
8300                    )?;
8301                    Ok(DataRouterDeprecatedRequest::_UnknownMethod {
8302                        ordinal: header.ordinal,
8303                        control_handle: DataRouterDeprecatedControlHandle { inner: this.inner.clone() },
8304                        method_type: fidl::MethodType::TwoWay,
8305                    })
8306                }
8307                _ => Err(fidl::Error::UnknownOrdinal {
8308                    ordinal: header.ordinal,
8309                    protocol_name: <DataRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8310                }),
8311            }))
8312            },
8313        )
8314    }
8315}
8316
8317/// A factory for `Data` capabilities.
8318#[derive(Debug)]
8319pub enum DataRouterDeprecatedRequest {
8320    Clone {
8321        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8322        control_handle: DataRouterDeprecatedControlHandle,
8323    },
8324    /// Attempts to produce a `Data` capability from this
8325    /// `DataRouter`. This will return:
8326    ///
8327    /// - A `Data` value if the operation is successful.
8328    /// - An empty value if there is no issue found but the capability is not
8329    ///   being provided (for example, an optional route ended in an offer from
8330    ///   void).
8331    /// - An error, if the operation failed.
8332    Route { request: RouteRequest, responder: DataRouterDeprecatedRouteResponder },
8333    /// An interaction was received which does not match any known method.
8334    #[non_exhaustive]
8335    _UnknownMethod {
8336        /// Ordinal of the method that was called.
8337        ordinal: u64,
8338        control_handle: DataRouterDeprecatedControlHandle,
8339        method_type: fidl::MethodType,
8340    },
8341}
8342
8343impl DataRouterDeprecatedRequest {
8344    #[allow(irrefutable_let_patterns)]
8345    pub fn into_clone(
8346        self,
8347    ) -> Option<(
8348        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8349        DataRouterDeprecatedControlHandle,
8350    )> {
8351        if let DataRouterDeprecatedRequest::Clone { request, control_handle } = self {
8352            Some((request, control_handle))
8353        } else {
8354            None
8355        }
8356    }
8357
8358    #[allow(irrefutable_let_patterns)]
8359    pub fn into_route(self) -> Option<(RouteRequest, DataRouterDeprecatedRouteResponder)> {
8360        if let DataRouterDeprecatedRequest::Route { request, responder } = self {
8361            Some((request, responder))
8362        } else {
8363            None
8364        }
8365    }
8366
8367    /// Name of the method defined in FIDL
8368    pub fn method_name(&self) -> &'static str {
8369        match *self {
8370            DataRouterDeprecatedRequest::Clone { .. } => "clone",
8371            DataRouterDeprecatedRequest::Route { .. } => "route",
8372            DataRouterDeprecatedRequest::_UnknownMethod {
8373                method_type: fidl::MethodType::OneWay,
8374                ..
8375            } => "unknown one-way method",
8376            DataRouterDeprecatedRequest::_UnknownMethod {
8377                method_type: fidl::MethodType::TwoWay,
8378                ..
8379            } => "unknown two-way method",
8380        }
8381    }
8382}
8383
8384#[derive(Debug, Clone)]
8385pub struct DataRouterDeprecatedControlHandle {
8386    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8387}
8388
8389impl fidl::endpoints::ControlHandle for DataRouterDeprecatedControlHandle {
8390    fn shutdown(&self) {
8391        self.inner.shutdown()
8392    }
8393    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8394        self.inner.shutdown_with_epitaph(status)
8395    }
8396
8397    fn is_closed(&self) -> bool {
8398        self.inner.channel().is_closed()
8399    }
8400    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8401        self.inner.channel().on_closed()
8402    }
8403
8404    #[cfg(target_os = "fuchsia")]
8405    fn signal_peer(
8406        &self,
8407        clear_mask: zx::Signals,
8408        set_mask: zx::Signals,
8409    ) -> Result<(), zx_status::Status> {
8410        use fidl::Peered;
8411        self.inner.channel().signal_peer(clear_mask, set_mask)
8412    }
8413}
8414
8415impl DataRouterDeprecatedControlHandle {}
8416
8417#[must_use = "FIDL methods require a response to be sent"]
8418#[derive(Debug)]
8419pub struct DataRouterDeprecatedRouteResponder {
8420    control_handle: std::mem::ManuallyDrop<DataRouterDeprecatedControlHandle>,
8421    tx_id: u32,
8422}
8423
8424/// Set the the channel to be shutdown (see [`DataRouterDeprecatedControlHandle::shutdown`])
8425/// if the responder is dropped without sending a response, so that the client
8426/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8427impl std::ops::Drop for DataRouterDeprecatedRouteResponder {
8428    fn drop(&mut self) {
8429        self.control_handle.shutdown();
8430        // Safety: drops once, never accessed again
8431        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8432    }
8433}
8434
8435impl fidl::endpoints::Responder for DataRouterDeprecatedRouteResponder {
8436    type ControlHandle = DataRouterDeprecatedControlHandle;
8437
8438    fn control_handle(&self) -> &DataRouterDeprecatedControlHandle {
8439        &self.control_handle
8440    }
8441
8442    fn drop_without_shutdown(mut self) {
8443        // Safety: drops once, never accessed again due to mem::forget
8444        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8445        // Prevent Drop from running (which would shut down the channel)
8446        std::mem::forget(self);
8447    }
8448}
8449
8450impl DataRouterDeprecatedRouteResponder {
8451    /// Sends a response to the FIDL transaction.
8452    ///
8453    /// Sets the channel to shutdown if an error occurs.
8454    pub fn send(
8455        self,
8456        mut result: Result<(RouterResponse, Option<&Data>), RouterError>,
8457    ) -> Result<(), fidl::Error> {
8458        let _result = self.send_raw(result);
8459        if _result.is_err() {
8460            self.control_handle.shutdown();
8461        }
8462        self.drop_without_shutdown();
8463        _result
8464    }
8465
8466    /// Similar to "send" but does not shutdown the channel if an error occurs.
8467    pub fn send_no_shutdown_on_err(
8468        self,
8469        mut result: Result<(RouterResponse, Option<&Data>), RouterError>,
8470    ) -> Result<(), fidl::Error> {
8471        let _result = self.send_raw(result);
8472        self.drop_without_shutdown();
8473        _result
8474    }
8475
8476    fn send_raw(
8477        &self,
8478        mut result: Result<(RouterResponse, Option<&Data>), RouterError>,
8479    ) -> Result<(), fidl::Error> {
8480        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8481            DataRouterDeprecatedRouteResponse,
8482            RouterError,
8483        >>(
8484            fidl::encoding::FlexibleResult::new(result),
8485            self.tx_id,
8486            0x9a0b381e65e9ed3,
8487            fidl::encoding::DynamicFlags::FLEXIBLE,
8488        )
8489    }
8490}
8491
8492#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8493pub struct DictionaryMarker;
8494
8495impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
8496    type Proxy = DictionaryProxy;
8497    type RequestStream = DictionaryRequestStream;
8498    #[cfg(target_os = "fuchsia")]
8499    type SynchronousProxy = DictionarySynchronousProxy;
8500
8501    const DEBUG_NAME: &'static str = "(anonymous) Dictionary";
8502}
8503
8504pub trait DictionaryProxyInterface: Send + Sync {
8505    fn r#clone(
8506        &self,
8507        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8508    ) -> Result<(), fidl::Error>;
8509    fn r#insert(&self, key: &str, capability: CapabilityDeprecated) -> Result<(), fidl::Error>;
8510    type GetResponseFut: std::future::Future<Output = Result<Option<Box<CapabilityDeprecated>>, fidl::Error>>
8511        + Send;
8512    fn r#get(&self, key: &str) -> Self::GetResponseFut;
8513    type RemoveResponseFut: std::future::Future<Output = Result<Option<Box<CapabilityDeprecated>>, fidl::Error>>
8514        + Send;
8515    fn r#remove(&self, key: &str) -> Self::RemoveResponseFut;
8516    fn r#iterate_keys(
8517        &self,
8518        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
8519    ) -> Result<(), fidl::Error>;
8520    type LegacyExportResponseFut: std::future::Future<
8521            Output = Result<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::Error>,
8522        > + Send;
8523    fn r#legacy_export(&self) -> Self::LegacyExportResponseFut;
8524}
8525#[derive(Debug)]
8526#[cfg(target_os = "fuchsia")]
8527pub struct DictionarySynchronousProxy {
8528    client: fidl::client::sync::Client,
8529}
8530
8531#[cfg(target_os = "fuchsia")]
8532impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
8533    type Proxy = DictionaryProxy;
8534    type Protocol = DictionaryMarker;
8535
8536    fn from_channel(inner: fidl::Channel) -> Self {
8537        Self::new(inner)
8538    }
8539
8540    fn into_channel(self) -> fidl::Channel {
8541        self.client.into_channel()
8542    }
8543
8544    fn as_channel(&self) -> &fidl::Channel {
8545        self.client.as_channel()
8546    }
8547}
8548
8549#[cfg(target_os = "fuchsia")]
8550impl DictionarySynchronousProxy {
8551    pub fn new(channel: fidl::Channel) -> Self {
8552        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8553        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8554    }
8555
8556    pub fn into_channel(self) -> fidl::Channel {
8557        self.client.into_channel()
8558    }
8559
8560    /// Waits until an event arrives and returns it. It is safe for other
8561    /// threads to make concurrent requests while waiting for an event.
8562    pub fn wait_for_event(
8563        &self,
8564        deadline: zx::MonotonicInstant,
8565    ) -> Result<DictionaryEvent, fidl::Error> {
8566        DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
8567    }
8568
8569    pub fn r#clone(
8570        &self,
8571        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8572    ) -> Result<(), fidl::Error> {
8573        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8574            (request,),
8575            0x20d8a7aba2168a79,
8576            fidl::encoding::DynamicFlags::empty(),
8577        )
8578    }
8579
8580    /// Inserts a new `Capability` into this `Dictionary` under the name `key`.
8581    /// Overwrites any existing entry.
8582    ///
8583    /// The server end associated with the provided client end must be owned by
8584    /// component manager.
8585    pub fn r#insert(
8586        &self,
8587        mut key: &str,
8588        mut capability: CapabilityDeprecated,
8589    ) -> Result<(), fidl::Error> {
8590        self.client.send::<DictionaryInsertRequest>(
8591            (key, &mut capability),
8592            0x673364c89c4b0ed7,
8593            fidl::encoding::DynamicFlags::FLEXIBLE,
8594        )
8595    }
8596
8597    /// Returns a clone of the `Capability` named `key` in this dictionary, if
8598    /// that capability both exists and can be cloned.
8599    pub fn r#get(
8600        &self,
8601        mut key: &str,
8602        ___deadline: zx::MonotonicInstant,
8603    ) -> Result<Option<Box<CapabilityDeprecated>>, fidl::Error> {
8604        let _response = self.client.send_query::<
8605            DictionaryGetRequest,
8606            fidl::encoding::FlexibleType<DictionaryGetResponse>,
8607        >(
8608            (key,),
8609            0x46d4b1dcd30feed9,
8610            fidl::encoding::DynamicFlags::FLEXIBLE,
8611            ___deadline,
8612        )?
8613        .into_result::<DictionaryMarker>("get")?;
8614        Ok(_response.capability)
8615    }
8616
8617    /// Removes the `Capability` named `key` from this dictionary and returns
8618    /// it, if that capability exists.
8619    pub fn r#remove(
8620        &self,
8621        mut key: &str,
8622        ___deadline: zx::MonotonicInstant,
8623    ) -> Result<Option<Box<CapabilityDeprecated>>, fidl::Error> {
8624        let _response = self.client.send_query::<
8625            DictionaryRemoveRequest,
8626            fidl::encoding::FlexibleType<DictionaryRemoveResponse>,
8627        >(
8628            (key,),
8629            0x7931ac0ea29dffe7,
8630            fidl::encoding::DynamicFlags::FLEXIBLE,
8631            ___deadline,
8632        )?
8633        .into_result::<DictionaryMarker>("remove")?;
8634        Ok(_response.capability)
8635    }
8636
8637    /// Opens an iterator which can be used to iterate over the keys of this
8638    /// dictionary.
8639    pub fn r#iterate_keys(
8640        &self,
8641        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
8642    ) -> Result<(), fidl::Error> {
8643        self.client.send::<DictionaryIterateKeysRequest>(
8644            (key_iterator,),
8645            0x331df1e1e73158a1,
8646            fidl::encoding::DynamicFlags::FLEXIBLE,
8647        )
8648    }
8649
8650    /// Exports this dictionary for use in a
8651    /// `fuchsia.component.Realm/CreateChild` call.
8652    pub fn r#legacy_export(
8653        &self,
8654        ___deadline: zx::MonotonicInstant,
8655    ) -> Result<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::Error> {
8656        let _response = self.client.send_query::<
8657            fidl::encoding::EmptyPayload,
8658            fidl::encoding::FlexibleType<DictionaryLegacyExportResponse>,
8659        >(
8660            (),
8661            0x722a26456a1ee1d0,
8662            fidl::encoding::DynamicFlags::FLEXIBLE,
8663            ___deadline,
8664        )?
8665        .into_result::<DictionaryMarker>("legacy_export")?;
8666        Ok(_response.dictionary_ref)
8667    }
8668}
8669
8670#[cfg(target_os = "fuchsia")]
8671impl From<DictionarySynchronousProxy> for zx::Handle {
8672    fn from(value: DictionarySynchronousProxy) -> Self {
8673        value.into_channel().into()
8674    }
8675}
8676
8677#[cfg(target_os = "fuchsia")]
8678impl From<fidl::Channel> for DictionarySynchronousProxy {
8679    fn from(value: fidl::Channel) -> Self {
8680        Self::new(value)
8681    }
8682}
8683
8684#[cfg(target_os = "fuchsia")]
8685impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
8686    type Protocol = DictionaryMarker;
8687
8688    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
8689        Self::new(value.into_channel())
8690    }
8691}
8692
8693#[derive(Debug, Clone)]
8694pub struct DictionaryProxy {
8695    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8696}
8697
8698impl fidl::endpoints::Proxy for DictionaryProxy {
8699    type Protocol = DictionaryMarker;
8700
8701    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8702        Self::new(inner)
8703    }
8704
8705    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8706        self.client.into_channel().map_err(|client| Self { client })
8707    }
8708
8709    fn as_channel(&self) -> &::fidl::AsyncChannel {
8710        self.client.as_channel()
8711    }
8712}
8713
8714impl DictionaryProxy {
8715    /// Create a new Proxy for fuchsia.component.runtime/Dictionary.
8716    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8717        let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8718        Self { client: fidl::client::Client::new(channel, protocol_name) }
8719    }
8720
8721    /// Get a Stream of events from the remote end of the protocol.
8722    ///
8723    /// # Panics
8724    ///
8725    /// Panics if the event stream was already taken.
8726    pub fn take_event_stream(&self) -> DictionaryEventStream {
8727        DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
8728    }
8729
8730    pub fn r#clone(
8731        &self,
8732        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8733    ) -> Result<(), fidl::Error> {
8734        DictionaryProxyInterface::r#clone(self, request)
8735    }
8736
8737    /// Inserts a new `Capability` into this `Dictionary` under the name `key`.
8738    /// Overwrites any existing entry.
8739    ///
8740    /// The server end associated with the provided client end must be owned by
8741    /// component manager.
8742    pub fn r#insert(
8743        &self,
8744        mut key: &str,
8745        mut capability: CapabilityDeprecated,
8746    ) -> Result<(), fidl::Error> {
8747        DictionaryProxyInterface::r#insert(self, key, capability)
8748    }
8749
8750    /// Returns a clone of the `Capability` named `key` in this dictionary, if
8751    /// that capability both exists and can be cloned.
8752    pub fn r#get(
8753        &self,
8754        mut key: &str,
8755    ) -> fidl::client::QueryResponseFut<
8756        Option<Box<CapabilityDeprecated>>,
8757        fidl::encoding::DefaultFuchsiaResourceDialect,
8758    > {
8759        DictionaryProxyInterface::r#get(self, key)
8760    }
8761
8762    /// Removes the `Capability` named `key` from this dictionary and returns
8763    /// it, if that capability exists.
8764    pub fn r#remove(
8765        &self,
8766        mut key: &str,
8767    ) -> fidl::client::QueryResponseFut<
8768        Option<Box<CapabilityDeprecated>>,
8769        fidl::encoding::DefaultFuchsiaResourceDialect,
8770    > {
8771        DictionaryProxyInterface::r#remove(self, key)
8772    }
8773
8774    /// Opens an iterator which can be used to iterate over the keys of this
8775    /// dictionary.
8776    pub fn r#iterate_keys(
8777        &self,
8778        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
8779    ) -> Result<(), fidl::Error> {
8780        DictionaryProxyInterface::r#iterate_keys(self, key_iterator)
8781    }
8782
8783    /// Exports this dictionary for use in a
8784    /// `fuchsia.component.Realm/CreateChild` call.
8785    pub fn r#legacy_export(
8786        &self,
8787    ) -> fidl::client::QueryResponseFut<
8788        fidl_fuchsia_component_sandbox::DictionaryRef,
8789        fidl::encoding::DefaultFuchsiaResourceDialect,
8790    > {
8791        DictionaryProxyInterface::r#legacy_export(self)
8792    }
8793}
8794
8795impl DictionaryProxyInterface for DictionaryProxy {
8796    fn r#clone(
8797        &self,
8798        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
8799    ) -> Result<(), fidl::Error> {
8800        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
8801            (request,),
8802            0x20d8a7aba2168a79,
8803            fidl::encoding::DynamicFlags::empty(),
8804        )
8805    }
8806
8807    fn r#insert(
8808        &self,
8809        mut key: &str,
8810        mut capability: CapabilityDeprecated,
8811    ) -> Result<(), fidl::Error> {
8812        self.client.send::<DictionaryInsertRequest>(
8813            (key, &mut capability),
8814            0x673364c89c4b0ed7,
8815            fidl::encoding::DynamicFlags::FLEXIBLE,
8816        )
8817    }
8818
8819    type GetResponseFut = fidl::client::QueryResponseFut<
8820        Option<Box<CapabilityDeprecated>>,
8821        fidl::encoding::DefaultFuchsiaResourceDialect,
8822    >;
8823    fn r#get(&self, mut key: &str) -> Self::GetResponseFut {
8824        fn _decode(
8825            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8826        ) -> Result<Option<Box<CapabilityDeprecated>>, fidl::Error> {
8827            let _response = fidl::client::decode_transaction_body::<
8828                fidl::encoding::FlexibleType<DictionaryGetResponse>,
8829                fidl::encoding::DefaultFuchsiaResourceDialect,
8830                0x46d4b1dcd30feed9,
8831            >(_buf?)?
8832            .into_result::<DictionaryMarker>("get")?;
8833            Ok(_response.capability)
8834        }
8835        self.client
8836            .send_query_and_decode::<DictionaryGetRequest, Option<Box<CapabilityDeprecated>>>(
8837                (key,),
8838                0x46d4b1dcd30feed9,
8839                fidl::encoding::DynamicFlags::FLEXIBLE,
8840                _decode,
8841            )
8842    }
8843
8844    type RemoveResponseFut = fidl::client::QueryResponseFut<
8845        Option<Box<CapabilityDeprecated>>,
8846        fidl::encoding::DefaultFuchsiaResourceDialect,
8847    >;
8848    fn r#remove(&self, mut key: &str) -> Self::RemoveResponseFut {
8849        fn _decode(
8850            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8851        ) -> Result<Option<Box<CapabilityDeprecated>>, fidl::Error> {
8852            let _response = fidl::client::decode_transaction_body::<
8853                fidl::encoding::FlexibleType<DictionaryRemoveResponse>,
8854                fidl::encoding::DefaultFuchsiaResourceDialect,
8855                0x7931ac0ea29dffe7,
8856            >(_buf?)?
8857            .into_result::<DictionaryMarker>("remove")?;
8858            Ok(_response.capability)
8859        }
8860        self.client
8861            .send_query_and_decode::<DictionaryRemoveRequest, Option<Box<CapabilityDeprecated>>>(
8862                (key,),
8863                0x7931ac0ea29dffe7,
8864                fidl::encoding::DynamicFlags::FLEXIBLE,
8865                _decode,
8866            )
8867    }
8868
8869    fn r#iterate_keys(
8870        &self,
8871        mut key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
8872    ) -> Result<(), fidl::Error> {
8873        self.client.send::<DictionaryIterateKeysRequest>(
8874            (key_iterator,),
8875            0x331df1e1e73158a1,
8876            fidl::encoding::DynamicFlags::FLEXIBLE,
8877        )
8878    }
8879
8880    type LegacyExportResponseFut = fidl::client::QueryResponseFut<
8881        fidl_fuchsia_component_sandbox::DictionaryRef,
8882        fidl::encoding::DefaultFuchsiaResourceDialect,
8883    >;
8884    fn r#legacy_export(&self) -> Self::LegacyExportResponseFut {
8885        fn _decode(
8886            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8887        ) -> Result<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::Error> {
8888            let _response = fidl::client::decode_transaction_body::<
8889                fidl::encoding::FlexibleType<DictionaryLegacyExportResponse>,
8890                fidl::encoding::DefaultFuchsiaResourceDialect,
8891                0x722a26456a1ee1d0,
8892            >(_buf?)?
8893            .into_result::<DictionaryMarker>("legacy_export")?;
8894            Ok(_response.dictionary_ref)
8895        }
8896        self.client.send_query_and_decode::<
8897            fidl::encoding::EmptyPayload,
8898            fidl_fuchsia_component_sandbox::DictionaryRef,
8899        >(
8900            (),
8901            0x722a26456a1ee1d0,
8902            fidl::encoding::DynamicFlags::FLEXIBLE,
8903            _decode,
8904        )
8905    }
8906}
8907
8908pub struct DictionaryEventStream {
8909    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8910}
8911
8912impl std::marker::Unpin for DictionaryEventStream {}
8913
8914impl futures::stream::FusedStream for DictionaryEventStream {
8915    fn is_terminated(&self) -> bool {
8916        self.event_receiver.is_terminated()
8917    }
8918}
8919
8920impl futures::Stream for DictionaryEventStream {
8921    type Item = Result<DictionaryEvent, fidl::Error>;
8922
8923    fn poll_next(
8924        mut self: std::pin::Pin<&mut Self>,
8925        cx: &mut std::task::Context<'_>,
8926    ) -> std::task::Poll<Option<Self::Item>> {
8927        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8928            &mut self.event_receiver,
8929            cx
8930        )?) {
8931            Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
8932            None => std::task::Poll::Ready(None),
8933        }
8934    }
8935}
8936
8937#[derive(Debug)]
8938pub enum DictionaryEvent {
8939    #[non_exhaustive]
8940    _UnknownEvent {
8941        /// Ordinal of the event that was sent.
8942        ordinal: u64,
8943    },
8944}
8945
8946impl DictionaryEvent {
8947    /// Decodes a message buffer as a [`DictionaryEvent`].
8948    fn decode(
8949        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8950    ) -> Result<DictionaryEvent, fidl::Error> {
8951        let (bytes, _handles) = buf.split_mut();
8952        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8953        debug_assert_eq!(tx_header.tx_id, 0);
8954        match tx_header.ordinal {
8955            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8956                Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8957            }
8958            _ => Err(fidl::Error::UnknownOrdinal {
8959                ordinal: tx_header.ordinal,
8960                protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8961            }),
8962        }
8963    }
8964}
8965
8966/// A Stream of incoming requests for fuchsia.component.runtime/Dictionary.
8967pub struct DictionaryRequestStream {
8968    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8969    is_terminated: bool,
8970}
8971
8972impl std::marker::Unpin for DictionaryRequestStream {}
8973
8974impl futures::stream::FusedStream for DictionaryRequestStream {
8975    fn is_terminated(&self) -> bool {
8976        self.is_terminated
8977    }
8978}
8979
8980impl fidl::endpoints::RequestStream for DictionaryRequestStream {
8981    type Protocol = DictionaryMarker;
8982    type ControlHandle = DictionaryControlHandle;
8983
8984    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8985        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8986    }
8987
8988    fn control_handle(&self) -> Self::ControlHandle {
8989        DictionaryControlHandle { inner: self.inner.clone() }
8990    }
8991
8992    fn into_inner(
8993        self,
8994    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8995    {
8996        (self.inner, self.is_terminated)
8997    }
8998
8999    fn from_inner(
9000        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9001        is_terminated: bool,
9002    ) -> Self {
9003        Self { inner, is_terminated }
9004    }
9005}
9006
9007impl futures::Stream for DictionaryRequestStream {
9008    type Item = Result<DictionaryRequest, fidl::Error>;
9009
9010    fn poll_next(
9011        mut self: std::pin::Pin<&mut Self>,
9012        cx: &mut std::task::Context<'_>,
9013    ) -> std::task::Poll<Option<Self::Item>> {
9014        let this = &mut *self;
9015        if this.inner.check_shutdown(cx) {
9016            this.is_terminated = true;
9017            return std::task::Poll::Ready(None);
9018        }
9019        if this.is_terminated {
9020            panic!("polled DictionaryRequestStream after completion");
9021        }
9022        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9023            |bytes, handles| {
9024                match this.inner.channel().read_etc(cx, bytes, handles) {
9025                    std::task::Poll::Ready(Ok(())) => {}
9026                    std::task::Poll::Pending => return std::task::Poll::Pending,
9027                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9028                        this.is_terminated = true;
9029                        return std::task::Poll::Ready(None);
9030                    }
9031                    std::task::Poll::Ready(Err(e)) => {
9032                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9033                            e.into(),
9034                        ))));
9035                    }
9036                }
9037
9038                // A message has been received from the channel
9039                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9040
9041                std::task::Poll::Ready(Some(match header.ordinal {
9042                    0x20d8a7aba2168a79 => {
9043                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9044                        let mut req = fidl::new_empty!(
9045                            fidl_fuchsia_unknown::CloneableCloneRequest,
9046                            fidl::encoding::DefaultFuchsiaResourceDialect
9047                        );
9048                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
9049                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9050                        Ok(DictionaryRequest::Clone { request: req.request, control_handle })
9051                    }
9052                    0x673364c89c4b0ed7 => {
9053                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9054                        let mut req = fidl::new_empty!(
9055                            DictionaryInsertRequest,
9056                            fidl::encoding::DefaultFuchsiaResourceDialect
9057                        );
9058                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
9059                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9060                        Ok(DictionaryRequest::Insert {
9061                            key: req.key,
9062                            capability: req.capability,
9063
9064                            control_handle,
9065                        })
9066                    }
9067                    0x46d4b1dcd30feed9 => {
9068                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9069                        let mut req = fidl::new_empty!(
9070                            DictionaryGetRequest,
9071                            fidl::encoding::DefaultFuchsiaResourceDialect
9072                        );
9073                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
9074                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9075                        Ok(DictionaryRequest::Get {
9076                            key: req.key,
9077
9078                            responder: DictionaryGetResponder {
9079                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9080                                tx_id: header.tx_id,
9081                            },
9082                        })
9083                    }
9084                    0x7931ac0ea29dffe7 => {
9085                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9086                        let mut req = fidl::new_empty!(
9087                            DictionaryRemoveRequest,
9088                            fidl::encoding::DefaultFuchsiaResourceDialect
9089                        );
9090                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
9091                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9092                        Ok(DictionaryRequest::Remove {
9093                            key: req.key,
9094
9095                            responder: DictionaryRemoveResponder {
9096                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9097                                tx_id: header.tx_id,
9098                            },
9099                        })
9100                    }
9101                    0x331df1e1e73158a1 => {
9102                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9103                        let mut req = fidl::new_empty!(
9104                            DictionaryIterateKeysRequest,
9105                            fidl::encoding::DefaultFuchsiaResourceDialect
9106                        );
9107                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryIterateKeysRequest>(&header, _body_bytes, handles, &mut req)?;
9108                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9109                        Ok(DictionaryRequest::IterateKeys {
9110                            key_iterator: req.key_iterator,
9111
9112                            control_handle,
9113                        })
9114                    }
9115                    0x722a26456a1ee1d0 => {
9116                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9117                        let mut req = fidl::new_empty!(
9118                            fidl::encoding::EmptyPayload,
9119                            fidl::encoding::DefaultFuchsiaResourceDialect
9120                        );
9121                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9122                        let control_handle = DictionaryControlHandle { inner: this.inner.clone() };
9123                        Ok(DictionaryRequest::LegacyExport {
9124                            responder: DictionaryLegacyExportResponder {
9125                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9126                                tx_id: header.tx_id,
9127                            },
9128                        })
9129                    }
9130                    _ if header.tx_id == 0
9131                        && header
9132                            .dynamic_flags()
9133                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9134                    {
9135                        Ok(DictionaryRequest::_UnknownMethod {
9136                            ordinal: header.ordinal,
9137                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
9138                            method_type: fidl::MethodType::OneWay,
9139                        })
9140                    }
9141                    _ if header
9142                        .dynamic_flags()
9143                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9144                    {
9145                        this.inner.send_framework_err(
9146                            fidl::encoding::FrameworkErr::UnknownMethod,
9147                            header.tx_id,
9148                            header.ordinal,
9149                            header.dynamic_flags(),
9150                            (bytes, handles),
9151                        )?;
9152                        Ok(DictionaryRequest::_UnknownMethod {
9153                            ordinal: header.ordinal,
9154                            control_handle: DictionaryControlHandle { inner: this.inner.clone() },
9155                            method_type: fidl::MethodType::TwoWay,
9156                        })
9157                    }
9158                    _ => Err(fidl::Error::UnknownOrdinal {
9159                        ordinal: header.ordinal,
9160                        protocol_name:
9161                            <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9162                    }),
9163                }))
9164            },
9165        )
9166    }
9167}
9168
9169/// A `Dictionary` is a bundle of named runtime capabilities.
9170#[derive(Debug)]
9171pub enum DictionaryRequest {
9172    Clone {
9173        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9174        control_handle: DictionaryControlHandle,
9175    },
9176    /// Inserts a new `Capability` into this `Dictionary` under the name `key`.
9177    /// Overwrites any existing entry.
9178    ///
9179    /// The server end associated with the provided client end must be owned by
9180    /// component manager.
9181    Insert {
9182        key: String,
9183        capability: CapabilityDeprecated,
9184        control_handle: DictionaryControlHandle,
9185    },
9186    /// Returns a clone of the `Capability` named `key` in this dictionary, if
9187    /// that capability both exists and can be cloned.
9188    Get { key: String, responder: DictionaryGetResponder },
9189    /// Removes the `Capability` named `key` from this dictionary and returns
9190    /// it, if that capability exists.
9191    Remove { key: String, responder: DictionaryRemoveResponder },
9192    /// Opens an iterator which can be used to iterate over the keys of this
9193    /// dictionary.
9194    IterateKeys {
9195        key_iterator: fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
9196        control_handle: DictionaryControlHandle,
9197    },
9198    /// Exports this dictionary for use in a
9199    /// `fuchsia.component.Realm/CreateChild` call.
9200    LegacyExport { responder: DictionaryLegacyExportResponder },
9201    /// An interaction was received which does not match any known method.
9202    #[non_exhaustive]
9203    _UnknownMethod {
9204        /// Ordinal of the method that was called.
9205        ordinal: u64,
9206        control_handle: DictionaryControlHandle,
9207        method_type: fidl::MethodType,
9208    },
9209}
9210
9211impl DictionaryRequest {
9212    #[allow(irrefutable_let_patterns)]
9213    pub fn into_clone(
9214        self,
9215    ) -> Option<(
9216        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
9217        DictionaryControlHandle,
9218    )> {
9219        if let DictionaryRequest::Clone { request, control_handle } = self {
9220            Some((request, control_handle))
9221        } else {
9222            None
9223        }
9224    }
9225
9226    #[allow(irrefutable_let_patterns)]
9227    pub fn into_insert(self) -> Option<(String, CapabilityDeprecated, DictionaryControlHandle)> {
9228        if let DictionaryRequest::Insert { key, capability, control_handle } = self {
9229            Some((key, capability, control_handle))
9230        } else {
9231            None
9232        }
9233    }
9234
9235    #[allow(irrefutable_let_patterns)]
9236    pub fn into_get(self) -> Option<(String, DictionaryGetResponder)> {
9237        if let DictionaryRequest::Get { key, responder } = self {
9238            Some((key, responder))
9239        } else {
9240            None
9241        }
9242    }
9243
9244    #[allow(irrefutable_let_patterns)]
9245    pub fn into_remove(self) -> Option<(String, DictionaryRemoveResponder)> {
9246        if let DictionaryRequest::Remove { key, responder } = self {
9247            Some((key, responder))
9248        } else {
9249            None
9250        }
9251    }
9252
9253    #[allow(irrefutable_let_patterns)]
9254    pub fn into_iterate_keys(
9255        self,
9256    ) -> Option<(fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>, DictionaryControlHandle)>
9257    {
9258        if let DictionaryRequest::IterateKeys { key_iterator, control_handle } = self {
9259            Some((key_iterator, control_handle))
9260        } else {
9261            None
9262        }
9263    }
9264
9265    #[allow(irrefutable_let_patterns)]
9266    pub fn into_legacy_export(self) -> Option<(DictionaryLegacyExportResponder)> {
9267        if let DictionaryRequest::LegacyExport { responder } = self {
9268            Some((responder))
9269        } else {
9270            None
9271        }
9272    }
9273
9274    /// Name of the method defined in FIDL
9275    pub fn method_name(&self) -> &'static str {
9276        match *self {
9277            DictionaryRequest::Clone { .. } => "clone",
9278            DictionaryRequest::Insert { .. } => "insert",
9279            DictionaryRequest::Get { .. } => "get",
9280            DictionaryRequest::Remove { .. } => "remove",
9281            DictionaryRequest::IterateKeys { .. } => "iterate_keys",
9282            DictionaryRequest::LegacyExport { .. } => "legacy_export",
9283            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
9284                "unknown one-way method"
9285            }
9286            DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
9287                "unknown two-way method"
9288            }
9289        }
9290    }
9291}
9292
9293#[derive(Debug, Clone)]
9294pub struct DictionaryControlHandle {
9295    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9296}
9297
9298impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
9299    fn shutdown(&self) {
9300        self.inner.shutdown()
9301    }
9302    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9303        self.inner.shutdown_with_epitaph(status)
9304    }
9305
9306    fn is_closed(&self) -> bool {
9307        self.inner.channel().is_closed()
9308    }
9309    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9310        self.inner.channel().on_closed()
9311    }
9312
9313    #[cfg(target_os = "fuchsia")]
9314    fn signal_peer(
9315        &self,
9316        clear_mask: zx::Signals,
9317        set_mask: zx::Signals,
9318    ) -> Result<(), zx_status::Status> {
9319        use fidl::Peered;
9320        self.inner.channel().signal_peer(clear_mask, set_mask)
9321    }
9322}
9323
9324impl DictionaryControlHandle {}
9325
9326#[must_use = "FIDL methods require a response to be sent"]
9327#[derive(Debug)]
9328pub struct DictionaryGetResponder {
9329    control_handle: std::mem::ManuallyDrop<DictionaryControlHandle>,
9330    tx_id: u32,
9331}
9332
9333/// Set the the channel to be shutdown (see [`DictionaryControlHandle::shutdown`])
9334/// if the responder is dropped without sending a response, so that the client
9335/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9336impl std::ops::Drop for DictionaryGetResponder {
9337    fn drop(&mut self) {
9338        self.control_handle.shutdown();
9339        // Safety: drops once, never accessed again
9340        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9341    }
9342}
9343
9344impl fidl::endpoints::Responder for DictionaryGetResponder {
9345    type ControlHandle = DictionaryControlHandle;
9346
9347    fn control_handle(&self) -> &DictionaryControlHandle {
9348        &self.control_handle
9349    }
9350
9351    fn drop_without_shutdown(mut self) {
9352        // Safety: drops once, never accessed again due to mem::forget
9353        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9354        // Prevent Drop from running (which would shut down the channel)
9355        std::mem::forget(self);
9356    }
9357}
9358
9359impl DictionaryGetResponder {
9360    /// Sends a response to the FIDL transaction.
9361    ///
9362    /// Sets the channel to shutdown if an error occurs.
9363    pub fn send(self, mut capability: Option<CapabilityDeprecated>) -> Result<(), fidl::Error> {
9364        let _result = self.send_raw(capability);
9365        if _result.is_err() {
9366            self.control_handle.shutdown();
9367        }
9368        self.drop_without_shutdown();
9369        _result
9370    }
9371
9372    /// Similar to "send" but does not shutdown the channel if an error occurs.
9373    pub fn send_no_shutdown_on_err(
9374        self,
9375        mut capability: Option<CapabilityDeprecated>,
9376    ) -> Result<(), fidl::Error> {
9377        let _result = self.send_raw(capability);
9378        self.drop_without_shutdown();
9379        _result
9380    }
9381
9382    fn send_raw(&self, mut capability: Option<CapabilityDeprecated>) -> Result<(), fidl::Error> {
9383        self.control_handle.inner.send::<fidl::encoding::FlexibleType<DictionaryGetResponse>>(
9384            fidl::encoding::Flexible::new((capability.as_mut(),)),
9385            self.tx_id,
9386            0x46d4b1dcd30feed9,
9387            fidl::encoding::DynamicFlags::FLEXIBLE,
9388        )
9389    }
9390}
9391
9392#[must_use = "FIDL methods require a response to be sent"]
9393#[derive(Debug)]
9394pub struct DictionaryRemoveResponder {
9395    control_handle: std::mem::ManuallyDrop<DictionaryControlHandle>,
9396    tx_id: u32,
9397}
9398
9399/// Set the the channel to be shutdown (see [`DictionaryControlHandle::shutdown`])
9400/// if the responder is dropped without sending a response, so that the client
9401/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9402impl std::ops::Drop for DictionaryRemoveResponder {
9403    fn drop(&mut self) {
9404        self.control_handle.shutdown();
9405        // Safety: drops once, never accessed again
9406        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9407    }
9408}
9409
9410impl fidl::endpoints::Responder for DictionaryRemoveResponder {
9411    type ControlHandle = DictionaryControlHandle;
9412
9413    fn control_handle(&self) -> &DictionaryControlHandle {
9414        &self.control_handle
9415    }
9416
9417    fn drop_without_shutdown(mut self) {
9418        // Safety: drops once, never accessed again due to mem::forget
9419        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9420        // Prevent Drop from running (which would shut down the channel)
9421        std::mem::forget(self);
9422    }
9423}
9424
9425impl DictionaryRemoveResponder {
9426    /// Sends a response to the FIDL transaction.
9427    ///
9428    /// Sets the channel to shutdown if an error occurs.
9429    pub fn send(self, mut capability: Option<CapabilityDeprecated>) -> Result<(), fidl::Error> {
9430        let _result = self.send_raw(capability);
9431        if _result.is_err() {
9432            self.control_handle.shutdown();
9433        }
9434        self.drop_without_shutdown();
9435        _result
9436    }
9437
9438    /// Similar to "send" but does not shutdown the channel if an error occurs.
9439    pub fn send_no_shutdown_on_err(
9440        self,
9441        mut capability: Option<CapabilityDeprecated>,
9442    ) -> Result<(), fidl::Error> {
9443        let _result = self.send_raw(capability);
9444        self.drop_without_shutdown();
9445        _result
9446    }
9447
9448    fn send_raw(&self, mut capability: Option<CapabilityDeprecated>) -> Result<(), fidl::Error> {
9449        self.control_handle.inner.send::<fidl::encoding::FlexibleType<DictionaryRemoveResponse>>(
9450            fidl::encoding::Flexible::new((capability.as_mut(),)),
9451            self.tx_id,
9452            0x7931ac0ea29dffe7,
9453            fidl::encoding::DynamicFlags::FLEXIBLE,
9454        )
9455    }
9456}
9457
9458#[must_use = "FIDL methods require a response to be sent"]
9459#[derive(Debug)]
9460pub struct DictionaryLegacyExportResponder {
9461    control_handle: std::mem::ManuallyDrop<DictionaryControlHandle>,
9462    tx_id: u32,
9463}
9464
9465/// Set the the channel to be shutdown (see [`DictionaryControlHandle::shutdown`])
9466/// if the responder is dropped without sending a response, so that the client
9467/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9468impl std::ops::Drop for DictionaryLegacyExportResponder {
9469    fn drop(&mut self) {
9470        self.control_handle.shutdown();
9471        // Safety: drops once, never accessed again
9472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9473    }
9474}
9475
9476impl fidl::endpoints::Responder for DictionaryLegacyExportResponder {
9477    type ControlHandle = DictionaryControlHandle;
9478
9479    fn control_handle(&self) -> &DictionaryControlHandle {
9480        &self.control_handle
9481    }
9482
9483    fn drop_without_shutdown(mut self) {
9484        // Safety: drops once, never accessed again due to mem::forget
9485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9486        // Prevent Drop from running (which would shut down the channel)
9487        std::mem::forget(self);
9488    }
9489}
9490
9491impl DictionaryLegacyExportResponder {
9492    /// Sends a response to the FIDL transaction.
9493    ///
9494    /// Sets the channel to shutdown if an error occurs.
9495    pub fn send(
9496        self,
9497        mut dictionary_ref: fidl_fuchsia_component_sandbox::DictionaryRef,
9498    ) -> Result<(), fidl::Error> {
9499        let _result = self.send_raw(dictionary_ref);
9500        if _result.is_err() {
9501            self.control_handle.shutdown();
9502        }
9503        self.drop_without_shutdown();
9504        _result
9505    }
9506
9507    /// Similar to "send" but does not shutdown the channel if an error occurs.
9508    pub fn send_no_shutdown_on_err(
9509        self,
9510        mut dictionary_ref: fidl_fuchsia_component_sandbox::DictionaryRef,
9511    ) -> Result<(), fidl::Error> {
9512        let _result = self.send_raw(dictionary_ref);
9513        self.drop_without_shutdown();
9514        _result
9515    }
9516
9517    fn send_raw(
9518        &self,
9519        mut dictionary_ref: fidl_fuchsia_component_sandbox::DictionaryRef,
9520    ) -> Result<(), fidl::Error> {
9521        self.control_handle
9522            .inner
9523            .send::<fidl::encoding::FlexibleType<DictionaryLegacyExportResponse>>(
9524                fidl::encoding::Flexible::new((&mut dictionary_ref,)),
9525                self.tx_id,
9526                0x722a26456a1ee1d0,
9527                fidl::encoding::DynamicFlags::FLEXIBLE,
9528            )
9529    }
9530}
9531
9532#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9533pub struct DictionaryKeyIteratorMarker;
9534
9535impl fidl::endpoints::ProtocolMarker for DictionaryKeyIteratorMarker {
9536    type Proxy = DictionaryKeyIteratorProxy;
9537    type RequestStream = DictionaryKeyIteratorRequestStream;
9538    #[cfg(target_os = "fuchsia")]
9539    type SynchronousProxy = DictionaryKeyIteratorSynchronousProxy;
9540
9541    const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeyIterator";
9542}
9543
9544pub trait DictionaryKeyIteratorProxyInterface: Send + Sync {
9545    type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
9546    fn r#get_next(&self) -> Self::GetNextResponseFut;
9547}
9548#[derive(Debug)]
9549#[cfg(target_os = "fuchsia")]
9550pub struct DictionaryKeyIteratorSynchronousProxy {
9551    client: fidl::client::sync::Client,
9552}
9553
9554#[cfg(target_os = "fuchsia")]
9555impl fidl::endpoints::SynchronousProxy for DictionaryKeyIteratorSynchronousProxy {
9556    type Proxy = DictionaryKeyIteratorProxy;
9557    type Protocol = DictionaryKeyIteratorMarker;
9558
9559    fn from_channel(inner: fidl::Channel) -> Self {
9560        Self::new(inner)
9561    }
9562
9563    fn into_channel(self) -> fidl::Channel {
9564        self.client.into_channel()
9565    }
9566
9567    fn as_channel(&self) -> &fidl::Channel {
9568        self.client.as_channel()
9569    }
9570}
9571
9572#[cfg(target_os = "fuchsia")]
9573impl DictionaryKeyIteratorSynchronousProxy {
9574    pub fn new(channel: fidl::Channel) -> Self {
9575        let protocol_name =
9576            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9577        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9578    }
9579
9580    pub fn into_channel(self) -> fidl::Channel {
9581        self.client.into_channel()
9582    }
9583
9584    /// Waits until an event arrives and returns it. It is safe for other
9585    /// threads to make concurrent requests while waiting for an event.
9586    pub fn wait_for_event(
9587        &self,
9588        deadline: zx::MonotonicInstant,
9589    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
9590        DictionaryKeyIteratorEvent::decode(self.client.wait_for_event(deadline)?)
9591    }
9592
9593    /// Returns the next set of keys in this dictionary. Returns an empty vector
9594    /// when there are no more keys to iterate.
9595    pub fn r#get_next(
9596        &self,
9597        ___deadline: zx::MonotonicInstant,
9598    ) -> Result<Vec<String>, fidl::Error> {
9599        let _response = self
9600            .client
9601            .send_query::<fidl::encoding::EmptyPayload, DictionaryKeyIteratorGetNextResponse>(
9602                (),
9603                0x3806bda34433db54,
9604                fidl::encoding::DynamicFlags::empty(),
9605                ___deadline,
9606            )?;
9607        Ok(_response.keys)
9608    }
9609}
9610
9611#[cfg(target_os = "fuchsia")]
9612impl From<DictionaryKeyIteratorSynchronousProxy> for zx::Handle {
9613    fn from(value: DictionaryKeyIteratorSynchronousProxy) -> Self {
9614        value.into_channel().into()
9615    }
9616}
9617
9618#[cfg(target_os = "fuchsia")]
9619impl From<fidl::Channel> for DictionaryKeyIteratorSynchronousProxy {
9620    fn from(value: fidl::Channel) -> Self {
9621        Self::new(value)
9622    }
9623}
9624
9625#[cfg(target_os = "fuchsia")]
9626impl fidl::endpoints::FromClient for DictionaryKeyIteratorSynchronousProxy {
9627    type Protocol = DictionaryKeyIteratorMarker;
9628
9629    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeyIteratorMarker>) -> Self {
9630        Self::new(value.into_channel())
9631    }
9632}
9633
9634#[derive(Debug, Clone)]
9635pub struct DictionaryKeyIteratorProxy {
9636    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9637}
9638
9639impl fidl::endpoints::Proxy for DictionaryKeyIteratorProxy {
9640    type Protocol = DictionaryKeyIteratorMarker;
9641
9642    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9643        Self::new(inner)
9644    }
9645
9646    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9647        self.client.into_channel().map_err(|client| Self { client })
9648    }
9649
9650    fn as_channel(&self) -> &::fidl::AsyncChannel {
9651        self.client.as_channel()
9652    }
9653}
9654
9655impl DictionaryKeyIteratorProxy {
9656    /// Create a new Proxy for fuchsia.component.runtime/DictionaryKeyIterator.
9657    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9658        let protocol_name =
9659            <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9660        Self { client: fidl::client::Client::new(channel, protocol_name) }
9661    }
9662
9663    /// Get a Stream of events from the remote end of the protocol.
9664    ///
9665    /// # Panics
9666    ///
9667    /// Panics if the event stream was already taken.
9668    pub fn take_event_stream(&self) -> DictionaryKeyIteratorEventStream {
9669        DictionaryKeyIteratorEventStream { event_receiver: self.client.take_event_receiver() }
9670    }
9671
9672    /// Returns the next set of keys in this dictionary. Returns an empty vector
9673    /// when there are no more keys to iterate.
9674    pub fn r#get_next(
9675        &self,
9676    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
9677    {
9678        DictionaryKeyIteratorProxyInterface::r#get_next(self)
9679    }
9680}
9681
9682impl DictionaryKeyIteratorProxyInterface for DictionaryKeyIteratorProxy {
9683    type GetNextResponseFut =
9684        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
9685    fn r#get_next(&self) -> Self::GetNextResponseFut {
9686        fn _decode(
9687            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9688        ) -> Result<Vec<String>, fidl::Error> {
9689            let _response = fidl::client::decode_transaction_body::<
9690                DictionaryKeyIteratorGetNextResponse,
9691                fidl::encoding::DefaultFuchsiaResourceDialect,
9692                0x3806bda34433db54,
9693            >(_buf?)?;
9694            Ok(_response.keys)
9695        }
9696        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
9697            (),
9698            0x3806bda34433db54,
9699            fidl::encoding::DynamicFlags::empty(),
9700            _decode,
9701        )
9702    }
9703}
9704
9705pub struct DictionaryKeyIteratorEventStream {
9706    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9707}
9708
9709impl std::marker::Unpin for DictionaryKeyIteratorEventStream {}
9710
9711impl futures::stream::FusedStream for DictionaryKeyIteratorEventStream {
9712    fn is_terminated(&self) -> bool {
9713        self.event_receiver.is_terminated()
9714    }
9715}
9716
9717impl futures::Stream for DictionaryKeyIteratorEventStream {
9718    type Item = Result<DictionaryKeyIteratorEvent, fidl::Error>;
9719
9720    fn poll_next(
9721        mut self: std::pin::Pin<&mut Self>,
9722        cx: &mut std::task::Context<'_>,
9723    ) -> std::task::Poll<Option<Self::Item>> {
9724        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9725            &mut self.event_receiver,
9726            cx
9727        )?) {
9728            Some(buf) => std::task::Poll::Ready(Some(DictionaryKeyIteratorEvent::decode(buf))),
9729            None => std::task::Poll::Ready(None),
9730        }
9731    }
9732}
9733
9734#[derive(Debug)]
9735pub enum DictionaryKeyIteratorEvent {}
9736
9737impl DictionaryKeyIteratorEvent {
9738    /// Decodes a message buffer as a [`DictionaryKeyIteratorEvent`].
9739    fn decode(
9740        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9741    ) -> Result<DictionaryKeyIteratorEvent, fidl::Error> {
9742        let (bytes, _handles) = buf.split_mut();
9743        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9744        debug_assert_eq!(tx_header.tx_id, 0);
9745        match tx_header.ordinal {
9746            _ => Err(fidl::Error::UnknownOrdinal {
9747                ordinal: tx_header.ordinal,
9748                protocol_name:
9749                    <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9750            }),
9751        }
9752    }
9753}
9754
9755/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryKeyIterator.
9756pub struct DictionaryKeyIteratorRequestStream {
9757    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9758    is_terminated: bool,
9759}
9760
9761impl std::marker::Unpin for DictionaryKeyIteratorRequestStream {}
9762
9763impl futures::stream::FusedStream for DictionaryKeyIteratorRequestStream {
9764    fn is_terminated(&self) -> bool {
9765        self.is_terminated
9766    }
9767}
9768
9769impl fidl::endpoints::RequestStream for DictionaryKeyIteratorRequestStream {
9770    type Protocol = DictionaryKeyIteratorMarker;
9771    type ControlHandle = DictionaryKeyIteratorControlHandle;
9772
9773    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9774        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9775    }
9776
9777    fn control_handle(&self) -> Self::ControlHandle {
9778        DictionaryKeyIteratorControlHandle { inner: self.inner.clone() }
9779    }
9780
9781    fn into_inner(
9782        self,
9783    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9784    {
9785        (self.inner, self.is_terminated)
9786    }
9787
9788    fn from_inner(
9789        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9790        is_terminated: bool,
9791    ) -> Self {
9792        Self { inner, is_terminated }
9793    }
9794}
9795
9796impl futures::Stream for DictionaryKeyIteratorRequestStream {
9797    type Item = Result<DictionaryKeyIteratorRequest, fidl::Error>;
9798
9799    fn poll_next(
9800        mut self: std::pin::Pin<&mut Self>,
9801        cx: &mut std::task::Context<'_>,
9802    ) -> std::task::Poll<Option<Self::Item>> {
9803        let this = &mut *self;
9804        if this.inner.check_shutdown(cx) {
9805            this.is_terminated = true;
9806            return std::task::Poll::Ready(None);
9807        }
9808        if this.is_terminated {
9809            panic!("polled DictionaryKeyIteratorRequestStream after completion");
9810        }
9811        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9812            |bytes, handles| {
9813                match this.inner.channel().read_etc(cx, bytes, handles) {
9814                    std::task::Poll::Ready(Ok(())) => {}
9815                    std::task::Poll::Pending => return std::task::Poll::Pending,
9816                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9817                        this.is_terminated = true;
9818                        return std::task::Poll::Ready(None);
9819                    }
9820                    std::task::Poll::Ready(Err(e)) => {
9821                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9822                            e.into(),
9823                        ))));
9824                    }
9825                }
9826
9827                // A message has been received from the channel
9828                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9829
9830                std::task::Poll::Ready(Some(match header.ordinal {
9831                0x3806bda34433db54 => {
9832                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9833                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
9834                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9835                    let control_handle = DictionaryKeyIteratorControlHandle {
9836                        inner: this.inner.clone(),
9837                    };
9838                    Ok(DictionaryKeyIteratorRequest::GetNext {
9839                        responder: DictionaryKeyIteratorGetNextResponder {
9840                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9841                            tx_id: header.tx_id,
9842                        },
9843                    })
9844                }
9845                _ => Err(fidl::Error::UnknownOrdinal {
9846                    ordinal: header.ordinal,
9847                    protocol_name: <DictionaryKeyIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9848                }),
9849            }))
9850            },
9851        )
9852    }
9853}
9854
9855#[derive(Debug)]
9856pub enum DictionaryKeyIteratorRequest {
9857    /// Returns the next set of keys in this dictionary. Returns an empty vector
9858    /// when there are no more keys to iterate.
9859    GetNext { responder: DictionaryKeyIteratorGetNextResponder },
9860}
9861
9862impl DictionaryKeyIteratorRequest {
9863    #[allow(irrefutable_let_patterns)]
9864    pub fn into_get_next(self) -> Option<(DictionaryKeyIteratorGetNextResponder)> {
9865        if let DictionaryKeyIteratorRequest::GetNext { responder } = self {
9866            Some((responder))
9867        } else {
9868            None
9869        }
9870    }
9871
9872    /// Name of the method defined in FIDL
9873    pub fn method_name(&self) -> &'static str {
9874        match *self {
9875            DictionaryKeyIteratorRequest::GetNext { .. } => "get_next",
9876        }
9877    }
9878}
9879
9880#[derive(Debug, Clone)]
9881pub struct DictionaryKeyIteratorControlHandle {
9882    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9883}
9884
9885impl fidl::endpoints::ControlHandle for DictionaryKeyIteratorControlHandle {
9886    fn shutdown(&self) {
9887        self.inner.shutdown()
9888    }
9889    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9890        self.inner.shutdown_with_epitaph(status)
9891    }
9892
9893    fn is_closed(&self) -> bool {
9894        self.inner.channel().is_closed()
9895    }
9896    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9897        self.inner.channel().on_closed()
9898    }
9899
9900    #[cfg(target_os = "fuchsia")]
9901    fn signal_peer(
9902        &self,
9903        clear_mask: zx::Signals,
9904        set_mask: zx::Signals,
9905    ) -> Result<(), zx_status::Status> {
9906        use fidl::Peered;
9907        self.inner.channel().signal_peer(clear_mask, set_mask)
9908    }
9909}
9910
9911impl DictionaryKeyIteratorControlHandle {}
9912
9913#[must_use = "FIDL methods require a response to be sent"]
9914#[derive(Debug)]
9915pub struct DictionaryKeyIteratorGetNextResponder {
9916    control_handle: std::mem::ManuallyDrop<DictionaryKeyIteratorControlHandle>,
9917    tx_id: u32,
9918}
9919
9920/// Set the the channel to be shutdown (see [`DictionaryKeyIteratorControlHandle::shutdown`])
9921/// if the responder is dropped without sending a response, so that the client
9922/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9923impl std::ops::Drop for DictionaryKeyIteratorGetNextResponder {
9924    fn drop(&mut self) {
9925        self.control_handle.shutdown();
9926        // Safety: drops once, never accessed again
9927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9928    }
9929}
9930
9931impl fidl::endpoints::Responder for DictionaryKeyIteratorGetNextResponder {
9932    type ControlHandle = DictionaryKeyIteratorControlHandle;
9933
9934    fn control_handle(&self) -> &DictionaryKeyIteratorControlHandle {
9935        &self.control_handle
9936    }
9937
9938    fn drop_without_shutdown(mut self) {
9939        // Safety: drops once, never accessed again due to mem::forget
9940        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9941        // Prevent Drop from running (which would shut down the channel)
9942        std::mem::forget(self);
9943    }
9944}
9945
9946impl DictionaryKeyIteratorGetNextResponder {
9947    /// Sends a response to the FIDL transaction.
9948    ///
9949    /// Sets the channel to shutdown if an error occurs.
9950    pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
9951        let _result = self.send_raw(keys);
9952        if _result.is_err() {
9953            self.control_handle.shutdown();
9954        }
9955        self.drop_without_shutdown();
9956        _result
9957    }
9958
9959    /// Similar to "send" but does not shutdown the channel if an error occurs.
9960    pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
9961        let _result = self.send_raw(keys);
9962        self.drop_without_shutdown();
9963        _result
9964    }
9965
9966    fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
9967        self.control_handle.inner.send::<DictionaryKeyIteratorGetNextResponse>(
9968            (keys,),
9969            self.tx_id,
9970            0x3806bda34433db54,
9971            fidl::encoding::DynamicFlags::empty(),
9972        )
9973    }
9974}
9975
9976#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9977pub struct DictionaryRouterMarker;
9978
9979impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
9980    type Proxy = DictionaryRouterProxy;
9981    type RequestStream = DictionaryRouterRequestStream;
9982    #[cfg(target_os = "fuchsia")]
9983    type SynchronousProxy = DictionaryRouterSynchronousProxy;
9984
9985    const DEBUG_NAME: &'static str = "(anonymous) DictionaryRouter";
9986}
9987pub type DictionaryRouterRouteResult = Result<Option<fidl::EventPair>, RouterError>;
9988
9989pub trait DictionaryRouterProxyInterface: Send + Sync {
9990    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
9991        + Send;
9992    fn r#route(&self, request: RouteRequest) -> Self::RouteResponseFut;
9993}
9994#[derive(Debug)]
9995#[cfg(target_os = "fuchsia")]
9996pub struct DictionaryRouterSynchronousProxy {
9997    client: fidl::client::sync::Client,
9998}
9999
10000#[cfg(target_os = "fuchsia")]
10001impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
10002    type Proxy = DictionaryRouterProxy;
10003    type Protocol = DictionaryRouterMarker;
10004
10005    fn from_channel(inner: fidl::Channel) -> Self {
10006        Self::new(inner)
10007    }
10008
10009    fn into_channel(self) -> fidl::Channel {
10010        self.client.into_channel()
10011    }
10012
10013    fn as_channel(&self) -> &fidl::Channel {
10014        self.client.as_channel()
10015    }
10016}
10017
10018#[cfg(target_os = "fuchsia")]
10019impl DictionaryRouterSynchronousProxy {
10020    pub fn new(channel: fidl::Channel) -> Self {
10021        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10022        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10023    }
10024
10025    pub fn into_channel(self) -> fidl::Channel {
10026        self.client.into_channel()
10027    }
10028
10029    /// Waits until an event arrives and returns it. It is safe for other
10030    /// threads to make concurrent requests while waiting for an event.
10031    pub fn wait_for_event(
10032        &self,
10033        deadline: zx::MonotonicInstant,
10034    ) -> Result<DictionaryRouterEvent, fidl::Error> {
10035        DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
10036    }
10037
10038    /// Attempts to produce a `Dictionary` capability from this
10039    /// `DictionaryRouter`. This will return:
10040    ///
10041    /// - A `Dictionary` if the operation is successful.
10042    /// - An empty value if there is no issue found but the capability is not
10043    ///   being provided (for example, an optional route ended in an offer from
10044    ///   void).
10045    /// - An error, if the operation failed.
10046    pub fn r#route(
10047        &self,
10048        mut request: RouteRequest,
10049        ___deadline: zx::MonotonicInstant,
10050    ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
10051        let _response = self.client.send_query::<
10052            DictionaryRouterRouteRequest,
10053            fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
10054        >(
10055            (&mut request,),
10056            0x199389f437b3937b,
10057            fidl::encoding::DynamicFlags::FLEXIBLE,
10058            ___deadline,
10059        )?
10060        .into_result::<DictionaryRouterMarker>("route")?;
10061        Ok(_response.map(|x| x.handle))
10062    }
10063}
10064
10065#[cfg(target_os = "fuchsia")]
10066impl From<DictionaryRouterSynchronousProxy> for zx::Handle {
10067    fn from(value: DictionaryRouterSynchronousProxy) -> Self {
10068        value.into_channel().into()
10069    }
10070}
10071
10072#[cfg(target_os = "fuchsia")]
10073impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
10074    fn from(value: fidl::Channel) -> Self {
10075        Self::new(value)
10076    }
10077}
10078
10079#[cfg(target_os = "fuchsia")]
10080impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
10081    type Protocol = DictionaryRouterMarker;
10082
10083    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
10084        Self::new(value.into_channel())
10085    }
10086}
10087
10088#[derive(Debug, Clone)]
10089pub struct DictionaryRouterProxy {
10090    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10091}
10092
10093impl fidl::endpoints::Proxy for DictionaryRouterProxy {
10094    type Protocol = DictionaryRouterMarker;
10095
10096    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10097        Self::new(inner)
10098    }
10099
10100    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10101        self.client.into_channel().map_err(|client| Self { client })
10102    }
10103
10104    fn as_channel(&self) -> &::fidl::AsyncChannel {
10105        self.client.as_channel()
10106    }
10107}
10108
10109impl DictionaryRouterProxy {
10110    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouter.
10111    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10112        let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10113        Self { client: fidl::client::Client::new(channel, protocol_name) }
10114    }
10115
10116    /// Get a Stream of events from the remote end of the protocol.
10117    ///
10118    /// # Panics
10119    ///
10120    /// Panics if the event stream was already taken.
10121    pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
10122        DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
10123    }
10124
10125    /// Attempts to produce a `Dictionary` capability from this
10126    /// `DictionaryRouter`. This will return:
10127    ///
10128    /// - A `Dictionary` if the operation is successful.
10129    /// - An empty value if there is no issue found but the capability is not
10130    ///   being provided (for example, an optional route ended in an offer from
10131    ///   void).
10132    /// - An error, if the operation failed.
10133    pub fn r#route(
10134        &self,
10135        mut request: RouteRequest,
10136    ) -> fidl::client::QueryResponseFut<
10137        DictionaryRouterRouteResult,
10138        fidl::encoding::DefaultFuchsiaResourceDialect,
10139    > {
10140        DictionaryRouterProxyInterface::r#route(self, request)
10141    }
10142}
10143
10144impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
10145    type RouteResponseFut = fidl::client::QueryResponseFut<
10146        DictionaryRouterRouteResult,
10147        fidl::encoding::DefaultFuchsiaResourceDialect,
10148    >;
10149    fn r#route(&self, mut request: RouteRequest) -> Self::RouteResponseFut {
10150        fn _decode(
10151            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10152        ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
10153            let _response = fidl::client::decode_transaction_body::<
10154                fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
10155                fidl::encoding::DefaultFuchsiaResourceDialect,
10156                0x199389f437b3937b,
10157            >(_buf?)?
10158            .into_result::<DictionaryRouterMarker>("route")?;
10159            Ok(_response.map(|x| x.handle))
10160        }
10161        self.client
10162            .send_query_and_decode::<DictionaryRouterRouteRequest, DictionaryRouterRouteResult>(
10163                (&mut request,),
10164                0x199389f437b3937b,
10165                fidl::encoding::DynamicFlags::FLEXIBLE,
10166                _decode,
10167            )
10168    }
10169}
10170
10171pub struct DictionaryRouterEventStream {
10172    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10173}
10174
10175impl std::marker::Unpin for DictionaryRouterEventStream {}
10176
10177impl futures::stream::FusedStream for DictionaryRouterEventStream {
10178    fn is_terminated(&self) -> bool {
10179        self.event_receiver.is_terminated()
10180    }
10181}
10182
10183impl futures::Stream for DictionaryRouterEventStream {
10184    type Item = Result<DictionaryRouterEvent, fidl::Error>;
10185
10186    fn poll_next(
10187        mut self: std::pin::Pin<&mut Self>,
10188        cx: &mut std::task::Context<'_>,
10189    ) -> std::task::Poll<Option<Self::Item>> {
10190        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10191            &mut self.event_receiver,
10192            cx
10193        )?) {
10194            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
10195            None => std::task::Poll::Ready(None),
10196        }
10197    }
10198}
10199
10200#[derive(Debug)]
10201pub enum DictionaryRouterEvent {
10202    #[non_exhaustive]
10203    _UnknownEvent {
10204        /// Ordinal of the event that was sent.
10205        ordinal: u64,
10206    },
10207}
10208
10209impl DictionaryRouterEvent {
10210    /// Decodes a message buffer as a [`DictionaryRouterEvent`].
10211    fn decode(
10212        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10213    ) -> Result<DictionaryRouterEvent, fidl::Error> {
10214        let (bytes, _handles) = buf.split_mut();
10215        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10216        debug_assert_eq!(tx_header.tx_id, 0);
10217        match tx_header.ordinal {
10218            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10219                Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10220            }
10221            _ => Err(fidl::Error::UnknownOrdinal {
10222                ordinal: tx_header.ordinal,
10223                protocol_name:
10224                    <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10225            }),
10226        }
10227    }
10228}
10229
10230/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouter.
10231pub struct DictionaryRouterRequestStream {
10232    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10233    is_terminated: bool,
10234}
10235
10236impl std::marker::Unpin for DictionaryRouterRequestStream {}
10237
10238impl futures::stream::FusedStream for DictionaryRouterRequestStream {
10239    fn is_terminated(&self) -> bool {
10240        self.is_terminated
10241    }
10242}
10243
10244impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
10245    type Protocol = DictionaryRouterMarker;
10246    type ControlHandle = DictionaryRouterControlHandle;
10247
10248    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10249        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10250    }
10251
10252    fn control_handle(&self) -> Self::ControlHandle {
10253        DictionaryRouterControlHandle { inner: self.inner.clone() }
10254    }
10255
10256    fn into_inner(
10257        self,
10258    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10259    {
10260        (self.inner, self.is_terminated)
10261    }
10262
10263    fn from_inner(
10264        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10265        is_terminated: bool,
10266    ) -> Self {
10267        Self { inner, is_terminated }
10268    }
10269}
10270
10271impl futures::Stream for DictionaryRouterRequestStream {
10272    type Item = Result<DictionaryRouterRequest, fidl::Error>;
10273
10274    fn poll_next(
10275        mut self: std::pin::Pin<&mut Self>,
10276        cx: &mut std::task::Context<'_>,
10277    ) -> std::task::Poll<Option<Self::Item>> {
10278        let this = &mut *self;
10279        if this.inner.check_shutdown(cx) {
10280            this.is_terminated = true;
10281            return std::task::Poll::Ready(None);
10282        }
10283        if this.is_terminated {
10284            panic!("polled DictionaryRouterRequestStream after completion");
10285        }
10286        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10287            |bytes, handles| {
10288                match this.inner.channel().read_etc(cx, bytes, handles) {
10289                    std::task::Poll::Ready(Ok(())) => {}
10290                    std::task::Poll::Pending => return std::task::Poll::Pending,
10291                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10292                        this.is_terminated = true;
10293                        return std::task::Poll::Ready(None);
10294                    }
10295                    std::task::Poll::Ready(Err(e)) => {
10296                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10297                            e.into(),
10298                        ))));
10299                    }
10300                }
10301
10302                // A message has been received from the channel
10303                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10304
10305                std::task::Poll::Ready(Some(match header.ordinal {
10306                    0x199389f437b3937b => {
10307                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10308                        let mut req = fidl::new_empty!(
10309                            DictionaryRouterRouteRequest,
10310                            fidl::encoding::DefaultFuchsiaResourceDialect
10311                        );
10312                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
10313                        let control_handle =
10314                            DictionaryRouterControlHandle { inner: this.inner.clone() };
10315                        Ok(DictionaryRouterRequest::Route {
10316                            request: req.request,
10317
10318                            responder: DictionaryRouterRouteResponder {
10319                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10320                                tx_id: header.tx_id,
10321                            },
10322                        })
10323                    }
10324                    _ if header.tx_id == 0
10325                        && header
10326                            .dynamic_flags()
10327                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10328                    {
10329                        Ok(DictionaryRouterRequest::_UnknownMethod {
10330                            ordinal: header.ordinal,
10331                            control_handle: DictionaryRouterControlHandle {
10332                                inner: this.inner.clone(),
10333                            },
10334                            method_type: fidl::MethodType::OneWay,
10335                        })
10336                    }
10337                    _ if header
10338                        .dynamic_flags()
10339                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10340                    {
10341                        this.inner.send_framework_err(
10342                            fidl::encoding::FrameworkErr::UnknownMethod,
10343                            header.tx_id,
10344                            header.ordinal,
10345                            header.dynamic_flags(),
10346                            (bytes, handles),
10347                        )?;
10348                        Ok(DictionaryRouterRequest::_UnknownMethod {
10349                            ordinal: header.ordinal,
10350                            control_handle: DictionaryRouterControlHandle {
10351                                inner: this.inner.clone(),
10352                            },
10353                            method_type: fidl::MethodType::TwoWay,
10354                        })
10355                    }
10356                    _ => Err(fidl::Error::UnknownOrdinal {
10357                        ordinal: header.ordinal,
10358                        protocol_name:
10359                            <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10360                    }),
10361                }))
10362            },
10363        )
10364    }
10365}
10366
10367/// A factory for `Dictionary` capabilities.
10368#[derive(Debug)]
10369pub enum DictionaryRouterRequest {
10370    /// Attempts to produce a `Dictionary` capability from this
10371    /// `DictionaryRouter`. This will return:
10372    ///
10373    /// - A `Dictionary` if the operation is successful.
10374    /// - An empty value if there is no issue found but the capability is not
10375    ///   being provided (for example, an optional route ended in an offer from
10376    ///   void).
10377    /// - An error, if the operation failed.
10378    Route { request: RouteRequest, responder: DictionaryRouterRouteResponder },
10379    /// An interaction was received which does not match any known method.
10380    #[non_exhaustive]
10381    _UnknownMethod {
10382        /// Ordinal of the method that was called.
10383        ordinal: u64,
10384        control_handle: DictionaryRouterControlHandle,
10385        method_type: fidl::MethodType,
10386    },
10387}
10388
10389impl DictionaryRouterRequest {
10390    #[allow(irrefutable_let_patterns)]
10391    pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
10392        if let DictionaryRouterRequest::Route { request, responder } = self {
10393            Some((request, responder))
10394        } else {
10395            None
10396        }
10397    }
10398
10399    /// Name of the method defined in FIDL
10400    pub fn method_name(&self) -> &'static str {
10401        match *self {
10402            DictionaryRouterRequest::Route { .. } => "route",
10403            DictionaryRouterRequest::_UnknownMethod {
10404                method_type: fidl::MethodType::OneWay,
10405                ..
10406            } => "unknown one-way method",
10407            DictionaryRouterRequest::_UnknownMethod {
10408                method_type: fidl::MethodType::TwoWay,
10409                ..
10410            } => "unknown two-way method",
10411        }
10412    }
10413}
10414
10415#[derive(Debug, Clone)]
10416pub struct DictionaryRouterControlHandle {
10417    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10418}
10419
10420impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
10421    fn shutdown(&self) {
10422        self.inner.shutdown()
10423    }
10424    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10425        self.inner.shutdown_with_epitaph(status)
10426    }
10427
10428    fn is_closed(&self) -> bool {
10429        self.inner.channel().is_closed()
10430    }
10431    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10432        self.inner.channel().on_closed()
10433    }
10434
10435    #[cfg(target_os = "fuchsia")]
10436    fn signal_peer(
10437        &self,
10438        clear_mask: zx::Signals,
10439        set_mask: zx::Signals,
10440    ) -> Result<(), zx_status::Status> {
10441        use fidl::Peered;
10442        self.inner.channel().signal_peer(clear_mask, set_mask)
10443    }
10444}
10445
10446impl DictionaryRouterControlHandle {}
10447
10448#[must_use = "FIDL methods require a response to be sent"]
10449#[derive(Debug)]
10450pub struct DictionaryRouterRouteResponder {
10451    control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
10452    tx_id: u32,
10453}
10454
10455/// Set the the channel to be shutdown (see [`DictionaryRouterControlHandle::shutdown`])
10456/// if the responder is dropped without sending a response, so that the client
10457/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10458impl std::ops::Drop for DictionaryRouterRouteResponder {
10459    fn drop(&mut self) {
10460        self.control_handle.shutdown();
10461        // Safety: drops once, never accessed again
10462        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10463    }
10464}
10465
10466impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
10467    type ControlHandle = DictionaryRouterControlHandle;
10468
10469    fn control_handle(&self) -> &DictionaryRouterControlHandle {
10470        &self.control_handle
10471    }
10472
10473    fn drop_without_shutdown(mut self) {
10474        // Safety: drops once, never accessed again due to mem::forget
10475        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10476        // Prevent Drop from running (which would shut down the channel)
10477        std::mem::forget(self);
10478    }
10479}
10480
10481impl DictionaryRouterRouteResponder {
10482    /// Sends a response to the FIDL transaction.
10483    ///
10484    /// Sets the channel to shutdown if an error occurs.
10485    pub fn send(
10486        self,
10487        mut result: Result<Option<fidl::EventPair>, RouterError>,
10488    ) -> Result<(), fidl::Error> {
10489        let _result = self.send_raw(result);
10490        if _result.is_err() {
10491            self.control_handle.shutdown();
10492        }
10493        self.drop_without_shutdown();
10494        _result
10495    }
10496
10497    /// Similar to "send" but does not shutdown the channel if an error occurs.
10498    pub fn send_no_shutdown_on_err(
10499        self,
10500        mut result: Result<Option<fidl::EventPair>, RouterError>,
10501    ) -> Result<(), fidl::Error> {
10502        let _result = self.send_raw(result);
10503        self.drop_without_shutdown();
10504        _result
10505    }
10506
10507    fn send_raw(
10508        &self,
10509        mut result: Result<Option<fidl::EventPair>, RouterError>,
10510    ) -> Result<(), fidl::Error> {
10511        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10512            DictionaryRouterRouteResponse,
10513            RouterError,
10514        >>(
10515            fidl::encoding::FlexibleResult::new(result.map(|handle| (handle,))),
10516            self.tx_id,
10517            0x199389f437b3937b,
10518            fidl::encoding::DynamicFlags::FLEXIBLE,
10519        )
10520    }
10521}
10522
10523#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10524pub struct DictionaryRouterDeprecatedMarker;
10525
10526impl fidl::endpoints::ProtocolMarker for DictionaryRouterDeprecatedMarker {
10527    type Proxy = DictionaryRouterDeprecatedProxy;
10528    type RequestStream = DictionaryRouterDeprecatedRequestStream;
10529    #[cfg(target_os = "fuchsia")]
10530    type SynchronousProxy = DictionaryRouterDeprecatedSynchronousProxy;
10531
10532    const DEBUG_NAME: &'static str = "(anonymous) DictionaryRouterDeprecated";
10533}
10534pub type DictionaryRouterDeprecatedRouteResult = Result<RouterResponse, RouterError>;
10535
10536pub trait DictionaryRouterDeprecatedProxyInterface: Send + Sync {
10537    fn r#clone(
10538        &self,
10539        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10540    ) -> Result<(), fidl::Error>;
10541    type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterDeprecatedRouteResult, fidl::Error>>
10542        + Send;
10543    fn r#route(
10544        &self,
10545        request: RouteRequest,
10546        dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
10547    ) -> Self::RouteResponseFut;
10548}
10549#[derive(Debug)]
10550#[cfg(target_os = "fuchsia")]
10551pub struct DictionaryRouterDeprecatedSynchronousProxy {
10552    client: fidl::client::sync::Client,
10553}
10554
10555#[cfg(target_os = "fuchsia")]
10556impl fidl::endpoints::SynchronousProxy for DictionaryRouterDeprecatedSynchronousProxy {
10557    type Proxy = DictionaryRouterDeprecatedProxy;
10558    type Protocol = DictionaryRouterDeprecatedMarker;
10559
10560    fn from_channel(inner: fidl::Channel) -> Self {
10561        Self::new(inner)
10562    }
10563
10564    fn into_channel(self) -> fidl::Channel {
10565        self.client.into_channel()
10566    }
10567
10568    fn as_channel(&self) -> &fidl::Channel {
10569        self.client.as_channel()
10570    }
10571}
10572
10573#[cfg(target_os = "fuchsia")]
10574impl DictionaryRouterDeprecatedSynchronousProxy {
10575    pub fn new(channel: fidl::Channel) -> Self {
10576        let protocol_name =
10577            <DictionaryRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10578        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10579    }
10580
10581    pub fn into_channel(self) -> fidl::Channel {
10582        self.client.into_channel()
10583    }
10584
10585    /// Waits until an event arrives and returns it. It is safe for other
10586    /// threads to make concurrent requests while waiting for an event.
10587    pub fn wait_for_event(
10588        &self,
10589        deadline: zx::MonotonicInstant,
10590    ) -> Result<DictionaryRouterDeprecatedEvent, fidl::Error> {
10591        DictionaryRouterDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
10592    }
10593
10594    pub fn r#clone(
10595        &self,
10596        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10597    ) -> Result<(), fidl::Error> {
10598        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
10599            (request,),
10600            0x20d8a7aba2168a79,
10601            fidl::encoding::DynamicFlags::empty(),
10602        )
10603    }
10604
10605    /// Attempts to produce a `Dictionary` capability from this
10606    /// `DictionaryRouter`. This will return:
10607    ///
10608    /// - A `Dictionary` if the operation is successful.
10609    /// - An empty value if there is no issue found but the capability is not
10610    ///   being provided (for example, an optional route ended in an offer from
10611    ///   void).
10612    /// - An error, if the operation failed.
10613    pub fn r#route(
10614        &self,
10615        mut request: RouteRequest,
10616        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
10617        ___deadline: zx::MonotonicInstant,
10618    ) -> Result<DictionaryRouterDeprecatedRouteResult, fidl::Error> {
10619        let _response = self.client.send_query::<
10620            DictionaryRouterDeprecatedRouteRequest,
10621            fidl::encoding::FlexibleResultType<DictionaryRouterDeprecatedRouteResponse, RouterError>,
10622        >(
10623            (&mut request, dictionary_server_end,),
10624            0x10b86c8a8e9eb51a,
10625            fidl::encoding::DynamicFlags::FLEXIBLE,
10626            ___deadline,
10627        )?
10628        .into_result::<DictionaryRouterDeprecatedMarker>("route")?;
10629        Ok(_response.map(|x| x.response))
10630    }
10631}
10632
10633#[cfg(target_os = "fuchsia")]
10634impl From<DictionaryRouterDeprecatedSynchronousProxy> for zx::Handle {
10635    fn from(value: DictionaryRouterDeprecatedSynchronousProxy) -> Self {
10636        value.into_channel().into()
10637    }
10638}
10639
10640#[cfg(target_os = "fuchsia")]
10641impl From<fidl::Channel> for DictionaryRouterDeprecatedSynchronousProxy {
10642    fn from(value: fidl::Channel) -> Self {
10643        Self::new(value)
10644    }
10645}
10646
10647#[cfg(target_os = "fuchsia")]
10648impl fidl::endpoints::FromClient for DictionaryRouterDeprecatedSynchronousProxy {
10649    type Protocol = DictionaryRouterDeprecatedMarker;
10650
10651    fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>) -> Self {
10652        Self::new(value.into_channel())
10653    }
10654}
10655
10656#[derive(Debug, Clone)]
10657pub struct DictionaryRouterDeprecatedProxy {
10658    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10659}
10660
10661impl fidl::endpoints::Proxy for DictionaryRouterDeprecatedProxy {
10662    type Protocol = DictionaryRouterDeprecatedMarker;
10663
10664    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10665        Self::new(inner)
10666    }
10667
10668    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10669        self.client.into_channel().map_err(|client| Self { client })
10670    }
10671
10672    fn as_channel(&self) -> &::fidl::AsyncChannel {
10673        self.client.as_channel()
10674    }
10675}
10676
10677impl DictionaryRouterDeprecatedProxy {
10678    /// Create a new Proxy for fuchsia.component.runtime/DictionaryRouterDeprecated.
10679    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10680        let protocol_name =
10681            <DictionaryRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10682        Self { client: fidl::client::Client::new(channel, protocol_name) }
10683    }
10684
10685    /// Get a Stream of events from the remote end of the protocol.
10686    ///
10687    /// # Panics
10688    ///
10689    /// Panics if the event stream was already taken.
10690    pub fn take_event_stream(&self) -> DictionaryRouterDeprecatedEventStream {
10691        DictionaryRouterDeprecatedEventStream { event_receiver: self.client.take_event_receiver() }
10692    }
10693
10694    pub fn r#clone(
10695        &self,
10696        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10697    ) -> Result<(), fidl::Error> {
10698        DictionaryRouterDeprecatedProxyInterface::r#clone(self, request)
10699    }
10700
10701    /// Attempts to produce a `Dictionary` capability from this
10702    /// `DictionaryRouter`. This will return:
10703    ///
10704    /// - A `Dictionary` if the operation is successful.
10705    /// - An empty value if there is no issue found but the capability is not
10706    ///   being provided (for example, an optional route ended in an offer from
10707    ///   void).
10708    /// - An error, if the operation failed.
10709    pub fn r#route(
10710        &self,
10711        mut request: RouteRequest,
10712        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
10713    ) -> fidl::client::QueryResponseFut<
10714        DictionaryRouterDeprecatedRouteResult,
10715        fidl::encoding::DefaultFuchsiaResourceDialect,
10716    > {
10717        DictionaryRouterDeprecatedProxyInterface::r#route(self, request, dictionary_server_end)
10718    }
10719}
10720
10721impl DictionaryRouterDeprecatedProxyInterface for DictionaryRouterDeprecatedProxy {
10722    fn r#clone(
10723        &self,
10724        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10725    ) -> Result<(), fidl::Error> {
10726        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
10727            (request,),
10728            0x20d8a7aba2168a79,
10729            fidl::encoding::DynamicFlags::empty(),
10730        )
10731    }
10732
10733    type RouteResponseFut = fidl::client::QueryResponseFut<
10734        DictionaryRouterDeprecatedRouteResult,
10735        fidl::encoding::DefaultFuchsiaResourceDialect,
10736    >;
10737    fn r#route(
10738        &self,
10739        mut request: RouteRequest,
10740        mut dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
10741    ) -> Self::RouteResponseFut {
10742        fn _decode(
10743            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10744        ) -> Result<DictionaryRouterDeprecatedRouteResult, fidl::Error> {
10745            let _response = fidl::client::decode_transaction_body::<
10746                fidl::encoding::FlexibleResultType<
10747                    DictionaryRouterDeprecatedRouteResponse,
10748                    RouterError,
10749                >,
10750                fidl::encoding::DefaultFuchsiaResourceDialect,
10751                0x10b86c8a8e9eb51a,
10752            >(_buf?)?
10753            .into_result::<DictionaryRouterDeprecatedMarker>("route")?;
10754            Ok(_response.map(|x| x.response))
10755        }
10756        self.client.send_query_and_decode::<
10757            DictionaryRouterDeprecatedRouteRequest,
10758            DictionaryRouterDeprecatedRouteResult,
10759        >(
10760            (&mut request, dictionary_server_end,),
10761            0x10b86c8a8e9eb51a,
10762            fidl::encoding::DynamicFlags::FLEXIBLE,
10763            _decode,
10764        )
10765    }
10766}
10767
10768pub struct DictionaryRouterDeprecatedEventStream {
10769    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10770}
10771
10772impl std::marker::Unpin for DictionaryRouterDeprecatedEventStream {}
10773
10774impl futures::stream::FusedStream for DictionaryRouterDeprecatedEventStream {
10775    fn is_terminated(&self) -> bool {
10776        self.event_receiver.is_terminated()
10777    }
10778}
10779
10780impl futures::Stream for DictionaryRouterDeprecatedEventStream {
10781    type Item = Result<DictionaryRouterDeprecatedEvent, fidl::Error>;
10782
10783    fn poll_next(
10784        mut self: std::pin::Pin<&mut Self>,
10785        cx: &mut std::task::Context<'_>,
10786    ) -> std::task::Poll<Option<Self::Item>> {
10787        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10788            &mut self.event_receiver,
10789            cx
10790        )?) {
10791            Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterDeprecatedEvent::decode(buf))),
10792            None => std::task::Poll::Ready(None),
10793        }
10794    }
10795}
10796
10797#[derive(Debug)]
10798pub enum DictionaryRouterDeprecatedEvent {
10799    #[non_exhaustive]
10800    _UnknownEvent {
10801        /// Ordinal of the event that was sent.
10802        ordinal: u64,
10803    },
10804}
10805
10806impl DictionaryRouterDeprecatedEvent {
10807    /// Decodes a message buffer as a [`DictionaryRouterDeprecatedEvent`].
10808    fn decode(
10809        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10810    ) -> Result<DictionaryRouterDeprecatedEvent, fidl::Error> {
10811        let (bytes, _handles) = buf.split_mut();
10812        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10813        debug_assert_eq!(tx_header.tx_id, 0);
10814        match tx_header.ordinal {
10815            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10816                Ok(DictionaryRouterDeprecatedEvent::_UnknownEvent {
10817                    ordinal: tx_header.ordinal,
10818                })
10819            }
10820            _ => Err(fidl::Error::UnknownOrdinal {
10821                ordinal: tx_header.ordinal,
10822                protocol_name: <DictionaryRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10823            })
10824        }
10825    }
10826}
10827
10828/// A Stream of incoming requests for fuchsia.component.runtime/DictionaryRouterDeprecated.
10829pub struct DictionaryRouterDeprecatedRequestStream {
10830    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10831    is_terminated: bool,
10832}
10833
10834impl std::marker::Unpin for DictionaryRouterDeprecatedRequestStream {}
10835
10836impl futures::stream::FusedStream for DictionaryRouterDeprecatedRequestStream {
10837    fn is_terminated(&self) -> bool {
10838        self.is_terminated
10839    }
10840}
10841
10842impl fidl::endpoints::RequestStream for DictionaryRouterDeprecatedRequestStream {
10843    type Protocol = DictionaryRouterDeprecatedMarker;
10844    type ControlHandle = DictionaryRouterDeprecatedControlHandle;
10845
10846    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10847        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10848    }
10849
10850    fn control_handle(&self) -> Self::ControlHandle {
10851        DictionaryRouterDeprecatedControlHandle { inner: self.inner.clone() }
10852    }
10853
10854    fn into_inner(
10855        self,
10856    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10857    {
10858        (self.inner, self.is_terminated)
10859    }
10860
10861    fn from_inner(
10862        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10863        is_terminated: bool,
10864    ) -> Self {
10865        Self { inner, is_terminated }
10866    }
10867}
10868
10869impl futures::Stream for DictionaryRouterDeprecatedRequestStream {
10870    type Item = Result<DictionaryRouterDeprecatedRequest, fidl::Error>;
10871
10872    fn poll_next(
10873        mut self: std::pin::Pin<&mut Self>,
10874        cx: &mut std::task::Context<'_>,
10875    ) -> std::task::Poll<Option<Self::Item>> {
10876        let this = &mut *self;
10877        if this.inner.check_shutdown(cx) {
10878            this.is_terminated = true;
10879            return std::task::Poll::Ready(None);
10880        }
10881        if this.is_terminated {
10882            panic!("polled DictionaryRouterDeprecatedRequestStream after completion");
10883        }
10884        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10885            |bytes, handles| {
10886                match this.inner.channel().read_etc(cx, bytes, handles) {
10887                    std::task::Poll::Ready(Ok(())) => {}
10888                    std::task::Poll::Pending => return std::task::Poll::Pending,
10889                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10890                        this.is_terminated = true;
10891                        return std::task::Poll::Ready(None);
10892                    }
10893                    std::task::Poll::Ready(Err(e)) => {
10894                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10895                            e.into(),
10896                        ))));
10897                    }
10898                }
10899
10900                // A message has been received from the channel
10901                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10902
10903                std::task::Poll::Ready(Some(match header.ordinal {
10904                0x20d8a7aba2168a79 => {
10905                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10906                    let mut req = fidl::new_empty!(fidl_fuchsia_unknown::CloneableCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
10907                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
10908                    let control_handle = DictionaryRouterDeprecatedControlHandle {
10909                        inner: this.inner.clone(),
10910                    };
10911                    Ok(DictionaryRouterDeprecatedRequest::Clone {request: req.request,
10912
10913                        control_handle,
10914                    })
10915                }
10916                0x10b86c8a8e9eb51a => {
10917                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10918                    let mut req = fidl::new_empty!(DictionaryRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
10919                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryRouterDeprecatedRouteRequest>(&header, _body_bytes, handles, &mut req)?;
10920                    let control_handle = DictionaryRouterDeprecatedControlHandle {
10921                        inner: this.inner.clone(),
10922                    };
10923                    Ok(DictionaryRouterDeprecatedRequest::Route {request: req.request,
10924dictionary_server_end: req.dictionary_server_end,
10925
10926                        responder: DictionaryRouterDeprecatedRouteResponder {
10927                            control_handle: std::mem::ManuallyDrop::new(control_handle),
10928                            tx_id: header.tx_id,
10929                        },
10930                    })
10931                }
10932                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10933                    Ok(DictionaryRouterDeprecatedRequest::_UnknownMethod {
10934                        ordinal: header.ordinal,
10935                        control_handle: DictionaryRouterDeprecatedControlHandle { inner: this.inner.clone() },
10936                        method_type: fidl::MethodType::OneWay,
10937                    })
10938                }
10939                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10940                    this.inner.send_framework_err(
10941                        fidl::encoding::FrameworkErr::UnknownMethod,
10942                        header.tx_id,
10943                        header.ordinal,
10944                        header.dynamic_flags(),
10945                        (bytes, handles),
10946                    )?;
10947                    Ok(DictionaryRouterDeprecatedRequest::_UnknownMethod {
10948                        ordinal: header.ordinal,
10949                        control_handle: DictionaryRouterDeprecatedControlHandle { inner: this.inner.clone() },
10950                        method_type: fidl::MethodType::TwoWay,
10951                    })
10952                }
10953                _ => Err(fidl::Error::UnknownOrdinal {
10954                    ordinal: header.ordinal,
10955                    protocol_name: <DictionaryRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10956                }),
10957            }))
10958            },
10959        )
10960    }
10961}
10962
10963/// A factory for `Dictionary` capabilities.
10964#[derive(Debug)]
10965pub enum DictionaryRouterDeprecatedRequest {
10966    Clone {
10967        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10968        control_handle: DictionaryRouterDeprecatedControlHandle,
10969    },
10970    /// Attempts to produce a `Dictionary` capability from this
10971    /// `DictionaryRouter`. This will return:
10972    ///
10973    /// - A `Dictionary` if the operation is successful.
10974    /// - An empty value if there is no issue found but the capability is not
10975    ///   being provided (for example, an optional route ended in an offer from
10976    ///   void).
10977    /// - An error, if the operation failed.
10978    Route {
10979        request: RouteRequest,
10980        dictionary_server_end: fidl::endpoints::ServerEnd<DictionaryMarker>,
10981        responder: DictionaryRouterDeprecatedRouteResponder,
10982    },
10983    /// An interaction was received which does not match any known method.
10984    #[non_exhaustive]
10985    _UnknownMethod {
10986        /// Ordinal of the method that was called.
10987        ordinal: u64,
10988        control_handle: DictionaryRouterDeprecatedControlHandle,
10989        method_type: fidl::MethodType,
10990    },
10991}
10992
10993impl DictionaryRouterDeprecatedRequest {
10994    #[allow(irrefutable_let_patterns)]
10995    pub fn into_clone(
10996        self,
10997    ) -> Option<(
10998        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
10999        DictionaryRouterDeprecatedControlHandle,
11000    )> {
11001        if let DictionaryRouterDeprecatedRequest::Clone { request, control_handle } = self {
11002            Some((request, control_handle))
11003        } else {
11004            None
11005        }
11006    }
11007
11008    #[allow(irrefutable_let_patterns)]
11009    pub fn into_route(
11010        self,
11011    ) -> Option<(
11012        RouteRequest,
11013        fidl::endpoints::ServerEnd<DictionaryMarker>,
11014        DictionaryRouterDeprecatedRouteResponder,
11015    )> {
11016        if let DictionaryRouterDeprecatedRequest::Route {
11017            request,
11018            dictionary_server_end,
11019            responder,
11020        } = self
11021        {
11022            Some((request, dictionary_server_end, responder))
11023        } else {
11024            None
11025        }
11026    }
11027
11028    /// Name of the method defined in FIDL
11029    pub fn method_name(&self) -> &'static str {
11030        match *self {
11031            DictionaryRouterDeprecatedRequest::Clone { .. } => "clone",
11032            DictionaryRouterDeprecatedRequest::Route { .. } => "route",
11033            DictionaryRouterDeprecatedRequest::_UnknownMethod {
11034                method_type: fidl::MethodType::OneWay,
11035                ..
11036            } => "unknown one-way method",
11037            DictionaryRouterDeprecatedRequest::_UnknownMethod {
11038                method_type: fidl::MethodType::TwoWay,
11039                ..
11040            } => "unknown two-way method",
11041        }
11042    }
11043}
11044
11045#[derive(Debug, Clone)]
11046pub struct DictionaryRouterDeprecatedControlHandle {
11047    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11048}
11049
11050impl fidl::endpoints::ControlHandle for DictionaryRouterDeprecatedControlHandle {
11051    fn shutdown(&self) {
11052        self.inner.shutdown()
11053    }
11054    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
11055        self.inner.shutdown_with_epitaph(status)
11056    }
11057
11058    fn is_closed(&self) -> bool {
11059        self.inner.channel().is_closed()
11060    }
11061    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11062        self.inner.channel().on_closed()
11063    }
11064
11065    #[cfg(target_os = "fuchsia")]
11066    fn signal_peer(
11067        &self,
11068        clear_mask: zx::Signals,
11069        set_mask: zx::Signals,
11070    ) -> Result<(), zx_status::Status> {
11071        use fidl::Peered;
11072        self.inner.channel().signal_peer(clear_mask, set_mask)
11073    }
11074}
11075
11076impl DictionaryRouterDeprecatedControlHandle {}
11077
11078#[must_use = "FIDL methods require a response to be sent"]
11079#[derive(Debug)]
11080pub struct DictionaryRouterDeprecatedRouteResponder {
11081    control_handle: std::mem::ManuallyDrop<DictionaryRouterDeprecatedControlHandle>,
11082    tx_id: u32,
11083}
11084
11085/// Set the the channel to be shutdown (see [`DictionaryRouterDeprecatedControlHandle::shutdown`])
11086/// if the responder is dropped without sending a response, so that the client
11087/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11088impl std::ops::Drop for DictionaryRouterDeprecatedRouteResponder {
11089    fn drop(&mut self) {
11090        self.control_handle.shutdown();
11091        // Safety: drops once, never accessed again
11092        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11093    }
11094}
11095
11096impl fidl::endpoints::Responder for DictionaryRouterDeprecatedRouteResponder {
11097    type ControlHandle = DictionaryRouterDeprecatedControlHandle;
11098
11099    fn control_handle(&self) -> &DictionaryRouterDeprecatedControlHandle {
11100        &self.control_handle
11101    }
11102
11103    fn drop_without_shutdown(mut self) {
11104        // Safety: drops once, never accessed again due to mem::forget
11105        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11106        // Prevent Drop from running (which would shut down the channel)
11107        std::mem::forget(self);
11108    }
11109}
11110
11111impl DictionaryRouterDeprecatedRouteResponder {
11112    /// Sends a response to the FIDL transaction.
11113    ///
11114    /// Sets the channel to shutdown if an error occurs.
11115    pub fn send(self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
11116        let _result = self.send_raw(result);
11117        if _result.is_err() {
11118            self.control_handle.shutdown();
11119        }
11120        self.drop_without_shutdown();
11121        _result
11122    }
11123
11124    /// Similar to "send" but does not shutdown the channel if an error occurs.
11125    pub fn send_no_shutdown_on_err(
11126        self,
11127        mut result: Result<RouterResponse, RouterError>,
11128    ) -> Result<(), fidl::Error> {
11129        let _result = self.send_raw(result);
11130        self.drop_without_shutdown();
11131        _result
11132    }
11133
11134    fn send_raw(&self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
11135        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11136            DictionaryRouterDeprecatedRouteResponse,
11137            RouterError,
11138        >>(
11139            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
11140            self.tx_id,
11141            0x10b86c8a8e9eb51a,
11142            fidl::encoding::DynamicFlags::FLEXIBLE,
11143        )
11144    }
11145}
11146
11147#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11148pub struct DirConnectorMarker;
11149
11150impl fidl::endpoints::ProtocolMarker for DirConnectorMarker {
11151    type Proxy = DirConnectorProxy;
11152    type RequestStream = DirConnectorRequestStream;
11153    #[cfg(target_os = "fuchsia")]
11154    type SynchronousProxy = DirConnectorSynchronousProxy;
11155
11156    const DEBUG_NAME: &'static str = "(anonymous) DirConnector";
11157}
11158
11159pub trait DirConnectorProxyInterface: Send + Sync {
11160    fn r#clone(
11161        &self,
11162        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11163    ) -> Result<(), fidl::Error>;
11164    fn r#connect(
11165        &self,
11166        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11167    ) -> Result<(), fidl::Error>;
11168}
11169#[derive(Debug)]
11170#[cfg(target_os = "fuchsia")]
11171pub struct DirConnectorSynchronousProxy {
11172    client: fidl::client::sync::Client,
11173}
11174
11175#[cfg(target_os = "fuchsia")]
11176impl fidl::endpoints::SynchronousProxy for DirConnectorSynchronousProxy {
11177    type Proxy = DirConnectorProxy;
11178    type Protocol = DirConnectorMarker;
11179
11180    fn from_channel(inner: fidl::Channel) -> Self {
11181        Self::new(inner)
11182    }
11183
11184    fn into_channel(self) -> fidl::Channel {
11185        self.client.into_channel()
11186    }
11187
11188    fn as_channel(&self) -> &fidl::Channel {
11189        self.client.as_channel()
11190    }
11191}
11192
11193#[cfg(target_os = "fuchsia")]
11194impl DirConnectorSynchronousProxy {
11195    pub fn new(channel: fidl::Channel) -> Self {
11196        let protocol_name = <DirConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11197        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
11198    }
11199
11200    pub fn into_channel(self) -> fidl::Channel {
11201        self.client.into_channel()
11202    }
11203
11204    /// Waits until an event arrives and returns it. It is safe for other
11205    /// threads to make concurrent requests while waiting for an event.
11206    pub fn wait_for_event(
11207        &self,
11208        deadline: zx::MonotonicInstant,
11209    ) -> Result<DirConnectorEvent, fidl::Error> {
11210        DirConnectorEvent::decode(self.client.wait_for_event(deadline)?)
11211    }
11212
11213    pub fn r#clone(
11214        &self,
11215        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11216    ) -> Result<(), fidl::Error> {
11217        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
11218            (request,),
11219            0x20d8a7aba2168a79,
11220            fidl::encoding::DynamicFlags::empty(),
11221        )
11222    }
11223
11224    /// Sends a channel to the `DirReceiver` associated with this `DirConnector`.
11225    pub fn r#connect(
11226        &self,
11227        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11228    ) -> Result<(), fidl::Error> {
11229        self.client.send::<DirConnectorConnectRequest>(
11230            (channel,),
11231            0x23fbb3d289ca7e5b,
11232            fidl::encoding::DynamicFlags::FLEXIBLE,
11233        )
11234    }
11235}
11236
11237#[cfg(target_os = "fuchsia")]
11238impl From<DirConnectorSynchronousProxy> for zx::Handle {
11239    fn from(value: DirConnectorSynchronousProxy) -> Self {
11240        value.into_channel().into()
11241    }
11242}
11243
11244#[cfg(target_os = "fuchsia")]
11245impl From<fidl::Channel> for DirConnectorSynchronousProxy {
11246    fn from(value: fidl::Channel) -> Self {
11247        Self::new(value)
11248    }
11249}
11250
11251#[cfg(target_os = "fuchsia")]
11252impl fidl::endpoints::FromClient for DirConnectorSynchronousProxy {
11253    type Protocol = DirConnectorMarker;
11254
11255    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorMarker>) -> Self {
11256        Self::new(value.into_channel())
11257    }
11258}
11259
11260#[derive(Debug, Clone)]
11261pub struct DirConnectorProxy {
11262    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11263}
11264
11265impl fidl::endpoints::Proxy for DirConnectorProxy {
11266    type Protocol = DirConnectorMarker;
11267
11268    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11269        Self::new(inner)
11270    }
11271
11272    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11273        self.client.into_channel().map_err(|client| Self { client })
11274    }
11275
11276    fn as_channel(&self) -> &::fidl::AsyncChannel {
11277        self.client.as_channel()
11278    }
11279}
11280
11281impl DirConnectorProxy {
11282    /// Create a new Proxy for fuchsia.component.runtime/DirConnector.
11283    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11284        let protocol_name = <DirConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11285        Self { client: fidl::client::Client::new(channel, protocol_name) }
11286    }
11287
11288    /// Get a Stream of events from the remote end of the protocol.
11289    ///
11290    /// # Panics
11291    ///
11292    /// Panics if the event stream was already taken.
11293    pub fn take_event_stream(&self) -> DirConnectorEventStream {
11294        DirConnectorEventStream { event_receiver: self.client.take_event_receiver() }
11295    }
11296
11297    pub fn r#clone(
11298        &self,
11299        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11300    ) -> Result<(), fidl::Error> {
11301        DirConnectorProxyInterface::r#clone(self, request)
11302    }
11303
11304    /// Sends a channel to the `DirReceiver` associated with this `DirConnector`.
11305    pub fn r#connect(
11306        &self,
11307        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11308    ) -> Result<(), fidl::Error> {
11309        DirConnectorProxyInterface::r#connect(self, channel)
11310    }
11311}
11312
11313impl DirConnectorProxyInterface for DirConnectorProxy {
11314    fn r#clone(
11315        &self,
11316        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11317    ) -> Result<(), fidl::Error> {
11318        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
11319            (request,),
11320            0x20d8a7aba2168a79,
11321            fidl::encoding::DynamicFlags::empty(),
11322        )
11323    }
11324
11325    fn r#connect(
11326        &self,
11327        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11328    ) -> Result<(), fidl::Error> {
11329        self.client.send::<DirConnectorConnectRequest>(
11330            (channel,),
11331            0x23fbb3d289ca7e5b,
11332            fidl::encoding::DynamicFlags::FLEXIBLE,
11333        )
11334    }
11335}
11336
11337pub struct DirConnectorEventStream {
11338    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11339}
11340
11341impl std::marker::Unpin for DirConnectorEventStream {}
11342
11343impl futures::stream::FusedStream for DirConnectorEventStream {
11344    fn is_terminated(&self) -> bool {
11345        self.event_receiver.is_terminated()
11346    }
11347}
11348
11349impl futures::Stream for DirConnectorEventStream {
11350    type Item = Result<DirConnectorEvent, fidl::Error>;
11351
11352    fn poll_next(
11353        mut self: std::pin::Pin<&mut Self>,
11354        cx: &mut std::task::Context<'_>,
11355    ) -> std::task::Poll<Option<Self::Item>> {
11356        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11357            &mut self.event_receiver,
11358            cx
11359        )?) {
11360            Some(buf) => std::task::Poll::Ready(Some(DirConnectorEvent::decode(buf))),
11361            None => std::task::Poll::Ready(None),
11362        }
11363    }
11364}
11365
11366#[derive(Debug)]
11367pub enum DirConnectorEvent {
11368    #[non_exhaustive]
11369    _UnknownEvent {
11370        /// Ordinal of the event that was sent.
11371        ordinal: u64,
11372    },
11373}
11374
11375impl DirConnectorEvent {
11376    /// Decodes a message buffer as a [`DirConnectorEvent`].
11377    fn decode(
11378        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11379    ) -> Result<DirConnectorEvent, fidl::Error> {
11380        let (bytes, _handles) = buf.split_mut();
11381        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11382        debug_assert_eq!(tx_header.tx_id, 0);
11383        match tx_header.ordinal {
11384            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11385                Ok(DirConnectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11386            }
11387            _ => Err(fidl::Error::UnknownOrdinal {
11388                ordinal: tx_header.ordinal,
11389                protocol_name: <DirConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11390            }),
11391        }
11392    }
11393}
11394
11395/// A Stream of incoming requests for fuchsia.component.runtime/DirConnector.
11396pub struct DirConnectorRequestStream {
11397    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11398    is_terminated: bool,
11399}
11400
11401impl std::marker::Unpin for DirConnectorRequestStream {}
11402
11403impl futures::stream::FusedStream for DirConnectorRequestStream {
11404    fn is_terminated(&self) -> bool {
11405        self.is_terminated
11406    }
11407}
11408
11409impl fidl::endpoints::RequestStream for DirConnectorRequestStream {
11410    type Protocol = DirConnectorMarker;
11411    type ControlHandle = DirConnectorControlHandle;
11412
11413    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11414        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11415    }
11416
11417    fn control_handle(&self) -> Self::ControlHandle {
11418        DirConnectorControlHandle { inner: self.inner.clone() }
11419    }
11420
11421    fn into_inner(
11422        self,
11423    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11424    {
11425        (self.inner, self.is_terminated)
11426    }
11427
11428    fn from_inner(
11429        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11430        is_terminated: bool,
11431    ) -> Self {
11432        Self { inner, is_terminated }
11433    }
11434}
11435
11436impl futures::Stream for DirConnectorRequestStream {
11437    type Item = Result<DirConnectorRequest, fidl::Error>;
11438
11439    fn poll_next(
11440        mut self: std::pin::Pin<&mut Self>,
11441        cx: &mut std::task::Context<'_>,
11442    ) -> std::task::Poll<Option<Self::Item>> {
11443        let this = &mut *self;
11444        if this.inner.check_shutdown(cx) {
11445            this.is_terminated = true;
11446            return std::task::Poll::Ready(None);
11447        }
11448        if this.is_terminated {
11449            panic!("polled DirConnectorRequestStream after completion");
11450        }
11451        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11452            |bytes, handles| {
11453                match this.inner.channel().read_etc(cx, bytes, handles) {
11454                    std::task::Poll::Ready(Ok(())) => {}
11455                    std::task::Poll::Pending => return std::task::Poll::Pending,
11456                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11457                        this.is_terminated = true;
11458                        return std::task::Poll::Ready(None);
11459                    }
11460                    std::task::Poll::Ready(Err(e)) => {
11461                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11462                            e.into(),
11463                        ))));
11464                    }
11465                }
11466
11467                // A message has been received from the channel
11468                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11469
11470                std::task::Poll::Ready(Some(match header.ordinal {
11471                    0x20d8a7aba2168a79 => {
11472                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11473                        let mut req = fidl::new_empty!(
11474                            fidl_fuchsia_unknown::CloneableCloneRequest,
11475                            fidl::encoding::DefaultFuchsiaResourceDialect
11476                        );
11477                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
11478                        let control_handle =
11479                            DirConnectorControlHandle { inner: this.inner.clone() };
11480                        Ok(DirConnectorRequest::Clone { request: req.request, control_handle })
11481                    }
11482                    0x23fbb3d289ca7e5b => {
11483                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11484                        let mut req = fidl::new_empty!(
11485                            DirConnectorConnectRequest,
11486                            fidl::encoding::DefaultFuchsiaResourceDialect
11487                        );
11488                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
11489                        let control_handle =
11490                            DirConnectorControlHandle { inner: this.inner.clone() };
11491                        Ok(DirConnectorRequest::Connect { channel: req.channel, control_handle })
11492                    }
11493                    _ if header.tx_id == 0
11494                        && header
11495                            .dynamic_flags()
11496                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11497                    {
11498                        Ok(DirConnectorRequest::_UnknownMethod {
11499                            ordinal: header.ordinal,
11500                            control_handle: DirConnectorControlHandle { inner: this.inner.clone() },
11501                            method_type: fidl::MethodType::OneWay,
11502                        })
11503                    }
11504                    _ if header
11505                        .dynamic_flags()
11506                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11507                    {
11508                        this.inner.send_framework_err(
11509                            fidl::encoding::FrameworkErr::UnknownMethod,
11510                            header.tx_id,
11511                            header.ordinal,
11512                            header.dynamic_flags(),
11513                            (bytes, handles),
11514                        )?;
11515                        Ok(DirConnectorRequest::_UnknownMethod {
11516                            ordinal: header.ordinal,
11517                            control_handle: DirConnectorControlHandle { inner: this.inner.clone() },
11518                            method_type: fidl::MethodType::TwoWay,
11519                        })
11520                    }
11521                    _ => Err(fidl::Error::UnknownOrdinal {
11522                        ordinal: header.ordinal,
11523                        protocol_name:
11524                            <DirConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11525                    }),
11526                }))
11527            },
11528        )
11529    }
11530}
11531
11532/// A `DirConnector` represents the sending end of a connection to a capability.
11533/// A `DirConnector` presents as a directory node when inserted into a
11534/// `fuchsia.io.Directory`.
11535#[derive(Debug)]
11536pub enum DirConnectorRequest {
11537    Clone {
11538        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11539        control_handle: DirConnectorControlHandle,
11540    },
11541    /// Sends a channel to the `DirReceiver` associated with this `DirConnector`.
11542    Connect {
11543        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11544        control_handle: DirConnectorControlHandle,
11545    },
11546    /// An interaction was received which does not match any known method.
11547    #[non_exhaustive]
11548    _UnknownMethod {
11549        /// Ordinal of the method that was called.
11550        ordinal: u64,
11551        control_handle: DirConnectorControlHandle,
11552        method_type: fidl::MethodType,
11553    },
11554}
11555
11556impl DirConnectorRequest {
11557    #[allow(irrefutable_let_patterns)]
11558    pub fn into_clone(
11559        self,
11560    ) -> Option<(
11561        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
11562        DirConnectorControlHandle,
11563    )> {
11564        if let DirConnectorRequest::Clone { request, control_handle } = self {
11565            Some((request, control_handle))
11566        } else {
11567            None
11568        }
11569    }
11570
11571    #[allow(irrefutable_let_patterns)]
11572    pub fn into_connect(
11573        self,
11574    ) -> Option<(
11575        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11576        DirConnectorControlHandle,
11577    )> {
11578        if let DirConnectorRequest::Connect { channel, control_handle } = self {
11579            Some((channel, control_handle))
11580        } else {
11581            None
11582        }
11583    }
11584
11585    /// Name of the method defined in FIDL
11586    pub fn method_name(&self) -> &'static str {
11587        match *self {
11588            DirConnectorRequest::Clone { .. } => "clone",
11589            DirConnectorRequest::Connect { .. } => "connect",
11590            DirConnectorRequest::_UnknownMethod {
11591                method_type: fidl::MethodType::OneWay, ..
11592            } => "unknown one-way method",
11593            DirConnectorRequest::_UnknownMethod {
11594                method_type: fidl::MethodType::TwoWay, ..
11595            } => "unknown two-way method",
11596        }
11597    }
11598}
11599
11600#[derive(Debug, Clone)]
11601pub struct DirConnectorControlHandle {
11602    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11603}
11604
11605impl fidl::endpoints::ControlHandle for DirConnectorControlHandle {
11606    fn shutdown(&self) {
11607        self.inner.shutdown()
11608    }
11609    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
11610        self.inner.shutdown_with_epitaph(status)
11611    }
11612
11613    fn is_closed(&self) -> bool {
11614        self.inner.channel().is_closed()
11615    }
11616    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11617        self.inner.channel().on_closed()
11618    }
11619
11620    #[cfg(target_os = "fuchsia")]
11621    fn signal_peer(
11622        &self,
11623        clear_mask: zx::Signals,
11624        set_mask: zx::Signals,
11625    ) -> Result<(), zx_status::Status> {
11626        use fidl::Peered;
11627        self.inner.channel().signal_peer(clear_mask, set_mask)
11628    }
11629}
11630
11631impl DirConnectorControlHandle {}
11632
11633#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11634pub struct DirConnectorRouterMarker;
11635
11636impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
11637    type Proxy = DirConnectorRouterProxy;
11638    type RequestStream = DirConnectorRouterRequestStream;
11639    #[cfg(target_os = "fuchsia")]
11640    type SynchronousProxy = DirConnectorRouterSynchronousProxy;
11641
11642    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouter";
11643}
11644pub type DirConnectorRouterRouteResult = Result<Option<fidl::EventPair>, RouterError>;
11645
11646pub trait DirConnectorRouterProxyInterface: Send + Sync {
11647    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
11648        + Send;
11649    fn r#route(&self, request: RouteRequest) -> Self::RouteResponseFut;
11650}
11651#[derive(Debug)]
11652#[cfg(target_os = "fuchsia")]
11653pub struct DirConnectorRouterSynchronousProxy {
11654    client: fidl::client::sync::Client,
11655}
11656
11657#[cfg(target_os = "fuchsia")]
11658impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
11659    type Proxy = DirConnectorRouterProxy;
11660    type Protocol = DirConnectorRouterMarker;
11661
11662    fn from_channel(inner: fidl::Channel) -> Self {
11663        Self::new(inner)
11664    }
11665
11666    fn into_channel(self) -> fidl::Channel {
11667        self.client.into_channel()
11668    }
11669
11670    fn as_channel(&self) -> &fidl::Channel {
11671        self.client.as_channel()
11672    }
11673}
11674
11675#[cfg(target_os = "fuchsia")]
11676impl DirConnectorRouterSynchronousProxy {
11677    pub fn new(channel: fidl::Channel) -> Self {
11678        let protocol_name =
11679            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11680        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
11681    }
11682
11683    pub fn into_channel(self) -> fidl::Channel {
11684        self.client.into_channel()
11685    }
11686
11687    /// Waits until an event arrives and returns it. It is safe for other
11688    /// threads to make concurrent requests while waiting for an event.
11689    pub fn wait_for_event(
11690        &self,
11691        deadline: zx::MonotonicInstant,
11692    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
11693        DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
11694    }
11695
11696    /// Attempts to produce a `DirConnector` capability from this
11697    /// `DirConnectorRouter`. This will return:
11698    ///
11699    /// - A `DirConnector` if the operation is successful.
11700    /// - An empty value if there is no issue found but the capability is not
11701    ///   being provided (for example, an optional route ended in an offer from
11702    ///   void).
11703    /// - An error, if the operation failed.
11704    pub fn r#route(
11705        &self,
11706        mut request: RouteRequest,
11707        ___deadline: zx::MonotonicInstant,
11708    ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
11709        let _response = self.client.send_query::<
11710            DirConnectorRouterRouteRequest,
11711            fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
11712        >(
11713            (&mut request,),
11714            0x233f2ac038127462,
11715            fidl::encoding::DynamicFlags::FLEXIBLE,
11716            ___deadline,
11717        )?
11718        .into_result::<DirConnectorRouterMarker>("route")?;
11719        Ok(_response.map(|x| x.handle))
11720    }
11721}
11722
11723#[cfg(target_os = "fuchsia")]
11724impl From<DirConnectorRouterSynchronousProxy> for zx::Handle {
11725    fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
11726        value.into_channel().into()
11727    }
11728}
11729
11730#[cfg(target_os = "fuchsia")]
11731impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
11732    fn from(value: fidl::Channel) -> Self {
11733        Self::new(value)
11734    }
11735}
11736
11737#[cfg(target_os = "fuchsia")]
11738impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
11739    type Protocol = DirConnectorRouterMarker;
11740
11741    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
11742        Self::new(value.into_channel())
11743    }
11744}
11745
11746#[derive(Debug, Clone)]
11747pub struct DirConnectorRouterProxy {
11748    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11749}
11750
11751impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
11752    type Protocol = DirConnectorRouterMarker;
11753
11754    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11755        Self::new(inner)
11756    }
11757
11758    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11759        self.client.into_channel().map_err(|client| Self { client })
11760    }
11761
11762    fn as_channel(&self) -> &::fidl::AsyncChannel {
11763        self.client.as_channel()
11764    }
11765}
11766
11767impl DirConnectorRouterProxy {
11768    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouter.
11769    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11770        let protocol_name =
11771            <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11772        Self { client: fidl::client::Client::new(channel, protocol_name) }
11773    }
11774
11775    /// Get a Stream of events from the remote end of the protocol.
11776    ///
11777    /// # Panics
11778    ///
11779    /// Panics if the event stream was already taken.
11780    pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
11781        DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
11782    }
11783
11784    /// Attempts to produce a `DirConnector` capability from this
11785    /// `DirConnectorRouter`. This will return:
11786    ///
11787    /// - A `DirConnector` if the operation is successful.
11788    /// - An empty value if there is no issue found but the capability is not
11789    ///   being provided (for example, an optional route ended in an offer from
11790    ///   void).
11791    /// - An error, if the operation failed.
11792    pub fn r#route(
11793        &self,
11794        mut request: RouteRequest,
11795    ) -> fidl::client::QueryResponseFut<
11796        DirConnectorRouterRouteResult,
11797        fidl::encoding::DefaultFuchsiaResourceDialect,
11798    > {
11799        DirConnectorRouterProxyInterface::r#route(self, request)
11800    }
11801}
11802
11803impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
11804    type RouteResponseFut = fidl::client::QueryResponseFut<
11805        DirConnectorRouterRouteResult,
11806        fidl::encoding::DefaultFuchsiaResourceDialect,
11807    >;
11808    fn r#route(&self, mut request: RouteRequest) -> Self::RouteResponseFut {
11809        fn _decode(
11810            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
11811        ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
11812            let _response = fidl::client::decode_transaction_body::<
11813                fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
11814                fidl::encoding::DefaultFuchsiaResourceDialect,
11815                0x233f2ac038127462,
11816            >(_buf?)?
11817            .into_result::<DirConnectorRouterMarker>("route")?;
11818            Ok(_response.map(|x| x.handle))
11819        }
11820        self.client
11821            .send_query_and_decode::<DirConnectorRouterRouteRequest, DirConnectorRouterRouteResult>(
11822                (&mut request,),
11823                0x233f2ac038127462,
11824                fidl::encoding::DynamicFlags::FLEXIBLE,
11825                _decode,
11826            )
11827    }
11828}
11829
11830pub struct DirConnectorRouterEventStream {
11831    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11832}
11833
11834impl std::marker::Unpin for DirConnectorRouterEventStream {}
11835
11836impl futures::stream::FusedStream for DirConnectorRouterEventStream {
11837    fn is_terminated(&self) -> bool {
11838        self.event_receiver.is_terminated()
11839    }
11840}
11841
11842impl futures::Stream for DirConnectorRouterEventStream {
11843    type Item = Result<DirConnectorRouterEvent, fidl::Error>;
11844
11845    fn poll_next(
11846        mut self: std::pin::Pin<&mut Self>,
11847        cx: &mut std::task::Context<'_>,
11848    ) -> std::task::Poll<Option<Self::Item>> {
11849        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11850            &mut self.event_receiver,
11851            cx
11852        )?) {
11853            Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
11854            None => std::task::Poll::Ready(None),
11855        }
11856    }
11857}
11858
11859#[derive(Debug)]
11860pub enum DirConnectorRouterEvent {
11861    #[non_exhaustive]
11862    _UnknownEvent {
11863        /// Ordinal of the event that was sent.
11864        ordinal: u64,
11865    },
11866}
11867
11868impl DirConnectorRouterEvent {
11869    /// Decodes a message buffer as a [`DirConnectorRouterEvent`].
11870    fn decode(
11871        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11872    ) -> Result<DirConnectorRouterEvent, fidl::Error> {
11873        let (bytes, _handles) = buf.split_mut();
11874        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11875        debug_assert_eq!(tx_header.tx_id, 0);
11876        match tx_header.ordinal {
11877            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11878                Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11879            }
11880            _ => Err(fidl::Error::UnknownOrdinal {
11881                ordinal: tx_header.ordinal,
11882                protocol_name:
11883                    <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11884            }),
11885        }
11886    }
11887}
11888
11889/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouter.
11890pub struct DirConnectorRouterRequestStream {
11891    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11892    is_terminated: bool,
11893}
11894
11895impl std::marker::Unpin for DirConnectorRouterRequestStream {}
11896
11897impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
11898    fn is_terminated(&self) -> bool {
11899        self.is_terminated
11900    }
11901}
11902
11903impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
11904    type Protocol = DirConnectorRouterMarker;
11905    type ControlHandle = DirConnectorRouterControlHandle;
11906
11907    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11908        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11909    }
11910
11911    fn control_handle(&self) -> Self::ControlHandle {
11912        DirConnectorRouterControlHandle { inner: self.inner.clone() }
11913    }
11914
11915    fn into_inner(
11916        self,
11917    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11918    {
11919        (self.inner, self.is_terminated)
11920    }
11921
11922    fn from_inner(
11923        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11924        is_terminated: bool,
11925    ) -> Self {
11926        Self { inner, is_terminated }
11927    }
11928}
11929
11930impl futures::Stream for DirConnectorRouterRequestStream {
11931    type Item = Result<DirConnectorRouterRequest, fidl::Error>;
11932
11933    fn poll_next(
11934        mut self: std::pin::Pin<&mut Self>,
11935        cx: &mut std::task::Context<'_>,
11936    ) -> std::task::Poll<Option<Self::Item>> {
11937        let this = &mut *self;
11938        if this.inner.check_shutdown(cx) {
11939            this.is_terminated = true;
11940            return std::task::Poll::Ready(None);
11941        }
11942        if this.is_terminated {
11943            panic!("polled DirConnectorRouterRequestStream after completion");
11944        }
11945        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11946            |bytes, handles| {
11947                match this.inner.channel().read_etc(cx, bytes, handles) {
11948                    std::task::Poll::Ready(Ok(())) => {}
11949                    std::task::Poll::Pending => return std::task::Poll::Pending,
11950                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11951                        this.is_terminated = true;
11952                        return std::task::Poll::Ready(None);
11953                    }
11954                    std::task::Poll::Ready(Err(e)) => {
11955                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11956                            e.into(),
11957                        ))));
11958                    }
11959                }
11960
11961                // A message has been received from the channel
11962                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11963
11964                std::task::Poll::Ready(Some(match header.ordinal {
11965                0x233f2ac038127462 => {
11966                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
11967                    let mut req = fidl::new_empty!(DirConnectorRouterRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
11968                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterRouteRequest>(&header, _body_bytes, handles, &mut req)?;
11969                    let control_handle = DirConnectorRouterControlHandle {
11970                        inner: this.inner.clone(),
11971                    };
11972                    Ok(DirConnectorRouterRequest::Route {request: req.request,
11973
11974                        responder: DirConnectorRouterRouteResponder {
11975                            control_handle: std::mem::ManuallyDrop::new(control_handle),
11976                            tx_id: header.tx_id,
11977                        },
11978                    })
11979                }
11980                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11981                    Ok(DirConnectorRouterRequest::_UnknownMethod {
11982                        ordinal: header.ordinal,
11983                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
11984                        method_type: fidl::MethodType::OneWay,
11985                    })
11986                }
11987                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11988                    this.inner.send_framework_err(
11989                        fidl::encoding::FrameworkErr::UnknownMethod,
11990                        header.tx_id,
11991                        header.ordinal,
11992                        header.dynamic_flags(),
11993                        (bytes, handles),
11994                    )?;
11995                    Ok(DirConnectorRouterRequest::_UnknownMethod {
11996                        ordinal: header.ordinal,
11997                        control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
11998                        method_type: fidl::MethodType::TwoWay,
11999                    })
12000                }
12001                _ => Err(fidl::Error::UnknownOrdinal {
12002                    ordinal: header.ordinal,
12003                    protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12004                }),
12005            }))
12006            },
12007        )
12008    }
12009}
12010
12011/// A factory for `DirConnector` capabilities.
12012#[derive(Debug)]
12013pub enum DirConnectorRouterRequest {
12014    /// Attempts to produce a `DirConnector` capability from this
12015    /// `DirConnectorRouter`. This will return:
12016    ///
12017    /// - A `DirConnector` if the operation is successful.
12018    /// - An empty value if there is no issue found but the capability is not
12019    ///   being provided (for example, an optional route ended in an offer from
12020    ///   void).
12021    /// - An error, if the operation failed.
12022    Route { request: RouteRequest, responder: DirConnectorRouterRouteResponder },
12023    /// An interaction was received which does not match any known method.
12024    #[non_exhaustive]
12025    _UnknownMethod {
12026        /// Ordinal of the method that was called.
12027        ordinal: u64,
12028        control_handle: DirConnectorRouterControlHandle,
12029        method_type: fidl::MethodType,
12030    },
12031}
12032
12033impl DirConnectorRouterRequest {
12034    #[allow(irrefutable_let_patterns)]
12035    pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
12036        if let DirConnectorRouterRequest::Route { request, responder } = self {
12037            Some((request, responder))
12038        } else {
12039            None
12040        }
12041    }
12042
12043    /// Name of the method defined in FIDL
12044    pub fn method_name(&self) -> &'static str {
12045        match *self {
12046            DirConnectorRouterRequest::Route { .. } => "route",
12047            DirConnectorRouterRequest::_UnknownMethod {
12048                method_type: fidl::MethodType::OneWay,
12049                ..
12050            } => "unknown one-way method",
12051            DirConnectorRouterRequest::_UnknownMethod {
12052                method_type: fidl::MethodType::TwoWay,
12053                ..
12054            } => "unknown two-way method",
12055        }
12056    }
12057}
12058
12059#[derive(Debug, Clone)]
12060pub struct DirConnectorRouterControlHandle {
12061    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12062}
12063
12064impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
12065    fn shutdown(&self) {
12066        self.inner.shutdown()
12067    }
12068    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12069        self.inner.shutdown_with_epitaph(status)
12070    }
12071
12072    fn is_closed(&self) -> bool {
12073        self.inner.channel().is_closed()
12074    }
12075    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12076        self.inner.channel().on_closed()
12077    }
12078
12079    #[cfg(target_os = "fuchsia")]
12080    fn signal_peer(
12081        &self,
12082        clear_mask: zx::Signals,
12083        set_mask: zx::Signals,
12084    ) -> Result<(), zx_status::Status> {
12085        use fidl::Peered;
12086        self.inner.channel().signal_peer(clear_mask, set_mask)
12087    }
12088}
12089
12090impl DirConnectorRouterControlHandle {}
12091
12092#[must_use = "FIDL methods require a response to be sent"]
12093#[derive(Debug)]
12094pub struct DirConnectorRouterRouteResponder {
12095    control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
12096    tx_id: u32,
12097}
12098
12099/// Set the the channel to be shutdown (see [`DirConnectorRouterControlHandle::shutdown`])
12100/// if the responder is dropped without sending a response, so that the client
12101/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12102impl std::ops::Drop for DirConnectorRouterRouteResponder {
12103    fn drop(&mut self) {
12104        self.control_handle.shutdown();
12105        // Safety: drops once, never accessed again
12106        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12107    }
12108}
12109
12110impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
12111    type ControlHandle = DirConnectorRouterControlHandle;
12112
12113    fn control_handle(&self) -> &DirConnectorRouterControlHandle {
12114        &self.control_handle
12115    }
12116
12117    fn drop_without_shutdown(mut self) {
12118        // Safety: drops once, never accessed again due to mem::forget
12119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12120        // Prevent Drop from running (which would shut down the channel)
12121        std::mem::forget(self);
12122    }
12123}
12124
12125impl DirConnectorRouterRouteResponder {
12126    /// Sends a response to the FIDL transaction.
12127    ///
12128    /// Sets the channel to shutdown if an error occurs.
12129    pub fn send(
12130        self,
12131        mut result: Result<Option<fidl::EventPair>, RouterError>,
12132    ) -> Result<(), fidl::Error> {
12133        let _result = self.send_raw(result);
12134        if _result.is_err() {
12135            self.control_handle.shutdown();
12136        }
12137        self.drop_without_shutdown();
12138        _result
12139    }
12140
12141    /// Similar to "send" but does not shutdown the channel if an error occurs.
12142    pub fn send_no_shutdown_on_err(
12143        self,
12144        mut result: Result<Option<fidl::EventPair>, RouterError>,
12145    ) -> Result<(), fidl::Error> {
12146        let _result = self.send_raw(result);
12147        self.drop_without_shutdown();
12148        _result
12149    }
12150
12151    fn send_raw(
12152        &self,
12153        mut result: Result<Option<fidl::EventPair>, RouterError>,
12154    ) -> Result<(), fidl::Error> {
12155        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12156            DirConnectorRouterRouteResponse,
12157            RouterError,
12158        >>(
12159            fidl::encoding::FlexibleResult::new(result.map(|handle| (handle,))),
12160            self.tx_id,
12161            0x233f2ac038127462,
12162            fidl::encoding::DynamicFlags::FLEXIBLE,
12163        )
12164    }
12165}
12166
12167#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12168pub struct DirConnectorRouterDeprecatedMarker;
12169
12170impl fidl::endpoints::ProtocolMarker for DirConnectorRouterDeprecatedMarker {
12171    type Proxy = DirConnectorRouterDeprecatedProxy;
12172    type RequestStream = DirConnectorRouterDeprecatedRequestStream;
12173    #[cfg(target_os = "fuchsia")]
12174    type SynchronousProxy = DirConnectorRouterDeprecatedSynchronousProxy;
12175
12176    const DEBUG_NAME: &'static str = "(anonymous) DirConnectorRouterDeprecated";
12177}
12178pub type DirConnectorRouterDeprecatedRouteResult = Result<RouterResponse, RouterError>;
12179
12180pub trait DirConnectorRouterDeprecatedProxyInterface: Send + Sync {
12181    fn r#clone(
12182        &self,
12183        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12184    ) -> Result<(), fidl::Error>;
12185    type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterDeprecatedRouteResult, fidl::Error>>
12186        + Send;
12187    fn r#route(
12188        &self,
12189        request: RouteRequest,
12190        dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
12191    ) -> Self::RouteResponseFut;
12192}
12193#[derive(Debug)]
12194#[cfg(target_os = "fuchsia")]
12195pub struct DirConnectorRouterDeprecatedSynchronousProxy {
12196    client: fidl::client::sync::Client,
12197}
12198
12199#[cfg(target_os = "fuchsia")]
12200impl fidl::endpoints::SynchronousProxy for DirConnectorRouterDeprecatedSynchronousProxy {
12201    type Proxy = DirConnectorRouterDeprecatedProxy;
12202    type Protocol = DirConnectorRouterDeprecatedMarker;
12203
12204    fn from_channel(inner: fidl::Channel) -> Self {
12205        Self::new(inner)
12206    }
12207
12208    fn into_channel(self) -> fidl::Channel {
12209        self.client.into_channel()
12210    }
12211
12212    fn as_channel(&self) -> &fidl::Channel {
12213        self.client.as_channel()
12214    }
12215}
12216
12217#[cfg(target_os = "fuchsia")]
12218impl DirConnectorRouterDeprecatedSynchronousProxy {
12219    pub fn new(channel: fidl::Channel) -> Self {
12220        let protocol_name =
12221            <DirConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12222        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12223    }
12224
12225    pub fn into_channel(self) -> fidl::Channel {
12226        self.client.into_channel()
12227    }
12228
12229    /// Waits until an event arrives and returns it. It is safe for other
12230    /// threads to make concurrent requests while waiting for an event.
12231    pub fn wait_for_event(
12232        &self,
12233        deadline: zx::MonotonicInstant,
12234    ) -> Result<DirConnectorRouterDeprecatedEvent, fidl::Error> {
12235        DirConnectorRouterDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
12236    }
12237
12238    pub fn r#clone(
12239        &self,
12240        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12241    ) -> Result<(), fidl::Error> {
12242        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12243            (request,),
12244            0x20d8a7aba2168a79,
12245            fidl::encoding::DynamicFlags::empty(),
12246        )
12247    }
12248
12249    /// Attempts to produce a `DirConnector` capability from this
12250    /// `DirConnectorRouter`. This will return:
12251    ///
12252    /// - A `DirConnector` if the operation is successful.
12253    /// - An empty value if there is no issue found but the capability is not
12254    ///   being provided (for example, an optional route ended in an offer from
12255    ///   void).
12256    /// - An error, if the operation failed.
12257    pub fn r#route(
12258        &self,
12259        mut request: RouteRequest,
12260        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
12261        ___deadline: zx::MonotonicInstant,
12262    ) -> Result<DirConnectorRouterDeprecatedRouteResult, fidl::Error> {
12263        let _response = self.client.send_query::<
12264            DirConnectorRouterDeprecatedRouteRequest,
12265            fidl::encoding::FlexibleResultType<DirConnectorRouterDeprecatedRouteResponse, RouterError>,
12266        >(
12267            (&mut request, dir_connector_server_end,),
12268            0x199e1dee6ba3d71a,
12269            fidl::encoding::DynamicFlags::FLEXIBLE,
12270            ___deadline,
12271        )?
12272        .into_result::<DirConnectorRouterDeprecatedMarker>("route")?;
12273        Ok(_response.map(|x| x.response))
12274    }
12275}
12276
12277#[cfg(target_os = "fuchsia")]
12278impl From<DirConnectorRouterDeprecatedSynchronousProxy> for zx::Handle {
12279    fn from(value: DirConnectorRouterDeprecatedSynchronousProxy) -> Self {
12280        value.into_channel().into()
12281    }
12282}
12283
12284#[cfg(target_os = "fuchsia")]
12285impl From<fidl::Channel> for DirConnectorRouterDeprecatedSynchronousProxy {
12286    fn from(value: fidl::Channel) -> Self {
12287        Self::new(value)
12288    }
12289}
12290
12291#[cfg(target_os = "fuchsia")]
12292impl fidl::endpoints::FromClient for DirConnectorRouterDeprecatedSynchronousProxy {
12293    type Protocol = DirConnectorRouterDeprecatedMarker;
12294
12295    fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>) -> Self {
12296        Self::new(value.into_channel())
12297    }
12298}
12299
12300#[derive(Debug, Clone)]
12301pub struct DirConnectorRouterDeprecatedProxy {
12302    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12303}
12304
12305impl fidl::endpoints::Proxy for DirConnectorRouterDeprecatedProxy {
12306    type Protocol = DirConnectorRouterDeprecatedMarker;
12307
12308    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12309        Self::new(inner)
12310    }
12311
12312    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12313        self.client.into_channel().map_err(|client| Self { client })
12314    }
12315
12316    fn as_channel(&self) -> &::fidl::AsyncChannel {
12317        self.client.as_channel()
12318    }
12319}
12320
12321impl DirConnectorRouterDeprecatedProxy {
12322    /// Create a new Proxy for fuchsia.component.runtime/DirConnectorRouterDeprecated.
12323    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12324        let protocol_name =
12325            <DirConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12326        Self { client: fidl::client::Client::new(channel, protocol_name) }
12327    }
12328
12329    /// Get a Stream of events from the remote end of the protocol.
12330    ///
12331    /// # Panics
12332    ///
12333    /// Panics if the event stream was already taken.
12334    pub fn take_event_stream(&self) -> DirConnectorRouterDeprecatedEventStream {
12335        DirConnectorRouterDeprecatedEventStream {
12336            event_receiver: self.client.take_event_receiver(),
12337        }
12338    }
12339
12340    pub fn r#clone(
12341        &self,
12342        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12343    ) -> Result<(), fidl::Error> {
12344        DirConnectorRouterDeprecatedProxyInterface::r#clone(self, request)
12345    }
12346
12347    /// Attempts to produce a `DirConnector` capability from this
12348    /// `DirConnectorRouter`. This will return:
12349    ///
12350    /// - A `DirConnector` if the operation is successful.
12351    /// - An empty value if there is no issue found but the capability is not
12352    ///   being provided (for example, an optional route ended in an offer from
12353    ///   void).
12354    /// - An error, if the operation failed.
12355    pub fn r#route(
12356        &self,
12357        mut request: RouteRequest,
12358        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
12359    ) -> fidl::client::QueryResponseFut<
12360        DirConnectorRouterDeprecatedRouteResult,
12361        fidl::encoding::DefaultFuchsiaResourceDialect,
12362    > {
12363        DirConnectorRouterDeprecatedProxyInterface::r#route(self, request, dir_connector_server_end)
12364    }
12365}
12366
12367impl DirConnectorRouterDeprecatedProxyInterface for DirConnectorRouterDeprecatedProxy {
12368    fn r#clone(
12369        &self,
12370        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12371    ) -> Result<(), fidl::Error> {
12372        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
12373            (request,),
12374            0x20d8a7aba2168a79,
12375            fidl::encoding::DynamicFlags::empty(),
12376        )
12377    }
12378
12379    type RouteResponseFut = fidl::client::QueryResponseFut<
12380        DirConnectorRouterDeprecatedRouteResult,
12381        fidl::encoding::DefaultFuchsiaResourceDialect,
12382    >;
12383    fn r#route(
12384        &self,
12385        mut request: RouteRequest,
12386        mut dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
12387    ) -> Self::RouteResponseFut {
12388        fn _decode(
12389            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
12390        ) -> Result<DirConnectorRouterDeprecatedRouteResult, fidl::Error> {
12391            let _response = fidl::client::decode_transaction_body::<
12392                fidl::encoding::FlexibleResultType<
12393                    DirConnectorRouterDeprecatedRouteResponse,
12394                    RouterError,
12395                >,
12396                fidl::encoding::DefaultFuchsiaResourceDialect,
12397                0x199e1dee6ba3d71a,
12398            >(_buf?)?
12399            .into_result::<DirConnectorRouterDeprecatedMarker>("route")?;
12400            Ok(_response.map(|x| x.response))
12401        }
12402        self.client.send_query_and_decode::<
12403            DirConnectorRouterDeprecatedRouteRequest,
12404            DirConnectorRouterDeprecatedRouteResult,
12405        >(
12406            (&mut request, dir_connector_server_end,),
12407            0x199e1dee6ba3d71a,
12408            fidl::encoding::DynamicFlags::FLEXIBLE,
12409            _decode,
12410        )
12411    }
12412}
12413
12414pub struct DirConnectorRouterDeprecatedEventStream {
12415    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12416}
12417
12418impl std::marker::Unpin for DirConnectorRouterDeprecatedEventStream {}
12419
12420impl futures::stream::FusedStream for DirConnectorRouterDeprecatedEventStream {
12421    fn is_terminated(&self) -> bool {
12422        self.event_receiver.is_terminated()
12423    }
12424}
12425
12426impl futures::Stream for DirConnectorRouterDeprecatedEventStream {
12427    type Item = Result<DirConnectorRouterDeprecatedEvent, fidl::Error>;
12428
12429    fn poll_next(
12430        mut self: std::pin::Pin<&mut Self>,
12431        cx: &mut std::task::Context<'_>,
12432    ) -> std::task::Poll<Option<Self::Item>> {
12433        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12434            &mut self.event_receiver,
12435            cx
12436        )?) {
12437            Some(buf) => {
12438                std::task::Poll::Ready(Some(DirConnectorRouterDeprecatedEvent::decode(buf)))
12439            }
12440            None => std::task::Poll::Ready(None),
12441        }
12442    }
12443}
12444
12445#[derive(Debug)]
12446pub enum DirConnectorRouterDeprecatedEvent {
12447    #[non_exhaustive]
12448    _UnknownEvent {
12449        /// Ordinal of the event that was sent.
12450        ordinal: u64,
12451    },
12452}
12453
12454impl DirConnectorRouterDeprecatedEvent {
12455    /// Decodes a message buffer as a [`DirConnectorRouterDeprecatedEvent`].
12456    fn decode(
12457        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12458    ) -> Result<DirConnectorRouterDeprecatedEvent, fidl::Error> {
12459        let (bytes, _handles) = buf.split_mut();
12460        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12461        debug_assert_eq!(tx_header.tx_id, 0);
12462        match tx_header.ordinal {
12463            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12464                Ok(DirConnectorRouterDeprecatedEvent::_UnknownEvent {
12465                    ordinal: tx_header.ordinal,
12466                })
12467            }
12468            _ => Err(fidl::Error::UnknownOrdinal {
12469                ordinal: tx_header.ordinal,
12470                protocol_name: <DirConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12471            })
12472        }
12473    }
12474}
12475
12476/// A Stream of incoming requests for fuchsia.component.runtime/DirConnectorRouterDeprecated.
12477pub struct DirConnectorRouterDeprecatedRequestStream {
12478    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12479    is_terminated: bool,
12480}
12481
12482impl std::marker::Unpin for DirConnectorRouterDeprecatedRequestStream {}
12483
12484impl futures::stream::FusedStream for DirConnectorRouterDeprecatedRequestStream {
12485    fn is_terminated(&self) -> bool {
12486        self.is_terminated
12487    }
12488}
12489
12490impl fidl::endpoints::RequestStream for DirConnectorRouterDeprecatedRequestStream {
12491    type Protocol = DirConnectorRouterDeprecatedMarker;
12492    type ControlHandle = DirConnectorRouterDeprecatedControlHandle;
12493
12494    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12495        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12496    }
12497
12498    fn control_handle(&self) -> Self::ControlHandle {
12499        DirConnectorRouterDeprecatedControlHandle { inner: self.inner.clone() }
12500    }
12501
12502    fn into_inner(
12503        self,
12504    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12505    {
12506        (self.inner, self.is_terminated)
12507    }
12508
12509    fn from_inner(
12510        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12511        is_terminated: bool,
12512    ) -> Self {
12513        Self { inner, is_terminated }
12514    }
12515}
12516
12517impl futures::Stream for DirConnectorRouterDeprecatedRequestStream {
12518    type Item = Result<DirConnectorRouterDeprecatedRequest, fidl::Error>;
12519
12520    fn poll_next(
12521        mut self: std::pin::Pin<&mut Self>,
12522        cx: &mut std::task::Context<'_>,
12523    ) -> std::task::Poll<Option<Self::Item>> {
12524        let this = &mut *self;
12525        if this.inner.check_shutdown(cx) {
12526            this.is_terminated = true;
12527            return std::task::Poll::Ready(None);
12528        }
12529        if this.is_terminated {
12530            panic!("polled DirConnectorRouterDeprecatedRequestStream after completion");
12531        }
12532        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12533            |bytes, handles| {
12534                match this.inner.channel().read_etc(cx, bytes, handles) {
12535                    std::task::Poll::Ready(Ok(())) => {}
12536                    std::task::Poll::Pending => return std::task::Poll::Pending,
12537                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12538                        this.is_terminated = true;
12539                        return std::task::Poll::Ready(None);
12540                    }
12541                    std::task::Poll::Ready(Err(e)) => {
12542                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12543                            e.into(),
12544                        ))));
12545                    }
12546                }
12547
12548                // A message has been received from the channel
12549                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12550
12551                std::task::Poll::Ready(Some(match header.ordinal {
12552                0x20d8a7aba2168a79 => {
12553                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12554                    let mut req = fidl::new_empty!(fidl_fuchsia_unknown::CloneableCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
12555                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
12556                    let control_handle = DirConnectorRouterDeprecatedControlHandle {
12557                        inner: this.inner.clone(),
12558                    };
12559                    Ok(DirConnectorRouterDeprecatedRequest::Clone {request: req.request,
12560
12561                        control_handle,
12562                    })
12563                }
12564                0x199e1dee6ba3d71a => {
12565                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
12566                    let mut req = fidl::new_empty!(DirConnectorRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
12567                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirConnectorRouterDeprecatedRouteRequest>(&header, _body_bytes, handles, &mut req)?;
12568                    let control_handle = DirConnectorRouterDeprecatedControlHandle {
12569                        inner: this.inner.clone(),
12570                    };
12571                    Ok(DirConnectorRouterDeprecatedRequest::Route {request: req.request,
12572dir_connector_server_end: req.dir_connector_server_end,
12573
12574                        responder: DirConnectorRouterDeprecatedRouteResponder {
12575                            control_handle: std::mem::ManuallyDrop::new(control_handle),
12576                            tx_id: header.tx_id,
12577                        },
12578                    })
12579                }
12580                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12581                    Ok(DirConnectorRouterDeprecatedRequest::_UnknownMethod {
12582                        ordinal: header.ordinal,
12583                        control_handle: DirConnectorRouterDeprecatedControlHandle { inner: this.inner.clone() },
12584                        method_type: fidl::MethodType::OneWay,
12585                    })
12586                }
12587                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12588                    this.inner.send_framework_err(
12589                        fidl::encoding::FrameworkErr::UnknownMethod,
12590                        header.tx_id,
12591                        header.ordinal,
12592                        header.dynamic_flags(),
12593                        (bytes, handles),
12594                    )?;
12595                    Ok(DirConnectorRouterDeprecatedRequest::_UnknownMethod {
12596                        ordinal: header.ordinal,
12597                        control_handle: DirConnectorRouterDeprecatedControlHandle { inner: this.inner.clone() },
12598                        method_type: fidl::MethodType::TwoWay,
12599                    })
12600                }
12601                _ => Err(fidl::Error::UnknownOrdinal {
12602                    ordinal: header.ordinal,
12603                    protocol_name: <DirConnectorRouterDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12604                }),
12605            }))
12606            },
12607        )
12608    }
12609}
12610
12611/// A factory for `DirConnector` capabilities.
12612#[derive(Debug)]
12613pub enum DirConnectorRouterDeprecatedRequest {
12614    Clone {
12615        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12616        control_handle: DirConnectorRouterDeprecatedControlHandle,
12617    },
12618    /// Attempts to produce a `DirConnector` capability from this
12619    /// `DirConnectorRouter`. This will return:
12620    ///
12621    /// - A `DirConnector` if the operation is successful.
12622    /// - An empty value if there is no issue found but the capability is not
12623    ///   being provided (for example, an optional route ended in an offer from
12624    ///   void).
12625    /// - An error, if the operation failed.
12626    Route {
12627        request: RouteRequest,
12628        dir_connector_server_end: fidl::endpoints::ServerEnd<DirConnectorMarker>,
12629        responder: DirConnectorRouterDeprecatedRouteResponder,
12630    },
12631    /// An interaction was received which does not match any known method.
12632    #[non_exhaustive]
12633    _UnknownMethod {
12634        /// Ordinal of the method that was called.
12635        ordinal: u64,
12636        control_handle: DirConnectorRouterDeprecatedControlHandle,
12637        method_type: fidl::MethodType,
12638    },
12639}
12640
12641impl DirConnectorRouterDeprecatedRequest {
12642    #[allow(irrefutable_let_patterns)]
12643    pub fn into_clone(
12644        self,
12645    ) -> Option<(
12646        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
12647        DirConnectorRouterDeprecatedControlHandle,
12648    )> {
12649        if let DirConnectorRouterDeprecatedRequest::Clone { request, control_handle } = self {
12650            Some((request, control_handle))
12651        } else {
12652            None
12653        }
12654    }
12655
12656    #[allow(irrefutable_let_patterns)]
12657    pub fn into_route(
12658        self,
12659    ) -> Option<(
12660        RouteRequest,
12661        fidl::endpoints::ServerEnd<DirConnectorMarker>,
12662        DirConnectorRouterDeprecatedRouteResponder,
12663    )> {
12664        if let DirConnectorRouterDeprecatedRequest::Route {
12665            request,
12666            dir_connector_server_end,
12667            responder,
12668        } = self
12669        {
12670            Some((request, dir_connector_server_end, responder))
12671        } else {
12672            None
12673        }
12674    }
12675
12676    /// Name of the method defined in FIDL
12677    pub fn method_name(&self) -> &'static str {
12678        match *self {
12679            DirConnectorRouterDeprecatedRequest::Clone { .. } => "clone",
12680            DirConnectorRouterDeprecatedRequest::Route { .. } => "route",
12681            DirConnectorRouterDeprecatedRequest::_UnknownMethod {
12682                method_type: fidl::MethodType::OneWay,
12683                ..
12684            } => "unknown one-way method",
12685            DirConnectorRouterDeprecatedRequest::_UnknownMethod {
12686                method_type: fidl::MethodType::TwoWay,
12687                ..
12688            } => "unknown two-way method",
12689        }
12690    }
12691}
12692
12693#[derive(Debug, Clone)]
12694pub struct DirConnectorRouterDeprecatedControlHandle {
12695    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12696}
12697
12698impl fidl::endpoints::ControlHandle for DirConnectorRouterDeprecatedControlHandle {
12699    fn shutdown(&self) {
12700        self.inner.shutdown()
12701    }
12702    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
12703        self.inner.shutdown_with_epitaph(status)
12704    }
12705
12706    fn is_closed(&self) -> bool {
12707        self.inner.channel().is_closed()
12708    }
12709    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12710        self.inner.channel().on_closed()
12711    }
12712
12713    #[cfg(target_os = "fuchsia")]
12714    fn signal_peer(
12715        &self,
12716        clear_mask: zx::Signals,
12717        set_mask: zx::Signals,
12718    ) -> Result<(), zx_status::Status> {
12719        use fidl::Peered;
12720        self.inner.channel().signal_peer(clear_mask, set_mask)
12721    }
12722}
12723
12724impl DirConnectorRouterDeprecatedControlHandle {}
12725
12726#[must_use = "FIDL methods require a response to be sent"]
12727#[derive(Debug)]
12728pub struct DirConnectorRouterDeprecatedRouteResponder {
12729    control_handle: std::mem::ManuallyDrop<DirConnectorRouterDeprecatedControlHandle>,
12730    tx_id: u32,
12731}
12732
12733/// Set the the channel to be shutdown (see [`DirConnectorRouterDeprecatedControlHandle::shutdown`])
12734/// if the responder is dropped without sending a response, so that the client
12735/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
12736impl std::ops::Drop for DirConnectorRouterDeprecatedRouteResponder {
12737    fn drop(&mut self) {
12738        self.control_handle.shutdown();
12739        // Safety: drops once, never accessed again
12740        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12741    }
12742}
12743
12744impl fidl::endpoints::Responder for DirConnectorRouterDeprecatedRouteResponder {
12745    type ControlHandle = DirConnectorRouterDeprecatedControlHandle;
12746
12747    fn control_handle(&self) -> &DirConnectorRouterDeprecatedControlHandle {
12748        &self.control_handle
12749    }
12750
12751    fn drop_without_shutdown(mut self) {
12752        // Safety: drops once, never accessed again due to mem::forget
12753        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
12754        // Prevent Drop from running (which would shut down the channel)
12755        std::mem::forget(self);
12756    }
12757}
12758
12759impl DirConnectorRouterDeprecatedRouteResponder {
12760    /// Sends a response to the FIDL transaction.
12761    ///
12762    /// Sets the channel to shutdown if an error occurs.
12763    pub fn send(self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
12764        let _result = self.send_raw(result);
12765        if _result.is_err() {
12766            self.control_handle.shutdown();
12767        }
12768        self.drop_without_shutdown();
12769        _result
12770    }
12771
12772    /// Similar to "send" but does not shutdown the channel if an error occurs.
12773    pub fn send_no_shutdown_on_err(
12774        self,
12775        mut result: Result<RouterResponse, RouterError>,
12776    ) -> Result<(), fidl::Error> {
12777        let _result = self.send_raw(result);
12778        self.drop_without_shutdown();
12779        _result
12780    }
12781
12782    fn send_raw(&self, mut result: Result<RouterResponse, RouterError>) -> Result<(), fidl::Error> {
12783        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
12784            DirConnectorRouterDeprecatedRouteResponse,
12785            RouterError,
12786        >>(
12787            fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
12788            self.tx_id,
12789            0x199e1dee6ba3d71a,
12790            fidl::encoding::DynamicFlags::FLEXIBLE,
12791        )
12792    }
12793}
12794
12795#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12796pub struct DirReceiverMarker;
12797
12798impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
12799    type Proxy = DirReceiverProxy;
12800    type RequestStream = DirReceiverRequestStream;
12801    #[cfg(target_os = "fuchsia")]
12802    type SynchronousProxy = DirReceiverSynchronousProxy;
12803
12804    const DEBUG_NAME: &'static str = "(anonymous) DirReceiver";
12805}
12806
12807pub trait DirReceiverProxyInterface: Send + Sync {
12808    fn r#receive(
12809        &self,
12810        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12811        rights: fidl_fuchsia_io::Flags,
12812    ) -> Result<(), fidl::Error>;
12813}
12814#[derive(Debug)]
12815#[cfg(target_os = "fuchsia")]
12816pub struct DirReceiverSynchronousProxy {
12817    client: fidl::client::sync::Client,
12818}
12819
12820#[cfg(target_os = "fuchsia")]
12821impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
12822    type Proxy = DirReceiverProxy;
12823    type Protocol = DirReceiverMarker;
12824
12825    fn from_channel(inner: fidl::Channel) -> Self {
12826        Self::new(inner)
12827    }
12828
12829    fn into_channel(self) -> fidl::Channel {
12830        self.client.into_channel()
12831    }
12832
12833    fn as_channel(&self) -> &fidl::Channel {
12834        self.client.as_channel()
12835    }
12836}
12837
12838#[cfg(target_os = "fuchsia")]
12839impl DirReceiverSynchronousProxy {
12840    pub fn new(channel: fidl::Channel) -> Self {
12841        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12842        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
12843    }
12844
12845    pub fn into_channel(self) -> fidl::Channel {
12846        self.client.into_channel()
12847    }
12848
12849    /// Waits until an event arrives and returns it. It is safe for other
12850    /// threads to make concurrent requests while waiting for an event.
12851    pub fn wait_for_event(
12852        &self,
12853        deadline: zx::MonotonicInstant,
12854    ) -> Result<DirReceiverEvent, fidl::Error> {
12855        DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
12856    }
12857
12858    /// `Receive` will be called by component manager whenever a new handle has
12859    /// been given to any `DirConnector` associated with this `DirReceiver`.
12860    pub fn r#receive(
12861        &self,
12862        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12863        mut rights: fidl_fuchsia_io::Flags,
12864    ) -> Result<(), fidl::Error> {
12865        self.client.send::<DirReceiverReceiveRequest>(
12866            (channel, rights),
12867            0x4ac564d726bb325e,
12868            fidl::encoding::DynamicFlags::empty(),
12869        )
12870    }
12871}
12872
12873#[cfg(target_os = "fuchsia")]
12874impl From<DirReceiverSynchronousProxy> for zx::Handle {
12875    fn from(value: DirReceiverSynchronousProxy) -> Self {
12876        value.into_channel().into()
12877    }
12878}
12879
12880#[cfg(target_os = "fuchsia")]
12881impl From<fidl::Channel> for DirReceiverSynchronousProxy {
12882    fn from(value: fidl::Channel) -> Self {
12883        Self::new(value)
12884    }
12885}
12886
12887#[cfg(target_os = "fuchsia")]
12888impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
12889    type Protocol = DirReceiverMarker;
12890
12891    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
12892        Self::new(value.into_channel())
12893    }
12894}
12895
12896#[derive(Debug, Clone)]
12897pub struct DirReceiverProxy {
12898    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12899}
12900
12901impl fidl::endpoints::Proxy for DirReceiverProxy {
12902    type Protocol = DirReceiverMarker;
12903
12904    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12905        Self::new(inner)
12906    }
12907
12908    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12909        self.client.into_channel().map_err(|client| Self { client })
12910    }
12911
12912    fn as_channel(&self) -> &::fidl::AsyncChannel {
12913        self.client.as_channel()
12914    }
12915}
12916
12917impl DirReceiverProxy {
12918    /// Create a new Proxy for fuchsia.component.runtime/DirReceiver.
12919    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12920        let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12921        Self { client: fidl::client::Client::new(channel, protocol_name) }
12922    }
12923
12924    /// Get a Stream of events from the remote end of the protocol.
12925    ///
12926    /// # Panics
12927    ///
12928    /// Panics if the event stream was already taken.
12929    pub fn take_event_stream(&self) -> DirReceiverEventStream {
12930        DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
12931    }
12932
12933    /// `Receive` will be called by component manager whenever a new handle has
12934    /// been given to any `DirConnector` associated with this `DirReceiver`.
12935    pub fn r#receive(
12936        &self,
12937        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12938        mut rights: fidl_fuchsia_io::Flags,
12939    ) -> Result<(), fidl::Error> {
12940        DirReceiverProxyInterface::r#receive(self, channel, rights)
12941    }
12942}
12943
12944impl DirReceiverProxyInterface for DirReceiverProxy {
12945    fn r#receive(
12946        &self,
12947        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
12948        mut rights: fidl_fuchsia_io::Flags,
12949    ) -> Result<(), fidl::Error> {
12950        self.client.send::<DirReceiverReceiveRequest>(
12951            (channel, rights),
12952            0x4ac564d726bb325e,
12953            fidl::encoding::DynamicFlags::empty(),
12954        )
12955    }
12956}
12957
12958pub struct DirReceiverEventStream {
12959    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12960}
12961
12962impl std::marker::Unpin for DirReceiverEventStream {}
12963
12964impl futures::stream::FusedStream for DirReceiverEventStream {
12965    fn is_terminated(&self) -> bool {
12966        self.event_receiver.is_terminated()
12967    }
12968}
12969
12970impl futures::Stream for DirReceiverEventStream {
12971    type Item = Result<DirReceiverEvent, fidl::Error>;
12972
12973    fn poll_next(
12974        mut self: std::pin::Pin<&mut Self>,
12975        cx: &mut std::task::Context<'_>,
12976    ) -> std::task::Poll<Option<Self::Item>> {
12977        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12978            &mut self.event_receiver,
12979            cx
12980        )?) {
12981            Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
12982            None => std::task::Poll::Ready(None),
12983        }
12984    }
12985}
12986
12987#[derive(Debug)]
12988pub enum DirReceiverEvent {}
12989
12990impl DirReceiverEvent {
12991    /// Decodes a message buffer as a [`DirReceiverEvent`].
12992    fn decode(
12993        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12994    ) -> Result<DirReceiverEvent, fidl::Error> {
12995        let (bytes, _handles) = buf.split_mut();
12996        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12997        debug_assert_eq!(tx_header.tx_id, 0);
12998        match tx_header.ordinal {
12999            _ => Err(fidl::Error::UnknownOrdinal {
13000                ordinal: tx_header.ordinal,
13001                protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13002            }),
13003        }
13004    }
13005}
13006
13007/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiver.
13008pub struct DirReceiverRequestStream {
13009    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13010    is_terminated: bool,
13011}
13012
13013impl std::marker::Unpin for DirReceiverRequestStream {}
13014
13015impl futures::stream::FusedStream for DirReceiverRequestStream {
13016    fn is_terminated(&self) -> bool {
13017        self.is_terminated
13018    }
13019}
13020
13021impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
13022    type Protocol = DirReceiverMarker;
13023    type ControlHandle = DirReceiverControlHandle;
13024
13025    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
13026        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13027    }
13028
13029    fn control_handle(&self) -> Self::ControlHandle {
13030        DirReceiverControlHandle { inner: self.inner.clone() }
13031    }
13032
13033    fn into_inner(
13034        self,
13035    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
13036    {
13037        (self.inner, self.is_terminated)
13038    }
13039
13040    fn from_inner(
13041        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13042        is_terminated: bool,
13043    ) -> Self {
13044        Self { inner, is_terminated }
13045    }
13046}
13047
13048impl futures::Stream for DirReceiverRequestStream {
13049    type Item = Result<DirReceiverRequest, fidl::Error>;
13050
13051    fn poll_next(
13052        mut self: std::pin::Pin<&mut Self>,
13053        cx: &mut std::task::Context<'_>,
13054    ) -> std::task::Poll<Option<Self::Item>> {
13055        let this = &mut *self;
13056        if this.inner.check_shutdown(cx) {
13057            this.is_terminated = true;
13058            return std::task::Poll::Ready(None);
13059        }
13060        if this.is_terminated {
13061            panic!("polled DirReceiverRequestStream after completion");
13062        }
13063        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
13064            |bytes, handles| {
13065                match this.inner.channel().read_etc(cx, bytes, handles) {
13066                    std::task::Poll::Ready(Ok(())) => {}
13067                    std::task::Poll::Pending => return std::task::Poll::Pending,
13068                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
13069                        this.is_terminated = true;
13070                        return std::task::Poll::Ready(None);
13071                    }
13072                    std::task::Poll::Ready(Err(e)) => {
13073                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13074                            e.into(),
13075                        ))));
13076                    }
13077                }
13078
13079                // A message has been received from the channel
13080                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13081
13082                std::task::Poll::Ready(Some(match header.ordinal {
13083                    0x4ac564d726bb325e => {
13084                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
13085                        let mut req = fidl::new_empty!(
13086                            DirReceiverReceiveRequest,
13087                            fidl::encoding::DefaultFuchsiaResourceDialect
13088                        );
13089                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
13090                        let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
13091                        Ok(DirReceiverRequest::Receive {
13092                            channel: req.channel,
13093                            rights: req.rights,
13094
13095                            control_handle,
13096                        })
13097                    }
13098                    _ => Err(fidl::Error::UnknownOrdinal {
13099                        ordinal: header.ordinal,
13100                        protocol_name:
13101                            <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13102                    }),
13103                }))
13104            },
13105        )
13106    }
13107}
13108
13109/// A `DirReceiver` represents the receiving end of a `DirConnector`.
13110#[derive(Debug)]
13111pub enum DirReceiverRequest {
13112    /// `Receive` will be called by component manager whenever a new handle has
13113    /// been given to any `DirConnector` associated with this `DirReceiver`.
13114    Receive {
13115        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13116        rights: fidl_fuchsia_io::Flags,
13117        control_handle: DirReceiverControlHandle,
13118    },
13119}
13120
13121impl DirReceiverRequest {
13122    #[allow(irrefutable_let_patterns)]
13123    pub fn into_receive(
13124        self,
13125    ) -> Option<(
13126        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13127        fidl_fuchsia_io::Flags,
13128        DirReceiverControlHandle,
13129    )> {
13130        if let DirReceiverRequest::Receive { channel, rights, control_handle } = self {
13131            Some((channel, rights, control_handle))
13132        } else {
13133            None
13134        }
13135    }
13136
13137    /// Name of the method defined in FIDL
13138    pub fn method_name(&self) -> &'static str {
13139        match *self {
13140            DirReceiverRequest::Receive { .. } => "receive",
13141        }
13142    }
13143}
13144
13145#[derive(Debug, Clone)]
13146pub struct DirReceiverControlHandle {
13147    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13148}
13149
13150impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
13151    fn shutdown(&self) {
13152        self.inner.shutdown()
13153    }
13154    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
13155        self.inner.shutdown_with_epitaph(status)
13156    }
13157
13158    fn is_closed(&self) -> bool {
13159        self.inner.channel().is_closed()
13160    }
13161    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
13162        self.inner.channel().on_closed()
13163    }
13164
13165    #[cfg(target_os = "fuchsia")]
13166    fn signal_peer(
13167        &self,
13168        clear_mask: zx::Signals,
13169        set_mask: zx::Signals,
13170    ) -> Result<(), zx_status::Status> {
13171        use fidl::Peered;
13172        self.inner.channel().signal_peer(clear_mask, set_mask)
13173    }
13174}
13175
13176impl DirReceiverControlHandle {}
13177
13178#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13179pub struct DirReceiverDeprecatedMarker;
13180
13181impl fidl::endpoints::ProtocolMarker for DirReceiverDeprecatedMarker {
13182    type Proxy = DirReceiverDeprecatedProxy;
13183    type RequestStream = DirReceiverDeprecatedRequestStream;
13184    #[cfg(target_os = "fuchsia")]
13185    type SynchronousProxy = DirReceiverDeprecatedSynchronousProxy;
13186
13187    const DEBUG_NAME: &'static str = "(anonymous) DirReceiverDeprecated";
13188}
13189
13190pub trait DirReceiverDeprecatedProxyInterface: Send + Sync {
13191    fn r#receive(
13192        &self,
13193        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13194    ) -> Result<(), fidl::Error>;
13195}
13196#[derive(Debug)]
13197#[cfg(target_os = "fuchsia")]
13198pub struct DirReceiverDeprecatedSynchronousProxy {
13199    client: fidl::client::sync::Client,
13200}
13201
13202#[cfg(target_os = "fuchsia")]
13203impl fidl::endpoints::SynchronousProxy for DirReceiverDeprecatedSynchronousProxy {
13204    type Proxy = DirReceiverDeprecatedProxy;
13205    type Protocol = DirReceiverDeprecatedMarker;
13206
13207    fn from_channel(inner: fidl::Channel) -> Self {
13208        Self::new(inner)
13209    }
13210
13211    fn into_channel(self) -> fidl::Channel {
13212        self.client.into_channel()
13213    }
13214
13215    fn as_channel(&self) -> &fidl::Channel {
13216        self.client.as_channel()
13217    }
13218}
13219
13220#[cfg(target_os = "fuchsia")]
13221impl DirReceiverDeprecatedSynchronousProxy {
13222    pub fn new(channel: fidl::Channel) -> Self {
13223        let protocol_name =
13224            <DirReceiverDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13225        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
13226    }
13227
13228    pub fn into_channel(self) -> fidl::Channel {
13229        self.client.into_channel()
13230    }
13231
13232    /// Waits until an event arrives and returns it. It is safe for other
13233    /// threads to make concurrent requests while waiting for an event.
13234    pub fn wait_for_event(
13235        &self,
13236        deadline: zx::MonotonicInstant,
13237    ) -> Result<DirReceiverDeprecatedEvent, fidl::Error> {
13238        DirReceiverDeprecatedEvent::decode(self.client.wait_for_event(deadline)?)
13239    }
13240
13241    /// `Receive` will be called by component manager whenever a new handle has
13242    /// been given to any `DirConnector` associated with this `DirReceiver`.
13243    pub fn r#receive(
13244        &self,
13245        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13246    ) -> Result<(), fidl::Error> {
13247        self.client.send::<DirReceiverDeprecatedReceiveRequest>(
13248            (channel,),
13249            0x6351363b40e73f58,
13250            fidl::encoding::DynamicFlags::FLEXIBLE,
13251        )
13252    }
13253}
13254
13255#[cfg(target_os = "fuchsia")]
13256impl From<DirReceiverDeprecatedSynchronousProxy> for zx::Handle {
13257    fn from(value: DirReceiverDeprecatedSynchronousProxy) -> Self {
13258        value.into_channel().into()
13259    }
13260}
13261
13262#[cfg(target_os = "fuchsia")]
13263impl From<fidl::Channel> for DirReceiverDeprecatedSynchronousProxy {
13264    fn from(value: fidl::Channel) -> Self {
13265        Self::new(value)
13266    }
13267}
13268
13269#[cfg(target_os = "fuchsia")]
13270impl fidl::endpoints::FromClient for DirReceiverDeprecatedSynchronousProxy {
13271    type Protocol = DirReceiverDeprecatedMarker;
13272
13273    fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>) -> Self {
13274        Self::new(value.into_channel())
13275    }
13276}
13277
13278#[derive(Debug, Clone)]
13279pub struct DirReceiverDeprecatedProxy {
13280    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13281}
13282
13283impl fidl::endpoints::Proxy for DirReceiverDeprecatedProxy {
13284    type Protocol = DirReceiverDeprecatedMarker;
13285
13286    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13287        Self::new(inner)
13288    }
13289
13290    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13291        self.client.into_channel().map_err(|client| Self { client })
13292    }
13293
13294    fn as_channel(&self) -> &::fidl::AsyncChannel {
13295        self.client.as_channel()
13296    }
13297}
13298
13299impl DirReceiverDeprecatedProxy {
13300    /// Create a new Proxy for fuchsia.component.runtime/DirReceiverDeprecated.
13301    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13302        let protocol_name =
13303            <DirReceiverDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13304        Self { client: fidl::client::Client::new(channel, protocol_name) }
13305    }
13306
13307    /// Get a Stream of events from the remote end of the protocol.
13308    ///
13309    /// # Panics
13310    ///
13311    /// Panics if the event stream was already taken.
13312    pub fn take_event_stream(&self) -> DirReceiverDeprecatedEventStream {
13313        DirReceiverDeprecatedEventStream { event_receiver: self.client.take_event_receiver() }
13314    }
13315
13316    /// `Receive` will be called by component manager whenever a new handle has
13317    /// been given to any `DirConnector` associated with this `DirReceiver`.
13318    pub fn r#receive(
13319        &self,
13320        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13321    ) -> Result<(), fidl::Error> {
13322        DirReceiverDeprecatedProxyInterface::r#receive(self, channel)
13323    }
13324}
13325
13326impl DirReceiverDeprecatedProxyInterface for DirReceiverDeprecatedProxy {
13327    fn r#receive(
13328        &self,
13329        mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13330    ) -> Result<(), fidl::Error> {
13331        self.client.send::<DirReceiverDeprecatedReceiveRequest>(
13332            (channel,),
13333            0x6351363b40e73f58,
13334            fidl::encoding::DynamicFlags::FLEXIBLE,
13335        )
13336    }
13337}
13338
13339pub struct DirReceiverDeprecatedEventStream {
13340    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
13341}
13342
13343impl std::marker::Unpin for DirReceiverDeprecatedEventStream {}
13344
13345impl futures::stream::FusedStream for DirReceiverDeprecatedEventStream {
13346    fn is_terminated(&self) -> bool {
13347        self.event_receiver.is_terminated()
13348    }
13349}
13350
13351impl futures::Stream for DirReceiverDeprecatedEventStream {
13352    type Item = Result<DirReceiverDeprecatedEvent, fidl::Error>;
13353
13354    fn poll_next(
13355        mut self: std::pin::Pin<&mut Self>,
13356        cx: &mut std::task::Context<'_>,
13357    ) -> std::task::Poll<Option<Self::Item>> {
13358        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13359            &mut self.event_receiver,
13360            cx
13361        )?) {
13362            Some(buf) => std::task::Poll::Ready(Some(DirReceiverDeprecatedEvent::decode(buf))),
13363            None => std::task::Poll::Ready(None),
13364        }
13365    }
13366}
13367
13368#[derive(Debug)]
13369pub enum DirReceiverDeprecatedEvent {
13370    #[non_exhaustive]
13371    _UnknownEvent {
13372        /// Ordinal of the event that was sent.
13373        ordinal: u64,
13374    },
13375}
13376
13377impl DirReceiverDeprecatedEvent {
13378    /// Decodes a message buffer as a [`DirReceiverDeprecatedEvent`].
13379    fn decode(
13380        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13381    ) -> Result<DirReceiverDeprecatedEvent, fidl::Error> {
13382        let (bytes, _handles) = buf.split_mut();
13383        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13384        debug_assert_eq!(tx_header.tx_id, 0);
13385        match tx_header.ordinal {
13386            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13387                Ok(DirReceiverDeprecatedEvent::_UnknownEvent { ordinal: tx_header.ordinal })
13388            }
13389            _ => Err(fidl::Error::UnknownOrdinal {
13390                ordinal: tx_header.ordinal,
13391                protocol_name:
13392                    <DirReceiverDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13393            }),
13394        }
13395    }
13396}
13397
13398/// A Stream of incoming requests for fuchsia.component.runtime/DirReceiverDeprecated.
13399pub struct DirReceiverDeprecatedRequestStream {
13400    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13401    is_terminated: bool,
13402}
13403
13404impl std::marker::Unpin for DirReceiverDeprecatedRequestStream {}
13405
13406impl futures::stream::FusedStream for DirReceiverDeprecatedRequestStream {
13407    fn is_terminated(&self) -> bool {
13408        self.is_terminated
13409    }
13410}
13411
13412impl fidl::endpoints::RequestStream for DirReceiverDeprecatedRequestStream {
13413    type Protocol = DirReceiverDeprecatedMarker;
13414    type ControlHandle = DirReceiverDeprecatedControlHandle;
13415
13416    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
13417        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13418    }
13419
13420    fn control_handle(&self) -> Self::ControlHandle {
13421        DirReceiverDeprecatedControlHandle { inner: self.inner.clone() }
13422    }
13423
13424    fn into_inner(
13425        self,
13426    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
13427    {
13428        (self.inner, self.is_terminated)
13429    }
13430
13431    fn from_inner(
13432        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13433        is_terminated: bool,
13434    ) -> Self {
13435        Self { inner, is_terminated }
13436    }
13437}
13438
13439impl futures::Stream for DirReceiverDeprecatedRequestStream {
13440    type Item = Result<DirReceiverDeprecatedRequest, fidl::Error>;
13441
13442    fn poll_next(
13443        mut self: std::pin::Pin<&mut Self>,
13444        cx: &mut std::task::Context<'_>,
13445    ) -> std::task::Poll<Option<Self::Item>> {
13446        let this = &mut *self;
13447        if this.inner.check_shutdown(cx) {
13448            this.is_terminated = true;
13449            return std::task::Poll::Ready(None);
13450        }
13451        if this.is_terminated {
13452            panic!("polled DirReceiverDeprecatedRequestStream after completion");
13453        }
13454        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
13455            |bytes, handles| {
13456                match this.inner.channel().read_etc(cx, bytes, handles) {
13457                    std::task::Poll::Ready(Ok(())) => {}
13458                    std::task::Poll::Pending => return std::task::Poll::Pending,
13459                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
13460                        this.is_terminated = true;
13461                        return std::task::Poll::Ready(None);
13462                    }
13463                    std::task::Poll::Ready(Err(e)) => {
13464                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13465                            e.into(),
13466                        ))));
13467                    }
13468                }
13469
13470                // A message has been received from the channel
13471                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13472
13473                std::task::Poll::Ready(Some(match header.ordinal {
13474                0x6351363b40e73f58 => {
13475                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
13476                    let mut req = fidl::new_empty!(DirReceiverDeprecatedReceiveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
13477                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverDeprecatedReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
13478                    let control_handle = DirReceiverDeprecatedControlHandle {
13479                        inner: this.inner.clone(),
13480                    };
13481                    Ok(DirReceiverDeprecatedRequest::Receive {channel: req.channel,
13482
13483                        control_handle,
13484                    })
13485                }
13486                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13487                    Ok(DirReceiverDeprecatedRequest::_UnknownMethod {
13488                        ordinal: header.ordinal,
13489                        control_handle: DirReceiverDeprecatedControlHandle { inner: this.inner.clone() },
13490                        method_type: fidl::MethodType::OneWay,
13491                    })
13492                }
13493                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
13494                    this.inner.send_framework_err(
13495                        fidl::encoding::FrameworkErr::UnknownMethod,
13496                        header.tx_id,
13497                        header.ordinal,
13498                        header.dynamic_flags(),
13499                        (bytes, handles),
13500                    )?;
13501                    Ok(DirReceiverDeprecatedRequest::_UnknownMethod {
13502                        ordinal: header.ordinal,
13503                        control_handle: DirReceiverDeprecatedControlHandle { inner: this.inner.clone() },
13504                        method_type: fidl::MethodType::TwoWay,
13505                    })
13506                }
13507                _ => Err(fidl::Error::UnknownOrdinal {
13508                    ordinal: header.ordinal,
13509                    protocol_name: <DirReceiverDeprecatedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13510                }),
13511            }))
13512            },
13513        )
13514    }
13515}
13516
13517/// A `DirReceiver` represents the receiving end of a connection to a
13518/// capability.
13519#[derive(Debug)]
13520pub enum DirReceiverDeprecatedRequest {
13521    /// `Receive` will be called by component manager whenever a new handle has
13522    /// been given to any `DirConnector` associated with this `DirReceiver`.
13523    Receive {
13524        channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13525        control_handle: DirReceiverDeprecatedControlHandle,
13526    },
13527    /// An interaction was received which does not match any known method.
13528    #[non_exhaustive]
13529    _UnknownMethod {
13530        /// Ordinal of the method that was called.
13531        ordinal: u64,
13532        control_handle: DirReceiverDeprecatedControlHandle,
13533        method_type: fidl::MethodType,
13534    },
13535}
13536
13537impl DirReceiverDeprecatedRequest {
13538    #[allow(irrefutable_let_patterns)]
13539    pub fn into_receive(
13540        self,
13541    ) -> Option<(
13542        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13543        DirReceiverDeprecatedControlHandle,
13544    )> {
13545        if let DirReceiverDeprecatedRequest::Receive { channel, control_handle } = self {
13546            Some((channel, control_handle))
13547        } else {
13548            None
13549        }
13550    }
13551
13552    /// Name of the method defined in FIDL
13553    pub fn method_name(&self) -> &'static str {
13554        match *self {
13555            DirReceiverDeprecatedRequest::Receive { .. } => "receive",
13556            DirReceiverDeprecatedRequest::_UnknownMethod {
13557                method_type: fidl::MethodType::OneWay,
13558                ..
13559            } => "unknown one-way method",
13560            DirReceiverDeprecatedRequest::_UnknownMethod {
13561                method_type: fidl::MethodType::TwoWay,
13562                ..
13563            } => "unknown two-way method",
13564        }
13565    }
13566}
13567
13568#[derive(Debug, Clone)]
13569pub struct DirReceiverDeprecatedControlHandle {
13570    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13571}
13572
13573impl fidl::endpoints::ControlHandle for DirReceiverDeprecatedControlHandle {
13574    fn shutdown(&self) {
13575        self.inner.shutdown()
13576    }
13577    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
13578        self.inner.shutdown_with_epitaph(status)
13579    }
13580
13581    fn is_closed(&self) -> bool {
13582        self.inner.channel().is_closed()
13583    }
13584    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
13585        self.inner.channel().on_closed()
13586    }
13587
13588    #[cfg(target_os = "fuchsia")]
13589    fn signal_peer(
13590        &self,
13591        clear_mask: zx::Signals,
13592        set_mask: zx::Signals,
13593    ) -> Result<(), zx_status::Status> {
13594        use fidl::Peered;
13595        self.inner.channel().signal_peer(clear_mask, set_mask)
13596    }
13597}
13598
13599impl DirReceiverDeprecatedControlHandle {}
13600
13601#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13602pub struct ReceiverMarker;
13603
13604impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
13605    type Proxy = ReceiverProxy;
13606    type RequestStream = ReceiverRequestStream;
13607    #[cfg(target_os = "fuchsia")]
13608    type SynchronousProxy = ReceiverSynchronousProxy;
13609
13610    const DEBUG_NAME: &'static str = "(anonymous) Receiver";
13611}
13612
13613pub trait ReceiverProxyInterface: Send + Sync {
13614    fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
13615}
13616#[derive(Debug)]
13617#[cfg(target_os = "fuchsia")]
13618pub struct ReceiverSynchronousProxy {
13619    client: fidl::client::sync::Client,
13620}
13621
13622#[cfg(target_os = "fuchsia")]
13623impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
13624    type Proxy = ReceiverProxy;
13625    type Protocol = ReceiverMarker;
13626
13627    fn from_channel(inner: fidl::Channel) -> Self {
13628        Self::new(inner)
13629    }
13630
13631    fn into_channel(self) -> fidl::Channel {
13632        self.client.into_channel()
13633    }
13634
13635    fn as_channel(&self) -> &fidl::Channel {
13636        self.client.as_channel()
13637    }
13638}
13639
13640#[cfg(target_os = "fuchsia")]
13641impl ReceiverSynchronousProxy {
13642    pub fn new(channel: fidl::Channel) -> Self {
13643        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13644        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
13645    }
13646
13647    pub fn into_channel(self) -> fidl::Channel {
13648        self.client.into_channel()
13649    }
13650
13651    /// Waits until an event arrives and returns it. It is safe for other
13652    /// threads to make concurrent requests while waiting for an event.
13653    pub fn wait_for_event(
13654        &self,
13655        deadline: zx::MonotonicInstant,
13656    ) -> Result<ReceiverEvent, fidl::Error> {
13657        ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
13658    }
13659
13660    /// `Receive` will be called by component manager whenever an new handle has
13661    /// been given to any `Connector` associated with this `Receiver`.
13662    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
13663        self.client.send::<ReceiverReceiveRequest>(
13664            (channel,),
13665            0x609ca5c7943b58d0,
13666            fidl::encoding::DynamicFlags::empty(),
13667        )
13668    }
13669}
13670
13671#[cfg(target_os = "fuchsia")]
13672impl From<ReceiverSynchronousProxy> for zx::Handle {
13673    fn from(value: ReceiverSynchronousProxy) -> Self {
13674        value.into_channel().into()
13675    }
13676}
13677
13678#[cfg(target_os = "fuchsia")]
13679impl From<fidl::Channel> for ReceiverSynchronousProxy {
13680    fn from(value: fidl::Channel) -> Self {
13681        Self::new(value)
13682    }
13683}
13684
13685#[cfg(target_os = "fuchsia")]
13686impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
13687    type Protocol = ReceiverMarker;
13688
13689    fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
13690        Self::new(value.into_channel())
13691    }
13692}
13693
13694#[derive(Debug, Clone)]
13695pub struct ReceiverProxy {
13696    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
13697}
13698
13699impl fidl::endpoints::Proxy for ReceiverProxy {
13700    type Protocol = ReceiverMarker;
13701
13702    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
13703        Self::new(inner)
13704    }
13705
13706    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
13707        self.client.into_channel().map_err(|client| Self { client })
13708    }
13709
13710    fn as_channel(&self) -> &::fidl::AsyncChannel {
13711        self.client.as_channel()
13712    }
13713}
13714
13715impl ReceiverProxy {
13716    /// Create a new Proxy for fuchsia.component.runtime/Receiver.
13717    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
13718        let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
13719        Self { client: fidl::client::Client::new(channel, protocol_name) }
13720    }
13721
13722    /// Get a Stream of events from the remote end of the protocol.
13723    ///
13724    /// # Panics
13725    ///
13726    /// Panics if the event stream was already taken.
13727    pub fn take_event_stream(&self) -> ReceiverEventStream {
13728        ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
13729    }
13730
13731    /// `Receive` will be called by component manager whenever an new handle has
13732    /// been given to any `Connector` associated with this `Receiver`.
13733    pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
13734        ReceiverProxyInterface::r#receive(self, channel)
13735    }
13736}
13737
13738impl ReceiverProxyInterface for ReceiverProxy {
13739    fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
13740        self.client.send::<ReceiverReceiveRequest>(
13741            (channel,),
13742            0x609ca5c7943b58d0,
13743            fidl::encoding::DynamicFlags::empty(),
13744        )
13745    }
13746}
13747
13748pub struct ReceiverEventStream {
13749    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
13750}
13751
13752impl std::marker::Unpin for ReceiverEventStream {}
13753
13754impl futures::stream::FusedStream for ReceiverEventStream {
13755    fn is_terminated(&self) -> bool {
13756        self.event_receiver.is_terminated()
13757    }
13758}
13759
13760impl futures::Stream for ReceiverEventStream {
13761    type Item = Result<ReceiverEvent, fidl::Error>;
13762
13763    fn poll_next(
13764        mut self: std::pin::Pin<&mut Self>,
13765        cx: &mut std::task::Context<'_>,
13766    ) -> std::task::Poll<Option<Self::Item>> {
13767        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
13768            &mut self.event_receiver,
13769            cx
13770        )?) {
13771            Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
13772            None => std::task::Poll::Ready(None),
13773        }
13774    }
13775}
13776
13777#[derive(Debug)]
13778pub enum ReceiverEvent {}
13779
13780impl ReceiverEvent {
13781    /// Decodes a message buffer as a [`ReceiverEvent`].
13782    fn decode(
13783        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
13784    ) -> Result<ReceiverEvent, fidl::Error> {
13785        let (bytes, _handles) = buf.split_mut();
13786        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13787        debug_assert_eq!(tx_header.tx_id, 0);
13788        match tx_header.ordinal {
13789            _ => Err(fidl::Error::UnknownOrdinal {
13790                ordinal: tx_header.ordinal,
13791                protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13792            }),
13793        }
13794    }
13795}
13796
13797/// A Stream of incoming requests for fuchsia.component.runtime/Receiver.
13798pub struct ReceiverRequestStream {
13799    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13800    is_terminated: bool,
13801}
13802
13803impl std::marker::Unpin for ReceiverRequestStream {}
13804
13805impl futures::stream::FusedStream for ReceiverRequestStream {
13806    fn is_terminated(&self) -> bool {
13807        self.is_terminated
13808    }
13809}
13810
13811impl fidl::endpoints::RequestStream for ReceiverRequestStream {
13812    type Protocol = ReceiverMarker;
13813    type ControlHandle = ReceiverControlHandle;
13814
13815    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
13816        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
13817    }
13818
13819    fn control_handle(&self) -> Self::ControlHandle {
13820        ReceiverControlHandle { inner: self.inner.clone() }
13821    }
13822
13823    fn into_inner(
13824        self,
13825    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
13826    {
13827        (self.inner, self.is_terminated)
13828    }
13829
13830    fn from_inner(
13831        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13832        is_terminated: bool,
13833    ) -> Self {
13834        Self { inner, is_terminated }
13835    }
13836}
13837
13838impl futures::Stream for ReceiverRequestStream {
13839    type Item = Result<ReceiverRequest, fidl::Error>;
13840
13841    fn poll_next(
13842        mut self: std::pin::Pin<&mut Self>,
13843        cx: &mut std::task::Context<'_>,
13844    ) -> std::task::Poll<Option<Self::Item>> {
13845        let this = &mut *self;
13846        if this.inner.check_shutdown(cx) {
13847            this.is_terminated = true;
13848            return std::task::Poll::Ready(None);
13849        }
13850        if this.is_terminated {
13851            panic!("polled ReceiverRequestStream after completion");
13852        }
13853        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
13854            |bytes, handles| {
13855                match this.inner.channel().read_etc(cx, bytes, handles) {
13856                    std::task::Poll::Ready(Ok(())) => {}
13857                    std::task::Poll::Pending => return std::task::Poll::Pending,
13858                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
13859                        this.is_terminated = true;
13860                        return std::task::Poll::Ready(None);
13861                    }
13862                    std::task::Poll::Ready(Err(e)) => {
13863                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
13864                            e.into(),
13865                        ))));
13866                    }
13867                }
13868
13869                // A message has been received from the channel
13870                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
13871
13872                std::task::Poll::Ready(Some(match header.ordinal {
13873                    0x609ca5c7943b58d0 => {
13874                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
13875                        let mut req = fidl::new_empty!(
13876                            ReceiverReceiveRequest,
13877                            fidl::encoding::DefaultFuchsiaResourceDialect
13878                        );
13879                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
13880                        let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
13881                        Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
13882                    }
13883                    _ => Err(fidl::Error::UnknownOrdinal {
13884                        ordinal: header.ordinal,
13885                        protocol_name:
13886                            <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
13887                    }),
13888                }))
13889            },
13890        )
13891    }
13892}
13893
13894/// A `Receiver` represents the receiving end of a `Connector`.
13895#[derive(Debug)]
13896pub enum ReceiverRequest {
13897    /// `Receive` will be called by component manager whenever an new handle has
13898    /// been given to any `Connector` associated with this `Receiver`.
13899    Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
13900}
13901
13902impl ReceiverRequest {
13903    #[allow(irrefutable_let_patterns)]
13904    pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
13905        if let ReceiverRequest::Receive { channel, control_handle } = self {
13906            Some((channel, control_handle))
13907        } else {
13908            None
13909        }
13910    }
13911
13912    /// Name of the method defined in FIDL
13913    pub fn method_name(&self) -> &'static str {
13914        match *self {
13915            ReceiverRequest::Receive { .. } => "receive",
13916        }
13917    }
13918}
13919
13920#[derive(Debug, Clone)]
13921pub struct ReceiverControlHandle {
13922    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
13923}
13924
13925impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
13926    fn shutdown(&self) {
13927        self.inner.shutdown()
13928    }
13929    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
13930        self.inner.shutdown_with_epitaph(status)
13931    }
13932
13933    fn is_closed(&self) -> bool {
13934        self.inner.channel().is_closed()
13935    }
13936    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
13937        self.inner.channel().on_closed()
13938    }
13939
13940    #[cfg(target_os = "fuchsia")]
13941    fn signal_peer(
13942        &self,
13943        clear_mask: zx::Signals,
13944        set_mask: zx::Signals,
13945    ) -> Result<(), zx_status::Status> {
13946        use fidl::Peered;
13947        self.inner.channel().signal_peer(clear_mask, set_mask)
13948    }
13949}
13950
13951impl ReceiverControlHandle {}
13952
13953mod internal {
13954    use super::*;
13955
13956    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorCreateRequest {
13957        type Borrowed<'a> = &'a mut Self;
13958        fn take_or_borrow<'a>(
13959            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13960        ) -> Self::Borrowed<'a> {
13961            value
13962        }
13963    }
13964
13965    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorCreateRequest {
13966        type Owned = Self;
13967
13968        #[inline(always)]
13969        fn inline_align(_context: fidl::encoding::Context) -> usize {
13970            4
13971        }
13972
13973        #[inline(always)]
13974        fn inline_size(_context: fidl::encoding::Context) -> usize {
13975            8
13976        }
13977    }
13978
13979    unsafe impl
13980        fidl::encoding::Encode<
13981            CapabilitiesConnectorCreateRequest,
13982            fidl::encoding::DefaultFuchsiaResourceDialect,
13983        > for &mut CapabilitiesConnectorCreateRequest
13984    {
13985        #[inline]
13986        unsafe fn encode(
13987            self,
13988            encoder: &mut fidl::encoding::Encoder<
13989                '_,
13990                fidl::encoding::DefaultFuchsiaResourceDialect,
13991            >,
13992            offset: usize,
13993            _depth: fidl::encoding::Depth,
13994        ) -> fidl::Result<()> {
13995            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
13996            // Delegate to tuple encoding.
13997            fidl::encoding::Encode::<CapabilitiesConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13998                (
13999                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector),
14000                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
14001                ),
14002                encoder, offset, _depth
14003            )
14004        }
14005    }
14006    unsafe impl<
14007        T0: fidl::encoding::Encode<
14008                fidl::encoding::HandleType<
14009                    fidl::EventPair,
14010                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14011                    2147483648,
14012                >,
14013                fidl::encoding::DefaultFuchsiaResourceDialect,
14014            >,
14015        T1: fidl::encoding::Encode<
14016                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
14017                fidl::encoding::DefaultFuchsiaResourceDialect,
14018            >,
14019    >
14020        fidl::encoding::Encode<
14021            CapabilitiesConnectorCreateRequest,
14022            fidl::encoding::DefaultFuchsiaResourceDialect,
14023        > for (T0, T1)
14024    {
14025        #[inline]
14026        unsafe fn encode(
14027            self,
14028            encoder: &mut fidl::encoding::Encoder<
14029                '_,
14030                fidl::encoding::DefaultFuchsiaResourceDialect,
14031            >,
14032            offset: usize,
14033            depth: fidl::encoding::Depth,
14034        ) -> fidl::Result<()> {
14035            encoder.debug_check_bounds::<CapabilitiesConnectorCreateRequest>(offset);
14036            // Zero out padding regions. There's no need to apply masks
14037            // because the unmasked parts will be overwritten by fields.
14038            // Write the fields.
14039            self.0.encode(encoder, offset + 0, depth)?;
14040            self.1.encode(encoder, offset + 4, depth)?;
14041            Ok(())
14042        }
14043    }
14044
14045    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14046        for CapabilitiesConnectorCreateRequest
14047    {
14048        #[inline(always)]
14049        fn new_empty() -> Self {
14050            Self {
14051                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14052                receiver_client_end: fidl::new_empty!(
14053                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
14054                    fidl::encoding::DefaultFuchsiaResourceDialect
14055                ),
14056            }
14057        }
14058
14059        #[inline]
14060        unsafe fn decode(
14061            &mut self,
14062            decoder: &mut fidl::encoding::Decoder<
14063                '_,
14064                fidl::encoding::DefaultFuchsiaResourceDialect,
14065            >,
14066            offset: usize,
14067            _depth: fidl::encoding::Depth,
14068        ) -> fidl::Result<()> {
14069            decoder.debug_check_bounds::<Self>(offset);
14070            // Verify that padding bytes are zero.
14071            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
14072            fidl::decode!(
14073                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
14074                fidl::encoding::DefaultFuchsiaResourceDialect,
14075                &mut self.receiver_client_end,
14076                decoder,
14077                offset + 4,
14078                _depth
14079            )?;
14080            Ok(())
14081        }
14082    }
14083
14084    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorOpenRequest {
14085        type Borrowed<'a> = &'a mut Self;
14086        fn take_or_borrow<'a>(
14087            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14088        ) -> Self::Borrowed<'a> {
14089            value
14090        }
14091    }
14092
14093    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorOpenRequest {
14094        type Owned = Self;
14095
14096        #[inline(always)]
14097        fn inline_align(_context: fidl::encoding::Context) -> usize {
14098            4
14099        }
14100
14101        #[inline(always)]
14102        fn inline_size(_context: fidl::encoding::Context) -> usize {
14103            8
14104        }
14105    }
14106
14107    unsafe impl
14108        fidl::encoding::Encode<
14109            CapabilitiesConnectorOpenRequest,
14110            fidl::encoding::DefaultFuchsiaResourceDialect,
14111        > for &mut CapabilitiesConnectorOpenRequest
14112    {
14113        #[inline]
14114        unsafe fn encode(
14115            self,
14116            encoder: &mut fidl::encoding::Encoder<
14117                '_,
14118                fidl::encoding::DefaultFuchsiaResourceDialect,
14119            >,
14120            offset: usize,
14121            _depth: fidl::encoding::Depth,
14122        ) -> fidl::Result<()> {
14123            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
14124            // Delegate to tuple encoding.
14125            fidl::encoding::Encode::<
14126                CapabilitiesConnectorOpenRequest,
14127                fidl::encoding::DefaultFuchsiaResourceDialect,
14128            >::encode(
14129                (
14130                    <fidl::encoding::HandleType<
14131                        fidl::EventPair,
14132                        { fidl::ObjectType::EVENTPAIR.into_raw() },
14133                        2147483648,
14134                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14135                        &mut self.connector
14136                    ),
14137                    <fidl::encoding::HandleType<
14138                        fidl::Channel,
14139                        { fidl::ObjectType::CHANNEL.into_raw() },
14140                        2147483648,
14141                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14142                        &mut self.channel
14143                    ),
14144                ),
14145                encoder,
14146                offset,
14147                _depth,
14148            )
14149        }
14150    }
14151    unsafe impl<
14152        T0: fidl::encoding::Encode<
14153                fidl::encoding::HandleType<
14154                    fidl::EventPair,
14155                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14156                    2147483648,
14157                >,
14158                fidl::encoding::DefaultFuchsiaResourceDialect,
14159            >,
14160        T1: fidl::encoding::Encode<
14161                fidl::encoding::HandleType<
14162                    fidl::Channel,
14163                    { fidl::ObjectType::CHANNEL.into_raw() },
14164                    2147483648,
14165                >,
14166                fidl::encoding::DefaultFuchsiaResourceDialect,
14167            >,
14168    >
14169        fidl::encoding::Encode<
14170            CapabilitiesConnectorOpenRequest,
14171            fidl::encoding::DefaultFuchsiaResourceDialect,
14172        > for (T0, T1)
14173    {
14174        #[inline]
14175        unsafe fn encode(
14176            self,
14177            encoder: &mut fidl::encoding::Encoder<
14178                '_,
14179                fidl::encoding::DefaultFuchsiaResourceDialect,
14180            >,
14181            offset: usize,
14182            depth: fidl::encoding::Depth,
14183        ) -> fidl::Result<()> {
14184            encoder.debug_check_bounds::<CapabilitiesConnectorOpenRequest>(offset);
14185            // Zero out padding regions. There's no need to apply masks
14186            // because the unmasked parts will be overwritten by fields.
14187            // Write the fields.
14188            self.0.encode(encoder, offset + 0, depth)?;
14189            self.1.encode(encoder, offset + 4, depth)?;
14190            Ok(())
14191        }
14192    }
14193
14194    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14195        for CapabilitiesConnectorOpenRequest
14196    {
14197        #[inline(always)]
14198        fn new_empty() -> Self {
14199            Self {
14200                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14201                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14202            }
14203        }
14204
14205        #[inline]
14206        unsafe fn decode(
14207            &mut self,
14208            decoder: &mut fidl::encoding::Decoder<
14209                '_,
14210                fidl::encoding::DefaultFuchsiaResourceDialect,
14211            >,
14212            offset: usize,
14213            _depth: fidl::encoding::Depth,
14214        ) -> fidl::Result<()> {
14215            decoder.debug_check_bounds::<Self>(offset);
14216            // Verify that padding bytes are zero.
14217            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 0, _depth)?;
14218            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
14219            Ok(())
14220        }
14221    }
14222
14223    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterCreateRequest {
14224        type Borrowed<'a> = &'a mut Self;
14225        fn take_or_borrow<'a>(
14226            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14227        ) -> Self::Borrowed<'a> {
14228            value
14229        }
14230    }
14231
14232    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterCreateRequest {
14233        type Owned = Self;
14234
14235        #[inline(always)]
14236        fn inline_align(_context: fidl::encoding::Context) -> usize {
14237            4
14238        }
14239
14240        #[inline(always)]
14241        fn inline_size(_context: fidl::encoding::Context) -> usize {
14242            8
14243        }
14244    }
14245
14246    unsafe impl
14247        fidl::encoding::Encode<
14248            CapabilitiesConnectorRouterCreateRequest,
14249            fidl::encoding::DefaultFuchsiaResourceDialect,
14250        > for &mut CapabilitiesConnectorRouterCreateRequest
14251    {
14252        #[inline]
14253        unsafe fn encode(
14254            self,
14255            encoder: &mut fidl::encoding::Encoder<
14256                '_,
14257                fidl::encoding::DefaultFuchsiaResourceDialect,
14258            >,
14259            offset: usize,
14260            _depth: fidl::encoding::Depth,
14261        ) -> fidl::Result<()> {
14262            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
14263            // Delegate to tuple encoding.
14264            fidl::encoding::Encode::<CapabilitiesConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
14265                (
14266                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
14267                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
14268                ),
14269                encoder, offset, _depth
14270            )
14271        }
14272    }
14273    unsafe impl<
14274        T0: fidl::encoding::Encode<
14275                fidl::encoding::HandleType<
14276                    fidl::EventPair,
14277                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14278                    2147483648,
14279                >,
14280                fidl::encoding::DefaultFuchsiaResourceDialect,
14281            >,
14282        T1: fidl::encoding::Encode<
14283                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
14284                fidl::encoding::DefaultFuchsiaResourceDialect,
14285            >,
14286    >
14287        fidl::encoding::Encode<
14288            CapabilitiesConnectorRouterCreateRequest,
14289            fidl::encoding::DefaultFuchsiaResourceDialect,
14290        > for (T0, T1)
14291    {
14292        #[inline]
14293        unsafe fn encode(
14294            self,
14295            encoder: &mut fidl::encoding::Encoder<
14296                '_,
14297                fidl::encoding::DefaultFuchsiaResourceDialect,
14298            >,
14299            offset: usize,
14300            depth: fidl::encoding::Depth,
14301        ) -> fidl::Result<()> {
14302            encoder.debug_check_bounds::<CapabilitiesConnectorRouterCreateRequest>(offset);
14303            // Zero out padding regions. There's no need to apply masks
14304            // because the unmasked parts will be overwritten by fields.
14305            // Write the fields.
14306            self.0.encode(encoder, offset + 0, depth)?;
14307            self.1.encode(encoder, offset + 4, depth)?;
14308            Ok(())
14309        }
14310    }
14311
14312    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14313        for CapabilitiesConnectorRouterCreateRequest
14314    {
14315        #[inline(always)]
14316        fn new_empty() -> Self {
14317            Self {
14318                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14319                router_client_end: fidl::new_empty!(
14320                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
14321                    fidl::encoding::DefaultFuchsiaResourceDialect
14322                ),
14323            }
14324        }
14325
14326        #[inline]
14327        unsafe fn decode(
14328            &mut self,
14329            decoder: &mut fidl::encoding::Decoder<
14330                '_,
14331                fidl::encoding::DefaultFuchsiaResourceDialect,
14332            >,
14333            offset: usize,
14334            _depth: fidl::encoding::Depth,
14335        ) -> fidl::Result<()> {
14336            decoder.debug_check_bounds::<Self>(offset);
14337            // Verify that padding bytes are zero.
14338            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
14339            fidl::decode!(
14340                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>,
14341                fidl::encoding::DefaultFuchsiaResourceDialect,
14342                &mut self.router_client_end,
14343                decoder,
14344                offset + 4,
14345                _depth
14346            )?;
14347            Ok(())
14348        }
14349    }
14350
14351    impl fidl::encoding::ResourceTypeMarker for CapabilitiesConnectorRouterRouteRequest {
14352        type Borrowed<'a> = &'a mut Self;
14353        fn take_or_borrow<'a>(
14354            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14355        ) -> Self::Borrowed<'a> {
14356            value
14357        }
14358    }
14359
14360    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteRequest {
14361        type Owned = Self;
14362
14363        #[inline(always)]
14364        fn inline_align(_context: fidl::encoding::Context) -> usize {
14365            8
14366        }
14367
14368        #[inline(always)]
14369        fn inline_size(_context: fidl::encoding::Context) -> usize {
14370            32
14371        }
14372    }
14373
14374    unsafe impl
14375        fidl::encoding::Encode<
14376            CapabilitiesConnectorRouterRouteRequest,
14377            fidl::encoding::DefaultFuchsiaResourceDialect,
14378        > for &mut CapabilitiesConnectorRouterRouteRequest
14379    {
14380        #[inline]
14381        unsafe fn encode(
14382            self,
14383            encoder: &mut fidl::encoding::Encoder<
14384                '_,
14385                fidl::encoding::DefaultFuchsiaResourceDialect,
14386            >,
14387            offset: usize,
14388            _depth: fidl::encoding::Depth,
14389        ) -> fidl::Result<()> {
14390            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
14391            // Delegate to tuple encoding.
14392            fidl::encoding::Encode::<
14393                CapabilitiesConnectorRouterRouteRequest,
14394                fidl::encoding::DefaultFuchsiaResourceDialect,
14395            >::encode(
14396                (
14397                    <fidl::encoding::HandleType<
14398                        fidl::EventPair,
14399                        { fidl::ObjectType::EVENTPAIR.into_raw() },
14400                        2147483648,
14401                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14402                        &mut self.router
14403                    ),
14404                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14405                        &mut self.request,
14406                    ),
14407                    <fidl::encoding::HandleType<
14408                        fidl::EventPair,
14409                        { fidl::ObjectType::EVENTPAIR.into_raw() },
14410                        2147483648,
14411                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14412                        &mut self.connector
14413                    ),
14414                ),
14415                encoder,
14416                offset,
14417                _depth,
14418            )
14419        }
14420    }
14421    unsafe impl<
14422        T0: fidl::encoding::Encode<
14423                fidl::encoding::HandleType<
14424                    fidl::EventPair,
14425                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14426                    2147483648,
14427                >,
14428                fidl::encoding::DefaultFuchsiaResourceDialect,
14429            >,
14430        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
14431        T2: fidl::encoding::Encode<
14432                fidl::encoding::HandleType<
14433                    fidl::EventPair,
14434                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14435                    2147483648,
14436                >,
14437                fidl::encoding::DefaultFuchsiaResourceDialect,
14438            >,
14439    >
14440        fidl::encoding::Encode<
14441            CapabilitiesConnectorRouterRouteRequest,
14442            fidl::encoding::DefaultFuchsiaResourceDialect,
14443        > for (T0, T1, T2)
14444    {
14445        #[inline]
14446        unsafe fn encode(
14447            self,
14448            encoder: &mut fidl::encoding::Encoder<
14449                '_,
14450                fidl::encoding::DefaultFuchsiaResourceDialect,
14451            >,
14452            offset: usize,
14453            depth: fidl::encoding::Depth,
14454        ) -> fidl::Result<()> {
14455            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteRequest>(offset);
14456            // Zero out padding regions. There's no need to apply masks
14457            // because the unmasked parts will be overwritten by fields.
14458            unsafe {
14459                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14460                (ptr as *mut u64).write_unaligned(0);
14461            }
14462            unsafe {
14463                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
14464                (ptr as *mut u64).write_unaligned(0);
14465            }
14466            // Write the fields.
14467            self.0.encode(encoder, offset + 0, depth)?;
14468            self.1.encode(encoder, offset + 8, depth)?;
14469            self.2.encode(encoder, offset + 24, depth)?;
14470            Ok(())
14471        }
14472    }
14473
14474    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14475        for CapabilitiesConnectorRouterRouteRequest
14476    {
14477        #[inline(always)]
14478        fn new_empty() -> Self {
14479            Self {
14480                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14481                request: fidl::new_empty!(
14482                    RouteRequest,
14483                    fidl::encoding::DefaultFuchsiaResourceDialect
14484                ),
14485                connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14486            }
14487        }
14488
14489        #[inline]
14490        unsafe fn decode(
14491            &mut self,
14492            decoder: &mut fidl::encoding::Decoder<
14493                '_,
14494                fidl::encoding::DefaultFuchsiaResourceDialect,
14495            >,
14496            offset: usize,
14497            _depth: fidl::encoding::Depth,
14498        ) -> fidl::Result<()> {
14499            decoder.debug_check_bounds::<Self>(offset);
14500            // Verify that padding bytes are zero.
14501            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14502            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14503            let mask = 0xffffffff00000000u64;
14504            let maskedval = padval & mask;
14505            if maskedval != 0 {
14506                return Err(fidl::Error::NonZeroPadding {
14507                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14508                });
14509            }
14510            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
14511            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14512            let mask = 0xffffffff00000000u64;
14513            let maskedval = padval & mask;
14514            if maskedval != 0 {
14515                return Err(fidl::Error::NonZeroPadding {
14516                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
14517                });
14518            }
14519            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
14520            fidl::decode!(
14521                RouteRequest,
14522                fidl::encoding::DefaultFuchsiaResourceDialect,
14523                &mut self.request,
14524                decoder,
14525                offset + 8,
14526                _depth
14527            )?;
14528            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.connector, decoder, offset + 24, _depth)?;
14529            Ok(())
14530        }
14531    }
14532
14533    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataCreateRequest {
14534        type Borrowed<'a> = &'a mut Self;
14535        fn take_or_borrow<'a>(
14536            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14537        ) -> Self::Borrowed<'a> {
14538            value
14539        }
14540    }
14541
14542    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataCreateRequest {
14543        type Owned = Self;
14544
14545        #[inline(always)]
14546        fn inline_align(_context: fidl::encoding::Context) -> usize {
14547            8
14548        }
14549
14550        #[inline(always)]
14551        fn inline_size(_context: fidl::encoding::Context) -> usize {
14552            24
14553        }
14554    }
14555
14556    unsafe impl
14557        fidl::encoding::Encode<
14558            CapabilitiesDataCreateRequest,
14559            fidl::encoding::DefaultFuchsiaResourceDialect,
14560        > for &mut CapabilitiesDataCreateRequest
14561    {
14562        #[inline]
14563        unsafe fn encode(
14564            self,
14565            encoder: &mut fidl::encoding::Encoder<
14566                '_,
14567                fidl::encoding::DefaultFuchsiaResourceDialect,
14568            >,
14569            offset: usize,
14570            _depth: fidl::encoding::Depth,
14571        ) -> fidl::Result<()> {
14572            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
14573            // Delegate to tuple encoding.
14574            fidl::encoding::Encode::<
14575                CapabilitiesDataCreateRequest,
14576                fidl::encoding::DefaultFuchsiaResourceDialect,
14577            >::encode(
14578                (
14579                    <fidl::encoding::HandleType<
14580                        fidl::EventPair,
14581                        { fidl::ObjectType::EVENTPAIR.into_raw() },
14582                        2147483648,
14583                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14584                        &mut self.data_handle
14585                    ),
14586                    <Data as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
14587                ),
14588                encoder,
14589                offset,
14590                _depth,
14591            )
14592        }
14593    }
14594    unsafe impl<
14595        T0: fidl::encoding::Encode<
14596                fidl::encoding::HandleType<
14597                    fidl::EventPair,
14598                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14599                    2147483648,
14600                >,
14601                fidl::encoding::DefaultFuchsiaResourceDialect,
14602            >,
14603        T1: fidl::encoding::Encode<Data, fidl::encoding::DefaultFuchsiaResourceDialect>,
14604    >
14605        fidl::encoding::Encode<
14606            CapabilitiesDataCreateRequest,
14607            fidl::encoding::DefaultFuchsiaResourceDialect,
14608        > for (T0, T1)
14609    {
14610        #[inline]
14611        unsafe fn encode(
14612            self,
14613            encoder: &mut fidl::encoding::Encoder<
14614                '_,
14615                fidl::encoding::DefaultFuchsiaResourceDialect,
14616            >,
14617            offset: usize,
14618            depth: fidl::encoding::Depth,
14619        ) -> fidl::Result<()> {
14620            encoder.debug_check_bounds::<CapabilitiesDataCreateRequest>(offset);
14621            // Zero out padding regions. There's no need to apply masks
14622            // because the unmasked parts will be overwritten by fields.
14623            unsafe {
14624                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14625                (ptr as *mut u64).write_unaligned(0);
14626            }
14627            // Write the fields.
14628            self.0.encode(encoder, offset + 0, depth)?;
14629            self.1.encode(encoder, offset + 8, depth)?;
14630            Ok(())
14631        }
14632    }
14633
14634    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14635        for CapabilitiesDataCreateRequest
14636    {
14637        #[inline(always)]
14638        fn new_empty() -> Self {
14639            Self {
14640                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14641                data: fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect),
14642            }
14643        }
14644
14645        #[inline]
14646        unsafe fn decode(
14647            &mut self,
14648            decoder: &mut fidl::encoding::Decoder<
14649                '_,
14650                fidl::encoding::DefaultFuchsiaResourceDialect,
14651            >,
14652            offset: usize,
14653            _depth: fidl::encoding::Depth,
14654        ) -> fidl::Result<()> {
14655            decoder.debug_check_bounds::<Self>(offset);
14656            // Verify that padding bytes are zero.
14657            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14658            let padval = unsafe { (ptr as *const u64).read_unaligned() };
14659            let mask = 0xffffffff00000000u64;
14660            let maskedval = padval & mask;
14661            if maskedval != 0 {
14662                return Err(fidl::Error::NonZeroPadding {
14663                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14664                });
14665            }
14666            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
14667            fidl::decode!(
14668                Data,
14669                fidl::encoding::DefaultFuchsiaResourceDialect,
14670                &mut self.data,
14671                decoder,
14672                offset + 8,
14673                _depth
14674            )?;
14675            Ok(())
14676        }
14677    }
14678
14679    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataGetRequest {
14680        type Borrowed<'a> = &'a mut Self;
14681        fn take_or_borrow<'a>(
14682            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14683        ) -> Self::Borrowed<'a> {
14684            value
14685        }
14686    }
14687
14688    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataGetRequest {
14689        type Owned = Self;
14690
14691        #[inline(always)]
14692        fn inline_align(_context: fidl::encoding::Context) -> usize {
14693            4
14694        }
14695
14696        #[inline(always)]
14697        fn inline_size(_context: fidl::encoding::Context) -> usize {
14698            4
14699        }
14700    }
14701
14702    unsafe impl
14703        fidl::encoding::Encode<
14704            CapabilitiesDataGetRequest,
14705            fidl::encoding::DefaultFuchsiaResourceDialect,
14706        > for &mut CapabilitiesDataGetRequest
14707    {
14708        #[inline]
14709        unsafe fn encode(
14710            self,
14711            encoder: &mut fidl::encoding::Encoder<
14712                '_,
14713                fidl::encoding::DefaultFuchsiaResourceDialect,
14714            >,
14715            offset: usize,
14716            _depth: fidl::encoding::Depth,
14717        ) -> fidl::Result<()> {
14718            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
14719            // Delegate to tuple encoding.
14720            fidl::encoding::Encode::<
14721                CapabilitiesDataGetRequest,
14722                fidl::encoding::DefaultFuchsiaResourceDialect,
14723            >::encode(
14724                (<fidl::encoding::HandleType<
14725                    fidl::EventPair,
14726                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14727                    2147483648,
14728                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14729                    &mut self.data_handle
14730                ),),
14731                encoder,
14732                offset,
14733                _depth,
14734            )
14735        }
14736    }
14737    unsafe impl<
14738        T0: fidl::encoding::Encode<
14739                fidl::encoding::HandleType<
14740                    fidl::EventPair,
14741                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14742                    2147483648,
14743                >,
14744                fidl::encoding::DefaultFuchsiaResourceDialect,
14745            >,
14746    >
14747        fidl::encoding::Encode<
14748            CapabilitiesDataGetRequest,
14749            fidl::encoding::DefaultFuchsiaResourceDialect,
14750        > for (T0,)
14751    {
14752        #[inline]
14753        unsafe fn encode(
14754            self,
14755            encoder: &mut fidl::encoding::Encoder<
14756                '_,
14757                fidl::encoding::DefaultFuchsiaResourceDialect,
14758            >,
14759            offset: usize,
14760            depth: fidl::encoding::Depth,
14761        ) -> fidl::Result<()> {
14762            encoder.debug_check_bounds::<CapabilitiesDataGetRequest>(offset);
14763            // Zero out padding regions. There's no need to apply masks
14764            // because the unmasked parts will be overwritten by fields.
14765            // Write the fields.
14766            self.0.encode(encoder, offset + 0, depth)?;
14767            Ok(())
14768        }
14769    }
14770
14771    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14772        for CapabilitiesDataGetRequest
14773    {
14774        #[inline(always)]
14775        fn new_empty() -> Self {
14776            Self {
14777                data_handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14778            }
14779        }
14780
14781        #[inline]
14782        unsafe fn decode(
14783            &mut self,
14784            decoder: &mut fidl::encoding::Decoder<
14785                '_,
14786                fidl::encoding::DefaultFuchsiaResourceDialect,
14787            >,
14788            offset: usize,
14789            _depth: fidl::encoding::Depth,
14790        ) -> fidl::Result<()> {
14791            decoder.debug_check_bounds::<Self>(offset);
14792            // Verify that padding bytes are zero.
14793            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.data_handle, decoder, offset + 0, _depth)?;
14794            Ok(())
14795        }
14796    }
14797
14798    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterCreateRequest {
14799        type Borrowed<'a> = &'a mut Self;
14800        fn take_or_borrow<'a>(
14801            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14802        ) -> Self::Borrowed<'a> {
14803            value
14804        }
14805    }
14806
14807    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterCreateRequest {
14808        type Owned = Self;
14809
14810        #[inline(always)]
14811        fn inline_align(_context: fidl::encoding::Context) -> usize {
14812            4
14813        }
14814
14815        #[inline(always)]
14816        fn inline_size(_context: fidl::encoding::Context) -> usize {
14817            8
14818        }
14819    }
14820
14821    unsafe impl
14822        fidl::encoding::Encode<
14823            CapabilitiesDataRouterCreateRequest,
14824            fidl::encoding::DefaultFuchsiaResourceDialect,
14825        > for &mut CapabilitiesDataRouterCreateRequest
14826    {
14827        #[inline]
14828        unsafe fn encode(
14829            self,
14830            encoder: &mut fidl::encoding::Encoder<
14831                '_,
14832                fidl::encoding::DefaultFuchsiaResourceDialect,
14833            >,
14834            offset: usize,
14835            _depth: fidl::encoding::Depth,
14836        ) -> fidl::Result<()> {
14837            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
14838            // Delegate to tuple encoding.
14839            fidl::encoding::Encode::<CapabilitiesDataRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
14840                (
14841                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
14842                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
14843                ),
14844                encoder, offset, _depth
14845            )
14846        }
14847    }
14848    unsafe impl<
14849        T0: fidl::encoding::Encode<
14850                fidl::encoding::HandleType<
14851                    fidl::EventPair,
14852                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14853                    2147483648,
14854                >,
14855                fidl::encoding::DefaultFuchsiaResourceDialect,
14856            >,
14857        T1: fidl::encoding::Encode<
14858                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14859                fidl::encoding::DefaultFuchsiaResourceDialect,
14860            >,
14861    >
14862        fidl::encoding::Encode<
14863            CapabilitiesDataRouterCreateRequest,
14864            fidl::encoding::DefaultFuchsiaResourceDialect,
14865        > for (T0, T1)
14866    {
14867        #[inline]
14868        unsafe fn encode(
14869            self,
14870            encoder: &mut fidl::encoding::Encoder<
14871                '_,
14872                fidl::encoding::DefaultFuchsiaResourceDialect,
14873            >,
14874            offset: usize,
14875            depth: fidl::encoding::Depth,
14876        ) -> fidl::Result<()> {
14877            encoder.debug_check_bounds::<CapabilitiesDataRouterCreateRequest>(offset);
14878            // Zero out padding regions. There's no need to apply masks
14879            // because the unmasked parts will be overwritten by fields.
14880            // Write the fields.
14881            self.0.encode(encoder, offset + 0, depth)?;
14882            self.1.encode(encoder, offset + 4, depth)?;
14883            Ok(())
14884        }
14885    }
14886
14887    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14888        for CapabilitiesDataRouterCreateRequest
14889    {
14890        #[inline(always)]
14891        fn new_empty() -> Self {
14892            Self {
14893                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14894                router_client_end: fidl::new_empty!(
14895                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14896                    fidl::encoding::DefaultFuchsiaResourceDialect
14897                ),
14898            }
14899        }
14900
14901        #[inline]
14902        unsafe fn decode(
14903            &mut self,
14904            decoder: &mut fidl::encoding::Decoder<
14905                '_,
14906                fidl::encoding::DefaultFuchsiaResourceDialect,
14907            >,
14908            offset: usize,
14909            _depth: fidl::encoding::Depth,
14910        ) -> fidl::Result<()> {
14911            decoder.debug_check_bounds::<Self>(offset);
14912            // Verify that padding bytes are zero.
14913            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
14914            fidl::decode!(
14915                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14916                fidl::encoding::DefaultFuchsiaResourceDialect,
14917                &mut self.router_client_end,
14918                decoder,
14919                offset + 4,
14920                _depth
14921            )?;
14922            Ok(())
14923        }
14924    }
14925
14926    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDataRouterRouteRequest {
14927        type Borrowed<'a> = &'a mut Self;
14928        fn take_or_borrow<'a>(
14929            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14930        ) -> Self::Borrowed<'a> {
14931            value
14932        }
14933    }
14934
14935    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteRequest {
14936        type Owned = Self;
14937
14938        #[inline(always)]
14939        fn inline_align(_context: fidl::encoding::Context) -> usize {
14940            8
14941        }
14942
14943        #[inline(always)]
14944        fn inline_size(_context: fidl::encoding::Context) -> usize {
14945            32
14946        }
14947    }
14948
14949    unsafe impl
14950        fidl::encoding::Encode<
14951            CapabilitiesDataRouterRouteRequest,
14952            fidl::encoding::DefaultFuchsiaResourceDialect,
14953        > for &mut CapabilitiesDataRouterRouteRequest
14954    {
14955        #[inline]
14956        unsafe fn encode(
14957            self,
14958            encoder: &mut fidl::encoding::Encoder<
14959                '_,
14960                fidl::encoding::DefaultFuchsiaResourceDialect,
14961            >,
14962            offset: usize,
14963            _depth: fidl::encoding::Depth,
14964        ) -> fidl::Result<()> {
14965            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
14966            // Delegate to tuple encoding.
14967            fidl::encoding::Encode::<
14968                CapabilitiesDataRouterRouteRequest,
14969                fidl::encoding::DefaultFuchsiaResourceDialect,
14970            >::encode(
14971                (
14972                    <fidl::encoding::HandleType<
14973                        fidl::EventPair,
14974                        { fidl::ObjectType::EVENTPAIR.into_raw() },
14975                        2147483648,
14976                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14977                        &mut self.router
14978                    ),
14979                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
14980                        &mut self.request,
14981                    ),
14982                    <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_handle),
14983                ),
14984                encoder,
14985                offset,
14986                _depth,
14987            )
14988        }
14989    }
14990    unsafe impl<
14991        T0: fidl::encoding::Encode<
14992                fidl::encoding::HandleType<
14993                    fidl::EventPair,
14994                    { fidl::ObjectType::EVENTPAIR.into_raw() },
14995                    2147483648,
14996                >,
14997                fidl::encoding::DefaultFuchsiaResourceDialect,
14998            >,
14999        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
15000        T2: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
15001    >
15002        fidl::encoding::Encode<
15003            CapabilitiesDataRouterRouteRequest,
15004            fidl::encoding::DefaultFuchsiaResourceDialect,
15005        > for (T0, T1, T2)
15006    {
15007        #[inline]
15008        unsafe fn encode(
15009            self,
15010            encoder: &mut fidl::encoding::Encoder<
15011                '_,
15012                fidl::encoding::DefaultFuchsiaResourceDialect,
15013            >,
15014            offset: usize,
15015            depth: fidl::encoding::Depth,
15016        ) -> fidl::Result<()> {
15017            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteRequest>(offset);
15018            // Zero out padding regions. There's no need to apply masks
15019            // because the unmasked parts will be overwritten by fields.
15020            unsafe {
15021                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
15022                (ptr as *mut u64).write_unaligned(0);
15023            }
15024            unsafe {
15025                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
15026                (ptr as *mut u64).write_unaligned(0);
15027            }
15028            // Write the fields.
15029            self.0.encode(encoder, offset + 0, depth)?;
15030            self.1.encode(encoder, offset + 8, depth)?;
15031            self.2.encode(encoder, offset + 24, depth)?;
15032            Ok(())
15033        }
15034    }
15035
15036    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15037        for CapabilitiesDataRouterRouteRequest
15038    {
15039        #[inline(always)]
15040        fn new_empty() -> Self {
15041            Self {
15042                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15043                request: fidl::new_empty!(
15044                    RouteRequest,
15045                    fidl::encoding::DefaultFuchsiaResourceDialect
15046                ),
15047                data_handle: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
15048            }
15049        }
15050
15051        #[inline]
15052        unsafe fn decode(
15053            &mut self,
15054            decoder: &mut fidl::encoding::Decoder<
15055                '_,
15056                fidl::encoding::DefaultFuchsiaResourceDialect,
15057            >,
15058            offset: usize,
15059            _depth: fidl::encoding::Depth,
15060        ) -> fidl::Result<()> {
15061            decoder.debug_check_bounds::<Self>(offset);
15062            // Verify that padding bytes are zero.
15063            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
15064            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15065            let mask = 0xffffffff00000000u64;
15066            let maskedval = padval & mask;
15067            if maskedval != 0 {
15068                return Err(fidl::Error::NonZeroPadding {
15069                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
15070                });
15071            }
15072            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
15073            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15074            let mask = 0xffffffff00000000u64;
15075            let maskedval = padval & mask;
15076            if maskedval != 0 {
15077                return Err(fidl::Error::NonZeroPadding {
15078                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
15079                });
15080            }
15081            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
15082            fidl::decode!(
15083                RouteRequest,
15084                fidl::encoding::DefaultFuchsiaResourceDialect,
15085                &mut self.request,
15086                decoder,
15087                offset + 8,
15088                _depth
15089            )?;
15090            fidl::decode!(
15091                i32,
15092                fidl::encoding::DefaultFuchsiaResourceDialect,
15093                &mut self.data_handle,
15094                decoder,
15095                offset + 24,
15096                _depth
15097            )?;
15098            Ok(())
15099        }
15100    }
15101
15102    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryCreateRequest {
15103        type Borrowed<'a> = &'a mut Self;
15104        fn take_or_borrow<'a>(
15105            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15106        ) -> Self::Borrowed<'a> {
15107            value
15108        }
15109    }
15110
15111    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryCreateRequest {
15112        type Owned = Self;
15113
15114        #[inline(always)]
15115        fn inline_align(_context: fidl::encoding::Context) -> usize {
15116            4
15117        }
15118
15119        #[inline(always)]
15120        fn inline_size(_context: fidl::encoding::Context) -> usize {
15121            4
15122        }
15123    }
15124
15125    unsafe impl
15126        fidl::encoding::Encode<
15127            CapabilitiesDictionaryCreateRequest,
15128            fidl::encoding::DefaultFuchsiaResourceDialect,
15129        > for &mut CapabilitiesDictionaryCreateRequest
15130    {
15131        #[inline]
15132        unsafe fn encode(
15133            self,
15134            encoder: &mut fidl::encoding::Encoder<
15135                '_,
15136                fidl::encoding::DefaultFuchsiaResourceDialect,
15137            >,
15138            offset: usize,
15139            _depth: fidl::encoding::Depth,
15140        ) -> fidl::Result<()> {
15141            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
15142            // Delegate to tuple encoding.
15143            fidl::encoding::Encode::<
15144                CapabilitiesDictionaryCreateRequest,
15145                fidl::encoding::DefaultFuchsiaResourceDialect,
15146            >::encode(
15147                (<fidl::encoding::HandleType<
15148                    fidl::EventPair,
15149                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15150                    2147483648,
15151                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15152                    &mut self.dictionary
15153                ),),
15154                encoder,
15155                offset,
15156                _depth,
15157            )
15158        }
15159    }
15160    unsafe impl<
15161        T0: fidl::encoding::Encode<
15162                fidl::encoding::HandleType<
15163                    fidl::EventPair,
15164                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15165                    2147483648,
15166                >,
15167                fidl::encoding::DefaultFuchsiaResourceDialect,
15168            >,
15169    >
15170        fidl::encoding::Encode<
15171            CapabilitiesDictionaryCreateRequest,
15172            fidl::encoding::DefaultFuchsiaResourceDialect,
15173        > for (T0,)
15174    {
15175        #[inline]
15176        unsafe fn encode(
15177            self,
15178            encoder: &mut fidl::encoding::Encoder<
15179                '_,
15180                fidl::encoding::DefaultFuchsiaResourceDialect,
15181            >,
15182            offset: usize,
15183            depth: fidl::encoding::Depth,
15184        ) -> fidl::Result<()> {
15185            encoder.debug_check_bounds::<CapabilitiesDictionaryCreateRequest>(offset);
15186            // Zero out padding regions. There's no need to apply masks
15187            // because the unmasked parts will be overwritten by fields.
15188            // Write the fields.
15189            self.0.encode(encoder, offset + 0, depth)?;
15190            Ok(())
15191        }
15192    }
15193
15194    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15195        for CapabilitiesDictionaryCreateRequest
15196    {
15197        #[inline(always)]
15198        fn new_empty() -> Self {
15199            Self {
15200                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15201            }
15202        }
15203
15204        #[inline]
15205        unsafe fn decode(
15206            &mut self,
15207            decoder: &mut fidl::encoding::Decoder<
15208                '_,
15209                fidl::encoding::DefaultFuchsiaResourceDialect,
15210            >,
15211            offset: usize,
15212            _depth: fidl::encoding::Depth,
15213        ) -> fidl::Result<()> {
15214            decoder.debug_check_bounds::<Self>(offset);
15215            // Verify that padding bytes are zero.
15216            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
15217            Ok(())
15218        }
15219    }
15220
15221    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetRequest {
15222        type Borrowed<'a> = &'a mut Self;
15223        fn take_or_borrow<'a>(
15224            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15225        ) -> Self::Borrowed<'a> {
15226            value
15227        }
15228    }
15229
15230    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetRequest {
15231        type Owned = Self;
15232
15233        #[inline(always)]
15234        fn inline_align(_context: fidl::encoding::Context) -> usize {
15235            8
15236        }
15237
15238        #[inline(always)]
15239        fn inline_size(_context: fidl::encoding::Context) -> usize {
15240            32
15241        }
15242    }
15243
15244    unsafe impl
15245        fidl::encoding::Encode<
15246            CapabilitiesDictionaryGetRequest,
15247            fidl::encoding::DefaultFuchsiaResourceDialect,
15248        > for &mut CapabilitiesDictionaryGetRequest
15249    {
15250        #[inline]
15251        unsafe fn encode(
15252            self,
15253            encoder: &mut fidl::encoding::Encoder<
15254                '_,
15255                fidl::encoding::DefaultFuchsiaResourceDialect,
15256            >,
15257            offset: usize,
15258            _depth: fidl::encoding::Depth,
15259        ) -> fidl::Result<()> {
15260            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
15261            // Delegate to tuple encoding.
15262            fidl::encoding::Encode::<
15263                CapabilitiesDictionaryGetRequest,
15264                fidl::encoding::DefaultFuchsiaResourceDialect,
15265            >::encode(
15266                (
15267                    <fidl::encoding::HandleType<
15268                        fidl::EventPair,
15269                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15270                        2147483648,
15271                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15272                        &mut self.dictionary
15273                    ),
15274                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
15275                        &self.key,
15276                    ),
15277                    <fidl::encoding::HandleType<
15278                        fidl::EventPair,
15279                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15280                        2147483648,
15281                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15282                        &mut self.value
15283                    ),
15284                ),
15285                encoder,
15286                offset,
15287                _depth,
15288            )
15289        }
15290    }
15291    unsafe impl<
15292        T0: fidl::encoding::Encode<
15293                fidl::encoding::HandleType<
15294                    fidl::EventPair,
15295                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15296                    2147483648,
15297                >,
15298                fidl::encoding::DefaultFuchsiaResourceDialect,
15299            >,
15300        T1: fidl::encoding::Encode<
15301                fidl::encoding::BoundedString<100>,
15302                fidl::encoding::DefaultFuchsiaResourceDialect,
15303            >,
15304        T2: fidl::encoding::Encode<
15305                fidl::encoding::HandleType<
15306                    fidl::EventPair,
15307                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15308                    2147483648,
15309                >,
15310                fidl::encoding::DefaultFuchsiaResourceDialect,
15311            >,
15312    >
15313        fidl::encoding::Encode<
15314            CapabilitiesDictionaryGetRequest,
15315            fidl::encoding::DefaultFuchsiaResourceDialect,
15316        > for (T0, T1, T2)
15317    {
15318        #[inline]
15319        unsafe fn encode(
15320            self,
15321            encoder: &mut fidl::encoding::Encoder<
15322                '_,
15323                fidl::encoding::DefaultFuchsiaResourceDialect,
15324            >,
15325            offset: usize,
15326            depth: fidl::encoding::Depth,
15327        ) -> fidl::Result<()> {
15328            encoder.debug_check_bounds::<CapabilitiesDictionaryGetRequest>(offset);
15329            // Zero out padding regions. There's no need to apply masks
15330            // because the unmasked parts will be overwritten by fields.
15331            unsafe {
15332                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
15333                (ptr as *mut u64).write_unaligned(0);
15334            }
15335            unsafe {
15336                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
15337                (ptr as *mut u64).write_unaligned(0);
15338            }
15339            // Write the fields.
15340            self.0.encode(encoder, offset + 0, depth)?;
15341            self.1.encode(encoder, offset + 8, depth)?;
15342            self.2.encode(encoder, offset + 24, depth)?;
15343            Ok(())
15344        }
15345    }
15346
15347    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15348        for CapabilitiesDictionaryGetRequest
15349    {
15350        #[inline(always)]
15351        fn new_empty() -> Self {
15352            Self {
15353                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15354                key: fidl::new_empty!(
15355                    fidl::encoding::BoundedString<100>,
15356                    fidl::encoding::DefaultFuchsiaResourceDialect
15357                ),
15358                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15359            }
15360        }
15361
15362        #[inline]
15363        unsafe fn decode(
15364            &mut self,
15365            decoder: &mut fidl::encoding::Decoder<
15366                '_,
15367                fidl::encoding::DefaultFuchsiaResourceDialect,
15368            >,
15369            offset: usize,
15370            _depth: fidl::encoding::Depth,
15371        ) -> fidl::Result<()> {
15372            decoder.debug_check_bounds::<Self>(offset);
15373            // Verify that padding bytes are zero.
15374            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
15375            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15376            let mask = 0xffffffff00000000u64;
15377            let maskedval = padval & mask;
15378            if maskedval != 0 {
15379                return Err(fidl::Error::NonZeroPadding {
15380                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
15381                });
15382            }
15383            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
15384            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15385            let mask = 0xffffffff00000000u64;
15386            let maskedval = padval & mask;
15387            if maskedval != 0 {
15388                return Err(fidl::Error::NonZeroPadding {
15389                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
15390                });
15391            }
15392            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
15393            fidl::decode!(
15394                fidl::encoding::BoundedString<100>,
15395                fidl::encoding::DefaultFuchsiaResourceDialect,
15396                &mut self.key,
15397                decoder,
15398                offset + 8,
15399                _depth
15400            )?;
15401            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
15402            Ok(())
15403        }
15404    }
15405
15406    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryInsertRequest {
15407        type Borrowed<'a> = &'a mut Self;
15408        fn take_or_borrow<'a>(
15409            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15410        ) -> Self::Borrowed<'a> {
15411            value
15412        }
15413    }
15414
15415    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryInsertRequest {
15416        type Owned = Self;
15417
15418        #[inline(always)]
15419        fn inline_align(_context: fidl::encoding::Context) -> usize {
15420            8
15421        }
15422
15423        #[inline(always)]
15424        fn inline_size(_context: fidl::encoding::Context) -> usize {
15425            32
15426        }
15427    }
15428
15429    unsafe impl
15430        fidl::encoding::Encode<
15431            CapabilitiesDictionaryInsertRequest,
15432            fidl::encoding::DefaultFuchsiaResourceDialect,
15433        > for &mut CapabilitiesDictionaryInsertRequest
15434    {
15435        #[inline]
15436        unsafe fn encode(
15437            self,
15438            encoder: &mut fidl::encoding::Encoder<
15439                '_,
15440                fidl::encoding::DefaultFuchsiaResourceDialect,
15441            >,
15442            offset: usize,
15443            _depth: fidl::encoding::Depth,
15444        ) -> fidl::Result<()> {
15445            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
15446            // Delegate to tuple encoding.
15447            fidl::encoding::Encode::<
15448                CapabilitiesDictionaryInsertRequest,
15449                fidl::encoding::DefaultFuchsiaResourceDialect,
15450            >::encode(
15451                (
15452                    <fidl::encoding::HandleType<
15453                        fidl::EventPair,
15454                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15455                        2147483648,
15456                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15457                        &mut self.dictionary
15458                    ),
15459                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
15460                        &self.key,
15461                    ),
15462                    <fidl::encoding::HandleType<
15463                        fidl::EventPair,
15464                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15465                        2147483648,
15466                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15467                        &mut self.value
15468                    ),
15469                ),
15470                encoder,
15471                offset,
15472                _depth,
15473            )
15474        }
15475    }
15476    unsafe impl<
15477        T0: fidl::encoding::Encode<
15478                fidl::encoding::HandleType<
15479                    fidl::EventPair,
15480                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15481                    2147483648,
15482                >,
15483                fidl::encoding::DefaultFuchsiaResourceDialect,
15484            >,
15485        T1: fidl::encoding::Encode<
15486                fidl::encoding::BoundedString<100>,
15487                fidl::encoding::DefaultFuchsiaResourceDialect,
15488            >,
15489        T2: fidl::encoding::Encode<
15490                fidl::encoding::HandleType<
15491                    fidl::EventPair,
15492                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15493                    2147483648,
15494                >,
15495                fidl::encoding::DefaultFuchsiaResourceDialect,
15496            >,
15497    >
15498        fidl::encoding::Encode<
15499            CapabilitiesDictionaryInsertRequest,
15500            fidl::encoding::DefaultFuchsiaResourceDialect,
15501        > for (T0, T1, T2)
15502    {
15503        #[inline]
15504        unsafe fn encode(
15505            self,
15506            encoder: &mut fidl::encoding::Encoder<
15507                '_,
15508                fidl::encoding::DefaultFuchsiaResourceDialect,
15509            >,
15510            offset: usize,
15511            depth: fidl::encoding::Depth,
15512        ) -> fidl::Result<()> {
15513            encoder.debug_check_bounds::<CapabilitiesDictionaryInsertRequest>(offset);
15514            // Zero out padding regions. There's no need to apply masks
15515            // because the unmasked parts will be overwritten by fields.
15516            unsafe {
15517                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
15518                (ptr as *mut u64).write_unaligned(0);
15519            }
15520            unsafe {
15521                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
15522                (ptr as *mut u64).write_unaligned(0);
15523            }
15524            // Write the fields.
15525            self.0.encode(encoder, offset + 0, depth)?;
15526            self.1.encode(encoder, offset + 8, depth)?;
15527            self.2.encode(encoder, offset + 24, depth)?;
15528            Ok(())
15529        }
15530    }
15531
15532    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15533        for CapabilitiesDictionaryInsertRequest
15534    {
15535        #[inline(always)]
15536        fn new_empty() -> Self {
15537            Self {
15538                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15539                key: fidl::new_empty!(
15540                    fidl::encoding::BoundedString<100>,
15541                    fidl::encoding::DefaultFuchsiaResourceDialect
15542                ),
15543                value: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15544            }
15545        }
15546
15547        #[inline]
15548        unsafe fn decode(
15549            &mut self,
15550            decoder: &mut fidl::encoding::Decoder<
15551                '_,
15552                fidl::encoding::DefaultFuchsiaResourceDialect,
15553            >,
15554            offset: usize,
15555            _depth: fidl::encoding::Depth,
15556        ) -> fidl::Result<()> {
15557            decoder.debug_check_bounds::<Self>(offset);
15558            // Verify that padding bytes are zero.
15559            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
15560            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15561            let mask = 0xffffffff00000000u64;
15562            let maskedval = padval & mask;
15563            if maskedval != 0 {
15564                return Err(fidl::Error::NonZeroPadding {
15565                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
15566                });
15567            }
15568            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
15569            let padval = unsafe { (ptr as *const u64).read_unaligned() };
15570            let mask = 0xffffffff00000000u64;
15571            let maskedval = padval & mask;
15572            if maskedval != 0 {
15573                return Err(fidl::Error::NonZeroPadding {
15574                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
15575                });
15576            }
15577            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
15578            fidl::decode!(
15579                fidl::encoding::BoundedString<100>,
15580                fidl::encoding::DefaultFuchsiaResourceDialect,
15581                &mut self.key,
15582                decoder,
15583                offset + 8,
15584                _depth
15585            )?;
15586            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.value, decoder, offset + 24, _depth)?;
15587            Ok(())
15588        }
15589    }
15590
15591    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryIterateKeysRequest {
15592        type Borrowed<'a> = &'a mut Self;
15593        fn take_or_borrow<'a>(
15594            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15595        ) -> Self::Borrowed<'a> {
15596            value
15597        }
15598    }
15599
15600    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryIterateKeysRequest {
15601        type Owned = Self;
15602
15603        #[inline(always)]
15604        fn inline_align(_context: fidl::encoding::Context) -> usize {
15605            4
15606        }
15607
15608        #[inline(always)]
15609        fn inline_size(_context: fidl::encoding::Context) -> usize {
15610            8
15611        }
15612    }
15613
15614    unsafe impl
15615        fidl::encoding::Encode<
15616            CapabilitiesDictionaryIterateKeysRequest,
15617            fidl::encoding::DefaultFuchsiaResourceDialect,
15618        > for &mut CapabilitiesDictionaryIterateKeysRequest
15619    {
15620        #[inline]
15621        unsafe fn encode(
15622            self,
15623            encoder: &mut fidl::encoding::Encoder<
15624                '_,
15625                fidl::encoding::DefaultFuchsiaResourceDialect,
15626            >,
15627            offset: usize,
15628            _depth: fidl::encoding::Depth,
15629        ) -> fidl::Result<()> {
15630            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
15631            // Delegate to tuple encoding.
15632            fidl::encoding::Encode::<
15633                CapabilitiesDictionaryIterateKeysRequest,
15634                fidl::encoding::DefaultFuchsiaResourceDialect,
15635            >::encode(
15636                (
15637                    <fidl::encoding::HandleType<
15638                        fidl::EventPair,
15639                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15640                        2147483648,
15641                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15642                        &mut self.dictionary
15643                    ),
15644                    <fidl::encoding::Endpoint<
15645                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
15646                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15647                        &mut self.key_iterator,
15648                    ),
15649                ),
15650                encoder,
15651                offset,
15652                _depth,
15653            )
15654        }
15655    }
15656    unsafe impl<
15657        T0: fidl::encoding::Encode<
15658                fidl::encoding::HandleType<
15659                    fidl::EventPair,
15660                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15661                    2147483648,
15662                >,
15663                fidl::encoding::DefaultFuchsiaResourceDialect,
15664            >,
15665        T1: fidl::encoding::Encode<
15666                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
15667                fidl::encoding::DefaultFuchsiaResourceDialect,
15668            >,
15669    >
15670        fidl::encoding::Encode<
15671            CapabilitiesDictionaryIterateKeysRequest,
15672            fidl::encoding::DefaultFuchsiaResourceDialect,
15673        > for (T0, T1)
15674    {
15675        #[inline]
15676        unsafe fn encode(
15677            self,
15678            encoder: &mut fidl::encoding::Encoder<
15679                '_,
15680                fidl::encoding::DefaultFuchsiaResourceDialect,
15681            >,
15682            offset: usize,
15683            depth: fidl::encoding::Depth,
15684        ) -> fidl::Result<()> {
15685            encoder.debug_check_bounds::<CapabilitiesDictionaryIterateKeysRequest>(offset);
15686            // Zero out padding regions. There's no need to apply masks
15687            // because the unmasked parts will be overwritten by fields.
15688            // Write the fields.
15689            self.0.encode(encoder, offset + 0, depth)?;
15690            self.1.encode(encoder, offset + 4, depth)?;
15691            Ok(())
15692        }
15693    }
15694
15695    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15696        for CapabilitiesDictionaryIterateKeysRequest
15697    {
15698        #[inline(always)]
15699        fn new_empty() -> Self {
15700            Self {
15701                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15702                key_iterator: fidl::new_empty!(
15703                    fidl::encoding::Endpoint<
15704                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
15705                    >,
15706                    fidl::encoding::DefaultFuchsiaResourceDialect
15707                ),
15708            }
15709        }
15710
15711        #[inline]
15712        unsafe fn decode(
15713            &mut self,
15714            decoder: &mut fidl::encoding::Decoder<
15715                '_,
15716                fidl::encoding::DefaultFuchsiaResourceDialect,
15717            >,
15718            offset: usize,
15719            _depth: fidl::encoding::Depth,
15720        ) -> fidl::Result<()> {
15721            decoder.debug_check_bounds::<Self>(offset);
15722            // Verify that padding bytes are zero.
15723            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
15724            fidl::decode!(
15725                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
15726                fidl::encoding::DefaultFuchsiaResourceDialect,
15727                &mut self.key_iterator,
15728                decoder,
15729                offset + 4,
15730                _depth
15731            )?;
15732            Ok(())
15733        }
15734    }
15735
15736    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterCreateRequest {
15737        type Borrowed<'a> = &'a mut Self;
15738        fn take_or_borrow<'a>(
15739            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15740        ) -> Self::Borrowed<'a> {
15741            value
15742        }
15743    }
15744
15745    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterCreateRequest {
15746        type Owned = Self;
15747
15748        #[inline(always)]
15749        fn inline_align(_context: fidl::encoding::Context) -> usize {
15750            4
15751        }
15752
15753        #[inline(always)]
15754        fn inline_size(_context: fidl::encoding::Context) -> usize {
15755            8
15756        }
15757    }
15758
15759    unsafe impl
15760        fidl::encoding::Encode<
15761            CapabilitiesDictionaryRouterCreateRequest,
15762            fidl::encoding::DefaultFuchsiaResourceDialect,
15763        > for &mut CapabilitiesDictionaryRouterCreateRequest
15764    {
15765        #[inline]
15766        unsafe fn encode(
15767            self,
15768            encoder: &mut fidl::encoding::Encoder<
15769                '_,
15770                fidl::encoding::DefaultFuchsiaResourceDialect,
15771            >,
15772            offset: usize,
15773            _depth: fidl::encoding::Depth,
15774        ) -> fidl::Result<()> {
15775            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
15776            // Delegate to tuple encoding.
15777            fidl::encoding::Encode::<CapabilitiesDictionaryRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
15778                (
15779                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
15780                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
15781                ),
15782                encoder, offset, _depth
15783            )
15784        }
15785    }
15786    unsafe impl<
15787        T0: fidl::encoding::Encode<
15788                fidl::encoding::HandleType<
15789                    fidl::EventPair,
15790                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15791                    2147483648,
15792                >,
15793                fidl::encoding::DefaultFuchsiaResourceDialect,
15794            >,
15795        T1: fidl::encoding::Encode<
15796                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
15797                fidl::encoding::DefaultFuchsiaResourceDialect,
15798            >,
15799    >
15800        fidl::encoding::Encode<
15801            CapabilitiesDictionaryRouterCreateRequest,
15802            fidl::encoding::DefaultFuchsiaResourceDialect,
15803        > for (T0, T1)
15804    {
15805        #[inline]
15806        unsafe fn encode(
15807            self,
15808            encoder: &mut fidl::encoding::Encoder<
15809                '_,
15810                fidl::encoding::DefaultFuchsiaResourceDialect,
15811            >,
15812            offset: usize,
15813            depth: fidl::encoding::Depth,
15814        ) -> fidl::Result<()> {
15815            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterCreateRequest>(offset);
15816            // Zero out padding regions. There's no need to apply masks
15817            // because the unmasked parts will be overwritten by fields.
15818            // Write the fields.
15819            self.0.encode(encoder, offset + 0, depth)?;
15820            self.1.encode(encoder, offset + 4, depth)?;
15821            Ok(())
15822        }
15823    }
15824
15825    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15826        for CapabilitiesDictionaryRouterCreateRequest
15827    {
15828        #[inline(always)]
15829        fn new_empty() -> Self {
15830            Self {
15831                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15832                router_client_end: fidl::new_empty!(
15833                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
15834                    fidl::encoding::DefaultFuchsiaResourceDialect
15835                ),
15836            }
15837        }
15838
15839        #[inline]
15840        unsafe fn decode(
15841            &mut self,
15842            decoder: &mut fidl::encoding::Decoder<
15843                '_,
15844                fidl::encoding::DefaultFuchsiaResourceDialect,
15845            >,
15846            offset: usize,
15847            _depth: fidl::encoding::Depth,
15848        ) -> fidl::Result<()> {
15849            decoder.debug_check_bounds::<Self>(offset);
15850            // Verify that padding bytes are zero.
15851            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
15852            fidl::decode!(
15853                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>,
15854                fidl::encoding::DefaultFuchsiaResourceDialect,
15855                &mut self.router_client_end,
15856                decoder,
15857                offset + 4,
15858                _depth
15859            )?;
15860            Ok(())
15861        }
15862    }
15863
15864    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRouterRouteRequest {
15865        type Borrowed<'a> = &'a mut Self;
15866        fn take_or_borrow<'a>(
15867            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15868        ) -> Self::Borrowed<'a> {
15869            value
15870        }
15871    }
15872
15873    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteRequest {
15874        type Owned = Self;
15875
15876        #[inline(always)]
15877        fn inline_align(_context: fidl::encoding::Context) -> usize {
15878            8
15879        }
15880
15881        #[inline(always)]
15882        fn inline_size(_context: fidl::encoding::Context) -> usize {
15883            32
15884        }
15885    }
15886
15887    unsafe impl
15888        fidl::encoding::Encode<
15889            CapabilitiesDictionaryRouterRouteRequest,
15890            fidl::encoding::DefaultFuchsiaResourceDialect,
15891        > for &mut CapabilitiesDictionaryRouterRouteRequest
15892    {
15893        #[inline]
15894        unsafe fn encode(
15895            self,
15896            encoder: &mut fidl::encoding::Encoder<
15897                '_,
15898                fidl::encoding::DefaultFuchsiaResourceDialect,
15899            >,
15900            offset: usize,
15901            _depth: fidl::encoding::Depth,
15902        ) -> fidl::Result<()> {
15903            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
15904            // Delegate to tuple encoding.
15905            fidl::encoding::Encode::<
15906                CapabilitiesDictionaryRouterRouteRequest,
15907                fidl::encoding::DefaultFuchsiaResourceDialect,
15908            >::encode(
15909                (
15910                    <fidl::encoding::HandleType<
15911                        fidl::EventPair,
15912                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15913                        2147483648,
15914                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15915                        &mut self.router
15916                    ),
15917                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15918                        &mut self.request,
15919                    ),
15920                    <fidl::encoding::HandleType<
15921                        fidl::EventPair,
15922                        { fidl::ObjectType::EVENTPAIR.into_raw() },
15923                        2147483648,
15924                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15925                        &mut self.dictionary
15926                    ),
15927                ),
15928                encoder,
15929                offset,
15930                _depth,
15931            )
15932        }
15933    }
15934    unsafe impl<
15935        T0: fidl::encoding::Encode<
15936                fidl::encoding::HandleType<
15937                    fidl::EventPair,
15938                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15939                    2147483648,
15940                >,
15941                fidl::encoding::DefaultFuchsiaResourceDialect,
15942            >,
15943        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
15944        T2: fidl::encoding::Encode<
15945                fidl::encoding::HandleType<
15946                    fidl::EventPair,
15947                    { fidl::ObjectType::EVENTPAIR.into_raw() },
15948                    2147483648,
15949                >,
15950                fidl::encoding::DefaultFuchsiaResourceDialect,
15951            >,
15952    >
15953        fidl::encoding::Encode<
15954            CapabilitiesDictionaryRouterRouteRequest,
15955            fidl::encoding::DefaultFuchsiaResourceDialect,
15956        > for (T0, T1, T2)
15957    {
15958        #[inline]
15959        unsafe fn encode(
15960            self,
15961            encoder: &mut fidl::encoding::Encoder<
15962                '_,
15963                fidl::encoding::DefaultFuchsiaResourceDialect,
15964            >,
15965            offset: usize,
15966            depth: fidl::encoding::Depth,
15967        ) -> fidl::Result<()> {
15968            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteRequest>(offset);
15969            // Zero out padding regions. There's no need to apply masks
15970            // because the unmasked parts will be overwritten by fields.
15971            unsafe {
15972                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
15973                (ptr as *mut u64).write_unaligned(0);
15974            }
15975            unsafe {
15976                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
15977                (ptr as *mut u64).write_unaligned(0);
15978            }
15979            // Write the fields.
15980            self.0.encode(encoder, offset + 0, depth)?;
15981            self.1.encode(encoder, offset + 8, depth)?;
15982            self.2.encode(encoder, offset + 24, depth)?;
15983            Ok(())
15984        }
15985    }
15986
15987    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15988        for CapabilitiesDictionaryRouterRouteRequest
15989    {
15990        #[inline(always)]
15991        fn new_empty() -> Self {
15992            Self {
15993                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15994                request: fidl::new_empty!(
15995                    RouteRequest,
15996                    fidl::encoding::DefaultFuchsiaResourceDialect
15997                ),
15998                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
15999            }
16000        }
16001
16002        #[inline]
16003        unsafe fn decode(
16004            &mut self,
16005            decoder: &mut fidl::encoding::Decoder<
16006                '_,
16007                fidl::encoding::DefaultFuchsiaResourceDialect,
16008            >,
16009            offset: usize,
16010            _depth: fidl::encoding::Depth,
16011        ) -> fidl::Result<()> {
16012            decoder.debug_check_bounds::<Self>(offset);
16013            // Verify that padding bytes are zero.
16014            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
16015            let padval = unsafe { (ptr as *const u64).read_unaligned() };
16016            let mask = 0xffffffff00000000u64;
16017            let maskedval = padval & mask;
16018            if maskedval != 0 {
16019                return Err(fidl::Error::NonZeroPadding {
16020                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
16021                });
16022            }
16023            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
16024            let padval = unsafe { (ptr as *const u64).read_unaligned() };
16025            let mask = 0xffffffff00000000u64;
16026            let maskedval = padval & mask;
16027            if maskedval != 0 {
16028                return Err(fidl::Error::NonZeroPadding {
16029                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
16030                });
16031            }
16032            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
16033            fidl::decode!(
16034                RouteRequest,
16035                fidl::encoding::DefaultFuchsiaResourceDialect,
16036                &mut self.request,
16037                decoder,
16038                offset + 8,
16039                _depth
16040            )?;
16041            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 24, _depth)?;
16042            Ok(())
16043        }
16044    }
16045
16046    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorCreateRequest {
16047        type Borrowed<'a> = &'a mut Self;
16048        fn take_or_borrow<'a>(
16049            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16050        ) -> Self::Borrowed<'a> {
16051            value
16052        }
16053    }
16054
16055    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorCreateRequest {
16056        type Owned = Self;
16057
16058        #[inline(always)]
16059        fn inline_align(_context: fidl::encoding::Context) -> usize {
16060            4
16061        }
16062
16063        #[inline(always)]
16064        fn inline_size(_context: fidl::encoding::Context) -> usize {
16065            8
16066        }
16067    }
16068
16069    unsafe impl
16070        fidl::encoding::Encode<
16071            CapabilitiesDirConnectorCreateRequest,
16072            fidl::encoding::DefaultFuchsiaResourceDialect,
16073        > for &mut CapabilitiesDirConnectorCreateRequest
16074    {
16075        #[inline]
16076        unsafe fn encode(
16077            self,
16078            encoder: &mut fidl::encoding::Encoder<
16079                '_,
16080                fidl::encoding::DefaultFuchsiaResourceDialect,
16081            >,
16082            offset: usize,
16083            _depth: fidl::encoding::Depth,
16084        ) -> fidl::Result<()> {
16085            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
16086            // Delegate to tuple encoding.
16087            fidl::encoding::Encode::<CapabilitiesDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
16088                (
16089                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector),
16090                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
16091                ),
16092                encoder, offset, _depth
16093            )
16094        }
16095    }
16096    unsafe impl<
16097        T0: fidl::encoding::Encode<
16098                fidl::encoding::HandleType<
16099                    fidl::EventPair,
16100                    { fidl::ObjectType::EVENTPAIR.into_raw() },
16101                    2147483648,
16102                >,
16103                fidl::encoding::DefaultFuchsiaResourceDialect,
16104            >,
16105        T1: fidl::encoding::Encode<
16106                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
16107                fidl::encoding::DefaultFuchsiaResourceDialect,
16108            >,
16109    >
16110        fidl::encoding::Encode<
16111            CapabilitiesDirConnectorCreateRequest,
16112            fidl::encoding::DefaultFuchsiaResourceDialect,
16113        > for (T0, T1)
16114    {
16115        #[inline]
16116        unsafe fn encode(
16117            self,
16118            encoder: &mut fidl::encoding::Encoder<
16119                '_,
16120                fidl::encoding::DefaultFuchsiaResourceDialect,
16121            >,
16122            offset: usize,
16123            depth: fidl::encoding::Depth,
16124        ) -> fidl::Result<()> {
16125            encoder.debug_check_bounds::<CapabilitiesDirConnectorCreateRequest>(offset);
16126            // Zero out padding regions. There's no need to apply masks
16127            // because the unmasked parts will be overwritten by fields.
16128            // Write the fields.
16129            self.0.encode(encoder, offset + 0, depth)?;
16130            self.1.encode(encoder, offset + 4, depth)?;
16131            Ok(())
16132        }
16133    }
16134
16135    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16136        for CapabilitiesDirConnectorCreateRequest
16137    {
16138        #[inline(always)]
16139        fn new_empty() -> Self {
16140            Self {
16141                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
16142                receiver_client_end: fidl::new_empty!(
16143                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
16144                    fidl::encoding::DefaultFuchsiaResourceDialect
16145                ),
16146            }
16147        }
16148
16149        #[inline]
16150        unsafe fn decode(
16151            &mut self,
16152            decoder: &mut fidl::encoding::Decoder<
16153                '_,
16154                fidl::encoding::DefaultFuchsiaResourceDialect,
16155            >,
16156            offset: usize,
16157            _depth: fidl::encoding::Depth,
16158        ) -> fidl::Result<()> {
16159            decoder.debug_check_bounds::<Self>(offset);
16160            // Verify that padding bytes are zero.
16161            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 0, _depth)?;
16162            fidl::decode!(
16163                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
16164                fidl::encoding::DefaultFuchsiaResourceDialect,
16165                &mut self.receiver_client_end,
16166                decoder,
16167                offset + 4,
16168                _depth
16169            )?;
16170            Ok(())
16171        }
16172    }
16173
16174    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
16175        type Borrowed<'a> = &'a mut Self;
16176        fn take_or_borrow<'a>(
16177            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16178        ) -> Self::Borrowed<'a> {
16179            value
16180        }
16181    }
16182
16183    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterCreateRequest {
16184        type Owned = Self;
16185
16186        #[inline(always)]
16187        fn inline_align(_context: fidl::encoding::Context) -> usize {
16188            4
16189        }
16190
16191        #[inline(always)]
16192        fn inline_size(_context: fidl::encoding::Context) -> usize {
16193            8
16194        }
16195    }
16196
16197    unsafe impl
16198        fidl::encoding::Encode<
16199            CapabilitiesDirConnectorRouterCreateRequest,
16200            fidl::encoding::DefaultFuchsiaResourceDialect,
16201        > for &mut CapabilitiesDirConnectorRouterCreateRequest
16202    {
16203        #[inline]
16204        unsafe fn encode(
16205            self,
16206            encoder: &mut fidl::encoding::Encoder<
16207                '_,
16208                fidl::encoding::DefaultFuchsiaResourceDialect,
16209            >,
16210            offset: usize,
16211            _depth: fidl::encoding::Depth,
16212        ) -> fidl::Result<()> {
16213            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
16214            // Delegate to tuple encoding.
16215            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
16216                (
16217                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router),
16218                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.router_client_end),
16219                ),
16220                encoder, offset, _depth
16221            )
16222        }
16223    }
16224    unsafe impl<
16225        T0: fidl::encoding::Encode<
16226                fidl::encoding::HandleType<
16227                    fidl::EventPair,
16228                    { fidl::ObjectType::EVENTPAIR.into_raw() },
16229                    2147483648,
16230                >,
16231                fidl::encoding::DefaultFuchsiaResourceDialect,
16232            >,
16233        T1: fidl::encoding::Encode<
16234                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
16235                fidl::encoding::DefaultFuchsiaResourceDialect,
16236            >,
16237    >
16238        fidl::encoding::Encode<
16239            CapabilitiesDirConnectorRouterCreateRequest,
16240            fidl::encoding::DefaultFuchsiaResourceDialect,
16241        > for (T0, T1)
16242    {
16243        #[inline]
16244        unsafe fn encode(
16245            self,
16246            encoder: &mut fidl::encoding::Encoder<
16247                '_,
16248                fidl::encoding::DefaultFuchsiaResourceDialect,
16249            >,
16250            offset: usize,
16251            depth: fidl::encoding::Depth,
16252        ) -> fidl::Result<()> {
16253            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterCreateRequest>(offset);
16254            // Zero out padding regions. There's no need to apply masks
16255            // because the unmasked parts will be overwritten by fields.
16256            // Write the fields.
16257            self.0.encode(encoder, offset + 0, depth)?;
16258            self.1.encode(encoder, offset + 4, depth)?;
16259            Ok(())
16260        }
16261    }
16262
16263    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16264        for CapabilitiesDirConnectorRouterCreateRequest
16265    {
16266        #[inline(always)]
16267        fn new_empty() -> Self {
16268            Self {
16269                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
16270                router_client_end: fidl::new_empty!(
16271                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
16272                    fidl::encoding::DefaultFuchsiaResourceDialect
16273                ),
16274            }
16275        }
16276
16277        #[inline]
16278        unsafe fn decode(
16279            &mut self,
16280            decoder: &mut fidl::encoding::Decoder<
16281                '_,
16282                fidl::encoding::DefaultFuchsiaResourceDialect,
16283            >,
16284            offset: usize,
16285            _depth: fidl::encoding::Depth,
16286        ) -> fidl::Result<()> {
16287            decoder.debug_check_bounds::<Self>(offset);
16288            // Verify that padding bytes are zero.
16289            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
16290            fidl::decode!(
16291                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>,
16292                fidl::encoding::DefaultFuchsiaResourceDialect,
16293                &mut self.router_client_end,
16294                decoder,
16295                offset + 4,
16296                _depth
16297            )?;
16298            Ok(())
16299        }
16300    }
16301
16302    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
16303        type Borrowed<'a> = &'a mut Self;
16304        fn take_or_borrow<'a>(
16305            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16306        ) -> Self::Borrowed<'a> {
16307            value
16308        }
16309    }
16310
16311    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteRequest {
16312        type Owned = Self;
16313
16314        #[inline(always)]
16315        fn inline_align(_context: fidl::encoding::Context) -> usize {
16316            8
16317        }
16318
16319        #[inline(always)]
16320        fn inline_size(_context: fidl::encoding::Context) -> usize {
16321            32
16322        }
16323    }
16324
16325    unsafe impl
16326        fidl::encoding::Encode<
16327            CapabilitiesDirConnectorRouterRouteRequest,
16328            fidl::encoding::DefaultFuchsiaResourceDialect,
16329        > for &mut CapabilitiesDirConnectorRouterRouteRequest
16330    {
16331        #[inline]
16332        unsafe fn encode(
16333            self,
16334            encoder: &mut fidl::encoding::Encoder<
16335                '_,
16336                fidl::encoding::DefaultFuchsiaResourceDialect,
16337            >,
16338            offset: usize,
16339            _depth: fidl::encoding::Depth,
16340        ) -> fidl::Result<()> {
16341            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
16342            // Delegate to tuple encoding.
16343            fidl::encoding::Encode::<
16344                CapabilitiesDirConnectorRouterRouteRequest,
16345                fidl::encoding::DefaultFuchsiaResourceDialect,
16346            >::encode(
16347                (
16348                    <fidl::encoding::HandleType<
16349                        fidl::EventPair,
16350                        { fidl::ObjectType::EVENTPAIR.into_raw() },
16351                        2147483648,
16352                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16353                        &mut self.router
16354                    ),
16355                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16356                        &mut self.request,
16357                    ),
16358                    <fidl::encoding::HandleType<
16359                        fidl::EventPair,
16360                        { fidl::ObjectType::EVENTPAIR.into_raw() },
16361                        2147483648,
16362                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16363                        &mut self.dir_connector,
16364                    ),
16365                ),
16366                encoder,
16367                offset,
16368                _depth,
16369            )
16370        }
16371    }
16372    unsafe impl<
16373        T0: fidl::encoding::Encode<
16374                fidl::encoding::HandleType<
16375                    fidl::EventPair,
16376                    { fidl::ObjectType::EVENTPAIR.into_raw() },
16377                    2147483648,
16378                >,
16379                fidl::encoding::DefaultFuchsiaResourceDialect,
16380            >,
16381        T1: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
16382        T2: fidl::encoding::Encode<
16383                fidl::encoding::HandleType<
16384                    fidl::EventPair,
16385                    { fidl::ObjectType::EVENTPAIR.into_raw() },
16386                    2147483648,
16387                >,
16388                fidl::encoding::DefaultFuchsiaResourceDialect,
16389            >,
16390    >
16391        fidl::encoding::Encode<
16392            CapabilitiesDirConnectorRouterRouteRequest,
16393            fidl::encoding::DefaultFuchsiaResourceDialect,
16394        > for (T0, T1, T2)
16395    {
16396        #[inline]
16397        unsafe fn encode(
16398            self,
16399            encoder: &mut fidl::encoding::Encoder<
16400                '_,
16401                fidl::encoding::DefaultFuchsiaResourceDialect,
16402            >,
16403            offset: usize,
16404            depth: fidl::encoding::Depth,
16405        ) -> fidl::Result<()> {
16406            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteRequest>(offset);
16407            // Zero out padding regions. There's no need to apply masks
16408            // because the unmasked parts will be overwritten by fields.
16409            unsafe {
16410                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
16411                (ptr as *mut u64).write_unaligned(0);
16412            }
16413            unsafe {
16414                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
16415                (ptr as *mut u64).write_unaligned(0);
16416            }
16417            // Write the fields.
16418            self.0.encode(encoder, offset + 0, depth)?;
16419            self.1.encode(encoder, offset + 8, depth)?;
16420            self.2.encode(encoder, offset + 24, depth)?;
16421            Ok(())
16422        }
16423    }
16424
16425    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16426        for CapabilitiesDirConnectorRouterRouteRequest
16427    {
16428        #[inline(always)]
16429        fn new_empty() -> Self {
16430            Self {
16431                router: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
16432                request: fidl::new_empty!(
16433                    RouteRequest,
16434                    fidl::encoding::DefaultFuchsiaResourceDialect
16435                ),
16436                dir_connector: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
16437            }
16438        }
16439
16440        #[inline]
16441        unsafe fn decode(
16442            &mut self,
16443            decoder: &mut fidl::encoding::Decoder<
16444                '_,
16445                fidl::encoding::DefaultFuchsiaResourceDialect,
16446            >,
16447            offset: usize,
16448            _depth: fidl::encoding::Depth,
16449        ) -> fidl::Result<()> {
16450            decoder.debug_check_bounds::<Self>(offset);
16451            // Verify that padding bytes are zero.
16452            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
16453            let padval = unsafe { (ptr as *const u64).read_unaligned() };
16454            let mask = 0xffffffff00000000u64;
16455            let maskedval = padval & mask;
16456            if maskedval != 0 {
16457                return Err(fidl::Error::NonZeroPadding {
16458                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
16459                });
16460            }
16461            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
16462            let padval = unsafe { (ptr as *const u64).read_unaligned() };
16463            let mask = 0xffffffff00000000u64;
16464            let maskedval = padval & mask;
16465            if maskedval != 0 {
16466                return Err(fidl::Error::NonZeroPadding {
16467                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
16468                });
16469            }
16470            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.router, decoder, offset + 0, _depth)?;
16471            fidl::decode!(
16472                RouteRequest,
16473                fidl::encoding::DefaultFuchsiaResourceDialect,
16474                &mut self.request,
16475                decoder,
16476                offset + 8,
16477                _depth
16478            )?;
16479            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dir_connector, decoder, offset + 24, _depth)?;
16480            Ok(())
16481        }
16482    }
16483
16484    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryGetResponse {
16485        type Borrowed<'a> = &'a mut Self;
16486        fn take_or_borrow<'a>(
16487            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16488        ) -> Self::Borrowed<'a> {
16489            value
16490        }
16491    }
16492
16493    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryGetResponse {
16494        type Owned = Self;
16495
16496        #[inline(always)]
16497        fn inline_align(_context: fidl::encoding::Context) -> usize {
16498            4
16499        }
16500
16501        #[inline(always)]
16502        fn inline_size(_context: fidl::encoding::Context) -> usize {
16503            4
16504        }
16505    }
16506
16507    unsafe impl
16508        fidl::encoding::Encode<
16509            CapabilitiesDictionaryGetResponse,
16510            fidl::encoding::DefaultFuchsiaResourceDialect,
16511        > for &mut CapabilitiesDictionaryGetResponse
16512    {
16513        #[inline]
16514        unsafe fn encode(
16515            self,
16516            encoder: &mut fidl::encoding::Encoder<
16517                '_,
16518                fidl::encoding::DefaultFuchsiaResourceDialect,
16519            >,
16520            offset: usize,
16521            _depth: fidl::encoding::Depth,
16522        ) -> fidl::Result<()> {
16523            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
16524            // Delegate to tuple encoding.
16525            fidl::encoding::Encode::<
16526                CapabilitiesDictionaryGetResponse,
16527                fidl::encoding::DefaultFuchsiaResourceDialect,
16528            >::encode(
16529                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
16530                    &self.capability_type,
16531                ),),
16532                encoder,
16533                offset,
16534                _depth,
16535            )
16536        }
16537    }
16538    unsafe impl<
16539        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
16540    >
16541        fidl::encoding::Encode<
16542            CapabilitiesDictionaryGetResponse,
16543            fidl::encoding::DefaultFuchsiaResourceDialect,
16544        > for (T0,)
16545    {
16546        #[inline]
16547        unsafe fn encode(
16548            self,
16549            encoder: &mut fidl::encoding::Encoder<
16550                '_,
16551                fidl::encoding::DefaultFuchsiaResourceDialect,
16552            >,
16553            offset: usize,
16554            depth: fidl::encoding::Depth,
16555        ) -> fidl::Result<()> {
16556            encoder.debug_check_bounds::<CapabilitiesDictionaryGetResponse>(offset);
16557            // Zero out padding regions. There's no need to apply masks
16558            // because the unmasked parts will be overwritten by fields.
16559            // Write the fields.
16560            self.0.encode(encoder, offset + 0, depth)?;
16561            Ok(())
16562        }
16563    }
16564
16565    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16566        for CapabilitiesDictionaryGetResponse
16567    {
16568        #[inline(always)]
16569        fn new_empty() -> Self {
16570            Self {
16571                capability_type: fidl::new_empty!(
16572                    CapabilityType,
16573                    fidl::encoding::DefaultFuchsiaResourceDialect
16574                ),
16575            }
16576        }
16577
16578        #[inline]
16579        unsafe fn decode(
16580            &mut self,
16581            decoder: &mut fidl::encoding::Decoder<
16582                '_,
16583                fidl::encoding::DefaultFuchsiaResourceDialect,
16584            >,
16585            offset: usize,
16586            _depth: fidl::encoding::Depth,
16587        ) -> fidl::Result<()> {
16588            decoder.debug_check_bounds::<Self>(offset);
16589            // Verify that padding bytes are zero.
16590            fidl::decode!(
16591                CapabilityType,
16592                fidl::encoding::DefaultFuchsiaResourceDialect,
16593                &mut self.capability_type,
16594                decoder,
16595                offset + 0,
16596                _depth
16597            )?;
16598            Ok(())
16599        }
16600    }
16601
16602    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveResponse {
16603        type Borrowed<'a> = &'a mut Self;
16604        fn take_or_borrow<'a>(
16605            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16606        ) -> Self::Borrowed<'a> {
16607            value
16608        }
16609    }
16610
16611    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveResponse {
16612        type Owned = Self;
16613
16614        #[inline(always)]
16615        fn inline_align(_context: fidl::encoding::Context) -> usize {
16616            4
16617        }
16618
16619        #[inline(always)]
16620        fn inline_size(_context: fidl::encoding::Context) -> usize {
16621            4
16622        }
16623    }
16624
16625    unsafe impl
16626        fidl::encoding::Encode<
16627            CapabilitiesDictionaryRemoveResponse,
16628            fidl::encoding::DefaultFuchsiaResourceDialect,
16629        > for &mut CapabilitiesDictionaryRemoveResponse
16630    {
16631        #[inline]
16632        unsafe fn encode(
16633            self,
16634            encoder: &mut fidl::encoding::Encoder<
16635                '_,
16636                fidl::encoding::DefaultFuchsiaResourceDialect,
16637            >,
16638            offset: usize,
16639            _depth: fidl::encoding::Depth,
16640        ) -> fidl::Result<()> {
16641            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
16642            // Delegate to tuple encoding.
16643            fidl::encoding::Encode::<
16644                CapabilitiesDictionaryRemoveResponse,
16645                fidl::encoding::DefaultFuchsiaResourceDialect,
16646            >::encode(
16647                (<CapabilityType as fidl::encoding::ValueTypeMarker>::borrow(
16648                    &self.capability_type,
16649                ),),
16650                encoder,
16651                offset,
16652                _depth,
16653            )
16654        }
16655    }
16656    unsafe impl<
16657        T0: fidl::encoding::Encode<CapabilityType, fidl::encoding::DefaultFuchsiaResourceDialect>,
16658    >
16659        fidl::encoding::Encode<
16660            CapabilitiesDictionaryRemoveResponse,
16661            fidl::encoding::DefaultFuchsiaResourceDialect,
16662        > for (T0,)
16663    {
16664        #[inline]
16665        unsafe fn encode(
16666            self,
16667            encoder: &mut fidl::encoding::Encoder<
16668                '_,
16669                fidl::encoding::DefaultFuchsiaResourceDialect,
16670            >,
16671            offset: usize,
16672            depth: fidl::encoding::Depth,
16673        ) -> fidl::Result<()> {
16674            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveResponse>(offset);
16675            // Zero out padding regions. There's no need to apply masks
16676            // because the unmasked parts will be overwritten by fields.
16677            // Write the fields.
16678            self.0.encode(encoder, offset + 0, depth)?;
16679            Ok(())
16680        }
16681    }
16682
16683    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16684        for CapabilitiesDictionaryRemoveResponse
16685    {
16686        #[inline(always)]
16687        fn new_empty() -> Self {
16688            Self {
16689                capability_type: fidl::new_empty!(
16690                    CapabilityType,
16691                    fidl::encoding::DefaultFuchsiaResourceDialect
16692                ),
16693            }
16694        }
16695
16696        #[inline]
16697        unsafe fn decode(
16698            &mut self,
16699            decoder: &mut fidl::encoding::Decoder<
16700                '_,
16701                fidl::encoding::DefaultFuchsiaResourceDialect,
16702            >,
16703            offset: usize,
16704            _depth: fidl::encoding::Depth,
16705        ) -> fidl::Result<()> {
16706            decoder.debug_check_bounds::<Self>(offset);
16707            // Verify that padding bytes are zero.
16708            fidl::decode!(
16709                CapabilityType,
16710                fidl::encoding::DefaultFuchsiaResourceDialect,
16711                &mut self.capability_type,
16712                decoder,
16713                offset + 0,
16714                _depth
16715            )?;
16716            Ok(())
16717        }
16718    }
16719
16720    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateConnectorRequest {
16721        type Borrowed<'a> = &'a mut Self;
16722        fn take_or_borrow<'a>(
16723            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16724        ) -> Self::Borrowed<'a> {
16725            value
16726        }
16727    }
16728
16729    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateConnectorRequest {
16730        type Owned = Self;
16731
16732        #[inline(always)]
16733        fn inline_align(_context: fidl::encoding::Context) -> usize {
16734            4
16735        }
16736
16737        #[inline(always)]
16738        fn inline_size(_context: fidl::encoding::Context) -> usize {
16739            8
16740        }
16741    }
16742
16743    unsafe impl
16744        fidl::encoding::Encode<
16745            CapabilityFactoryCreateConnectorRequest,
16746            fidl::encoding::DefaultFuchsiaResourceDialect,
16747        > for &mut CapabilityFactoryCreateConnectorRequest
16748    {
16749        #[inline]
16750        unsafe fn encode(
16751            self,
16752            encoder: &mut fidl::encoding::Encoder<
16753                '_,
16754                fidl::encoding::DefaultFuchsiaResourceDialect,
16755            >,
16756            offset: usize,
16757            _depth: fidl::encoding::Depth,
16758        ) -> fidl::Result<()> {
16759            encoder.debug_check_bounds::<CapabilityFactoryCreateConnectorRequest>(offset);
16760            // Delegate to tuple encoding.
16761            fidl::encoding::Encode::<CapabilityFactoryCreateConnectorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
16762                (
16763                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver_client_end),
16764                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector_server_end),
16765                ),
16766                encoder, offset, _depth
16767            )
16768        }
16769    }
16770    unsafe impl<
16771        T0: fidl::encoding::Encode<
16772                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
16773                fidl::encoding::DefaultFuchsiaResourceDialect,
16774            >,
16775        T1: fidl::encoding::Encode<
16776                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
16777                fidl::encoding::DefaultFuchsiaResourceDialect,
16778            >,
16779    >
16780        fidl::encoding::Encode<
16781            CapabilityFactoryCreateConnectorRequest,
16782            fidl::encoding::DefaultFuchsiaResourceDialect,
16783        > for (T0, T1)
16784    {
16785        #[inline]
16786        unsafe fn encode(
16787            self,
16788            encoder: &mut fidl::encoding::Encoder<
16789                '_,
16790                fidl::encoding::DefaultFuchsiaResourceDialect,
16791            >,
16792            offset: usize,
16793            depth: fidl::encoding::Depth,
16794        ) -> fidl::Result<()> {
16795            encoder.debug_check_bounds::<CapabilityFactoryCreateConnectorRequest>(offset);
16796            // Zero out padding regions. There's no need to apply masks
16797            // because the unmasked parts will be overwritten by fields.
16798            // Write the fields.
16799            self.0.encode(encoder, offset + 0, depth)?;
16800            self.1.encode(encoder, offset + 4, depth)?;
16801            Ok(())
16802        }
16803    }
16804
16805    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16806        for CapabilityFactoryCreateConnectorRequest
16807    {
16808        #[inline(always)]
16809        fn new_empty() -> Self {
16810            Self {
16811                receiver_client_end: fidl::new_empty!(
16812                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
16813                    fidl::encoding::DefaultFuchsiaResourceDialect
16814                ),
16815                connector_server_end: fidl::new_empty!(
16816                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
16817                    fidl::encoding::DefaultFuchsiaResourceDialect
16818                ),
16819            }
16820        }
16821
16822        #[inline]
16823        unsafe fn decode(
16824            &mut self,
16825            decoder: &mut fidl::encoding::Decoder<
16826                '_,
16827                fidl::encoding::DefaultFuchsiaResourceDialect,
16828            >,
16829            offset: usize,
16830            _depth: fidl::encoding::Depth,
16831        ) -> fidl::Result<()> {
16832            decoder.debug_check_bounds::<Self>(offset);
16833            // Verify that padding bytes are zero.
16834            fidl::decode!(
16835                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
16836                fidl::encoding::DefaultFuchsiaResourceDialect,
16837                &mut self.receiver_client_end,
16838                decoder,
16839                offset + 0,
16840                _depth
16841            )?;
16842            fidl::decode!(
16843                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
16844                fidl::encoding::DefaultFuchsiaResourceDialect,
16845                &mut self.connector_server_end,
16846                decoder,
16847                offset + 4,
16848                _depth
16849            )?;
16850            Ok(())
16851        }
16852    }
16853
16854    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateConnectorRouterRequest {
16855        type Borrowed<'a> = &'a mut Self;
16856        fn take_or_borrow<'a>(
16857            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16858        ) -> Self::Borrowed<'a> {
16859            value
16860        }
16861    }
16862
16863    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateConnectorRouterRequest {
16864        type Owned = Self;
16865
16866        #[inline(always)]
16867        fn inline_align(_context: fidl::encoding::Context) -> usize {
16868            4
16869        }
16870
16871        #[inline(always)]
16872        fn inline_size(_context: fidl::encoding::Context) -> usize {
16873            8
16874        }
16875    }
16876
16877    unsafe impl
16878        fidl::encoding::Encode<
16879            CapabilityFactoryCreateConnectorRouterRequest,
16880            fidl::encoding::DefaultFuchsiaResourceDialect,
16881        > for &mut CapabilityFactoryCreateConnectorRouterRequest
16882    {
16883        #[inline]
16884        unsafe fn encode(
16885            self,
16886            encoder: &mut fidl::encoding::Encoder<
16887                '_,
16888                fidl::encoding::DefaultFuchsiaResourceDialect,
16889            >,
16890            offset: usize,
16891            _depth: fidl::encoding::Depth,
16892        ) -> fidl::Result<()> {
16893            encoder.debug_check_bounds::<CapabilityFactoryCreateConnectorRouterRequest>(offset);
16894            // Delegate to tuple encoding.
16895            fidl::encoding::Encode::<
16896                CapabilityFactoryCreateConnectorRouterRequest,
16897                fidl::encoding::DefaultFuchsiaResourceDialect,
16898            >::encode(
16899                (
16900                    <fidl::encoding::Endpoint<
16901                        fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
16902                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16903                        &mut self.router_client_end,
16904                    ),
16905                    <fidl::encoding::Endpoint<
16906                        fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
16907                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
16908                        &mut self.router_server_end,
16909                    ),
16910                ),
16911                encoder,
16912                offset,
16913                _depth,
16914            )
16915        }
16916    }
16917    unsafe impl<
16918        T0: fidl::encoding::Encode<
16919                fidl::encoding::Endpoint<
16920                    fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
16921                >,
16922                fidl::encoding::DefaultFuchsiaResourceDialect,
16923            >,
16924        T1: fidl::encoding::Encode<
16925                fidl::encoding::Endpoint<
16926                    fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
16927                >,
16928                fidl::encoding::DefaultFuchsiaResourceDialect,
16929            >,
16930    >
16931        fidl::encoding::Encode<
16932            CapabilityFactoryCreateConnectorRouterRequest,
16933            fidl::encoding::DefaultFuchsiaResourceDialect,
16934        > for (T0, T1)
16935    {
16936        #[inline]
16937        unsafe fn encode(
16938            self,
16939            encoder: &mut fidl::encoding::Encoder<
16940                '_,
16941                fidl::encoding::DefaultFuchsiaResourceDialect,
16942            >,
16943            offset: usize,
16944            depth: fidl::encoding::Depth,
16945        ) -> fidl::Result<()> {
16946            encoder.debug_check_bounds::<CapabilityFactoryCreateConnectorRouterRequest>(offset);
16947            // Zero out padding regions. There's no need to apply masks
16948            // because the unmasked parts will be overwritten by fields.
16949            // Write the fields.
16950            self.0.encode(encoder, offset + 0, depth)?;
16951            self.1.encode(encoder, offset + 4, depth)?;
16952            Ok(())
16953        }
16954    }
16955
16956    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16957        for CapabilityFactoryCreateConnectorRouterRequest
16958    {
16959        #[inline(always)]
16960        fn new_empty() -> Self {
16961            Self {
16962                router_client_end: fidl::new_empty!(
16963                    fidl::encoding::Endpoint<
16964                        fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
16965                    >,
16966                    fidl::encoding::DefaultFuchsiaResourceDialect
16967                ),
16968                router_server_end: fidl::new_empty!(
16969                    fidl::encoding::Endpoint<
16970                        fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
16971                    >,
16972                    fidl::encoding::DefaultFuchsiaResourceDialect
16973                ),
16974            }
16975        }
16976
16977        #[inline]
16978        unsafe fn decode(
16979            &mut self,
16980            decoder: &mut fidl::encoding::Decoder<
16981                '_,
16982                fidl::encoding::DefaultFuchsiaResourceDialect,
16983            >,
16984            offset: usize,
16985            _depth: fidl::encoding::Depth,
16986        ) -> fidl::Result<()> {
16987            decoder.debug_check_bounds::<Self>(offset);
16988            // Verify that padding bytes are zero.
16989            fidl::decode!(
16990                fidl::encoding::Endpoint<
16991                    fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
16992                >,
16993                fidl::encoding::DefaultFuchsiaResourceDialect,
16994                &mut self.router_client_end,
16995                decoder,
16996                offset + 0,
16997                _depth
16998            )?;
16999            fidl::decode!(
17000                fidl::encoding::Endpoint<
17001                    fidl::endpoints::ServerEnd<ConnectorRouterDeprecatedMarker>,
17002                >,
17003                fidl::encoding::DefaultFuchsiaResourceDialect,
17004                &mut self.router_server_end,
17005                decoder,
17006                offset + 4,
17007                _depth
17008            )?;
17009            Ok(())
17010        }
17011    }
17012
17013    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateDataRouterRequest {
17014        type Borrowed<'a> = &'a mut Self;
17015        fn take_or_borrow<'a>(
17016            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17017        ) -> Self::Borrowed<'a> {
17018            value
17019        }
17020    }
17021
17022    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateDataRouterRequest {
17023        type Owned = Self;
17024
17025        #[inline(always)]
17026        fn inline_align(_context: fidl::encoding::Context) -> usize {
17027            4
17028        }
17029
17030        #[inline(always)]
17031        fn inline_size(_context: fidl::encoding::Context) -> usize {
17032            8
17033        }
17034    }
17035
17036    unsafe impl
17037        fidl::encoding::Encode<
17038            CapabilityFactoryCreateDataRouterRequest,
17039            fidl::encoding::DefaultFuchsiaResourceDialect,
17040        > for &mut CapabilityFactoryCreateDataRouterRequest
17041    {
17042        #[inline]
17043        unsafe fn encode(
17044            self,
17045            encoder: &mut fidl::encoding::Encoder<
17046                '_,
17047                fidl::encoding::DefaultFuchsiaResourceDialect,
17048            >,
17049            offset: usize,
17050            _depth: fidl::encoding::Depth,
17051        ) -> fidl::Result<()> {
17052            encoder.debug_check_bounds::<CapabilityFactoryCreateDataRouterRequest>(offset);
17053            // Delegate to tuple encoding.
17054            fidl::encoding::Encode::<
17055                CapabilityFactoryCreateDataRouterRequest,
17056                fidl::encoding::DefaultFuchsiaResourceDialect,
17057            >::encode(
17058                (
17059                    <fidl::encoding::Endpoint<
17060                        fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
17061                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17062                        &mut self.router_client_end,
17063                    ),
17064                    <fidl::encoding::Endpoint<
17065                        fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
17066                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17067                        &mut self.router_server_end,
17068                    ),
17069                ),
17070                encoder,
17071                offset,
17072                _depth,
17073            )
17074        }
17075    }
17076    unsafe impl<
17077        T0: fidl::encoding::Encode<
17078                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>>,
17079                fidl::encoding::DefaultFuchsiaResourceDialect,
17080            >,
17081        T1: fidl::encoding::Encode<
17082                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>>,
17083                fidl::encoding::DefaultFuchsiaResourceDialect,
17084            >,
17085    >
17086        fidl::encoding::Encode<
17087            CapabilityFactoryCreateDataRouterRequest,
17088            fidl::encoding::DefaultFuchsiaResourceDialect,
17089        > for (T0, T1)
17090    {
17091        #[inline]
17092        unsafe fn encode(
17093            self,
17094            encoder: &mut fidl::encoding::Encoder<
17095                '_,
17096                fidl::encoding::DefaultFuchsiaResourceDialect,
17097            >,
17098            offset: usize,
17099            depth: fidl::encoding::Depth,
17100        ) -> fidl::Result<()> {
17101            encoder.debug_check_bounds::<CapabilityFactoryCreateDataRouterRequest>(offset);
17102            // Zero out padding regions. There's no need to apply masks
17103            // because the unmasked parts will be overwritten by fields.
17104            // Write the fields.
17105            self.0.encode(encoder, offset + 0, depth)?;
17106            self.1.encode(encoder, offset + 4, depth)?;
17107            Ok(())
17108        }
17109    }
17110
17111    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17112        for CapabilityFactoryCreateDataRouterRequest
17113    {
17114        #[inline(always)]
17115        fn new_empty() -> Self {
17116            Self {
17117                router_client_end: fidl::new_empty!(
17118                    fidl::encoding::Endpoint<
17119                        fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
17120                    >,
17121                    fidl::encoding::DefaultFuchsiaResourceDialect
17122                ),
17123                router_server_end: fidl::new_empty!(
17124                    fidl::encoding::Endpoint<
17125                        fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>,
17126                    >,
17127                    fidl::encoding::DefaultFuchsiaResourceDialect
17128                ),
17129            }
17130        }
17131
17132        #[inline]
17133        unsafe fn decode(
17134            &mut self,
17135            decoder: &mut fidl::encoding::Decoder<
17136                '_,
17137                fidl::encoding::DefaultFuchsiaResourceDialect,
17138            >,
17139            offset: usize,
17140            _depth: fidl::encoding::Depth,
17141        ) -> fidl::Result<()> {
17142            decoder.debug_check_bounds::<Self>(offset);
17143            // Verify that padding bytes are zero.
17144            fidl::decode!(
17145                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>>,
17146                fidl::encoding::DefaultFuchsiaResourceDialect,
17147                &mut self.router_client_end,
17148                decoder,
17149                offset + 0,
17150                _depth
17151            )?;
17152            fidl::decode!(
17153                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DataRouterDeprecatedMarker>>,
17154                fidl::encoding::DefaultFuchsiaResourceDialect,
17155                &mut self.router_server_end,
17156                decoder,
17157                offset + 4,
17158                _depth
17159            )?;
17160            Ok(())
17161        }
17162    }
17163
17164    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateDictionaryRequest {
17165        type Borrowed<'a> = &'a mut Self;
17166        fn take_or_borrow<'a>(
17167            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17168        ) -> Self::Borrowed<'a> {
17169            value
17170        }
17171    }
17172
17173    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateDictionaryRequest {
17174        type Owned = Self;
17175
17176        #[inline(always)]
17177        fn inline_align(_context: fidl::encoding::Context) -> usize {
17178            4
17179        }
17180
17181        #[inline(always)]
17182        fn inline_size(_context: fidl::encoding::Context) -> usize {
17183            4
17184        }
17185    }
17186
17187    unsafe impl
17188        fidl::encoding::Encode<
17189            CapabilityFactoryCreateDictionaryRequest,
17190            fidl::encoding::DefaultFuchsiaResourceDialect,
17191        > for &mut CapabilityFactoryCreateDictionaryRequest
17192    {
17193        #[inline]
17194        unsafe fn encode(
17195            self,
17196            encoder: &mut fidl::encoding::Encoder<
17197                '_,
17198                fidl::encoding::DefaultFuchsiaResourceDialect,
17199            >,
17200            offset: usize,
17201            _depth: fidl::encoding::Depth,
17202        ) -> fidl::Result<()> {
17203            encoder.debug_check_bounds::<CapabilityFactoryCreateDictionaryRequest>(offset);
17204            // Delegate to tuple encoding.
17205            fidl::encoding::Encode::<CapabilityFactoryCreateDictionaryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
17206                (
17207                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary_server_end),
17208                ),
17209                encoder, offset, _depth
17210            )
17211        }
17212    }
17213    unsafe impl<
17214        T0: fidl::encoding::Encode<
17215                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
17216                fidl::encoding::DefaultFuchsiaResourceDialect,
17217            >,
17218    >
17219        fidl::encoding::Encode<
17220            CapabilityFactoryCreateDictionaryRequest,
17221            fidl::encoding::DefaultFuchsiaResourceDialect,
17222        > for (T0,)
17223    {
17224        #[inline]
17225        unsafe fn encode(
17226            self,
17227            encoder: &mut fidl::encoding::Encoder<
17228                '_,
17229                fidl::encoding::DefaultFuchsiaResourceDialect,
17230            >,
17231            offset: usize,
17232            depth: fidl::encoding::Depth,
17233        ) -> fidl::Result<()> {
17234            encoder.debug_check_bounds::<CapabilityFactoryCreateDictionaryRequest>(offset);
17235            // Zero out padding regions. There's no need to apply masks
17236            // because the unmasked parts will be overwritten by fields.
17237            // Write the fields.
17238            self.0.encode(encoder, offset + 0, depth)?;
17239            Ok(())
17240        }
17241    }
17242
17243    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17244        for CapabilityFactoryCreateDictionaryRequest
17245    {
17246        #[inline(always)]
17247        fn new_empty() -> Self {
17248            Self {
17249                dictionary_server_end: fidl::new_empty!(
17250                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
17251                    fidl::encoding::DefaultFuchsiaResourceDialect
17252                ),
17253            }
17254        }
17255
17256        #[inline]
17257        unsafe fn decode(
17258            &mut self,
17259            decoder: &mut fidl::encoding::Decoder<
17260                '_,
17261                fidl::encoding::DefaultFuchsiaResourceDialect,
17262            >,
17263            offset: usize,
17264            _depth: fidl::encoding::Depth,
17265        ) -> fidl::Result<()> {
17266            decoder.debug_check_bounds::<Self>(offset);
17267            // Verify that padding bytes are zero.
17268            fidl::decode!(
17269                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
17270                fidl::encoding::DefaultFuchsiaResourceDialect,
17271                &mut self.dictionary_server_end,
17272                decoder,
17273                offset + 0,
17274                _depth
17275            )?;
17276            Ok(())
17277        }
17278    }
17279
17280    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateDictionaryRouterRequest {
17281        type Borrowed<'a> = &'a mut Self;
17282        fn take_or_borrow<'a>(
17283            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17284        ) -> Self::Borrowed<'a> {
17285            value
17286        }
17287    }
17288
17289    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateDictionaryRouterRequest {
17290        type Owned = Self;
17291
17292        #[inline(always)]
17293        fn inline_align(_context: fidl::encoding::Context) -> usize {
17294            4
17295        }
17296
17297        #[inline(always)]
17298        fn inline_size(_context: fidl::encoding::Context) -> usize {
17299            8
17300        }
17301    }
17302
17303    unsafe impl
17304        fidl::encoding::Encode<
17305            CapabilityFactoryCreateDictionaryRouterRequest,
17306            fidl::encoding::DefaultFuchsiaResourceDialect,
17307        > for &mut CapabilityFactoryCreateDictionaryRouterRequest
17308    {
17309        #[inline]
17310        unsafe fn encode(
17311            self,
17312            encoder: &mut fidl::encoding::Encoder<
17313                '_,
17314                fidl::encoding::DefaultFuchsiaResourceDialect,
17315            >,
17316            offset: usize,
17317            _depth: fidl::encoding::Depth,
17318        ) -> fidl::Result<()> {
17319            encoder.debug_check_bounds::<CapabilityFactoryCreateDictionaryRouterRequest>(offset);
17320            // Delegate to tuple encoding.
17321            fidl::encoding::Encode::<
17322                CapabilityFactoryCreateDictionaryRouterRequest,
17323                fidl::encoding::DefaultFuchsiaResourceDialect,
17324            >::encode(
17325                (
17326                    <fidl::encoding::Endpoint<
17327                        fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
17328                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17329                        &mut self.router_client_end,
17330                    ),
17331                    <fidl::encoding::Endpoint<
17332                        fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
17333                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17334                        &mut self.router_server_end,
17335                    ),
17336                ),
17337                encoder,
17338                offset,
17339                _depth,
17340            )
17341        }
17342    }
17343    unsafe impl<
17344        T0: fidl::encoding::Encode<
17345                fidl::encoding::Endpoint<
17346                    fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
17347                >,
17348                fidl::encoding::DefaultFuchsiaResourceDialect,
17349            >,
17350        T1: fidl::encoding::Encode<
17351                fidl::encoding::Endpoint<
17352                    fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
17353                >,
17354                fidl::encoding::DefaultFuchsiaResourceDialect,
17355            >,
17356    >
17357        fidl::encoding::Encode<
17358            CapabilityFactoryCreateDictionaryRouterRequest,
17359            fidl::encoding::DefaultFuchsiaResourceDialect,
17360        > for (T0, T1)
17361    {
17362        #[inline]
17363        unsafe fn encode(
17364            self,
17365            encoder: &mut fidl::encoding::Encoder<
17366                '_,
17367                fidl::encoding::DefaultFuchsiaResourceDialect,
17368            >,
17369            offset: usize,
17370            depth: fidl::encoding::Depth,
17371        ) -> fidl::Result<()> {
17372            encoder.debug_check_bounds::<CapabilityFactoryCreateDictionaryRouterRequest>(offset);
17373            // Zero out padding regions. There's no need to apply masks
17374            // because the unmasked parts will be overwritten by fields.
17375            // Write the fields.
17376            self.0.encode(encoder, offset + 0, depth)?;
17377            self.1.encode(encoder, offset + 4, depth)?;
17378            Ok(())
17379        }
17380    }
17381
17382    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17383        for CapabilityFactoryCreateDictionaryRouterRequest
17384    {
17385        #[inline(always)]
17386        fn new_empty() -> Self {
17387            Self {
17388                router_client_end: fidl::new_empty!(
17389                    fidl::encoding::Endpoint<
17390                        fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
17391                    >,
17392                    fidl::encoding::DefaultFuchsiaResourceDialect
17393                ),
17394                router_server_end: fidl::new_empty!(
17395                    fidl::encoding::Endpoint<
17396                        fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
17397                    >,
17398                    fidl::encoding::DefaultFuchsiaResourceDialect
17399                ),
17400            }
17401        }
17402
17403        #[inline]
17404        unsafe fn decode(
17405            &mut self,
17406            decoder: &mut fidl::encoding::Decoder<
17407                '_,
17408                fidl::encoding::DefaultFuchsiaResourceDialect,
17409            >,
17410            offset: usize,
17411            _depth: fidl::encoding::Depth,
17412        ) -> fidl::Result<()> {
17413            decoder.debug_check_bounds::<Self>(offset);
17414            // Verify that padding bytes are zero.
17415            fidl::decode!(
17416                fidl::encoding::Endpoint<
17417                    fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
17418                >,
17419                fidl::encoding::DefaultFuchsiaResourceDialect,
17420                &mut self.router_client_end,
17421                decoder,
17422                offset + 0,
17423                _depth
17424            )?;
17425            fidl::decode!(
17426                fidl::encoding::Endpoint<
17427                    fidl::endpoints::ServerEnd<DictionaryRouterDeprecatedMarker>,
17428                >,
17429                fidl::encoding::DefaultFuchsiaResourceDialect,
17430                &mut self.router_server_end,
17431                decoder,
17432                offset + 4,
17433                _depth
17434            )?;
17435            Ok(())
17436        }
17437    }
17438
17439    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateDirConnectorRequest {
17440        type Borrowed<'a> = &'a mut Self;
17441        fn take_or_borrow<'a>(
17442            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17443        ) -> Self::Borrowed<'a> {
17444            value
17445        }
17446    }
17447
17448    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateDirConnectorRequest {
17449        type Owned = Self;
17450
17451        #[inline(always)]
17452        fn inline_align(_context: fidl::encoding::Context) -> usize {
17453            4
17454        }
17455
17456        #[inline(always)]
17457        fn inline_size(_context: fidl::encoding::Context) -> usize {
17458            8
17459        }
17460    }
17461
17462    unsafe impl
17463        fidl::encoding::Encode<
17464            CapabilityFactoryCreateDirConnectorRequest,
17465            fidl::encoding::DefaultFuchsiaResourceDialect,
17466        > for &mut CapabilityFactoryCreateDirConnectorRequest
17467    {
17468        #[inline]
17469        unsafe fn encode(
17470            self,
17471            encoder: &mut fidl::encoding::Encoder<
17472                '_,
17473                fidl::encoding::DefaultFuchsiaResourceDialect,
17474            >,
17475            offset: usize,
17476            _depth: fidl::encoding::Depth,
17477        ) -> fidl::Result<()> {
17478            encoder.debug_check_bounds::<CapabilityFactoryCreateDirConnectorRequest>(offset);
17479            // Delegate to tuple encoding.
17480            fidl::encoding::Encode::<CapabilityFactoryCreateDirConnectorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
17481                (
17482                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_receiver_client_end),
17483                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector_server_end),
17484                ),
17485                encoder, offset, _depth
17486            )
17487        }
17488    }
17489    unsafe impl<
17490        T0: fidl::encoding::Encode<
17491                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>>,
17492                fidl::encoding::DefaultFuchsiaResourceDialect,
17493            >,
17494        T1: fidl::encoding::Encode<
17495                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
17496                fidl::encoding::DefaultFuchsiaResourceDialect,
17497            >,
17498    >
17499        fidl::encoding::Encode<
17500            CapabilityFactoryCreateDirConnectorRequest,
17501            fidl::encoding::DefaultFuchsiaResourceDialect,
17502        > for (T0, T1)
17503    {
17504        #[inline]
17505        unsafe fn encode(
17506            self,
17507            encoder: &mut fidl::encoding::Encoder<
17508                '_,
17509                fidl::encoding::DefaultFuchsiaResourceDialect,
17510            >,
17511            offset: usize,
17512            depth: fidl::encoding::Depth,
17513        ) -> fidl::Result<()> {
17514            encoder.debug_check_bounds::<CapabilityFactoryCreateDirConnectorRequest>(offset);
17515            // Zero out padding regions. There's no need to apply masks
17516            // because the unmasked parts will be overwritten by fields.
17517            // Write the fields.
17518            self.0.encode(encoder, offset + 0, depth)?;
17519            self.1.encode(encoder, offset + 4, depth)?;
17520            Ok(())
17521        }
17522    }
17523
17524    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17525        for CapabilityFactoryCreateDirConnectorRequest
17526    {
17527        #[inline(always)]
17528        fn new_empty() -> Self {
17529            Self {
17530                dir_receiver_client_end: fidl::new_empty!(
17531                    fidl::encoding::Endpoint<
17532                        fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>,
17533                    >,
17534                    fidl::encoding::DefaultFuchsiaResourceDialect
17535                ),
17536                dir_connector_server_end: fidl::new_empty!(
17537                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
17538                    fidl::encoding::DefaultFuchsiaResourceDialect
17539                ),
17540            }
17541        }
17542
17543        #[inline]
17544        unsafe fn decode(
17545            &mut self,
17546            decoder: &mut fidl::encoding::Decoder<
17547                '_,
17548                fidl::encoding::DefaultFuchsiaResourceDialect,
17549            >,
17550            offset: usize,
17551            _depth: fidl::encoding::Depth,
17552        ) -> fidl::Result<()> {
17553            decoder.debug_check_bounds::<Self>(offset);
17554            // Verify that padding bytes are zero.
17555            fidl::decode!(
17556                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverDeprecatedMarker>>,
17557                fidl::encoding::DefaultFuchsiaResourceDialect,
17558                &mut self.dir_receiver_client_end,
17559                decoder,
17560                offset + 0,
17561                _depth
17562            )?;
17563            fidl::decode!(
17564                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
17565                fidl::encoding::DefaultFuchsiaResourceDialect,
17566                &mut self.dir_connector_server_end,
17567                decoder,
17568                offset + 4,
17569                _depth
17570            )?;
17571            Ok(())
17572        }
17573    }
17574
17575    impl fidl::encoding::ResourceTypeMarker for CapabilityFactoryCreateDirConnectorRouterRequest {
17576        type Borrowed<'a> = &'a mut Self;
17577        fn take_or_borrow<'a>(
17578            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17579        ) -> Self::Borrowed<'a> {
17580            value
17581        }
17582    }
17583
17584    unsafe impl fidl::encoding::TypeMarker for CapabilityFactoryCreateDirConnectorRouterRequest {
17585        type Owned = Self;
17586
17587        #[inline(always)]
17588        fn inline_align(_context: fidl::encoding::Context) -> usize {
17589            4
17590        }
17591
17592        #[inline(always)]
17593        fn inline_size(_context: fidl::encoding::Context) -> usize {
17594            8
17595        }
17596    }
17597
17598    unsafe impl
17599        fidl::encoding::Encode<
17600            CapabilityFactoryCreateDirConnectorRouterRequest,
17601            fidl::encoding::DefaultFuchsiaResourceDialect,
17602        > for &mut CapabilityFactoryCreateDirConnectorRouterRequest
17603    {
17604        #[inline]
17605        unsafe fn encode(
17606            self,
17607            encoder: &mut fidl::encoding::Encoder<
17608                '_,
17609                fidl::encoding::DefaultFuchsiaResourceDialect,
17610            >,
17611            offset: usize,
17612            _depth: fidl::encoding::Depth,
17613        ) -> fidl::Result<()> {
17614            encoder.debug_check_bounds::<CapabilityFactoryCreateDirConnectorRouterRequest>(offset);
17615            // Delegate to tuple encoding.
17616            fidl::encoding::Encode::<
17617                CapabilityFactoryCreateDirConnectorRouterRequest,
17618                fidl::encoding::DefaultFuchsiaResourceDialect,
17619            >::encode(
17620                (
17621                    <fidl::encoding::Endpoint<
17622                        fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
17623                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17624                        &mut self.router_client_end,
17625                    ),
17626                    <fidl::encoding::Endpoint<
17627                        fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
17628                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17629                        &mut self.router_server_end,
17630                    ),
17631                ),
17632                encoder,
17633                offset,
17634                _depth,
17635            )
17636        }
17637    }
17638    unsafe impl<
17639        T0: fidl::encoding::Encode<
17640                fidl::encoding::Endpoint<
17641                    fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
17642                >,
17643                fidl::encoding::DefaultFuchsiaResourceDialect,
17644            >,
17645        T1: fidl::encoding::Encode<
17646                fidl::encoding::Endpoint<
17647                    fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
17648                >,
17649                fidl::encoding::DefaultFuchsiaResourceDialect,
17650            >,
17651    >
17652        fidl::encoding::Encode<
17653            CapabilityFactoryCreateDirConnectorRouterRequest,
17654            fidl::encoding::DefaultFuchsiaResourceDialect,
17655        > for (T0, T1)
17656    {
17657        #[inline]
17658        unsafe fn encode(
17659            self,
17660            encoder: &mut fidl::encoding::Encoder<
17661                '_,
17662                fidl::encoding::DefaultFuchsiaResourceDialect,
17663            >,
17664            offset: usize,
17665            depth: fidl::encoding::Depth,
17666        ) -> fidl::Result<()> {
17667            encoder.debug_check_bounds::<CapabilityFactoryCreateDirConnectorRouterRequest>(offset);
17668            // Zero out padding regions. There's no need to apply masks
17669            // because the unmasked parts will be overwritten by fields.
17670            // Write the fields.
17671            self.0.encode(encoder, offset + 0, depth)?;
17672            self.1.encode(encoder, offset + 4, depth)?;
17673            Ok(())
17674        }
17675    }
17676
17677    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17678        for CapabilityFactoryCreateDirConnectorRouterRequest
17679    {
17680        #[inline(always)]
17681        fn new_empty() -> Self {
17682            Self {
17683                router_client_end: fidl::new_empty!(
17684                    fidl::encoding::Endpoint<
17685                        fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
17686                    >,
17687                    fidl::encoding::DefaultFuchsiaResourceDialect
17688                ),
17689                router_server_end: fidl::new_empty!(
17690                    fidl::encoding::Endpoint<
17691                        fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
17692                    >,
17693                    fidl::encoding::DefaultFuchsiaResourceDialect
17694                ),
17695            }
17696        }
17697
17698        #[inline]
17699        unsafe fn decode(
17700            &mut self,
17701            decoder: &mut fidl::encoding::Decoder<
17702                '_,
17703                fidl::encoding::DefaultFuchsiaResourceDialect,
17704            >,
17705            offset: usize,
17706            _depth: fidl::encoding::Depth,
17707        ) -> fidl::Result<()> {
17708            decoder.debug_check_bounds::<Self>(offset);
17709            // Verify that padding bytes are zero.
17710            fidl::decode!(
17711                fidl::encoding::Endpoint<
17712                    fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
17713                >,
17714                fidl::encoding::DefaultFuchsiaResourceDialect,
17715                &mut self.router_client_end,
17716                decoder,
17717                offset + 0,
17718                _depth
17719            )?;
17720            fidl::decode!(
17721                fidl::encoding::Endpoint<
17722                    fidl::endpoints::ServerEnd<DirConnectorRouterDeprecatedMarker>,
17723                >,
17724                fidl::encoding::DefaultFuchsiaResourceDialect,
17725                &mut self.router_server_end,
17726                decoder,
17727                offset + 4,
17728                _depth
17729            )?;
17730            Ok(())
17731        }
17732    }
17733
17734    impl fidl::encoding::ResourceTypeMarker for ConnectorConnectRequest {
17735        type Borrowed<'a> = &'a mut Self;
17736        fn take_or_borrow<'a>(
17737            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17738        ) -> Self::Borrowed<'a> {
17739            value
17740        }
17741    }
17742
17743    unsafe impl fidl::encoding::TypeMarker for ConnectorConnectRequest {
17744        type Owned = Self;
17745
17746        #[inline(always)]
17747        fn inline_align(_context: fidl::encoding::Context) -> usize {
17748            4
17749        }
17750
17751        #[inline(always)]
17752        fn inline_size(_context: fidl::encoding::Context) -> usize {
17753            4
17754        }
17755    }
17756
17757    unsafe impl
17758        fidl::encoding::Encode<
17759            ConnectorConnectRequest,
17760            fidl::encoding::DefaultFuchsiaResourceDialect,
17761        > for &mut ConnectorConnectRequest
17762    {
17763        #[inline]
17764        unsafe fn encode(
17765            self,
17766            encoder: &mut fidl::encoding::Encoder<
17767                '_,
17768                fidl::encoding::DefaultFuchsiaResourceDialect,
17769            >,
17770            offset: usize,
17771            _depth: fidl::encoding::Depth,
17772        ) -> fidl::Result<()> {
17773            encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
17774            // Delegate to tuple encoding.
17775            fidl::encoding::Encode::<
17776                ConnectorConnectRequest,
17777                fidl::encoding::DefaultFuchsiaResourceDialect,
17778            >::encode(
17779                (<fidl::encoding::HandleType<
17780                    fidl::Channel,
17781                    { fidl::ObjectType::CHANNEL.into_raw() },
17782                    2147483648,
17783                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
17784                    &mut self.channel
17785                ),),
17786                encoder,
17787                offset,
17788                _depth,
17789            )
17790        }
17791    }
17792    unsafe impl<
17793        T0: fidl::encoding::Encode<
17794                fidl::encoding::HandleType<
17795                    fidl::Channel,
17796                    { fidl::ObjectType::CHANNEL.into_raw() },
17797                    2147483648,
17798                >,
17799                fidl::encoding::DefaultFuchsiaResourceDialect,
17800            >,
17801    >
17802        fidl::encoding::Encode<
17803            ConnectorConnectRequest,
17804            fidl::encoding::DefaultFuchsiaResourceDialect,
17805        > for (T0,)
17806    {
17807        #[inline]
17808        unsafe fn encode(
17809            self,
17810            encoder: &mut fidl::encoding::Encoder<
17811                '_,
17812                fidl::encoding::DefaultFuchsiaResourceDialect,
17813            >,
17814            offset: usize,
17815            depth: fidl::encoding::Depth,
17816        ) -> fidl::Result<()> {
17817            encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
17818            // Zero out padding regions. There's no need to apply masks
17819            // because the unmasked parts will be overwritten by fields.
17820            // Write the fields.
17821            self.0.encode(encoder, offset + 0, depth)?;
17822            Ok(())
17823        }
17824    }
17825
17826    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17827        for ConnectorConnectRequest
17828    {
17829        #[inline(always)]
17830        fn new_empty() -> Self {
17831            Self {
17832                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
17833            }
17834        }
17835
17836        #[inline]
17837        unsafe fn decode(
17838            &mut self,
17839            decoder: &mut fidl::encoding::Decoder<
17840                '_,
17841                fidl::encoding::DefaultFuchsiaResourceDialect,
17842            >,
17843            offset: usize,
17844            _depth: fidl::encoding::Depth,
17845        ) -> fidl::Result<()> {
17846            decoder.debug_check_bounds::<Self>(offset);
17847            // Verify that padding bytes are zero.
17848            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
17849            Ok(())
17850        }
17851    }
17852
17853    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterDeprecatedRouteRequest {
17854        type Borrowed<'a> = &'a mut Self;
17855        fn take_or_borrow<'a>(
17856            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17857        ) -> Self::Borrowed<'a> {
17858            value
17859        }
17860    }
17861
17862    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterDeprecatedRouteRequest {
17863        type Owned = Self;
17864
17865        #[inline(always)]
17866        fn inline_align(_context: fidl::encoding::Context) -> usize {
17867            8
17868        }
17869
17870        #[inline(always)]
17871        fn inline_size(_context: fidl::encoding::Context) -> usize {
17872            24
17873        }
17874    }
17875
17876    unsafe impl
17877        fidl::encoding::Encode<
17878            ConnectorRouterDeprecatedRouteRequest,
17879            fidl::encoding::DefaultFuchsiaResourceDialect,
17880        > for &mut ConnectorRouterDeprecatedRouteRequest
17881    {
17882        #[inline]
17883        unsafe fn encode(
17884            self,
17885            encoder: &mut fidl::encoding::Encoder<
17886                '_,
17887                fidl::encoding::DefaultFuchsiaResourceDialect,
17888            >,
17889            offset: usize,
17890            _depth: fidl::encoding::Depth,
17891        ) -> fidl::Result<()> {
17892            encoder.debug_check_bounds::<ConnectorRouterDeprecatedRouteRequest>(offset);
17893            // Delegate to tuple encoding.
17894            fidl::encoding::Encode::<ConnectorRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
17895                (
17896                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
17897                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.connector_server_end),
17898                ),
17899                encoder, offset, _depth
17900            )
17901        }
17902    }
17903    unsafe impl<
17904        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
17905        T1: fidl::encoding::Encode<
17906                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
17907                fidl::encoding::DefaultFuchsiaResourceDialect,
17908            >,
17909    >
17910        fidl::encoding::Encode<
17911            ConnectorRouterDeprecatedRouteRequest,
17912            fidl::encoding::DefaultFuchsiaResourceDialect,
17913        > for (T0, T1)
17914    {
17915        #[inline]
17916        unsafe fn encode(
17917            self,
17918            encoder: &mut fidl::encoding::Encoder<
17919                '_,
17920                fidl::encoding::DefaultFuchsiaResourceDialect,
17921            >,
17922            offset: usize,
17923            depth: fidl::encoding::Depth,
17924        ) -> fidl::Result<()> {
17925            encoder.debug_check_bounds::<ConnectorRouterDeprecatedRouteRequest>(offset);
17926            // Zero out padding regions. There's no need to apply masks
17927            // because the unmasked parts will be overwritten by fields.
17928            unsafe {
17929                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
17930                (ptr as *mut u64).write_unaligned(0);
17931            }
17932            // Write the fields.
17933            self.0.encode(encoder, offset + 0, depth)?;
17934            self.1.encode(encoder, offset + 16, depth)?;
17935            Ok(())
17936        }
17937    }
17938
17939    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17940        for ConnectorRouterDeprecatedRouteRequest
17941    {
17942        #[inline(always)]
17943        fn new_empty() -> Self {
17944            Self {
17945                request: fidl::new_empty!(
17946                    RouteRequest,
17947                    fidl::encoding::DefaultFuchsiaResourceDialect
17948                ),
17949                connector_server_end: fidl::new_empty!(
17950                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
17951                    fidl::encoding::DefaultFuchsiaResourceDialect
17952                ),
17953            }
17954        }
17955
17956        #[inline]
17957        unsafe fn decode(
17958            &mut self,
17959            decoder: &mut fidl::encoding::Decoder<
17960                '_,
17961                fidl::encoding::DefaultFuchsiaResourceDialect,
17962            >,
17963            offset: usize,
17964            _depth: fidl::encoding::Depth,
17965        ) -> fidl::Result<()> {
17966            decoder.debug_check_bounds::<Self>(offset);
17967            // Verify that padding bytes are zero.
17968            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
17969            let padval = unsafe { (ptr as *const u64).read_unaligned() };
17970            let mask = 0xffffffff00000000u64;
17971            let maskedval = padval & mask;
17972            if maskedval != 0 {
17973                return Err(fidl::Error::NonZeroPadding {
17974                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
17975                });
17976            }
17977            fidl::decode!(
17978                RouteRequest,
17979                fidl::encoding::DefaultFuchsiaResourceDialect,
17980                &mut self.request,
17981                decoder,
17982                offset + 0,
17983                _depth
17984            )?;
17985            fidl::decode!(
17986                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectorMarker>>,
17987                fidl::encoding::DefaultFuchsiaResourceDialect,
17988                &mut self.connector_server_end,
17989                decoder,
17990                offset + 16,
17991                _depth
17992            )?;
17993            Ok(())
17994        }
17995    }
17996
17997    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterDeprecatedRouteResponse {
17998        type Borrowed<'a> = &'a mut Self;
17999        fn take_or_borrow<'a>(
18000            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18001        ) -> Self::Borrowed<'a> {
18002            value
18003        }
18004    }
18005
18006    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterDeprecatedRouteResponse {
18007        type Owned = Self;
18008
18009        #[inline(always)]
18010        fn inline_align(_context: fidl::encoding::Context) -> usize {
18011            4
18012        }
18013
18014        #[inline(always)]
18015        fn inline_size(_context: fidl::encoding::Context) -> usize {
18016            4
18017        }
18018    }
18019
18020    unsafe impl
18021        fidl::encoding::Encode<
18022            ConnectorRouterDeprecatedRouteResponse,
18023            fidl::encoding::DefaultFuchsiaResourceDialect,
18024        > for &mut ConnectorRouterDeprecatedRouteResponse
18025    {
18026        #[inline]
18027        unsafe fn encode(
18028            self,
18029            encoder: &mut fidl::encoding::Encoder<
18030                '_,
18031                fidl::encoding::DefaultFuchsiaResourceDialect,
18032            >,
18033            offset: usize,
18034            _depth: fidl::encoding::Depth,
18035        ) -> fidl::Result<()> {
18036            encoder.debug_check_bounds::<ConnectorRouterDeprecatedRouteResponse>(offset);
18037            // Delegate to tuple encoding.
18038            fidl::encoding::Encode::<
18039                ConnectorRouterDeprecatedRouteResponse,
18040                fidl::encoding::DefaultFuchsiaResourceDialect,
18041            >::encode(
18042                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
18043                encoder,
18044                offset,
18045                _depth,
18046            )
18047        }
18048    }
18049    unsafe impl<
18050        T0: fidl::encoding::Encode<RouterResponse, fidl::encoding::DefaultFuchsiaResourceDialect>,
18051    >
18052        fidl::encoding::Encode<
18053            ConnectorRouterDeprecatedRouteResponse,
18054            fidl::encoding::DefaultFuchsiaResourceDialect,
18055        > for (T0,)
18056    {
18057        #[inline]
18058        unsafe fn encode(
18059            self,
18060            encoder: &mut fidl::encoding::Encoder<
18061                '_,
18062                fidl::encoding::DefaultFuchsiaResourceDialect,
18063            >,
18064            offset: usize,
18065            depth: fidl::encoding::Depth,
18066        ) -> fidl::Result<()> {
18067            encoder.debug_check_bounds::<ConnectorRouterDeprecatedRouteResponse>(offset);
18068            // Zero out padding regions. There's no need to apply masks
18069            // because the unmasked parts will be overwritten by fields.
18070            // Write the fields.
18071            self.0.encode(encoder, offset + 0, depth)?;
18072            Ok(())
18073        }
18074    }
18075
18076    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18077        for ConnectorRouterDeprecatedRouteResponse
18078    {
18079        #[inline(always)]
18080        fn new_empty() -> Self {
18081            Self {
18082                response: fidl::new_empty!(
18083                    RouterResponse,
18084                    fidl::encoding::DefaultFuchsiaResourceDialect
18085                ),
18086            }
18087        }
18088
18089        #[inline]
18090        unsafe fn decode(
18091            &mut self,
18092            decoder: &mut fidl::encoding::Decoder<
18093                '_,
18094                fidl::encoding::DefaultFuchsiaResourceDialect,
18095            >,
18096            offset: usize,
18097            _depth: fidl::encoding::Depth,
18098        ) -> fidl::Result<()> {
18099            decoder.debug_check_bounds::<Self>(offset);
18100            // Verify that padding bytes are zero.
18101            fidl::decode!(
18102                RouterResponse,
18103                fidl::encoding::DefaultFuchsiaResourceDialect,
18104                &mut self.response,
18105                decoder,
18106                offset + 0,
18107                _depth
18108            )?;
18109            Ok(())
18110        }
18111    }
18112
18113    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteRequest {
18114        type Borrowed<'a> = &'a mut Self;
18115        fn take_or_borrow<'a>(
18116            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18117        ) -> Self::Borrowed<'a> {
18118            value
18119        }
18120    }
18121
18122    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteRequest {
18123        type Owned = Self;
18124
18125        #[inline(always)]
18126        fn inline_align(_context: fidl::encoding::Context) -> usize {
18127            8
18128        }
18129
18130        #[inline(always)]
18131        fn inline_size(_context: fidl::encoding::Context) -> usize {
18132            16
18133        }
18134    }
18135
18136    unsafe impl
18137        fidl::encoding::Encode<
18138            ConnectorRouterRouteRequest,
18139            fidl::encoding::DefaultFuchsiaResourceDialect,
18140        > for &mut ConnectorRouterRouteRequest
18141    {
18142        #[inline]
18143        unsafe fn encode(
18144            self,
18145            encoder: &mut fidl::encoding::Encoder<
18146                '_,
18147                fidl::encoding::DefaultFuchsiaResourceDialect,
18148            >,
18149            offset: usize,
18150            _depth: fidl::encoding::Depth,
18151        ) -> fidl::Result<()> {
18152            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
18153            // Delegate to tuple encoding.
18154            fidl::encoding::Encode::<
18155                ConnectorRouterRouteRequest,
18156                fidl::encoding::DefaultFuchsiaResourceDialect,
18157            >::encode(
18158                (<RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18159                    &mut self.request,
18160                ),),
18161                encoder,
18162                offset,
18163                _depth,
18164            )
18165        }
18166    }
18167    unsafe impl<
18168        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
18169    >
18170        fidl::encoding::Encode<
18171            ConnectorRouterRouteRequest,
18172            fidl::encoding::DefaultFuchsiaResourceDialect,
18173        > for (T0,)
18174    {
18175        #[inline]
18176        unsafe fn encode(
18177            self,
18178            encoder: &mut fidl::encoding::Encoder<
18179                '_,
18180                fidl::encoding::DefaultFuchsiaResourceDialect,
18181            >,
18182            offset: usize,
18183            depth: fidl::encoding::Depth,
18184        ) -> fidl::Result<()> {
18185            encoder.debug_check_bounds::<ConnectorRouterRouteRequest>(offset);
18186            // Zero out padding regions. There's no need to apply masks
18187            // because the unmasked parts will be overwritten by fields.
18188            // Write the fields.
18189            self.0.encode(encoder, offset + 0, depth)?;
18190            Ok(())
18191        }
18192    }
18193
18194    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18195        for ConnectorRouterRouteRequest
18196    {
18197        #[inline(always)]
18198        fn new_empty() -> Self {
18199            Self {
18200                request: fidl::new_empty!(
18201                    RouteRequest,
18202                    fidl::encoding::DefaultFuchsiaResourceDialect
18203                ),
18204            }
18205        }
18206
18207        #[inline]
18208        unsafe fn decode(
18209            &mut self,
18210            decoder: &mut fidl::encoding::Decoder<
18211                '_,
18212                fidl::encoding::DefaultFuchsiaResourceDialect,
18213            >,
18214            offset: usize,
18215            _depth: fidl::encoding::Depth,
18216        ) -> fidl::Result<()> {
18217            decoder.debug_check_bounds::<Self>(offset);
18218            // Verify that padding bytes are zero.
18219            fidl::decode!(
18220                RouteRequest,
18221                fidl::encoding::DefaultFuchsiaResourceDialect,
18222                &mut self.request,
18223                decoder,
18224                offset + 0,
18225                _depth
18226            )?;
18227            Ok(())
18228        }
18229    }
18230
18231    impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
18232        type Borrowed<'a> = &'a mut Self;
18233        fn take_or_borrow<'a>(
18234            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18235        ) -> Self::Borrowed<'a> {
18236            value
18237        }
18238    }
18239
18240    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
18241        type Owned = Self;
18242
18243        #[inline(always)]
18244        fn inline_align(_context: fidl::encoding::Context) -> usize {
18245            4
18246        }
18247
18248        #[inline(always)]
18249        fn inline_size(_context: fidl::encoding::Context) -> usize {
18250            4
18251        }
18252    }
18253
18254    unsafe impl
18255        fidl::encoding::Encode<
18256            ConnectorRouterRouteResponse,
18257            fidl::encoding::DefaultFuchsiaResourceDialect,
18258        > for &mut ConnectorRouterRouteResponse
18259    {
18260        #[inline]
18261        unsafe fn encode(
18262            self,
18263            encoder: &mut fidl::encoding::Encoder<
18264                '_,
18265                fidl::encoding::DefaultFuchsiaResourceDialect,
18266            >,
18267            offset: usize,
18268            _depth: fidl::encoding::Depth,
18269        ) -> fidl::Result<()> {
18270            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
18271            // Delegate to tuple encoding.
18272            fidl::encoding::Encode::<
18273                ConnectorRouterRouteResponse,
18274                fidl::encoding::DefaultFuchsiaResourceDialect,
18275            >::encode(
18276                (<fidl::encoding::Optional<
18277                    fidl::encoding::HandleType<
18278                        fidl::EventPair,
18279                        { fidl::ObjectType::EVENTPAIR.into_raw() },
18280                        2147483648,
18281                    >,
18282                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18283                    &mut self.handle
18284                ),),
18285                encoder,
18286                offset,
18287                _depth,
18288            )
18289        }
18290    }
18291    unsafe impl<
18292        T0: fidl::encoding::Encode<
18293                fidl::encoding::Optional<
18294                    fidl::encoding::HandleType<
18295                        fidl::EventPair,
18296                        { fidl::ObjectType::EVENTPAIR.into_raw() },
18297                        2147483648,
18298                    >,
18299                >,
18300                fidl::encoding::DefaultFuchsiaResourceDialect,
18301            >,
18302    >
18303        fidl::encoding::Encode<
18304            ConnectorRouterRouteResponse,
18305            fidl::encoding::DefaultFuchsiaResourceDialect,
18306        > for (T0,)
18307    {
18308        #[inline]
18309        unsafe fn encode(
18310            self,
18311            encoder: &mut fidl::encoding::Encoder<
18312                '_,
18313                fidl::encoding::DefaultFuchsiaResourceDialect,
18314            >,
18315            offset: usize,
18316            depth: fidl::encoding::Depth,
18317        ) -> fidl::Result<()> {
18318            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
18319            // Zero out padding regions. There's no need to apply masks
18320            // because the unmasked parts will be overwritten by fields.
18321            // Write the fields.
18322            self.0.encode(encoder, offset + 0, depth)?;
18323            Ok(())
18324        }
18325    }
18326
18327    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18328        for ConnectorRouterRouteResponse
18329    {
18330        #[inline(always)]
18331        fn new_empty() -> Self {
18332            Self {
18333                handle: fidl::new_empty!(
18334                    fidl::encoding::Optional<
18335                        fidl::encoding::HandleType<
18336                            fidl::EventPair,
18337                            { fidl::ObjectType::EVENTPAIR.into_raw() },
18338                            2147483648,
18339                        >,
18340                    >,
18341                    fidl::encoding::DefaultFuchsiaResourceDialect
18342                ),
18343            }
18344        }
18345
18346        #[inline]
18347        unsafe fn decode(
18348            &mut self,
18349            decoder: &mut fidl::encoding::Decoder<
18350                '_,
18351                fidl::encoding::DefaultFuchsiaResourceDialect,
18352            >,
18353            offset: usize,
18354            _depth: fidl::encoding::Depth,
18355        ) -> fidl::Result<()> {
18356            decoder.debug_check_bounds::<Self>(offset);
18357            // Verify that padding bytes are zero.
18358            fidl::decode!(
18359                fidl::encoding::Optional<
18360                    fidl::encoding::HandleType<
18361                        fidl::EventPair,
18362                        { fidl::ObjectType::EVENTPAIR.into_raw() },
18363                        2147483648,
18364                    >,
18365                >,
18366                fidl::encoding::DefaultFuchsiaResourceDialect,
18367                &mut self.handle,
18368                decoder,
18369                offset + 0,
18370                _depth
18371            )?;
18372            Ok(())
18373        }
18374    }
18375
18376    impl fidl::encoding::ResourceTypeMarker for DataRouterDeprecatedRouteRequest {
18377        type Borrowed<'a> = &'a mut Self;
18378        fn take_or_borrow<'a>(
18379            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18380        ) -> Self::Borrowed<'a> {
18381            value
18382        }
18383    }
18384
18385    unsafe impl fidl::encoding::TypeMarker for DataRouterDeprecatedRouteRequest {
18386        type Owned = Self;
18387
18388        #[inline(always)]
18389        fn inline_align(_context: fidl::encoding::Context) -> usize {
18390            8
18391        }
18392
18393        #[inline(always)]
18394        fn inline_size(_context: fidl::encoding::Context) -> usize {
18395            16
18396        }
18397    }
18398
18399    unsafe impl
18400        fidl::encoding::Encode<
18401            DataRouterDeprecatedRouteRequest,
18402            fidl::encoding::DefaultFuchsiaResourceDialect,
18403        > for &mut DataRouterDeprecatedRouteRequest
18404    {
18405        #[inline]
18406        unsafe fn encode(
18407            self,
18408            encoder: &mut fidl::encoding::Encoder<
18409                '_,
18410                fidl::encoding::DefaultFuchsiaResourceDialect,
18411            >,
18412            offset: usize,
18413            _depth: fidl::encoding::Depth,
18414        ) -> fidl::Result<()> {
18415            encoder.debug_check_bounds::<DataRouterDeprecatedRouteRequest>(offset);
18416            // Delegate to tuple encoding.
18417            fidl::encoding::Encode::<
18418                DataRouterDeprecatedRouteRequest,
18419                fidl::encoding::DefaultFuchsiaResourceDialect,
18420            >::encode(
18421                (<RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18422                    &mut self.request,
18423                ),),
18424                encoder,
18425                offset,
18426                _depth,
18427            )
18428        }
18429    }
18430    unsafe impl<
18431        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
18432    >
18433        fidl::encoding::Encode<
18434            DataRouterDeprecatedRouteRequest,
18435            fidl::encoding::DefaultFuchsiaResourceDialect,
18436        > for (T0,)
18437    {
18438        #[inline]
18439        unsafe fn encode(
18440            self,
18441            encoder: &mut fidl::encoding::Encoder<
18442                '_,
18443                fidl::encoding::DefaultFuchsiaResourceDialect,
18444            >,
18445            offset: usize,
18446            depth: fidl::encoding::Depth,
18447        ) -> fidl::Result<()> {
18448            encoder.debug_check_bounds::<DataRouterDeprecatedRouteRequest>(offset);
18449            // Zero out padding regions. There's no need to apply masks
18450            // because the unmasked parts will be overwritten by fields.
18451            // Write the fields.
18452            self.0.encode(encoder, offset + 0, depth)?;
18453            Ok(())
18454        }
18455    }
18456
18457    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18458        for DataRouterDeprecatedRouteRequest
18459    {
18460        #[inline(always)]
18461        fn new_empty() -> Self {
18462            Self {
18463                request: fidl::new_empty!(
18464                    RouteRequest,
18465                    fidl::encoding::DefaultFuchsiaResourceDialect
18466                ),
18467            }
18468        }
18469
18470        #[inline]
18471        unsafe fn decode(
18472            &mut self,
18473            decoder: &mut fidl::encoding::Decoder<
18474                '_,
18475                fidl::encoding::DefaultFuchsiaResourceDialect,
18476            >,
18477            offset: usize,
18478            _depth: fidl::encoding::Depth,
18479        ) -> fidl::Result<()> {
18480            decoder.debug_check_bounds::<Self>(offset);
18481            // Verify that padding bytes are zero.
18482            fidl::decode!(
18483                RouteRequest,
18484                fidl::encoding::DefaultFuchsiaResourceDialect,
18485                &mut self.request,
18486                decoder,
18487                offset + 0,
18488                _depth
18489            )?;
18490            Ok(())
18491        }
18492    }
18493
18494    impl fidl::encoding::ResourceTypeMarker for DataRouterDeprecatedRouteResponse {
18495        type Borrowed<'a> = &'a mut Self;
18496        fn take_or_borrow<'a>(
18497            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18498        ) -> Self::Borrowed<'a> {
18499            value
18500        }
18501    }
18502
18503    unsafe impl fidl::encoding::TypeMarker for DataRouterDeprecatedRouteResponse {
18504        type Owned = Self;
18505
18506        #[inline(always)]
18507        fn inline_align(_context: fidl::encoding::Context) -> usize {
18508            8
18509        }
18510
18511        #[inline(always)]
18512        fn inline_size(_context: fidl::encoding::Context) -> usize {
18513            24
18514        }
18515    }
18516
18517    unsafe impl
18518        fidl::encoding::Encode<
18519            DataRouterDeprecatedRouteResponse,
18520            fidl::encoding::DefaultFuchsiaResourceDialect,
18521        > for &mut DataRouterDeprecatedRouteResponse
18522    {
18523        #[inline]
18524        unsafe fn encode(
18525            self,
18526            encoder: &mut fidl::encoding::Encoder<
18527                '_,
18528                fidl::encoding::DefaultFuchsiaResourceDialect,
18529            >,
18530            offset: usize,
18531            _depth: fidl::encoding::Depth,
18532        ) -> fidl::Result<()> {
18533            encoder.debug_check_bounds::<DataRouterDeprecatedRouteResponse>(offset);
18534            // Delegate to tuple encoding.
18535            fidl::encoding::Encode::<DataRouterDeprecatedRouteResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
18536                (
18537                    <RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
18538                    <fidl::encoding::OptionalUnion<Data> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
18539                ),
18540                encoder, offset, _depth
18541            )
18542        }
18543    }
18544    unsafe impl<
18545        T0: fidl::encoding::Encode<RouterResponse, fidl::encoding::DefaultFuchsiaResourceDialect>,
18546        T1: fidl::encoding::Encode<
18547                fidl::encoding::OptionalUnion<Data>,
18548                fidl::encoding::DefaultFuchsiaResourceDialect,
18549            >,
18550    >
18551        fidl::encoding::Encode<
18552            DataRouterDeprecatedRouteResponse,
18553            fidl::encoding::DefaultFuchsiaResourceDialect,
18554        > for (T0, T1)
18555    {
18556        #[inline]
18557        unsafe fn encode(
18558            self,
18559            encoder: &mut fidl::encoding::Encoder<
18560                '_,
18561                fidl::encoding::DefaultFuchsiaResourceDialect,
18562            >,
18563            offset: usize,
18564            depth: fidl::encoding::Depth,
18565        ) -> fidl::Result<()> {
18566            encoder.debug_check_bounds::<DataRouterDeprecatedRouteResponse>(offset);
18567            // Zero out padding regions. There's no need to apply masks
18568            // because the unmasked parts will be overwritten by fields.
18569            unsafe {
18570                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
18571                (ptr as *mut u64).write_unaligned(0);
18572            }
18573            // Write the fields.
18574            self.0.encode(encoder, offset + 0, depth)?;
18575            self.1.encode(encoder, offset + 8, depth)?;
18576            Ok(())
18577        }
18578    }
18579
18580    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18581        for DataRouterDeprecatedRouteResponse
18582    {
18583        #[inline(always)]
18584        fn new_empty() -> Self {
18585            Self {
18586                response: fidl::new_empty!(
18587                    RouterResponse,
18588                    fidl::encoding::DefaultFuchsiaResourceDialect
18589                ),
18590                data: fidl::new_empty!(
18591                    fidl::encoding::OptionalUnion<Data>,
18592                    fidl::encoding::DefaultFuchsiaResourceDialect
18593                ),
18594            }
18595        }
18596
18597        #[inline]
18598        unsafe fn decode(
18599            &mut self,
18600            decoder: &mut fidl::encoding::Decoder<
18601                '_,
18602                fidl::encoding::DefaultFuchsiaResourceDialect,
18603            >,
18604            offset: usize,
18605            _depth: fidl::encoding::Depth,
18606        ) -> fidl::Result<()> {
18607            decoder.debug_check_bounds::<Self>(offset);
18608            // Verify that padding bytes are zero.
18609            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
18610            let padval = unsafe { (ptr as *const u64).read_unaligned() };
18611            let mask = 0xffffffff00000000u64;
18612            let maskedval = padval & mask;
18613            if maskedval != 0 {
18614                return Err(fidl::Error::NonZeroPadding {
18615                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
18616                });
18617            }
18618            fidl::decode!(
18619                RouterResponse,
18620                fidl::encoding::DefaultFuchsiaResourceDialect,
18621                &mut self.response,
18622                decoder,
18623                offset + 0,
18624                _depth
18625            )?;
18626            fidl::decode!(
18627                fidl::encoding::OptionalUnion<Data>,
18628                fidl::encoding::DefaultFuchsiaResourceDialect,
18629                &mut self.data,
18630                decoder,
18631                offset + 8,
18632                _depth
18633            )?;
18634            Ok(())
18635        }
18636    }
18637
18638    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteRequest {
18639        type Borrowed<'a> = &'a mut Self;
18640        fn take_or_borrow<'a>(
18641            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18642        ) -> Self::Borrowed<'a> {
18643            value
18644        }
18645    }
18646
18647    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteRequest {
18648        type Owned = Self;
18649
18650        #[inline(always)]
18651        fn inline_align(_context: fidl::encoding::Context) -> usize {
18652            8
18653        }
18654
18655        #[inline(always)]
18656        fn inline_size(_context: fidl::encoding::Context) -> usize {
18657            16
18658        }
18659    }
18660
18661    unsafe impl
18662        fidl::encoding::Encode<
18663            DataRouterRouteRequest,
18664            fidl::encoding::DefaultFuchsiaResourceDialect,
18665        > for &mut DataRouterRouteRequest
18666    {
18667        #[inline]
18668        unsafe fn encode(
18669            self,
18670            encoder: &mut fidl::encoding::Encoder<
18671                '_,
18672                fidl::encoding::DefaultFuchsiaResourceDialect,
18673            >,
18674            offset: usize,
18675            _depth: fidl::encoding::Depth,
18676        ) -> fidl::Result<()> {
18677            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
18678            // Delegate to tuple encoding.
18679            fidl::encoding::Encode::<
18680                DataRouterRouteRequest,
18681                fidl::encoding::DefaultFuchsiaResourceDialect,
18682            >::encode(
18683                (<RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
18684                    &mut self.request,
18685                ),),
18686                encoder,
18687                offset,
18688                _depth,
18689            )
18690        }
18691    }
18692    unsafe impl<
18693        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
18694    >
18695        fidl::encoding::Encode<
18696            DataRouterRouteRequest,
18697            fidl::encoding::DefaultFuchsiaResourceDialect,
18698        > for (T0,)
18699    {
18700        #[inline]
18701        unsafe fn encode(
18702            self,
18703            encoder: &mut fidl::encoding::Encoder<
18704                '_,
18705                fidl::encoding::DefaultFuchsiaResourceDialect,
18706            >,
18707            offset: usize,
18708            depth: fidl::encoding::Depth,
18709        ) -> fidl::Result<()> {
18710            encoder.debug_check_bounds::<DataRouterRouteRequest>(offset);
18711            // Zero out padding regions. There's no need to apply masks
18712            // because the unmasked parts will be overwritten by fields.
18713            // Write the fields.
18714            self.0.encode(encoder, offset + 0, depth)?;
18715            Ok(())
18716        }
18717    }
18718
18719    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18720        for DataRouterRouteRequest
18721    {
18722        #[inline(always)]
18723        fn new_empty() -> Self {
18724            Self {
18725                request: fidl::new_empty!(
18726                    RouteRequest,
18727                    fidl::encoding::DefaultFuchsiaResourceDialect
18728                ),
18729            }
18730        }
18731
18732        #[inline]
18733        unsafe fn decode(
18734            &mut self,
18735            decoder: &mut fidl::encoding::Decoder<
18736                '_,
18737                fidl::encoding::DefaultFuchsiaResourceDialect,
18738            >,
18739            offset: usize,
18740            _depth: fidl::encoding::Depth,
18741        ) -> fidl::Result<()> {
18742            decoder.debug_check_bounds::<Self>(offset);
18743            // Verify that padding bytes are zero.
18744            fidl::decode!(
18745                RouteRequest,
18746                fidl::encoding::DefaultFuchsiaResourceDialect,
18747                &mut self.request,
18748                decoder,
18749                offset + 0,
18750                _depth
18751            )?;
18752            Ok(())
18753        }
18754    }
18755
18756    impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
18757        type Borrowed<'a> = &'a mut Self;
18758        fn take_or_borrow<'a>(
18759            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18760        ) -> Self::Borrowed<'a> {
18761            value
18762        }
18763    }
18764
18765    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
18766        type Owned = Self;
18767
18768        #[inline(always)]
18769        fn inline_align(_context: fidl::encoding::Context) -> usize {
18770            8
18771        }
18772
18773        #[inline(always)]
18774        fn inline_size(_context: fidl::encoding::Context) -> usize {
18775            16
18776        }
18777    }
18778
18779    unsafe impl
18780        fidl::encoding::Encode<
18781            DataRouterRouteResponse,
18782            fidl::encoding::DefaultFuchsiaResourceDialect,
18783        > for &mut DataRouterRouteResponse
18784    {
18785        #[inline]
18786        unsafe fn encode(
18787            self,
18788            encoder: &mut fidl::encoding::Encoder<
18789                '_,
18790                fidl::encoding::DefaultFuchsiaResourceDialect,
18791            >,
18792            offset: usize,
18793            _depth: fidl::encoding::Depth,
18794        ) -> fidl::Result<()> {
18795            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
18796            // Delegate to tuple encoding.
18797            fidl::encoding::Encode::<
18798                DataRouterRouteResponse,
18799                fidl::encoding::DefaultFuchsiaResourceDialect,
18800            >::encode(
18801                (<fidl::encoding::OptionalUnion<Data> as fidl::encoding::ValueTypeMarker>::borrow(
18802                    &self.data,
18803                ),),
18804                encoder,
18805                offset,
18806                _depth,
18807            )
18808        }
18809    }
18810    unsafe impl<
18811        T0: fidl::encoding::Encode<
18812                fidl::encoding::OptionalUnion<Data>,
18813                fidl::encoding::DefaultFuchsiaResourceDialect,
18814            >,
18815    >
18816        fidl::encoding::Encode<
18817            DataRouterRouteResponse,
18818            fidl::encoding::DefaultFuchsiaResourceDialect,
18819        > for (T0,)
18820    {
18821        #[inline]
18822        unsafe fn encode(
18823            self,
18824            encoder: &mut fidl::encoding::Encoder<
18825                '_,
18826                fidl::encoding::DefaultFuchsiaResourceDialect,
18827            >,
18828            offset: usize,
18829            depth: fidl::encoding::Depth,
18830        ) -> fidl::Result<()> {
18831            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
18832            // Zero out padding regions. There's no need to apply masks
18833            // because the unmasked parts will be overwritten by fields.
18834            // Write the fields.
18835            self.0.encode(encoder, offset + 0, depth)?;
18836            Ok(())
18837        }
18838    }
18839
18840    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18841        for DataRouterRouteResponse
18842    {
18843        #[inline(always)]
18844        fn new_empty() -> Self {
18845            Self {
18846                data: fidl::new_empty!(
18847                    fidl::encoding::OptionalUnion<Data>,
18848                    fidl::encoding::DefaultFuchsiaResourceDialect
18849                ),
18850            }
18851        }
18852
18853        #[inline]
18854        unsafe fn decode(
18855            &mut self,
18856            decoder: &mut fidl::encoding::Decoder<
18857                '_,
18858                fidl::encoding::DefaultFuchsiaResourceDialect,
18859            >,
18860            offset: usize,
18861            _depth: fidl::encoding::Depth,
18862        ) -> fidl::Result<()> {
18863            decoder.debug_check_bounds::<Self>(offset);
18864            // Verify that padding bytes are zero.
18865            fidl::decode!(
18866                fidl::encoding::OptionalUnion<Data>,
18867                fidl::encoding::DefaultFuchsiaResourceDialect,
18868                &mut self.data,
18869                decoder,
18870                offset + 0,
18871                _depth
18872            )?;
18873            Ok(())
18874        }
18875    }
18876
18877    impl fidl::encoding::ResourceTypeMarker for DictionaryGetRequest {
18878        type Borrowed<'a> = &'a mut Self;
18879        fn take_or_borrow<'a>(
18880            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18881        ) -> Self::Borrowed<'a> {
18882            value
18883        }
18884    }
18885
18886    unsafe impl fidl::encoding::TypeMarker for DictionaryGetRequest {
18887        type Owned = Self;
18888
18889        #[inline(always)]
18890        fn inline_align(_context: fidl::encoding::Context) -> usize {
18891            8
18892        }
18893
18894        #[inline(always)]
18895        fn inline_size(_context: fidl::encoding::Context) -> usize {
18896            16
18897        }
18898    }
18899
18900    unsafe impl
18901        fidl::encoding::Encode<DictionaryGetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
18902        for &mut DictionaryGetRequest
18903    {
18904        #[inline]
18905        unsafe fn encode(
18906            self,
18907            encoder: &mut fidl::encoding::Encoder<
18908                '_,
18909                fidl::encoding::DefaultFuchsiaResourceDialect,
18910            >,
18911            offset: usize,
18912            _depth: fidl::encoding::Depth,
18913        ) -> fidl::Result<()> {
18914            encoder.debug_check_bounds::<DictionaryGetRequest>(offset);
18915            // Delegate to tuple encoding.
18916            fidl::encoding::Encode::<
18917                DictionaryGetRequest,
18918                fidl::encoding::DefaultFuchsiaResourceDialect,
18919            >::encode(
18920                (<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
18921                    &self.key,
18922                ),),
18923                encoder,
18924                offset,
18925                _depth,
18926            )
18927        }
18928    }
18929    unsafe impl<
18930        T0: fidl::encoding::Encode<
18931                fidl::encoding::BoundedString<100>,
18932                fidl::encoding::DefaultFuchsiaResourceDialect,
18933            >,
18934    >
18935        fidl::encoding::Encode<DictionaryGetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
18936        for (T0,)
18937    {
18938        #[inline]
18939        unsafe fn encode(
18940            self,
18941            encoder: &mut fidl::encoding::Encoder<
18942                '_,
18943                fidl::encoding::DefaultFuchsiaResourceDialect,
18944            >,
18945            offset: usize,
18946            depth: fidl::encoding::Depth,
18947        ) -> fidl::Result<()> {
18948            encoder.debug_check_bounds::<DictionaryGetRequest>(offset);
18949            // Zero out padding regions. There's no need to apply masks
18950            // because the unmasked parts will be overwritten by fields.
18951            // Write the fields.
18952            self.0.encode(encoder, offset + 0, depth)?;
18953            Ok(())
18954        }
18955    }
18956
18957    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18958        for DictionaryGetRequest
18959    {
18960        #[inline(always)]
18961        fn new_empty() -> Self {
18962            Self {
18963                key: fidl::new_empty!(
18964                    fidl::encoding::BoundedString<100>,
18965                    fidl::encoding::DefaultFuchsiaResourceDialect
18966                ),
18967            }
18968        }
18969
18970        #[inline]
18971        unsafe fn decode(
18972            &mut self,
18973            decoder: &mut fidl::encoding::Decoder<
18974                '_,
18975                fidl::encoding::DefaultFuchsiaResourceDialect,
18976            >,
18977            offset: usize,
18978            _depth: fidl::encoding::Depth,
18979        ) -> fidl::Result<()> {
18980            decoder.debug_check_bounds::<Self>(offset);
18981            // Verify that padding bytes are zero.
18982            fidl::decode!(
18983                fidl::encoding::BoundedString<100>,
18984                fidl::encoding::DefaultFuchsiaResourceDialect,
18985                &mut self.key,
18986                decoder,
18987                offset + 0,
18988                _depth
18989            )?;
18990            Ok(())
18991        }
18992    }
18993
18994    impl fidl::encoding::ResourceTypeMarker for DictionaryInsertRequest {
18995        type Borrowed<'a> = &'a mut Self;
18996        fn take_or_borrow<'a>(
18997            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18998        ) -> Self::Borrowed<'a> {
18999            value
19000        }
19001    }
19002
19003    unsafe impl fidl::encoding::TypeMarker for DictionaryInsertRequest {
19004        type Owned = Self;
19005
19006        #[inline(always)]
19007        fn inline_align(_context: fidl::encoding::Context) -> usize {
19008            8
19009        }
19010
19011        #[inline(always)]
19012        fn inline_size(_context: fidl::encoding::Context) -> usize {
19013            32
19014        }
19015    }
19016
19017    unsafe impl
19018        fidl::encoding::Encode<
19019            DictionaryInsertRequest,
19020            fidl::encoding::DefaultFuchsiaResourceDialect,
19021        > for &mut DictionaryInsertRequest
19022    {
19023        #[inline]
19024        unsafe fn encode(
19025            self,
19026            encoder: &mut fidl::encoding::Encoder<
19027                '_,
19028                fidl::encoding::DefaultFuchsiaResourceDialect,
19029            >,
19030            offset: usize,
19031            _depth: fidl::encoding::Depth,
19032        ) -> fidl::Result<()> {
19033            encoder.debug_check_bounds::<DictionaryInsertRequest>(offset);
19034            // Delegate to tuple encoding.
19035            fidl::encoding::Encode::<
19036                DictionaryInsertRequest,
19037                fidl::encoding::DefaultFuchsiaResourceDialect,
19038            >::encode(
19039                (
19040                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
19041                        &self.key,
19042                    ),
19043                    <CapabilityDeprecated as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19044                        &mut self.capability,
19045                    ),
19046                ),
19047                encoder,
19048                offset,
19049                _depth,
19050            )
19051        }
19052    }
19053    unsafe impl<
19054        T0: fidl::encoding::Encode<
19055                fidl::encoding::BoundedString<100>,
19056                fidl::encoding::DefaultFuchsiaResourceDialect,
19057            >,
19058        T1: fidl::encoding::Encode<CapabilityDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>,
19059    >
19060        fidl::encoding::Encode<
19061            DictionaryInsertRequest,
19062            fidl::encoding::DefaultFuchsiaResourceDialect,
19063        > for (T0, T1)
19064    {
19065        #[inline]
19066        unsafe fn encode(
19067            self,
19068            encoder: &mut fidl::encoding::Encoder<
19069                '_,
19070                fidl::encoding::DefaultFuchsiaResourceDialect,
19071            >,
19072            offset: usize,
19073            depth: fidl::encoding::Depth,
19074        ) -> fidl::Result<()> {
19075            encoder.debug_check_bounds::<DictionaryInsertRequest>(offset);
19076            // Zero out padding regions. There's no need to apply masks
19077            // because the unmasked parts will be overwritten by fields.
19078            // Write the fields.
19079            self.0.encode(encoder, offset + 0, depth)?;
19080            self.1.encode(encoder, offset + 16, depth)?;
19081            Ok(())
19082        }
19083    }
19084
19085    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19086        for DictionaryInsertRequest
19087    {
19088        #[inline(always)]
19089        fn new_empty() -> Self {
19090            Self {
19091                key: fidl::new_empty!(
19092                    fidl::encoding::BoundedString<100>,
19093                    fidl::encoding::DefaultFuchsiaResourceDialect
19094                ),
19095                capability: fidl::new_empty!(
19096                    CapabilityDeprecated,
19097                    fidl::encoding::DefaultFuchsiaResourceDialect
19098                ),
19099            }
19100        }
19101
19102        #[inline]
19103        unsafe fn decode(
19104            &mut self,
19105            decoder: &mut fidl::encoding::Decoder<
19106                '_,
19107                fidl::encoding::DefaultFuchsiaResourceDialect,
19108            >,
19109            offset: usize,
19110            _depth: fidl::encoding::Depth,
19111        ) -> fidl::Result<()> {
19112            decoder.debug_check_bounds::<Self>(offset);
19113            // Verify that padding bytes are zero.
19114            fidl::decode!(
19115                fidl::encoding::BoundedString<100>,
19116                fidl::encoding::DefaultFuchsiaResourceDialect,
19117                &mut self.key,
19118                decoder,
19119                offset + 0,
19120                _depth
19121            )?;
19122            fidl::decode!(
19123                CapabilityDeprecated,
19124                fidl::encoding::DefaultFuchsiaResourceDialect,
19125                &mut self.capability,
19126                decoder,
19127                offset + 16,
19128                _depth
19129            )?;
19130            Ok(())
19131        }
19132    }
19133
19134    impl fidl::encoding::ResourceTypeMarker for DictionaryIterateKeysRequest {
19135        type Borrowed<'a> = &'a mut Self;
19136        fn take_or_borrow<'a>(
19137            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19138        ) -> Self::Borrowed<'a> {
19139            value
19140        }
19141    }
19142
19143    unsafe impl fidl::encoding::TypeMarker for DictionaryIterateKeysRequest {
19144        type Owned = Self;
19145
19146        #[inline(always)]
19147        fn inline_align(_context: fidl::encoding::Context) -> usize {
19148            4
19149        }
19150
19151        #[inline(always)]
19152        fn inline_size(_context: fidl::encoding::Context) -> usize {
19153            4
19154        }
19155    }
19156
19157    unsafe impl
19158        fidl::encoding::Encode<
19159            DictionaryIterateKeysRequest,
19160            fidl::encoding::DefaultFuchsiaResourceDialect,
19161        > for &mut DictionaryIterateKeysRequest
19162    {
19163        #[inline]
19164        unsafe fn encode(
19165            self,
19166            encoder: &mut fidl::encoding::Encoder<
19167                '_,
19168                fidl::encoding::DefaultFuchsiaResourceDialect,
19169            >,
19170            offset: usize,
19171            _depth: fidl::encoding::Depth,
19172        ) -> fidl::Result<()> {
19173            encoder.debug_check_bounds::<DictionaryIterateKeysRequest>(offset);
19174            // Delegate to tuple encoding.
19175            fidl::encoding::Encode::<
19176                DictionaryIterateKeysRequest,
19177                fidl::encoding::DefaultFuchsiaResourceDialect,
19178            >::encode(
19179                (
19180                    <fidl::encoding::Endpoint<
19181                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
19182                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19183                        &mut self.key_iterator,
19184                    ),
19185                ),
19186                encoder,
19187                offset,
19188                _depth,
19189            )
19190        }
19191    }
19192    unsafe impl<
19193        T0: fidl::encoding::Encode<
19194                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
19195                fidl::encoding::DefaultFuchsiaResourceDialect,
19196            >,
19197    >
19198        fidl::encoding::Encode<
19199            DictionaryIterateKeysRequest,
19200            fidl::encoding::DefaultFuchsiaResourceDialect,
19201        > for (T0,)
19202    {
19203        #[inline]
19204        unsafe fn encode(
19205            self,
19206            encoder: &mut fidl::encoding::Encoder<
19207                '_,
19208                fidl::encoding::DefaultFuchsiaResourceDialect,
19209            >,
19210            offset: usize,
19211            depth: fidl::encoding::Depth,
19212        ) -> fidl::Result<()> {
19213            encoder.debug_check_bounds::<DictionaryIterateKeysRequest>(offset);
19214            // Zero out padding regions. There's no need to apply masks
19215            // because the unmasked parts will be overwritten by fields.
19216            // Write the fields.
19217            self.0.encode(encoder, offset + 0, depth)?;
19218            Ok(())
19219        }
19220    }
19221
19222    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19223        for DictionaryIterateKeysRequest
19224    {
19225        #[inline(always)]
19226        fn new_empty() -> Self {
19227            Self {
19228                key_iterator: fidl::new_empty!(
19229                    fidl::encoding::Endpoint<
19230                        fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>,
19231                    >,
19232                    fidl::encoding::DefaultFuchsiaResourceDialect
19233                ),
19234            }
19235        }
19236
19237        #[inline]
19238        unsafe fn decode(
19239            &mut self,
19240            decoder: &mut fidl::encoding::Decoder<
19241                '_,
19242                fidl::encoding::DefaultFuchsiaResourceDialect,
19243            >,
19244            offset: usize,
19245            _depth: fidl::encoding::Depth,
19246        ) -> fidl::Result<()> {
19247            decoder.debug_check_bounds::<Self>(offset);
19248            // Verify that padding bytes are zero.
19249            fidl::decode!(
19250                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeyIteratorMarker>>,
19251                fidl::encoding::DefaultFuchsiaResourceDialect,
19252                &mut self.key_iterator,
19253                decoder,
19254                offset + 0,
19255                _depth
19256            )?;
19257            Ok(())
19258        }
19259    }
19260
19261    impl fidl::encoding::ResourceTypeMarker for DictionaryRemoveRequest {
19262        type Borrowed<'a> = &'a mut Self;
19263        fn take_or_borrow<'a>(
19264            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19265        ) -> Self::Borrowed<'a> {
19266            value
19267        }
19268    }
19269
19270    unsafe impl fidl::encoding::TypeMarker for DictionaryRemoveRequest {
19271        type Owned = Self;
19272
19273        #[inline(always)]
19274        fn inline_align(_context: fidl::encoding::Context) -> usize {
19275            8
19276        }
19277
19278        #[inline(always)]
19279        fn inline_size(_context: fidl::encoding::Context) -> usize {
19280            16
19281        }
19282    }
19283
19284    unsafe impl
19285        fidl::encoding::Encode<
19286            DictionaryRemoveRequest,
19287            fidl::encoding::DefaultFuchsiaResourceDialect,
19288        > for &mut DictionaryRemoveRequest
19289    {
19290        #[inline]
19291        unsafe fn encode(
19292            self,
19293            encoder: &mut fidl::encoding::Encoder<
19294                '_,
19295                fidl::encoding::DefaultFuchsiaResourceDialect,
19296            >,
19297            offset: usize,
19298            _depth: fidl::encoding::Depth,
19299        ) -> fidl::Result<()> {
19300            encoder.debug_check_bounds::<DictionaryRemoveRequest>(offset);
19301            // Delegate to tuple encoding.
19302            fidl::encoding::Encode::<
19303                DictionaryRemoveRequest,
19304                fidl::encoding::DefaultFuchsiaResourceDialect,
19305            >::encode(
19306                (<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
19307                    &self.key,
19308                ),),
19309                encoder,
19310                offset,
19311                _depth,
19312            )
19313        }
19314    }
19315    unsafe impl<
19316        T0: fidl::encoding::Encode<
19317                fidl::encoding::BoundedString<100>,
19318                fidl::encoding::DefaultFuchsiaResourceDialect,
19319            >,
19320    >
19321        fidl::encoding::Encode<
19322            DictionaryRemoveRequest,
19323            fidl::encoding::DefaultFuchsiaResourceDialect,
19324        > for (T0,)
19325    {
19326        #[inline]
19327        unsafe fn encode(
19328            self,
19329            encoder: &mut fidl::encoding::Encoder<
19330                '_,
19331                fidl::encoding::DefaultFuchsiaResourceDialect,
19332            >,
19333            offset: usize,
19334            depth: fidl::encoding::Depth,
19335        ) -> fidl::Result<()> {
19336            encoder.debug_check_bounds::<DictionaryRemoveRequest>(offset);
19337            // Zero out padding regions. There's no need to apply masks
19338            // because the unmasked parts will be overwritten by fields.
19339            // Write the fields.
19340            self.0.encode(encoder, offset + 0, depth)?;
19341            Ok(())
19342        }
19343    }
19344
19345    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19346        for DictionaryRemoveRequest
19347    {
19348        #[inline(always)]
19349        fn new_empty() -> Self {
19350            Self {
19351                key: fidl::new_empty!(
19352                    fidl::encoding::BoundedString<100>,
19353                    fidl::encoding::DefaultFuchsiaResourceDialect
19354                ),
19355            }
19356        }
19357
19358        #[inline]
19359        unsafe fn decode(
19360            &mut self,
19361            decoder: &mut fidl::encoding::Decoder<
19362                '_,
19363                fidl::encoding::DefaultFuchsiaResourceDialect,
19364            >,
19365            offset: usize,
19366            _depth: fidl::encoding::Depth,
19367        ) -> fidl::Result<()> {
19368            decoder.debug_check_bounds::<Self>(offset);
19369            // Verify that padding bytes are zero.
19370            fidl::decode!(
19371                fidl::encoding::BoundedString<100>,
19372                fidl::encoding::DefaultFuchsiaResourceDialect,
19373                &mut self.key,
19374                decoder,
19375                offset + 0,
19376                _depth
19377            )?;
19378            Ok(())
19379        }
19380    }
19381
19382    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterDeprecatedRouteRequest {
19383        type Borrowed<'a> = &'a mut Self;
19384        fn take_or_borrow<'a>(
19385            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19386        ) -> Self::Borrowed<'a> {
19387            value
19388        }
19389    }
19390
19391    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterDeprecatedRouteRequest {
19392        type Owned = Self;
19393
19394        #[inline(always)]
19395        fn inline_align(_context: fidl::encoding::Context) -> usize {
19396            8
19397        }
19398
19399        #[inline(always)]
19400        fn inline_size(_context: fidl::encoding::Context) -> usize {
19401            24
19402        }
19403    }
19404
19405    unsafe impl
19406        fidl::encoding::Encode<
19407            DictionaryRouterDeprecatedRouteRequest,
19408            fidl::encoding::DefaultFuchsiaResourceDialect,
19409        > for &mut DictionaryRouterDeprecatedRouteRequest
19410    {
19411        #[inline]
19412        unsafe fn encode(
19413            self,
19414            encoder: &mut fidl::encoding::Encoder<
19415                '_,
19416                fidl::encoding::DefaultFuchsiaResourceDialect,
19417            >,
19418            offset: usize,
19419            _depth: fidl::encoding::Depth,
19420        ) -> fidl::Result<()> {
19421            encoder.debug_check_bounds::<DictionaryRouterDeprecatedRouteRequest>(offset);
19422            // Delegate to tuple encoding.
19423            fidl::encoding::Encode::<DictionaryRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
19424                (
19425                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
19426                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary_server_end),
19427                ),
19428                encoder, offset, _depth
19429            )
19430        }
19431    }
19432    unsafe impl<
19433        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
19434        T1: fidl::encoding::Encode<
19435                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
19436                fidl::encoding::DefaultFuchsiaResourceDialect,
19437            >,
19438    >
19439        fidl::encoding::Encode<
19440            DictionaryRouterDeprecatedRouteRequest,
19441            fidl::encoding::DefaultFuchsiaResourceDialect,
19442        > for (T0, T1)
19443    {
19444        #[inline]
19445        unsafe fn encode(
19446            self,
19447            encoder: &mut fidl::encoding::Encoder<
19448                '_,
19449                fidl::encoding::DefaultFuchsiaResourceDialect,
19450            >,
19451            offset: usize,
19452            depth: fidl::encoding::Depth,
19453        ) -> fidl::Result<()> {
19454            encoder.debug_check_bounds::<DictionaryRouterDeprecatedRouteRequest>(offset);
19455            // Zero out padding regions. There's no need to apply masks
19456            // because the unmasked parts will be overwritten by fields.
19457            unsafe {
19458                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
19459                (ptr as *mut u64).write_unaligned(0);
19460            }
19461            // Write the fields.
19462            self.0.encode(encoder, offset + 0, depth)?;
19463            self.1.encode(encoder, offset + 16, depth)?;
19464            Ok(())
19465        }
19466    }
19467
19468    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19469        for DictionaryRouterDeprecatedRouteRequest
19470    {
19471        #[inline(always)]
19472        fn new_empty() -> Self {
19473            Self {
19474                request: fidl::new_empty!(
19475                    RouteRequest,
19476                    fidl::encoding::DefaultFuchsiaResourceDialect
19477                ),
19478                dictionary_server_end: fidl::new_empty!(
19479                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
19480                    fidl::encoding::DefaultFuchsiaResourceDialect
19481                ),
19482            }
19483        }
19484
19485        #[inline]
19486        unsafe fn decode(
19487            &mut self,
19488            decoder: &mut fidl::encoding::Decoder<
19489                '_,
19490                fidl::encoding::DefaultFuchsiaResourceDialect,
19491            >,
19492            offset: usize,
19493            _depth: fidl::encoding::Depth,
19494        ) -> fidl::Result<()> {
19495            decoder.debug_check_bounds::<Self>(offset);
19496            // Verify that padding bytes are zero.
19497            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
19498            let padval = unsafe { (ptr as *const u64).read_unaligned() };
19499            let mask = 0xffffffff00000000u64;
19500            let maskedval = padval & mask;
19501            if maskedval != 0 {
19502                return Err(fidl::Error::NonZeroPadding {
19503                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
19504                });
19505            }
19506            fidl::decode!(
19507                RouteRequest,
19508                fidl::encoding::DefaultFuchsiaResourceDialect,
19509                &mut self.request,
19510                decoder,
19511                offset + 0,
19512                _depth
19513            )?;
19514            fidl::decode!(
19515                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryMarker>>,
19516                fidl::encoding::DefaultFuchsiaResourceDialect,
19517                &mut self.dictionary_server_end,
19518                decoder,
19519                offset + 16,
19520                _depth
19521            )?;
19522            Ok(())
19523        }
19524    }
19525
19526    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterDeprecatedRouteResponse {
19527        type Borrowed<'a> = &'a mut Self;
19528        fn take_or_borrow<'a>(
19529            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19530        ) -> Self::Borrowed<'a> {
19531            value
19532        }
19533    }
19534
19535    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterDeprecatedRouteResponse {
19536        type Owned = Self;
19537
19538        #[inline(always)]
19539        fn inline_align(_context: fidl::encoding::Context) -> usize {
19540            4
19541        }
19542
19543        #[inline(always)]
19544        fn inline_size(_context: fidl::encoding::Context) -> usize {
19545            4
19546        }
19547    }
19548
19549    unsafe impl
19550        fidl::encoding::Encode<
19551            DictionaryRouterDeprecatedRouteResponse,
19552            fidl::encoding::DefaultFuchsiaResourceDialect,
19553        > for &mut DictionaryRouterDeprecatedRouteResponse
19554    {
19555        #[inline]
19556        unsafe fn encode(
19557            self,
19558            encoder: &mut fidl::encoding::Encoder<
19559                '_,
19560                fidl::encoding::DefaultFuchsiaResourceDialect,
19561            >,
19562            offset: usize,
19563            _depth: fidl::encoding::Depth,
19564        ) -> fidl::Result<()> {
19565            encoder.debug_check_bounds::<DictionaryRouterDeprecatedRouteResponse>(offset);
19566            // Delegate to tuple encoding.
19567            fidl::encoding::Encode::<
19568                DictionaryRouterDeprecatedRouteResponse,
19569                fidl::encoding::DefaultFuchsiaResourceDialect,
19570            >::encode(
19571                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
19572                encoder,
19573                offset,
19574                _depth,
19575            )
19576        }
19577    }
19578    unsafe impl<
19579        T0: fidl::encoding::Encode<RouterResponse, fidl::encoding::DefaultFuchsiaResourceDialect>,
19580    >
19581        fidl::encoding::Encode<
19582            DictionaryRouterDeprecatedRouteResponse,
19583            fidl::encoding::DefaultFuchsiaResourceDialect,
19584        > for (T0,)
19585    {
19586        #[inline]
19587        unsafe fn encode(
19588            self,
19589            encoder: &mut fidl::encoding::Encoder<
19590                '_,
19591                fidl::encoding::DefaultFuchsiaResourceDialect,
19592            >,
19593            offset: usize,
19594            depth: fidl::encoding::Depth,
19595        ) -> fidl::Result<()> {
19596            encoder.debug_check_bounds::<DictionaryRouterDeprecatedRouteResponse>(offset);
19597            // Zero out padding regions. There's no need to apply masks
19598            // because the unmasked parts will be overwritten by fields.
19599            // Write the fields.
19600            self.0.encode(encoder, offset + 0, depth)?;
19601            Ok(())
19602        }
19603    }
19604
19605    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19606        for DictionaryRouterDeprecatedRouteResponse
19607    {
19608        #[inline(always)]
19609        fn new_empty() -> Self {
19610            Self {
19611                response: fidl::new_empty!(
19612                    RouterResponse,
19613                    fidl::encoding::DefaultFuchsiaResourceDialect
19614                ),
19615            }
19616        }
19617
19618        #[inline]
19619        unsafe fn decode(
19620            &mut self,
19621            decoder: &mut fidl::encoding::Decoder<
19622                '_,
19623                fidl::encoding::DefaultFuchsiaResourceDialect,
19624            >,
19625            offset: usize,
19626            _depth: fidl::encoding::Depth,
19627        ) -> fidl::Result<()> {
19628            decoder.debug_check_bounds::<Self>(offset);
19629            // Verify that padding bytes are zero.
19630            fidl::decode!(
19631                RouterResponse,
19632                fidl::encoding::DefaultFuchsiaResourceDialect,
19633                &mut self.response,
19634                decoder,
19635                offset + 0,
19636                _depth
19637            )?;
19638            Ok(())
19639        }
19640    }
19641
19642    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteRequest {
19643        type Borrowed<'a> = &'a mut Self;
19644        fn take_or_borrow<'a>(
19645            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19646        ) -> Self::Borrowed<'a> {
19647            value
19648        }
19649    }
19650
19651    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteRequest {
19652        type Owned = Self;
19653
19654        #[inline(always)]
19655        fn inline_align(_context: fidl::encoding::Context) -> usize {
19656            8
19657        }
19658
19659        #[inline(always)]
19660        fn inline_size(_context: fidl::encoding::Context) -> usize {
19661            16
19662        }
19663    }
19664
19665    unsafe impl
19666        fidl::encoding::Encode<
19667            DictionaryRouterRouteRequest,
19668            fidl::encoding::DefaultFuchsiaResourceDialect,
19669        > for &mut DictionaryRouterRouteRequest
19670    {
19671        #[inline]
19672        unsafe fn encode(
19673            self,
19674            encoder: &mut fidl::encoding::Encoder<
19675                '_,
19676                fidl::encoding::DefaultFuchsiaResourceDialect,
19677            >,
19678            offset: usize,
19679            _depth: fidl::encoding::Depth,
19680        ) -> fidl::Result<()> {
19681            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
19682            // Delegate to tuple encoding.
19683            fidl::encoding::Encode::<
19684                DictionaryRouterRouteRequest,
19685                fidl::encoding::DefaultFuchsiaResourceDialect,
19686            >::encode(
19687                (<RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19688                    &mut self.request,
19689                ),),
19690                encoder,
19691                offset,
19692                _depth,
19693            )
19694        }
19695    }
19696    unsafe impl<
19697        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
19698    >
19699        fidl::encoding::Encode<
19700            DictionaryRouterRouteRequest,
19701            fidl::encoding::DefaultFuchsiaResourceDialect,
19702        > for (T0,)
19703    {
19704        #[inline]
19705        unsafe fn encode(
19706            self,
19707            encoder: &mut fidl::encoding::Encoder<
19708                '_,
19709                fidl::encoding::DefaultFuchsiaResourceDialect,
19710            >,
19711            offset: usize,
19712            depth: fidl::encoding::Depth,
19713        ) -> fidl::Result<()> {
19714            encoder.debug_check_bounds::<DictionaryRouterRouteRequest>(offset);
19715            // Zero out padding regions. There's no need to apply masks
19716            // because the unmasked parts will be overwritten by fields.
19717            // Write the fields.
19718            self.0.encode(encoder, offset + 0, depth)?;
19719            Ok(())
19720        }
19721    }
19722
19723    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19724        for DictionaryRouterRouteRequest
19725    {
19726        #[inline(always)]
19727        fn new_empty() -> Self {
19728            Self {
19729                request: fidl::new_empty!(
19730                    RouteRequest,
19731                    fidl::encoding::DefaultFuchsiaResourceDialect
19732                ),
19733            }
19734        }
19735
19736        #[inline]
19737        unsafe fn decode(
19738            &mut self,
19739            decoder: &mut fidl::encoding::Decoder<
19740                '_,
19741                fidl::encoding::DefaultFuchsiaResourceDialect,
19742            >,
19743            offset: usize,
19744            _depth: fidl::encoding::Depth,
19745        ) -> fidl::Result<()> {
19746            decoder.debug_check_bounds::<Self>(offset);
19747            // Verify that padding bytes are zero.
19748            fidl::decode!(
19749                RouteRequest,
19750                fidl::encoding::DefaultFuchsiaResourceDialect,
19751                &mut self.request,
19752                decoder,
19753                offset + 0,
19754                _depth
19755            )?;
19756            Ok(())
19757        }
19758    }
19759
19760    impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
19761        type Borrowed<'a> = &'a mut Self;
19762        fn take_or_borrow<'a>(
19763            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19764        ) -> Self::Borrowed<'a> {
19765            value
19766        }
19767    }
19768
19769    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
19770        type Owned = Self;
19771
19772        #[inline(always)]
19773        fn inline_align(_context: fidl::encoding::Context) -> usize {
19774            4
19775        }
19776
19777        #[inline(always)]
19778        fn inline_size(_context: fidl::encoding::Context) -> usize {
19779            4
19780        }
19781    }
19782
19783    unsafe impl
19784        fidl::encoding::Encode<
19785            DictionaryRouterRouteResponse,
19786            fidl::encoding::DefaultFuchsiaResourceDialect,
19787        > for &mut DictionaryRouterRouteResponse
19788    {
19789        #[inline]
19790        unsafe fn encode(
19791            self,
19792            encoder: &mut fidl::encoding::Encoder<
19793                '_,
19794                fidl::encoding::DefaultFuchsiaResourceDialect,
19795            >,
19796            offset: usize,
19797            _depth: fidl::encoding::Depth,
19798        ) -> fidl::Result<()> {
19799            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
19800            // Delegate to tuple encoding.
19801            fidl::encoding::Encode::<
19802                DictionaryRouterRouteResponse,
19803                fidl::encoding::DefaultFuchsiaResourceDialect,
19804            >::encode(
19805                (<fidl::encoding::Optional<
19806                    fidl::encoding::HandleType<
19807                        fidl::EventPair,
19808                        { fidl::ObjectType::EVENTPAIR.into_raw() },
19809                        2147483648,
19810                    >,
19811                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
19812                    &mut self.handle
19813                ),),
19814                encoder,
19815                offset,
19816                _depth,
19817            )
19818        }
19819    }
19820    unsafe impl<
19821        T0: fidl::encoding::Encode<
19822                fidl::encoding::Optional<
19823                    fidl::encoding::HandleType<
19824                        fidl::EventPair,
19825                        { fidl::ObjectType::EVENTPAIR.into_raw() },
19826                        2147483648,
19827                    >,
19828                >,
19829                fidl::encoding::DefaultFuchsiaResourceDialect,
19830            >,
19831    >
19832        fidl::encoding::Encode<
19833            DictionaryRouterRouteResponse,
19834            fidl::encoding::DefaultFuchsiaResourceDialect,
19835        > for (T0,)
19836    {
19837        #[inline]
19838        unsafe fn encode(
19839            self,
19840            encoder: &mut fidl::encoding::Encoder<
19841                '_,
19842                fidl::encoding::DefaultFuchsiaResourceDialect,
19843            >,
19844            offset: usize,
19845            depth: fidl::encoding::Depth,
19846        ) -> fidl::Result<()> {
19847            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
19848            // Zero out padding regions. There's no need to apply masks
19849            // because the unmasked parts will be overwritten by fields.
19850            // Write the fields.
19851            self.0.encode(encoder, offset + 0, depth)?;
19852            Ok(())
19853        }
19854    }
19855
19856    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19857        for DictionaryRouterRouteResponse
19858    {
19859        #[inline(always)]
19860        fn new_empty() -> Self {
19861            Self {
19862                handle: fidl::new_empty!(
19863                    fidl::encoding::Optional<
19864                        fidl::encoding::HandleType<
19865                            fidl::EventPair,
19866                            { fidl::ObjectType::EVENTPAIR.into_raw() },
19867                            2147483648,
19868                        >,
19869                    >,
19870                    fidl::encoding::DefaultFuchsiaResourceDialect
19871                ),
19872            }
19873        }
19874
19875        #[inline]
19876        unsafe fn decode(
19877            &mut self,
19878            decoder: &mut fidl::encoding::Decoder<
19879                '_,
19880                fidl::encoding::DefaultFuchsiaResourceDialect,
19881            >,
19882            offset: usize,
19883            _depth: fidl::encoding::Depth,
19884        ) -> fidl::Result<()> {
19885            decoder.debug_check_bounds::<Self>(offset);
19886            // Verify that padding bytes are zero.
19887            fidl::decode!(
19888                fidl::encoding::Optional<
19889                    fidl::encoding::HandleType<
19890                        fidl::EventPair,
19891                        { fidl::ObjectType::EVENTPAIR.into_raw() },
19892                        2147483648,
19893                    >,
19894                >,
19895                fidl::encoding::DefaultFuchsiaResourceDialect,
19896                &mut self.handle,
19897                decoder,
19898                offset + 0,
19899                _depth
19900            )?;
19901            Ok(())
19902        }
19903    }
19904
19905    impl fidl::encoding::ResourceTypeMarker for DictionaryGetResponse {
19906        type Borrowed<'a> = &'a mut Self;
19907        fn take_or_borrow<'a>(
19908            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
19909        ) -> Self::Borrowed<'a> {
19910            value
19911        }
19912    }
19913
19914    unsafe impl fidl::encoding::TypeMarker for DictionaryGetResponse {
19915        type Owned = Self;
19916
19917        #[inline(always)]
19918        fn inline_align(_context: fidl::encoding::Context) -> usize {
19919            8
19920        }
19921
19922        #[inline(always)]
19923        fn inline_size(_context: fidl::encoding::Context) -> usize {
19924            16
19925        }
19926    }
19927
19928    unsafe impl
19929        fidl::encoding::Encode<DictionaryGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
19930        for &mut DictionaryGetResponse
19931    {
19932        #[inline]
19933        unsafe fn encode(
19934            self,
19935            encoder: &mut fidl::encoding::Encoder<
19936                '_,
19937                fidl::encoding::DefaultFuchsiaResourceDialect,
19938            >,
19939            offset: usize,
19940            _depth: fidl::encoding::Depth,
19941        ) -> fidl::Result<()> {
19942            encoder.debug_check_bounds::<DictionaryGetResponse>(offset);
19943            // Delegate to tuple encoding.
19944            fidl::encoding::Encode::<DictionaryGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
19945                (
19946                    <fidl::encoding::OptionalUnion<CapabilityDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.capability),
19947                ),
19948                encoder, offset, _depth
19949            )
19950        }
19951    }
19952    unsafe impl<
19953        T0: fidl::encoding::Encode<
19954                fidl::encoding::OptionalUnion<CapabilityDeprecated>,
19955                fidl::encoding::DefaultFuchsiaResourceDialect,
19956            >,
19957    >
19958        fidl::encoding::Encode<DictionaryGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
19959        for (T0,)
19960    {
19961        #[inline]
19962        unsafe fn encode(
19963            self,
19964            encoder: &mut fidl::encoding::Encoder<
19965                '_,
19966                fidl::encoding::DefaultFuchsiaResourceDialect,
19967            >,
19968            offset: usize,
19969            depth: fidl::encoding::Depth,
19970        ) -> fidl::Result<()> {
19971            encoder.debug_check_bounds::<DictionaryGetResponse>(offset);
19972            // Zero out padding regions. There's no need to apply masks
19973            // because the unmasked parts will be overwritten by fields.
19974            // Write the fields.
19975            self.0.encode(encoder, offset + 0, depth)?;
19976            Ok(())
19977        }
19978    }
19979
19980    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
19981        for DictionaryGetResponse
19982    {
19983        #[inline(always)]
19984        fn new_empty() -> Self {
19985            Self {
19986                capability: fidl::new_empty!(
19987                    fidl::encoding::OptionalUnion<CapabilityDeprecated>,
19988                    fidl::encoding::DefaultFuchsiaResourceDialect
19989                ),
19990            }
19991        }
19992
19993        #[inline]
19994        unsafe fn decode(
19995            &mut self,
19996            decoder: &mut fidl::encoding::Decoder<
19997                '_,
19998                fidl::encoding::DefaultFuchsiaResourceDialect,
19999            >,
20000            offset: usize,
20001            _depth: fidl::encoding::Depth,
20002        ) -> fidl::Result<()> {
20003            decoder.debug_check_bounds::<Self>(offset);
20004            // Verify that padding bytes are zero.
20005            fidl::decode!(
20006                fidl::encoding::OptionalUnion<CapabilityDeprecated>,
20007                fidl::encoding::DefaultFuchsiaResourceDialect,
20008                &mut self.capability,
20009                decoder,
20010                offset + 0,
20011                _depth
20012            )?;
20013            Ok(())
20014        }
20015    }
20016
20017    impl fidl::encoding::ResourceTypeMarker for DictionaryLegacyExportResponse {
20018        type Borrowed<'a> = &'a mut Self;
20019        fn take_or_borrow<'a>(
20020            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20021        ) -> Self::Borrowed<'a> {
20022            value
20023        }
20024    }
20025
20026    unsafe impl fidl::encoding::TypeMarker for DictionaryLegacyExportResponse {
20027        type Owned = Self;
20028
20029        #[inline(always)]
20030        fn inline_align(_context: fidl::encoding::Context) -> usize {
20031            4
20032        }
20033
20034        #[inline(always)]
20035        fn inline_size(_context: fidl::encoding::Context) -> usize {
20036            4
20037        }
20038    }
20039
20040    unsafe impl
20041        fidl::encoding::Encode<
20042            DictionaryLegacyExportResponse,
20043            fidl::encoding::DefaultFuchsiaResourceDialect,
20044        > for &mut DictionaryLegacyExportResponse
20045    {
20046        #[inline]
20047        unsafe fn encode(
20048            self,
20049            encoder: &mut fidl::encoding::Encoder<
20050                '_,
20051                fidl::encoding::DefaultFuchsiaResourceDialect,
20052            >,
20053            offset: usize,
20054            _depth: fidl::encoding::Depth,
20055        ) -> fidl::Result<()> {
20056            encoder.debug_check_bounds::<DictionaryLegacyExportResponse>(offset);
20057            // Delegate to tuple encoding.
20058            fidl::encoding::Encode::<DictionaryLegacyExportResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20059                (
20060                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary_ref),
20061                ),
20062                encoder, offset, _depth
20063            )
20064        }
20065    }
20066    unsafe impl<
20067        T0: fidl::encoding::Encode<
20068                fidl_fuchsia_component_sandbox::DictionaryRef,
20069                fidl::encoding::DefaultFuchsiaResourceDialect,
20070            >,
20071    >
20072        fidl::encoding::Encode<
20073            DictionaryLegacyExportResponse,
20074            fidl::encoding::DefaultFuchsiaResourceDialect,
20075        > for (T0,)
20076    {
20077        #[inline]
20078        unsafe fn encode(
20079            self,
20080            encoder: &mut fidl::encoding::Encoder<
20081                '_,
20082                fidl::encoding::DefaultFuchsiaResourceDialect,
20083            >,
20084            offset: usize,
20085            depth: fidl::encoding::Depth,
20086        ) -> fidl::Result<()> {
20087            encoder.debug_check_bounds::<DictionaryLegacyExportResponse>(offset);
20088            // Zero out padding regions. There's no need to apply masks
20089            // because the unmasked parts will be overwritten by fields.
20090            // Write the fields.
20091            self.0.encode(encoder, offset + 0, depth)?;
20092            Ok(())
20093        }
20094    }
20095
20096    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20097        for DictionaryLegacyExportResponse
20098    {
20099        #[inline(always)]
20100        fn new_empty() -> Self {
20101            Self {
20102                dictionary_ref: fidl::new_empty!(
20103                    fidl_fuchsia_component_sandbox::DictionaryRef,
20104                    fidl::encoding::DefaultFuchsiaResourceDialect
20105                ),
20106            }
20107        }
20108
20109        #[inline]
20110        unsafe fn decode(
20111            &mut self,
20112            decoder: &mut fidl::encoding::Decoder<
20113                '_,
20114                fidl::encoding::DefaultFuchsiaResourceDialect,
20115            >,
20116            offset: usize,
20117            _depth: fidl::encoding::Depth,
20118        ) -> fidl::Result<()> {
20119            decoder.debug_check_bounds::<Self>(offset);
20120            // Verify that padding bytes are zero.
20121            fidl::decode!(
20122                fidl_fuchsia_component_sandbox::DictionaryRef,
20123                fidl::encoding::DefaultFuchsiaResourceDialect,
20124                &mut self.dictionary_ref,
20125                decoder,
20126                offset + 0,
20127                _depth
20128            )?;
20129            Ok(())
20130        }
20131    }
20132
20133    impl fidl::encoding::ResourceTypeMarker for DictionaryRemoveResponse {
20134        type Borrowed<'a> = &'a mut Self;
20135        fn take_or_borrow<'a>(
20136            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20137        ) -> Self::Borrowed<'a> {
20138            value
20139        }
20140    }
20141
20142    unsafe impl fidl::encoding::TypeMarker for DictionaryRemoveResponse {
20143        type Owned = Self;
20144
20145        #[inline(always)]
20146        fn inline_align(_context: fidl::encoding::Context) -> usize {
20147            8
20148        }
20149
20150        #[inline(always)]
20151        fn inline_size(_context: fidl::encoding::Context) -> usize {
20152            16
20153        }
20154    }
20155
20156    unsafe impl
20157        fidl::encoding::Encode<
20158            DictionaryRemoveResponse,
20159            fidl::encoding::DefaultFuchsiaResourceDialect,
20160        > for &mut DictionaryRemoveResponse
20161    {
20162        #[inline]
20163        unsafe fn encode(
20164            self,
20165            encoder: &mut fidl::encoding::Encoder<
20166                '_,
20167                fidl::encoding::DefaultFuchsiaResourceDialect,
20168            >,
20169            offset: usize,
20170            _depth: fidl::encoding::Depth,
20171        ) -> fidl::Result<()> {
20172            encoder.debug_check_bounds::<DictionaryRemoveResponse>(offset);
20173            // Delegate to tuple encoding.
20174            fidl::encoding::Encode::<DictionaryRemoveResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20175                (
20176                    <fidl::encoding::OptionalUnion<CapabilityDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.capability),
20177                ),
20178                encoder, offset, _depth
20179            )
20180        }
20181    }
20182    unsafe impl<
20183        T0: fidl::encoding::Encode<
20184                fidl::encoding::OptionalUnion<CapabilityDeprecated>,
20185                fidl::encoding::DefaultFuchsiaResourceDialect,
20186            >,
20187    >
20188        fidl::encoding::Encode<
20189            DictionaryRemoveResponse,
20190            fidl::encoding::DefaultFuchsiaResourceDialect,
20191        > for (T0,)
20192    {
20193        #[inline]
20194        unsafe fn encode(
20195            self,
20196            encoder: &mut fidl::encoding::Encoder<
20197                '_,
20198                fidl::encoding::DefaultFuchsiaResourceDialect,
20199            >,
20200            offset: usize,
20201            depth: fidl::encoding::Depth,
20202        ) -> fidl::Result<()> {
20203            encoder.debug_check_bounds::<DictionaryRemoveResponse>(offset);
20204            // Zero out padding regions. There's no need to apply masks
20205            // because the unmasked parts will be overwritten by fields.
20206            // Write the fields.
20207            self.0.encode(encoder, offset + 0, depth)?;
20208            Ok(())
20209        }
20210    }
20211
20212    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20213        for DictionaryRemoveResponse
20214    {
20215        #[inline(always)]
20216        fn new_empty() -> Self {
20217            Self {
20218                capability: fidl::new_empty!(
20219                    fidl::encoding::OptionalUnion<CapabilityDeprecated>,
20220                    fidl::encoding::DefaultFuchsiaResourceDialect
20221                ),
20222            }
20223        }
20224
20225        #[inline]
20226        unsafe fn decode(
20227            &mut self,
20228            decoder: &mut fidl::encoding::Decoder<
20229                '_,
20230                fidl::encoding::DefaultFuchsiaResourceDialect,
20231            >,
20232            offset: usize,
20233            _depth: fidl::encoding::Depth,
20234        ) -> fidl::Result<()> {
20235            decoder.debug_check_bounds::<Self>(offset);
20236            // Verify that padding bytes are zero.
20237            fidl::decode!(
20238                fidl::encoding::OptionalUnion<CapabilityDeprecated>,
20239                fidl::encoding::DefaultFuchsiaResourceDialect,
20240                &mut self.capability,
20241                decoder,
20242                offset + 0,
20243                _depth
20244            )?;
20245            Ok(())
20246        }
20247    }
20248
20249    impl fidl::encoding::ResourceTypeMarker for DirConnectorConnectRequest {
20250        type Borrowed<'a> = &'a mut Self;
20251        fn take_or_borrow<'a>(
20252            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20253        ) -> Self::Borrowed<'a> {
20254            value
20255        }
20256    }
20257
20258    unsafe impl fidl::encoding::TypeMarker for DirConnectorConnectRequest {
20259        type Owned = Self;
20260
20261        #[inline(always)]
20262        fn inline_align(_context: fidl::encoding::Context) -> usize {
20263            4
20264        }
20265
20266        #[inline(always)]
20267        fn inline_size(_context: fidl::encoding::Context) -> usize {
20268            4
20269        }
20270    }
20271
20272    unsafe impl
20273        fidl::encoding::Encode<
20274            DirConnectorConnectRequest,
20275            fidl::encoding::DefaultFuchsiaResourceDialect,
20276        > for &mut DirConnectorConnectRequest
20277    {
20278        #[inline]
20279        unsafe fn encode(
20280            self,
20281            encoder: &mut fidl::encoding::Encoder<
20282                '_,
20283                fidl::encoding::DefaultFuchsiaResourceDialect,
20284            >,
20285            offset: usize,
20286            _depth: fidl::encoding::Depth,
20287        ) -> fidl::Result<()> {
20288            encoder.debug_check_bounds::<DirConnectorConnectRequest>(offset);
20289            // Delegate to tuple encoding.
20290            fidl::encoding::Encode::<
20291                DirConnectorConnectRequest,
20292                fidl::encoding::DefaultFuchsiaResourceDialect,
20293            >::encode(
20294                (<fidl::encoding::Endpoint<
20295                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20296                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20297                    &mut self.channel
20298                ),),
20299                encoder,
20300                offset,
20301                _depth,
20302            )
20303        }
20304    }
20305    unsafe impl<
20306        T0: fidl::encoding::Encode<
20307                fidl::encoding::Endpoint<
20308                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20309                >,
20310                fidl::encoding::DefaultFuchsiaResourceDialect,
20311            >,
20312    >
20313        fidl::encoding::Encode<
20314            DirConnectorConnectRequest,
20315            fidl::encoding::DefaultFuchsiaResourceDialect,
20316        > for (T0,)
20317    {
20318        #[inline]
20319        unsafe fn encode(
20320            self,
20321            encoder: &mut fidl::encoding::Encoder<
20322                '_,
20323                fidl::encoding::DefaultFuchsiaResourceDialect,
20324            >,
20325            offset: usize,
20326            depth: fidl::encoding::Depth,
20327        ) -> fidl::Result<()> {
20328            encoder.debug_check_bounds::<DirConnectorConnectRequest>(offset);
20329            // Zero out padding regions. There's no need to apply masks
20330            // because the unmasked parts will be overwritten by fields.
20331            // Write the fields.
20332            self.0.encode(encoder, offset + 0, depth)?;
20333            Ok(())
20334        }
20335    }
20336
20337    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20338        for DirConnectorConnectRequest
20339    {
20340        #[inline(always)]
20341        fn new_empty() -> Self {
20342            Self {
20343                channel: fidl::new_empty!(
20344                    fidl::encoding::Endpoint<
20345                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20346                    >,
20347                    fidl::encoding::DefaultFuchsiaResourceDialect
20348                ),
20349            }
20350        }
20351
20352        #[inline]
20353        unsafe fn decode(
20354            &mut self,
20355            decoder: &mut fidl::encoding::Decoder<
20356                '_,
20357                fidl::encoding::DefaultFuchsiaResourceDialect,
20358            >,
20359            offset: usize,
20360            _depth: fidl::encoding::Depth,
20361        ) -> fidl::Result<()> {
20362            decoder.debug_check_bounds::<Self>(offset);
20363            // Verify that padding bytes are zero.
20364            fidl::decode!(
20365                fidl::encoding::Endpoint<
20366                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20367                >,
20368                fidl::encoding::DefaultFuchsiaResourceDialect,
20369                &mut self.channel,
20370                decoder,
20371                offset + 0,
20372                _depth
20373            )?;
20374            Ok(())
20375        }
20376    }
20377
20378    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterDeprecatedRouteRequest {
20379        type Borrowed<'a> = &'a mut Self;
20380        fn take_or_borrow<'a>(
20381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20382        ) -> Self::Borrowed<'a> {
20383            value
20384        }
20385    }
20386
20387    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterDeprecatedRouteRequest {
20388        type Owned = Self;
20389
20390        #[inline(always)]
20391        fn inline_align(_context: fidl::encoding::Context) -> usize {
20392            8
20393        }
20394
20395        #[inline(always)]
20396        fn inline_size(_context: fidl::encoding::Context) -> usize {
20397            24
20398        }
20399    }
20400
20401    unsafe impl
20402        fidl::encoding::Encode<
20403            DirConnectorRouterDeprecatedRouteRequest,
20404            fidl::encoding::DefaultFuchsiaResourceDialect,
20405        > for &mut DirConnectorRouterDeprecatedRouteRequest
20406    {
20407        #[inline]
20408        unsafe fn encode(
20409            self,
20410            encoder: &mut fidl::encoding::Encoder<
20411                '_,
20412                fidl::encoding::DefaultFuchsiaResourceDialect,
20413            >,
20414            offset: usize,
20415            _depth: fidl::encoding::Depth,
20416        ) -> fidl::Result<()> {
20417            encoder.debug_check_bounds::<DirConnectorRouterDeprecatedRouteRequest>(offset);
20418            // Delegate to tuple encoding.
20419            fidl::encoding::Encode::<DirConnectorRouterDeprecatedRouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
20420                (
20421                    <RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
20422                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir_connector_server_end),
20423                ),
20424                encoder, offset, _depth
20425            )
20426        }
20427    }
20428    unsafe impl<
20429        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
20430        T1: fidl::encoding::Encode<
20431                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
20432                fidl::encoding::DefaultFuchsiaResourceDialect,
20433            >,
20434    >
20435        fidl::encoding::Encode<
20436            DirConnectorRouterDeprecatedRouteRequest,
20437            fidl::encoding::DefaultFuchsiaResourceDialect,
20438        > for (T0, T1)
20439    {
20440        #[inline]
20441        unsafe fn encode(
20442            self,
20443            encoder: &mut fidl::encoding::Encoder<
20444                '_,
20445                fidl::encoding::DefaultFuchsiaResourceDialect,
20446            >,
20447            offset: usize,
20448            depth: fidl::encoding::Depth,
20449        ) -> fidl::Result<()> {
20450            encoder.debug_check_bounds::<DirConnectorRouterDeprecatedRouteRequest>(offset);
20451            // Zero out padding regions. There's no need to apply masks
20452            // because the unmasked parts will be overwritten by fields.
20453            unsafe {
20454                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
20455                (ptr as *mut u64).write_unaligned(0);
20456            }
20457            // Write the fields.
20458            self.0.encode(encoder, offset + 0, depth)?;
20459            self.1.encode(encoder, offset + 16, depth)?;
20460            Ok(())
20461        }
20462    }
20463
20464    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20465        for DirConnectorRouterDeprecatedRouteRequest
20466    {
20467        #[inline(always)]
20468        fn new_empty() -> Self {
20469            Self {
20470                request: fidl::new_empty!(
20471                    RouteRequest,
20472                    fidl::encoding::DefaultFuchsiaResourceDialect
20473                ),
20474                dir_connector_server_end: fidl::new_empty!(
20475                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
20476                    fidl::encoding::DefaultFuchsiaResourceDialect
20477                ),
20478            }
20479        }
20480
20481        #[inline]
20482        unsafe fn decode(
20483            &mut self,
20484            decoder: &mut fidl::encoding::Decoder<
20485                '_,
20486                fidl::encoding::DefaultFuchsiaResourceDialect,
20487            >,
20488            offset: usize,
20489            _depth: fidl::encoding::Depth,
20490        ) -> fidl::Result<()> {
20491            decoder.debug_check_bounds::<Self>(offset);
20492            // Verify that padding bytes are zero.
20493            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
20494            let padval = unsafe { (ptr as *const u64).read_unaligned() };
20495            let mask = 0xffffffff00000000u64;
20496            let maskedval = padval & mask;
20497            if maskedval != 0 {
20498                return Err(fidl::Error::NonZeroPadding {
20499                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
20500                });
20501            }
20502            fidl::decode!(
20503                RouteRequest,
20504                fidl::encoding::DefaultFuchsiaResourceDialect,
20505                &mut self.request,
20506                decoder,
20507                offset + 0,
20508                _depth
20509            )?;
20510            fidl::decode!(
20511                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirConnectorMarker>>,
20512                fidl::encoding::DefaultFuchsiaResourceDialect,
20513                &mut self.dir_connector_server_end,
20514                decoder,
20515                offset + 16,
20516                _depth
20517            )?;
20518            Ok(())
20519        }
20520    }
20521
20522    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterDeprecatedRouteResponse {
20523        type Borrowed<'a> = &'a mut Self;
20524        fn take_or_borrow<'a>(
20525            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20526        ) -> Self::Borrowed<'a> {
20527            value
20528        }
20529    }
20530
20531    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterDeprecatedRouteResponse {
20532        type Owned = Self;
20533
20534        #[inline(always)]
20535        fn inline_align(_context: fidl::encoding::Context) -> usize {
20536            4
20537        }
20538
20539        #[inline(always)]
20540        fn inline_size(_context: fidl::encoding::Context) -> usize {
20541            4
20542        }
20543    }
20544
20545    unsafe impl
20546        fidl::encoding::Encode<
20547            DirConnectorRouterDeprecatedRouteResponse,
20548            fidl::encoding::DefaultFuchsiaResourceDialect,
20549        > for &mut DirConnectorRouterDeprecatedRouteResponse
20550    {
20551        #[inline]
20552        unsafe fn encode(
20553            self,
20554            encoder: &mut fidl::encoding::Encoder<
20555                '_,
20556                fidl::encoding::DefaultFuchsiaResourceDialect,
20557            >,
20558            offset: usize,
20559            _depth: fidl::encoding::Depth,
20560        ) -> fidl::Result<()> {
20561            encoder.debug_check_bounds::<DirConnectorRouterDeprecatedRouteResponse>(offset);
20562            // Delegate to tuple encoding.
20563            fidl::encoding::Encode::<
20564                DirConnectorRouterDeprecatedRouteResponse,
20565                fidl::encoding::DefaultFuchsiaResourceDialect,
20566            >::encode(
20567                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
20568                encoder,
20569                offset,
20570                _depth,
20571            )
20572        }
20573    }
20574    unsafe impl<
20575        T0: fidl::encoding::Encode<RouterResponse, fidl::encoding::DefaultFuchsiaResourceDialect>,
20576    >
20577        fidl::encoding::Encode<
20578            DirConnectorRouterDeprecatedRouteResponse,
20579            fidl::encoding::DefaultFuchsiaResourceDialect,
20580        > for (T0,)
20581    {
20582        #[inline]
20583        unsafe fn encode(
20584            self,
20585            encoder: &mut fidl::encoding::Encoder<
20586                '_,
20587                fidl::encoding::DefaultFuchsiaResourceDialect,
20588            >,
20589            offset: usize,
20590            depth: fidl::encoding::Depth,
20591        ) -> fidl::Result<()> {
20592            encoder.debug_check_bounds::<DirConnectorRouterDeprecatedRouteResponse>(offset);
20593            // Zero out padding regions. There's no need to apply masks
20594            // because the unmasked parts will be overwritten by fields.
20595            // Write the fields.
20596            self.0.encode(encoder, offset + 0, depth)?;
20597            Ok(())
20598        }
20599    }
20600
20601    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20602        for DirConnectorRouterDeprecatedRouteResponse
20603    {
20604        #[inline(always)]
20605        fn new_empty() -> Self {
20606            Self {
20607                response: fidl::new_empty!(
20608                    RouterResponse,
20609                    fidl::encoding::DefaultFuchsiaResourceDialect
20610                ),
20611            }
20612        }
20613
20614        #[inline]
20615        unsafe fn decode(
20616            &mut self,
20617            decoder: &mut fidl::encoding::Decoder<
20618                '_,
20619                fidl::encoding::DefaultFuchsiaResourceDialect,
20620            >,
20621            offset: usize,
20622            _depth: fidl::encoding::Depth,
20623        ) -> fidl::Result<()> {
20624            decoder.debug_check_bounds::<Self>(offset);
20625            // Verify that padding bytes are zero.
20626            fidl::decode!(
20627                RouterResponse,
20628                fidl::encoding::DefaultFuchsiaResourceDialect,
20629                &mut self.response,
20630                decoder,
20631                offset + 0,
20632                _depth
20633            )?;
20634            Ok(())
20635        }
20636    }
20637
20638    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteRequest {
20639        type Borrowed<'a> = &'a mut Self;
20640        fn take_or_borrow<'a>(
20641            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20642        ) -> Self::Borrowed<'a> {
20643            value
20644        }
20645    }
20646
20647    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteRequest {
20648        type Owned = Self;
20649
20650        #[inline(always)]
20651        fn inline_align(_context: fidl::encoding::Context) -> usize {
20652            8
20653        }
20654
20655        #[inline(always)]
20656        fn inline_size(_context: fidl::encoding::Context) -> usize {
20657            16
20658        }
20659    }
20660
20661    unsafe impl
20662        fidl::encoding::Encode<
20663            DirConnectorRouterRouteRequest,
20664            fidl::encoding::DefaultFuchsiaResourceDialect,
20665        > for &mut DirConnectorRouterRouteRequest
20666    {
20667        #[inline]
20668        unsafe fn encode(
20669            self,
20670            encoder: &mut fidl::encoding::Encoder<
20671                '_,
20672                fidl::encoding::DefaultFuchsiaResourceDialect,
20673            >,
20674            offset: usize,
20675            _depth: fidl::encoding::Depth,
20676        ) -> fidl::Result<()> {
20677            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
20678            // Delegate to tuple encoding.
20679            fidl::encoding::Encode::<
20680                DirConnectorRouterRouteRequest,
20681                fidl::encoding::DefaultFuchsiaResourceDialect,
20682            >::encode(
20683                (<RouteRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20684                    &mut self.request,
20685                ),),
20686                encoder,
20687                offset,
20688                _depth,
20689            )
20690        }
20691    }
20692    unsafe impl<
20693        T0: fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
20694    >
20695        fidl::encoding::Encode<
20696            DirConnectorRouterRouteRequest,
20697            fidl::encoding::DefaultFuchsiaResourceDialect,
20698        > for (T0,)
20699    {
20700        #[inline]
20701        unsafe fn encode(
20702            self,
20703            encoder: &mut fidl::encoding::Encoder<
20704                '_,
20705                fidl::encoding::DefaultFuchsiaResourceDialect,
20706            >,
20707            offset: usize,
20708            depth: fidl::encoding::Depth,
20709        ) -> fidl::Result<()> {
20710            encoder.debug_check_bounds::<DirConnectorRouterRouteRequest>(offset);
20711            // Zero out padding regions. There's no need to apply masks
20712            // because the unmasked parts will be overwritten by fields.
20713            // Write the fields.
20714            self.0.encode(encoder, offset + 0, depth)?;
20715            Ok(())
20716        }
20717    }
20718
20719    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20720        for DirConnectorRouterRouteRequest
20721    {
20722        #[inline(always)]
20723        fn new_empty() -> Self {
20724            Self {
20725                request: fidl::new_empty!(
20726                    RouteRequest,
20727                    fidl::encoding::DefaultFuchsiaResourceDialect
20728                ),
20729            }
20730        }
20731
20732        #[inline]
20733        unsafe fn decode(
20734            &mut self,
20735            decoder: &mut fidl::encoding::Decoder<
20736                '_,
20737                fidl::encoding::DefaultFuchsiaResourceDialect,
20738            >,
20739            offset: usize,
20740            _depth: fidl::encoding::Depth,
20741        ) -> fidl::Result<()> {
20742            decoder.debug_check_bounds::<Self>(offset);
20743            // Verify that padding bytes are zero.
20744            fidl::decode!(
20745                RouteRequest,
20746                fidl::encoding::DefaultFuchsiaResourceDialect,
20747                &mut self.request,
20748                decoder,
20749                offset + 0,
20750                _depth
20751            )?;
20752            Ok(())
20753        }
20754    }
20755
20756    impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
20757        type Borrowed<'a> = &'a mut Self;
20758        fn take_or_borrow<'a>(
20759            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20760        ) -> Self::Borrowed<'a> {
20761            value
20762        }
20763    }
20764
20765    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
20766        type Owned = Self;
20767
20768        #[inline(always)]
20769        fn inline_align(_context: fidl::encoding::Context) -> usize {
20770            4
20771        }
20772
20773        #[inline(always)]
20774        fn inline_size(_context: fidl::encoding::Context) -> usize {
20775            4
20776        }
20777    }
20778
20779    unsafe impl
20780        fidl::encoding::Encode<
20781            DirConnectorRouterRouteResponse,
20782            fidl::encoding::DefaultFuchsiaResourceDialect,
20783        > for &mut DirConnectorRouterRouteResponse
20784    {
20785        #[inline]
20786        unsafe fn encode(
20787            self,
20788            encoder: &mut fidl::encoding::Encoder<
20789                '_,
20790                fidl::encoding::DefaultFuchsiaResourceDialect,
20791            >,
20792            offset: usize,
20793            _depth: fidl::encoding::Depth,
20794        ) -> fidl::Result<()> {
20795            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
20796            // Delegate to tuple encoding.
20797            fidl::encoding::Encode::<
20798                DirConnectorRouterRouteResponse,
20799                fidl::encoding::DefaultFuchsiaResourceDialect,
20800            >::encode(
20801                (<fidl::encoding::Optional<
20802                    fidl::encoding::HandleType<
20803                        fidl::EventPair,
20804                        { fidl::ObjectType::EVENTPAIR.into_raw() },
20805                        2147483648,
20806                    >,
20807                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20808                    &mut self.handle
20809                ),),
20810                encoder,
20811                offset,
20812                _depth,
20813            )
20814        }
20815    }
20816    unsafe impl<
20817        T0: fidl::encoding::Encode<
20818                fidl::encoding::Optional<
20819                    fidl::encoding::HandleType<
20820                        fidl::EventPair,
20821                        { fidl::ObjectType::EVENTPAIR.into_raw() },
20822                        2147483648,
20823                    >,
20824                >,
20825                fidl::encoding::DefaultFuchsiaResourceDialect,
20826            >,
20827    >
20828        fidl::encoding::Encode<
20829            DirConnectorRouterRouteResponse,
20830            fidl::encoding::DefaultFuchsiaResourceDialect,
20831        > for (T0,)
20832    {
20833        #[inline]
20834        unsafe fn encode(
20835            self,
20836            encoder: &mut fidl::encoding::Encoder<
20837                '_,
20838                fidl::encoding::DefaultFuchsiaResourceDialect,
20839            >,
20840            offset: usize,
20841            depth: fidl::encoding::Depth,
20842        ) -> fidl::Result<()> {
20843            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
20844            // Zero out padding regions. There's no need to apply masks
20845            // because the unmasked parts will be overwritten by fields.
20846            // Write the fields.
20847            self.0.encode(encoder, offset + 0, depth)?;
20848            Ok(())
20849        }
20850    }
20851
20852    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20853        for DirConnectorRouterRouteResponse
20854    {
20855        #[inline(always)]
20856        fn new_empty() -> Self {
20857            Self {
20858                handle: fidl::new_empty!(
20859                    fidl::encoding::Optional<
20860                        fidl::encoding::HandleType<
20861                            fidl::EventPair,
20862                            { fidl::ObjectType::EVENTPAIR.into_raw() },
20863                            2147483648,
20864                        >,
20865                    >,
20866                    fidl::encoding::DefaultFuchsiaResourceDialect
20867                ),
20868            }
20869        }
20870
20871        #[inline]
20872        unsafe fn decode(
20873            &mut self,
20874            decoder: &mut fidl::encoding::Decoder<
20875                '_,
20876                fidl::encoding::DefaultFuchsiaResourceDialect,
20877            >,
20878            offset: usize,
20879            _depth: fidl::encoding::Depth,
20880        ) -> fidl::Result<()> {
20881            decoder.debug_check_bounds::<Self>(offset);
20882            // Verify that padding bytes are zero.
20883            fidl::decode!(
20884                fidl::encoding::Optional<
20885                    fidl::encoding::HandleType<
20886                        fidl::EventPair,
20887                        { fidl::ObjectType::EVENTPAIR.into_raw() },
20888                        2147483648,
20889                    >,
20890                >,
20891                fidl::encoding::DefaultFuchsiaResourceDialect,
20892                &mut self.handle,
20893                decoder,
20894                offset + 0,
20895                _depth
20896            )?;
20897            Ok(())
20898        }
20899    }
20900
20901    impl fidl::encoding::ResourceTypeMarker for DirReceiverDeprecatedReceiveRequest {
20902        type Borrowed<'a> = &'a mut Self;
20903        fn take_or_borrow<'a>(
20904            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
20905        ) -> Self::Borrowed<'a> {
20906            value
20907        }
20908    }
20909
20910    unsafe impl fidl::encoding::TypeMarker for DirReceiverDeprecatedReceiveRequest {
20911        type Owned = Self;
20912
20913        #[inline(always)]
20914        fn inline_align(_context: fidl::encoding::Context) -> usize {
20915            4
20916        }
20917
20918        #[inline(always)]
20919        fn inline_size(_context: fidl::encoding::Context) -> usize {
20920            4
20921        }
20922    }
20923
20924    unsafe impl
20925        fidl::encoding::Encode<
20926            DirReceiverDeprecatedReceiveRequest,
20927            fidl::encoding::DefaultFuchsiaResourceDialect,
20928        > for &mut DirReceiverDeprecatedReceiveRequest
20929    {
20930        #[inline]
20931        unsafe fn encode(
20932            self,
20933            encoder: &mut fidl::encoding::Encoder<
20934                '_,
20935                fidl::encoding::DefaultFuchsiaResourceDialect,
20936            >,
20937            offset: usize,
20938            _depth: fidl::encoding::Depth,
20939        ) -> fidl::Result<()> {
20940            encoder.debug_check_bounds::<DirReceiverDeprecatedReceiveRequest>(offset);
20941            // Delegate to tuple encoding.
20942            fidl::encoding::Encode::<
20943                DirReceiverDeprecatedReceiveRequest,
20944                fidl::encoding::DefaultFuchsiaResourceDialect,
20945            >::encode(
20946                (<fidl::encoding::Endpoint<
20947                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20948                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
20949                    &mut self.channel
20950                ),),
20951                encoder,
20952                offset,
20953                _depth,
20954            )
20955        }
20956    }
20957    unsafe impl<
20958        T0: fidl::encoding::Encode<
20959                fidl::encoding::Endpoint<
20960                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20961                >,
20962                fidl::encoding::DefaultFuchsiaResourceDialect,
20963            >,
20964    >
20965        fidl::encoding::Encode<
20966            DirReceiverDeprecatedReceiveRequest,
20967            fidl::encoding::DefaultFuchsiaResourceDialect,
20968        > for (T0,)
20969    {
20970        #[inline]
20971        unsafe fn encode(
20972            self,
20973            encoder: &mut fidl::encoding::Encoder<
20974                '_,
20975                fidl::encoding::DefaultFuchsiaResourceDialect,
20976            >,
20977            offset: usize,
20978            depth: fidl::encoding::Depth,
20979        ) -> fidl::Result<()> {
20980            encoder.debug_check_bounds::<DirReceiverDeprecatedReceiveRequest>(offset);
20981            // Zero out padding regions. There's no need to apply masks
20982            // because the unmasked parts will be overwritten by fields.
20983            // Write the fields.
20984            self.0.encode(encoder, offset + 0, depth)?;
20985            Ok(())
20986        }
20987    }
20988
20989    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
20990        for DirReceiverDeprecatedReceiveRequest
20991    {
20992        #[inline(always)]
20993        fn new_empty() -> Self {
20994            Self {
20995                channel: fidl::new_empty!(
20996                    fidl::encoding::Endpoint<
20997                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
20998                    >,
20999                    fidl::encoding::DefaultFuchsiaResourceDialect
21000                ),
21001            }
21002        }
21003
21004        #[inline]
21005        unsafe fn decode(
21006            &mut self,
21007            decoder: &mut fidl::encoding::Decoder<
21008                '_,
21009                fidl::encoding::DefaultFuchsiaResourceDialect,
21010            >,
21011            offset: usize,
21012            _depth: fidl::encoding::Depth,
21013        ) -> fidl::Result<()> {
21014            decoder.debug_check_bounds::<Self>(offset);
21015            // Verify that padding bytes are zero.
21016            fidl::decode!(
21017                fidl::encoding::Endpoint<
21018                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21019                >,
21020                fidl::encoding::DefaultFuchsiaResourceDialect,
21021                &mut self.channel,
21022                decoder,
21023                offset + 0,
21024                _depth
21025            )?;
21026            Ok(())
21027        }
21028    }
21029
21030    impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
21031        type Borrowed<'a> = &'a mut Self;
21032        fn take_or_borrow<'a>(
21033            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21034        ) -> Self::Borrowed<'a> {
21035            value
21036        }
21037    }
21038
21039    unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
21040        type Owned = Self;
21041
21042        #[inline(always)]
21043        fn inline_align(_context: fidl::encoding::Context) -> usize {
21044            8
21045        }
21046
21047        #[inline(always)]
21048        fn inline_size(_context: fidl::encoding::Context) -> usize {
21049            16
21050        }
21051    }
21052
21053    unsafe impl
21054        fidl::encoding::Encode<
21055            DirReceiverReceiveRequest,
21056            fidl::encoding::DefaultFuchsiaResourceDialect,
21057        > for &mut DirReceiverReceiveRequest
21058    {
21059        #[inline]
21060        unsafe fn encode(
21061            self,
21062            encoder: &mut fidl::encoding::Encoder<
21063                '_,
21064                fidl::encoding::DefaultFuchsiaResourceDialect,
21065            >,
21066            offset: usize,
21067            _depth: fidl::encoding::Depth,
21068        ) -> fidl::Result<()> {
21069            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
21070            // Delegate to tuple encoding.
21071            fidl::encoding::Encode::<
21072                DirReceiverReceiveRequest,
21073                fidl::encoding::DefaultFuchsiaResourceDialect,
21074            >::encode(
21075                (
21076                    <fidl::encoding::Endpoint<
21077                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21078                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21079                        &mut self.channel
21080                    ),
21081                    <fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow(
21082                        &self.rights,
21083                    ),
21084                ),
21085                encoder,
21086                offset,
21087                _depth,
21088            )
21089        }
21090    }
21091    unsafe impl<
21092        T0: fidl::encoding::Encode<
21093                fidl::encoding::Endpoint<
21094                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21095                >,
21096                fidl::encoding::DefaultFuchsiaResourceDialect,
21097            >,
21098        T1: fidl::encoding::Encode<
21099                fidl_fuchsia_io::Flags,
21100                fidl::encoding::DefaultFuchsiaResourceDialect,
21101            >,
21102    >
21103        fidl::encoding::Encode<
21104            DirReceiverReceiveRequest,
21105            fidl::encoding::DefaultFuchsiaResourceDialect,
21106        > for (T0, T1)
21107    {
21108        #[inline]
21109        unsafe fn encode(
21110            self,
21111            encoder: &mut fidl::encoding::Encoder<
21112                '_,
21113                fidl::encoding::DefaultFuchsiaResourceDialect,
21114            >,
21115            offset: usize,
21116            depth: fidl::encoding::Depth,
21117        ) -> fidl::Result<()> {
21118            encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
21119            // Zero out padding regions. There's no need to apply masks
21120            // because the unmasked parts will be overwritten by fields.
21121            unsafe {
21122                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
21123                (ptr as *mut u64).write_unaligned(0);
21124            }
21125            // Write the fields.
21126            self.0.encode(encoder, offset + 0, depth)?;
21127            self.1.encode(encoder, offset + 8, depth)?;
21128            Ok(())
21129        }
21130    }
21131
21132    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21133        for DirReceiverReceiveRequest
21134    {
21135        #[inline(always)]
21136        fn new_empty() -> Self {
21137            Self {
21138                channel: fidl::new_empty!(
21139                    fidl::encoding::Endpoint<
21140                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21141                    >,
21142                    fidl::encoding::DefaultFuchsiaResourceDialect
21143                ),
21144                rights: fidl::new_empty!(
21145                    fidl_fuchsia_io::Flags,
21146                    fidl::encoding::DefaultFuchsiaResourceDialect
21147                ),
21148            }
21149        }
21150
21151        #[inline]
21152        unsafe fn decode(
21153            &mut self,
21154            decoder: &mut fidl::encoding::Decoder<
21155                '_,
21156                fidl::encoding::DefaultFuchsiaResourceDialect,
21157            >,
21158            offset: usize,
21159            _depth: fidl::encoding::Depth,
21160        ) -> fidl::Result<()> {
21161            decoder.debug_check_bounds::<Self>(offset);
21162            // Verify that padding bytes are zero.
21163            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
21164            let padval = unsafe { (ptr as *const u64).read_unaligned() };
21165            let mask = 0xffffffff00000000u64;
21166            let maskedval = padval & mask;
21167            if maskedval != 0 {
21168                return Err(fidl::Error::NonZeroPadding {
21169                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
21170                });
21171            }
21172            fidl::decode!(
21173                fidl::encoding::Endpoint<
21174                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21175                >,
21176                fidl::encoding::DefaultFuchsiaResourceDialect,
21177                &mut self.channel,
21178                decoder,
21179                offset + 0,
21180                _depth
21181            )?;
21182            fidl::decode!(
21183                fidl_fuchsia_io::Flags,
21184                fidl::encoding::DefaultFuchsiaResourceDialect,
21185                &mut self.rights,
21186                decoder,
21187                offset + 8,
21188                _depth
21189            )?;
21190            Ok(())
21191        }
21192    }
21193
21194    impl fidl::encoding::ResourceTypeMarker for ReceiverReceiveRequest {
21195        type Borrowed<'a> = &'a mut Self;
21196        fn take_or_borrow<'a>(
21197            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21198        ) -> Self::Borrowed<'a> {
21199            value
21200        }
21201    }
21202
21203    unsafe impl fidl::encoding::TypeMarker for ReceiverReceiveRequest {
21204        type Owned = Self;
21205
21206        #[inline(always)]
21207        fn inline_align(_context: fidl::encoding::Context) -> usize {
21208            4
21209        }
21210
21211        #[inline(always)]
21212        fn inline_size(_context: fidl::encoding::Context) -> usize {
21213            4
21214        }
21215    }
21216
21217    unsafe impl
21218        fidl::encoding::Encode<
21219            ReceiverReceiveRequest,
21220            fidl::encoding::DefaultFuchsiaResourceDialect,
21221        > for &mut ReceiverReceiveRequest
21222    {
21223        #[inline]
21224        unsafe fn encode(
21225            self,
21226            encoder: &mut fidl::encoding::Encoder<
21227                '_,
21228                fidl::encoding::DefaultFuchsiaResourceDialect,
21229            >,
21230            offset: usize,
21231            _depth: fidl::encoding::Depth,
21232        ) -> fidl::Result<()> {
21233            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
21234            // Delegate to tuple encoding.
21235            fidl::encoding::Encode::<
21236                ReceiverReceiveRequest,
21237                fidl::encoding::DefaultFuchsiaResourceDialect,
21238            >::encode(
21239                (<fidl::encoding::HandleType<
21240                    fidl::Channel,
21241                    { fidl::ObjectType::CHANNEL.into_raw() },
21242                    2147483648,
21243                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
21244                    &mut self.channel
21245                ),),
21246                encoder,
21247                offset,
21248                _depth,
21249            )
21250        }
21251    }
21252    unsafe impl<
21253        T0: fidl::encoding::Encode<
21254                fidl::encoding::HandleType<
21255                    fidl::Channel,
21256                    { fidl::ObjectType::CHANNEL.into_raw() },
21257                    2147483648,
21258                >,
21259                fidl::encoding::DefaultFuchsiaResourceDialect,
21260            >,
21261    >
21262        fidl::encoding::Encode<
21263            ReceiverReceiveRequest,
21264            fidl::encoding::DefaultFuchsiaResourceDialect,
21265        > for (T0,)
21266    {
21267        #[inline]
21268        unsafe fn encode(
21269            self,
21270            encoder: &mut fidl::encoding::Encoder<
21271                '_,
21272                fidl::encoding::DefaultFuchsiaResourceDialect,
21273            >,
21274            offset: usize,
21275            depth: fidl::encoding::Depth,
21276        ) -> fidl::Result<()> {
21277            encoder.debug_check_bounds::<ReceiverReceiveRequest>(offset);
21278            // Zero out padding regions. There's no need to apply masks
21279            // because the unmasked parts will be overwritten by fields.
21280            // Write the fields.
21281            self.0.encode(encoder, offset + 0, depth)?;
21282            Ok(())
21283        }
21284    }
21285
21286    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21287        for ReceiverReceiveRequest
21288    {
21289        #[inline(always)]
21290        fn new_empty() -> Self {
21291            Self {
21292                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21293            }
21294        }
21295
21296        #[inline]
21297        unsafe fn decode(
21298            &mut self,
21299            decoder: &mut fidl::encoding::Decoder<
21300                '_,
21301                fidl::encoding::DefaultFuchsiaResourceDialect,
21302            >,
21303            offset: usize,
21304            _depth: fidl::encoding::Depth,
21305        ) -> fidl::Result<()> {
21306            decoder.debug_check_bounds::<Self>(offset);
21307            // Verify that padding bytes are zero.
21308            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
21309            Ok(())
21310        }
21311    }
21312
21313    impl fidl::encoding::ResourceTypeMarker for WeakInstanceToken {
21314        type Borrowed<'a> = &'a mut Self;
21315        fn take_or_borrow<'a>(
21316            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21317        ) -> Self::Borrowed<'a> {
21318            value
21319        }
21320    }
21321
21322    unsafe impl fidl::encoding::TypeMarker for WeakInstanceToken {
21323        type Owned = Self;
21324
21325        #[inline(always)]
21326        fn inline_align(_context: fidl::encoding::Context) -> usize {
21327            4
21328        }
21329
21330        #[inline(always)]
21331        fn inline_size(_context: fidl::encoding::Context) -> usize {
21332            4
21333        }
21334    }
21335
21336    unsafe impl
21337        fidl::encoding::Encode<WeakInstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
21338        for &mut WeakInstanceToken
21339    {
21340        #[inline]
21341        unsafe fn encode(
21342            self,
21343            encoder: &mut fidl::encoding::Encoder<
21344                '_,
21345                fidl::encoding::DefaultFuchsiaResourceDialect,
21346            >,
21347            offset: usize,
21348            _depth: fidl::encoding::Depth,
21349        ) -> fidl::Result<()> {
21350            encoder.debug_check_bounds::<WeakInstanceToken>(offset);
21351            // Delegate to tuple encoding.
21352            fidl::encoding::Encode::<WeakInstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
21353                (
21354                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
21355                ),
21356                encoder, offset, _depth
21357            )
21358        }
21359    }
21360    unsafe impl<
21361        T0: fidl::encoding::Encode<
21362                fidl::encoding::HandleType<
21363                    fidl::EventPair,
21364                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21365                    2147483648,
21366                >,
21367                fidl::encoding::DefaultFuchsiaResourceDialect,
21368            >,
21369    > fidl::encoding::Encode<WeakInstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
21370        for (T0,)
21371    {
21372        #[inline]
21373        unsafe fn encode(
21374            self,
21375            encoder: &mut fidl::encoding::Encoder<
21376                '_,
21377                fidl::encoding::DefaultFuchsiaResourceDialect,
21378            >,
21379            offset: usize,
21380            depth: fidl::encoding::Depth,
21381        ) -> fidl::Result<()> {
21382            encoder.debug_check_bounds::<WeakInstanceToken>(offset);
21383            // Zero out padding regions. There's no need to apply masks
21384            // because the unmasked parts will be overwritten by fields.
21385            // Write the fields.
21386            self.0.encode(encoder, offset + 0, depth)?;
21387            Ok(())
21388        }
21389    }
21390
21391    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21392        for WeakInstanceToken
21393    {
21394        #[inline(always)]
21395        fn new_empty() -> Self {
21396            Self {
21397                token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
21398            }
21399        }
21400
21401        #[inline]
21402        unsafe fn decode(
21403            &mut self,
21404            decoder: &mut fidl::encoding::Decoder<
21405                '_,
21406                fidl::encoding::DefaultFuchsiaResourceDialect,
21407            >,
21408            offset: usize,
21409            _depth: fidl::encoding::Depth,
21410        ) -> fidl::Result<()> {
21411            decoder.debug_check_bounds::<Self>(offset);
21412            // Verify that padding bytes are zero.
21413            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
21414            Ok(())
21415        }
21416    }
21417
21418    impl CapabilitiesDictionaryRemoveRequest {
21419        #[inline(always)]
21420        fn max_ordinal_present(&self) -> u64 {
21421            if let Some(_) = self.value {
21422                return 3;
21423            }
21424            if let Some(_) = self.key {
21425                return 2;
21426            }
21427            if let Some(_) = self.dictionary {
21428                return 1;
21429            }
21430            0
21431        }
21432    }
21433
21434    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDictionaryRemoveRequest {
21435        type Borrowed<'a> = &'a mut Self;
21436        fn take_or_borrow<'a>(
21437            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21438        ) -> Self::Borrowed<'a> {
21439            value
21440        }
21441    }
21442
21443    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRemoveRequest {
21444        type Owned = Self;
21445
21446        #[inline(always)]
21447        fn inline_align(_context: fidl::encoding::Context) -> usize {
21448            8
21449        }
21450
21451        #[inline(always)]
21452        fn inline_size(_context: fidl::encoding::Context) -> usize {
21453            16
21454        }
21455    }
21456
21457    unsafe impl
21458        fidl::encoding::Encode<
21459            CapabilitiesDictionaryRemoveRequest,
21460            fidl::encoding::DefaultFuchsiaResourceDialect,
21461        > for &mut CapabilitiesDictionaryRemoveRequest
21462    {
21463        unsafe fn encode(
21464            self,
21465            encoder: &mut fidl::encoding::Encoder<
21466                '_,
21467                fidl::encoding::DefaultFuchsiaResourceDialect,
21468            >,
21469            offset: usize,
21470            mut depth: fidl::encoding::Depth,
21471        ) -> fidl::Result<()> {
21472            encoder.debug_check_bounds::<CapabilitiesDictionaryRemoveRequest>(offset);
21473            // Vector header
21474            let max_ordinal: u64 = self.max_ordinal_present();
21475            encoder.write_num(max_ordinal, offset);
21476            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21477            // Calling encoder.out_of_line_offset(0) is not allowed.
21478            if max_ordinal == 0 {
21479                return Ok(());
21480            }
21481            depth.increment()?;
21482            let envelope_size = 8;
21483            let bytes_len = max_ordinal as usize * envelope_size;
21484            #[allow(unused_variables)]
21485            let offset = encoder.out_of_line_offset(bytes_len);
21486            let mut _prev_end_offset: usize = 0;
21487            if 1 > max_ordinal {
21488                return Ok(());
21489            }
21490
21491            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21492            // are envelope_size bytes.
21493            let cur_offset: usize = (1 - 1) * envelope_size;
21494
21495            // Zero reserved fields.
21496            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21497
21498            // Safety:
21499            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21500            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21501            //   envelope_size bytes, there is always sufficient room.
21502            fidl::encoding::encode_in_envelope_optional::<
21503                fidl::encoding::HandleType<
21504                    fidl::EventPair,
21505                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21506                    2147483648,
21507                >,
21508                fidl::encoding::DefaultFuchsiaResourceDialect,
21509            >(
21510                self.dictionary.as_mut().map(
21511                    <fidl::encoding::HandleType<
21512                        fidl::EventPair,
21513                        { fidl::ObjectType::EVENTPAIR.into_raw() },
21514                        2147483648,
21515                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
21516                ),
21517                encoder,
21518                offset + cur_offset,
21519                depth,
21520            )?;
21521
21522            _prev_end_offset = cur_offset + envelope_size;
21523            if 2 > max_ordinal {
21524                return Ok(());
21525            }
21526
21527            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21528            // are envelope_size bytes.
21529            let cur_offset: usize = (2 - 1) * envelope_size;
21530
21531            // Zero reserved fields.
21532            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21533
21534            // Safety:
21535            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21536            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21537            //   envelope_size bytes, there is always sufficient room.
21538            fidl::encoding::encode_in_envelope_optional::<
21539                fidl::encoding::BoundedString<100>,
21540                fidl::encoding::DefaultFuchsiaResourceDialect,
21541            >(
21542                self.key.as_ref().map(
21543                    <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
21544                ),
21545                encoder,
21546                offset + cur_offset,
21547                depth,
21548            )?;
21549
21550            _prev_end_offset = cur_offset + envelope_size;
21551            if 3 > max_ordinal {
21552                return Ok(());
21553            }
21554
21555            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21556            // are envelope_size bytes.
21557            let cur_offset: usize = (3 - 1) * envelope_size;
21558
21559            // Zero reserved fields.
21560            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21561
21562            // Safety:
21563            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21564            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21565            //   envelope_size bytes, there is always sufficient room.
21566            fidl::encoding::encode_in_envelope_optional::<
21567                fidl::encoding::HandleType<
21568                    fidl::EventPair,
21569                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21570                    2147483648,
21571                >,
21572                fidl::encoding::DefaultFuchsiaResourceDialect,
21573            >(
21574                self.value.as_mut().map(
21575                    <fidl::encoding::HandleType<
21576                        fidl::EventPair,
21577                        { fidl::ObjectType::EVENTPAIR.into_raw() },
21578                        2147483648,
21579                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
21580                ),
21581                encoder,
21582                offset + cur_offset,
21583                depth,
21584            )?;
21585
21586            _prev_end_offset = cur_offset + envelope_size;
21587
21588            Ok(())
21589        }
21590    }
21591
21592    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21593        for CapabilitiesDictionaryRemoveRequest
21594    {
21595        #[inline(always)]
21596        fn new_empty() -> Self {
21597            Self::default()
21598        }
21599
21600        unsafe fn decode(
21601            &mut self,
21602            decoder: &mut fidl::encoding::Decoder<
21603                '_,
21604                fidl::encoding::DefaultFuchsiaResourceDialect,
21605            >,
21606            offset: usize,
21607            mut depth: fidl::encoding::Depth,
21608        ) -> fidl::Result<()> {
21609            decoder.debug_check_bounds::<Self>(offset);
21610            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21611                None => return Err(fidl::Error::NotNullable),
21612                Some(len) => len,
21613            };
21614            // Calling decoder.out_of_line_offset(0) is not allowed.
21615            if len == 0 {
21616                return Ok(());
21617            };
21618            depth.increment()?;
21619            let envelope_size = 8;
21620            let bytes_len = len * envelope_size;
21621            let offset = decoder.out_of_line_offset(bytes_len)?;
21622            // Decode the envelope for each type.
21623            let mut _next_ordinal_to_read = 0;
21624            let mut next_offset = offset;
21625            let end_offset = offset + bytes_len;
21626            _next_ordinal_to_read += 1;
21627            if next_offset >= end_offset {
21628                return Ok(());
21629            }
21630
21631            // Decode unknown envelopes for gaps in ordinals.
21632            while _next_ordinal_to_read < 1 {
21633                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21634                _next_ordinal_to_read += 1;
21635                next_offset += envelope_size;
21636            }
21637
21638            let next_out_of_line = decoder.next_out_of_line();
21639            let handles_before = decoder.remaining_handles();
21640            if let Some((inlined, num_bytes, num_handles)) =
21641                fidl::encoding::decode_envelope_header(decoder, next_offset)?
21642            {
21643                let member_inline_size = <fidl::encoding::HandleType<
21644                    fidl::EventPair,
21645                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21646                    2147483648,
21647                > as fidl::encoding::TypeMarker>::inline_size(
21648                    decoder.context
21649                );
21650                if inlined != (member_inline_size <= 4) {
21651                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
21652                }
21653                let inner_offset;
21654                let mut inner_depth = depth.clone();
21655                if inlined {
21656                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21657                    inner_offset = next_offset;
21658                } else {
21659                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21660                    inner_depth.increment()?;
21661                }
21662                let val_ref =
21663                self.dictionary.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
21664                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
21665                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21666                {
21667                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
21668                }
21669                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21670                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21671                }
21672            }
21673
21674            next_offset += envelope_size;
21675            _next_ordinal_to_read += 1;
21676            if next_offset >= end_offset {
21677                return Ok(());
21678            }
21679
21680            // Decode unknown envelopes for gaps in ordinals.
21681            while _next_ordinal_to_read < 2 {
21682                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21683                _next_ordinal_to_read += 1;
21684                next_offset += envelope_size;
21685            }
21686
21687            let next_out_of_line = decoder.next_out_of_line();
21688            let handles_before = decoder.remaining_handles();
21689            if let Some((inlined, num_bytes, num_handles)) =
21690                fidl::encoding::decode_envelope_header(decoder, next_offset)?
21691            {
21692                let member_inline_size =
21693                    <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
21694                        decoder.context,
21695                    );
21696                if inlined != (member_inline_size <= 4) {
21697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
21698                }
21699                let inner_offset;
21700                let mut inner_depth = depth.clone();
21701                if inlined {
21702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21703                    inner_offset = next_offset;
21704                } else {
21705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21706                    inner_depth.increment()?;
21707                }
21708                let val_ref = self.key.get_or_insert_with(|| {
21709                    fidl::new_empty!(
21710                        fidl::encoding::BoundedString<100>,
21711                        fidl::encoding::DefaultFuchsiaResourceDialect
21712                    )
21713                });
21714                fidl::decode!(
21715                    fidl::encoding::BoundedString<100>,
21716                    fidl::encoding::DefaultFuchsiaResourceDialect,
21717                    val_ref,
21718                    decoder,
21719                    inner_offset,
21720                    inner_depth
21721                )?;
21722                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21723                {
21724                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
21725                }
21726                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21727                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21728                }
21729            }
21730
21731            next_offset += envelope_size;
21732            _next_ordinal_to_read += 1;
21733            if next_offset >= end_offset {
21734                return Ok(());
21735            }
21736
21737            // Decode unknown envelopes for gaps in ordinals.
21738            while _next_ordinal_to_read < 3 {
21739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21740                _next_ordinal_to_read += 1;
21741                next_offset += envelope_size;
21742            }
21743
21744            let next_out_of_line = decoder.next_out_of_line();
21745            let handles_before = decoder.remaining_handles();
21746            if let Some((inlined, num_bytes, num_handles)) =
21747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
21748            {
21749                let member_inline_size = <fidl::encoding::HandleType<
21750                    fidl::EventPair,
21751                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21752                    2147483648,
21753                > as fidl::encoding::TypeMarker>::inline_size(
21754                    decoder.context
21755                );
21756                if inlined != (member_inline_size <= 4) {
21757                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
21758                }
21759                let inner_offset;
21760                let mut inner_depth = depth.clone();
21761                if inlined {
21762                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21763                    inner_offset = next_offset;
21764                } else {
21765                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21766                    inner_depth.increment()?;
21767                }
21768                let val_ref =
21769                self.value.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
21770                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
21771                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21772                {
21773                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
21774                }
21775                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21776                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21777                }
21778            }
21779
21780            next_offset += envelope_size;
21781
21782            // Decode the remaining unknown envelopes.
21783            while next_offset < end_offset {
21784                _next_ordinal_to_read += 1;
21785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21786                next_offset += envelope_size;
21787            }
21788
21789            Ok(())
21790        }
21791    }
21792
21793    impl CapabilitiesDirConnectorOpenRequest {
21794        #[inline(always)]
21795        fn max_ordinal_present(&self) -> u64 {
21796            if let Some(_) = self.subdir {
21797                return 4;
21798            }
21799            if let Some(_) = self.rights {
21800                return 3;
21801            }
21802            if let Some(_) = self.channel {
21803                return 2;
21804            }
21805            if let Some(_) = self.dir_connector {
21806                return 1;
21807            }
21808            0
21809        }
21810    }
21811
21812    impl fidl::encoding::ResourceTypeMarker for CapabilitiesDirConnectorOpenRequest {
21813        type Borrowed<'a> = &'a mut Self;
21814        fn take_or_borrow<'a>(
21815            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
21816        ) -> Self::Borrowed<'a> {
21817            value
21818        }
21819    }
21820
21821    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorOpenRequest {
21822        type Owned = Self;
21823
21824        #[inline(always)]
21825        fn inline_align(_context: fidl::encoding::Context) -> usize {
21826            8
21827        }
21828
21829        #[inline(always)]
21830        fn inline_size(_context: fidl::encoding::Context) -> usize {
21831            16
21832        }
21833    }
21834
21835    unsafe impl
21836        fidl::encoding::Encode<
21837            CapabilitiesDirConnectorOpenRequest,
21838            fidl::encoding::DefaultFuchsiaResourceDialect,
21839        > for &mut CapabilitiesDirConnectorOpenRequest
21840    {
21841        unsafe fn encode(
21842            self,
21843            encoder: &mut fidl::encoding::Encoder<
21844                '_,
21845                fidl::encoding::DefaultFuchsiaResourceDialect,
21846            >,
21847            offset: usize,
21848            mut depth: fidl::encoding::Depth,
21849        ) -> fidl::Result<()> {
21850            encoder.debug_check_bounds::<CapabilitiesDirConnectorOpenRequest>(offset);
21851            // Vector header
21852            let max_ordinal: u64 = self.max_ordinal_present();
21853            encoder.write_num(max_ordinal, offset);
21854            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21855            // Calling encoder.out_of_line_offset(0) is not allowed.
21856            if max_ordinal == 0 {
21857                return Ok(());
21858            }
21859            depth.increment()?;
21860            let envelope_size = 8;
21861            let bytes_len = max_ordinal as usize * envelope_size;
21862            #[allow(unused_variables)]
21863            let offset = encoder.out_of_line_offset(bytes_len);
21864            let mut _prev_end_offset: usize = 0;
21865            if 1 > max_ordinal {
21866                return Ok(());
21867            }
21868
21869            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21870            // are envelope_size bytes.
21871            let cur_offset: usize = (1 - 1) * envelope_size;
21872
21873            // Zero reserved fields.
21874            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21875
21876            // Safety:
21877            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21878            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21879            //   envelope_size bytes, there is always sufficient room.
21880            fidl::encoding::encode_in_envelope_optional::<
21881                fidl::encoding::HandleType<
21882                    fidl::EventPair,
21883                    { fidl::ObjectType::EVENTPAIR.into_raw() },
21884                    2147483648,
21885                >,
21886                fidl::encoding::DefaultFuchsiaResourceDialect,
21887            >(
21888                self.dir_connector.as_mut().map(
21889                    <fidl::encoding::HandleType<
21890                        fidl::EventPair,
21891                        { fidl::ObjectType::EVENTPAIR.into_raw() },
21892                        2147483648,
21893                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
21894                ),
21895                encoder,
21896                offset + cur_offset,
21897                depth,
21898            )?;
21899
21900            _prev_end_offset = cur_offset + envelope_size;
21901            if 2 > max_ordinal {
21902                return Ok(());
21903            }
21904
21905            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21906            // are envelope_size bytes.
21907            let cur_offset: usize = (2 - 1) * envelope_size;
21908
21909            // Zero reserved fields.
21910            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21911
21912            // Safety:
21913            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21914            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21915            //   envelope_size bytes, there is always sufficient room.
21916            fidl::encoding::encode_in_envelope_optional::<
21917                fidl::encoding::Endpoint<
21918                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21919                >,
21920                fidl::encoding::DefaultFuchsiaResourceDialect,
21921            >(
21922                self.channel.as_mut().map(
21923                    <fidl::encoding::Endpoint<
21924                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
21925                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
21926                ),
21927                encoder,
21928                offset + cur_offset,
21929                depth,
21930            )?;
21931
21932            _prev_end_offset = cur_offset + envelope_size;
21933            if 3 > max_ordinal {
21934                return Ok(());
21935            }
21936
21937            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21938            // are envelope_size bytes.
21939            let cur_offset: usize = (3 - 1) * envelope_size;
21940
21941            // Zero reserved fields.
21942            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21943
21944            // Safety:
21945            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21946            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21947            //   envelope_size bytes, there is always sufficient room.
21948            fidl::encoding::encode_in_envelope_optional::<
21949                fidl_fuchsia_io::Flags,
21950                fidl::encoding::DefaultFuchsiaResourceDialect,
21951            >(
21952                self.rights
21953                    .as_ref()
21954                    .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
21955                encoder,
21956                offset + cur_offset,
21957                depth,
21958            )?;
21959
21960            _prev_end_offset = cur_offset + envelope_size;
21961            if 4 > max_ordinal {
21962                return Ok(());
21963            }
21964
21965            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
21966            // are envelope_size bytes.
21967            let cur_offset: usize = (4 - 1) * envelope_size;
21968
21969            // Zero reserved fields.
21970            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21971
21972            // Safety:
21973            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
21974            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
21975            //   envelope_size bytes, there is always sufficient room.
21976            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
21977            self.subdir.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
21978            encoder, offset + cur_offset, depth
21979        )?;
21980
21981            _prev_end_offset = cur_offset + envelope_size;
21982
21983            Ok(())
21984        }
21985    }
21986
21987    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
21988        for CapabilitiesDirConnectorOpenRequest
21989    {
21990        #[inline(always)]
21991        fn new_empty() -> Self {
21992            Self::default()
21993        }
21994
21995        unsafe fn decode(
21996            &mut self,
21997            decoder: &mut fidl::encoding::Decoder<
21998                '_,
21999                fidl::encoding::DefaultFuchsiaResourceDialect,
22000            >,
22001            offset: usize,
22002            mut depth: fidl::encoding::Depth,
22003        ) -> fidl::Result<()> {
22004            decoder.debug_check_bounds::<Self>(offset);
22005            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22006                None => return Err(fidl::Error::NotNullable),
22007                Some(len) => len,
22008            };
22009            // Calling decoder.out_of_line_offset(0) is not allowed.
22010            if len == 0 {
22011                return Ok(());
22012            };
22013            depth.increment()?;
22014            let envelope_size = 8;
22015            let bytes_len = len * envelope_size;
22016            let offset = decoder.out_of_line_offset(bytes_len)?;
22017            // Decode the envelope for each type.
22018            let mut _next_ordinal_to_read = 0;
22019            let mut next_offset = offset;
22020            let end_offset = offset + bytes_len;
22021            _next_ordinal_to_read += 1;
22022            if next_offset >= end_offset {
22023                return Ok(());
22024            }
22025
22026            // Decode unknown envelopes for gaps in ordinals.
22027            while _next_ordinal_to_read < 1 {
22028                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22029                _next_ordinal_to_read += 1;
22030                next_offset += envelope_size;
22031            }
22032
22033            let next_out_of_line = decoder.next_out_of_line();
22034            let handles_before = decoder.remaining_handles();
22035            if let Some((inlined, num_bytes, num_handles)) =
22036                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22037            {
22038                let member_inline_size = <fidl::encoding::HandleType<
22039                    fidl::EventPair,
22040                    { fidl::ObjectType::EVENTPAIR.into_raw() },
22041                    2147483648,
22042                > as fidl::encoding::TypeMarker>::inline_size(
22043                    decoder.context
22044                );
22045                if inlined != (member_inline_size <= 4) {
22046                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22047                }
22048                let inner_offset;
22049                let mut inner_depth = depth.clone();
22050                if inlined {
22051                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22052                    inner_offset = next_offset;
22053                } else {
22054                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22055                    inner_depth.increment()?;
22056                }
22057                let val_ref =
22058                self.dir_connector.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
22059                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
22060                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22061                {
22062                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22063                }
22064                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22065                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22066                }
22067            }
22068
22069            next_offset += envelope_size;
22070            _next_ordinal_to_read += 1;
22071            if next_offset >= end_offset {
22072                return Ok(());
22073            }
22074
22075            // Decode unknown envelopes for gaps in ordinals.
22076            while _next_ordinal_to_read < 2 {
22077                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22078                _next_ordinal_to_read += 1;
22079                next_offset += envelope_size;
22080            }
22081
22082            let next_out_of_line = decoder.next_out_of_line();
22083            let handles_before = decoder.remaining_handles();
22084            if let Some((inlined, num_bytes, num_handles)) =
22085                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22086            {
22087                let member_inline_size = <fidl::encoding::Endpoint<
22088                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
22089                > as fidl::encoding::TypeMarker>::inline_size(
22090                    decoder.context
22091                );
22092                if inlined != (member_inline_size <= 4) {
22093                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22094                }
22095                let inner_offset;
22096                let mut inner_depth = depth.clone();
22097                if inlined {
22098                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22099                    inner_offset = next_offset;
22100                } else {
22101                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22102                    inner_depth.increment()?;
22103                }
22104                let val_ref = self.channel.get_or_insert_with(|| {
22105                    fidl::new_empty!(
22106                        fidl::encoding::Endpoint<
22107                            fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
22108                        >,
22109                        fidl::encoding::DefaultFuchsiaResourceDialect
22110                    )
22111                });
22112                fidl::decode!(
22113                    fidl::encoding::Endpoint<
22114                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
22115                    >,
22116                    fidl::encoding::DefaultFuchsiaResourceDialect,
22117                    val_ref,
22118                    decoder,
22119                    inner_offset,
22120                    inner_depth
22121                )?;
22122                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22123                {
22124                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22125                }
22126                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22127                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22128                }
22129            }
22130
22131            next_offset += envelope_size;
22132            _next_ordinal_to_read += 1;
22133            if next_offset >= end_offset {
22134                return Ok(());
22135            }
22136
22137            // Decode unknown envelopes for gaps in ordinals.
22138            while _next_ordinal_to_read < 3 {
22139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22140                _next_ordinal_to_read += 1;
22141                next_offset += envelope_size;
22142            }
22143
22144            let next_out_of_line = decoder.next_out_of_line();
22145            let handles_before = decoder.remaining_handles();
22146            if let Some((inlined, num_bytes, num_handles)) =
22147                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22148            {
22149                let member_inline_size =
22150                    <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
22151                        decoder.context,
22152                    );
22153                if inlined != (member_inline_size <= 4) {
22154                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22155                }
22156                let inner_offset;
22157                let mut inner_depth = depth.clone();
22158                if inlined {
22159                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22160                    inner_offset = next_offset;
22161                } else {
22162                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22163                    inner_depth.increment()?;
22164                }
22165                let val_ref = self.rights.get_or_insert_with(|| {
22166                    fidl::new_empty!(
22167                        fidl_fuchsia_io::Flags,
22168                        fidl::encoding::DefaultFuchsiaResourceDialect
22169                    )
22170                });
22171                fidl::decode!(
22172                    fidl_fuchsia_io::Flags,
22173                    fidl::encoding::DefaultFuchsiaResourceDialect,
22174                    val_ref,
22175                    decoder,
22176                    inner_offset,
22177                    inner_depth
22178                )?;
22179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22180                {
22181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22182                }
22183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22185                }
22186            }
22187
22188            next_offset += envelope_size;
22189            _next_ordinal_to_read += 1;
22190            if next_offset >= end_offset {
22191                return Ok(());
22192            }
22193
22194            // Decode unknown envelopes for gaps in ordinals.
22195            while _next_ordinal_to_read < 4 {
22196                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22197                _next_ordinal_to_read += 1;
22198                next_offset += envelope_size;
22199            }
22200
22201            let next_out_of_line = decoder.next_out_of_line();
22202            let handles_before = decoder.remaining_handles();
22203            if let Some((inlined, num_bytes, num_handles)) =
22204                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22205            {
22206                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22207                if inlined != (member_inline_size <= 4) {
22208                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22209                }
22210                let inner_offset;
22211                let mut inner_depth = depth.clone();
22212                if inlined {
22213                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22214                    inner_offset = next_offset;
22215                } else {
22216                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22217                    inner_depth.increment()?;
22218                }
22219                let val_ref = self.subdir.get_or_insert_with(|| {
22220                    fidl::new_empty!(
22221                        fidl::encoding::BoundedString<1024>,
22222                        fidl::encoding::DefaultFuchsiaResourceDialect
22223                    )
22224                });
22225                fidl::decode!(
22226                    fidl::encoding::BoundedString<1024>,
22227                    fidl::encoding::DefaultFuchsiaResourceDialect,
22228                    val_ref,
22229                    decoder,
22230                    inner_offset,
22231                    inner_depth
22232                )?;
22233                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22234                {
22235                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22236                }
22237                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22238                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22239                }
22240            }
22241
22242            next_offset += envelope_size;
22243
22244            // Decode the remaining unknown envelopes.
22245            while next_offset < end_offset {
22246                _next_ordinal_to_read += 1;
22247                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22248                next_offset += envelope_size;
22249            }
22250
22251            Ok(())
22252        }
22253    }
22254
22255    impl RouteRequest {
22256        #[inline(always)]
22257        fn max_ordinal_present(&self) -> u64 {
22258            if let Some(_) = self.metadata {
22259                return 2;
22260            }
22261            if let Some(_) = self.target {
22262                return 1;
22263            }
22264            0
22265        }
22266    }
22267
22268    impl fidl::encoding::ResourceTypeMarker for RouteRequest {
22269        type Borrowed<'a> = &'a mut Self;
22270        fn take_or_borrow<'a>(
22271            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22272        ) -> Self::Borrowed<'a> {
22273            value
22274        }
22275    }
22276
22277    unsafe impl fidl::encoding::TypeMarker for RouteRequest {
22278        type Owned = Self;
22279
22280        #[inline(always)]
22281        fn inline_align(_context: fidl::encoding::Context) -> usize {
22282            8
22283        }
22284
22285        #[inline(always)]
22286        fn inline_size(_context: fidl::encoding::Context) -> usize {
22287            16
22288        }
22289    }
22290
22291    unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
22292        for &mut RouteRequest
22293    {
22294        unsafe fn encode(
22295            self,
22296            encoder: &mut fidl::encoding::Encoder<
22297                '_,
22298                fidl::encoding::DefaultFuchsiaResourceDialect,
22299            >,
22300            offset: usize,
22301            mut depth: fidl::encoding::Depth,
22302        ) -> fidl::Result<()> {
22303            encoder.debug_check_bounds::<RouteRequest>(offset);
22304            // Vector header
22305            let max_ordinal: u64 = self.max_ordinal_present();
22306            encoder.write_num(max_ordinal, offset);
22307            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22308            // Calling encoder.out_of_line_offset(0) is not allowed.
22309            if max_ordinal == 0 {
22310                return Ok(());
22311            }
22312            depth.increment()?;
22313            let envelope_size = 8;
22314            let bytes_len = max_ordinal as usize * envelope_size;
22315            #[allow(unused_variables)]
22316            let offset = encoder.out_of_line_offset(bytes_len);
22317            let mut _prev_end_offset: usize = 0;
22318            if 1 > max_ordinal {
22319                return Ok(());
22320            }
22321
22322            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22323            // are envelope_size bytes.
22324            let cur_offset: usize = (1 - 1) * envelope_size;
22325
22326            // Zero reserved fields.
22327            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22328
22329            // Safety:
22330            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22331            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22332            //   envelope_size bytes, there is always sufficient room.
22333            fidl::encoding::encode_in_envelope_optional::<
22334                WeakInstanceToken,
22335                fidl::encoding::DefaultFuchsiaResourceDialect,
22336            >(
22337                self.target
22338                    .as_mut()
22339                    .map(<WeakInstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
22340                encoder,
22341                offset + cur_offset,
22342                depth,
22343            )?;
22344
22345            _prev_end_offset = cur_offset + envelope_size;
22346            if 2 > max_ordinal {
22347                return Ok(());
22348            }
22349
22350            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
22351            // are envelope_size bytes.
22352            let cur_offset: usize = (2 - 1) * envelope_size;
22353
22354            // Zero reserved fields.
22355            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22356
22357            // Safety:
22358            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
22359            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
22360            //   envelope_size bytes, there is always sufficient room.
22361            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22362            self.metadata.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
22363            encoder, offset + cur_offset, depth
22364        )?;
22365
22366            _prev_end_offset = cur_offset + envelope_size;
22367
22368            Ok(())
22369        }
22370    }
22371
22372    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
22373        #[inline(always)]
22374        fn new_empty() -> Self {
22375            Self::default()
22376        }
22377
22378        unsafe fn decode(
22379            &mut self,
22380            decoder: &mut fidl::encoding::Decoder<
22381                '_,
22382                fidl::encoding::DefaultFuchsiaResourceDialect,
22383            >,
22384            offset: usize,
22385            mut depth: fidl::encoding::Depth,
22386        ) -> fidl::Result<()> {
22387            decoder.debug_check_bounds::<Self>(offset);
22388            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22389                None => return Err(fidl::Error::NotNullable),
22390                Some(len) => len,
22391            };
22392            // Calling decoder.out_of_line_offset(0) is not allowed.
22393            if len == 0 {
22394                return Ok(());
22395            };
22396            depth.increment()?;
22397            let envelope_size = 8;
22398            let bytes_len = len * envelope_size;
22399            let offset = decoder.out_of_line_offset(bytes_len)?;
22400            // Decode the envelope for each type.
22401            let mut _next_ordinal_to_read = 0;
22402            let mut next_offset = offset;
22403            let end_offset = offset + bytes_len;
22404            _next_ordinal_to_read += 1;
22405            if next_offset >= end_offset {
22406                return Ok(());
22407            }
22408
22409            // Decode unknown envelopes for gaps in ordinals.
22410            while _next_ordinal_to_read < 1 {
22411                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22412                _next_ordinal_to_read += 1;
22413                next_offset += envelope_size;
22414            }
22415
22416            let next_out_of_line = decoder.next_out_of_line();
22417            let handles_before = decoder.remaining_handles();
22418            if let Some((inlined, num_bytes, num_handles)) =
22419                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22420            {
22421                let member_inline_size =
22422                    <WeakInstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22423                if inlined != (member_inline_size <= 4) {
22424                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22425                }
22426                let inner_offset;
22427                let mut inner_depth = depth.clone();
22428                if inlined {
22429                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22430                    inner_offset = next_offset;
22431                } else {
22432                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22433                    inner_depth.increment()?;
22434                }
22435                let val_ref = self.target.get_or_insert_with(|| {
22436                    fidl::new_empty!(
22437                        WeakInstanceToken,
22438                        fidl::encoding::DefaultFuchsiaResourceDialect
22439                    )
22440                });
22441                fidl::decode!(
22442                    WeakInstanceToken,
22443                    fidl::encoding::DefaultFuchsiaResourceDialect,
22444                    val_ref,
22445                    decoder,
22446                    inner_offset,
22447                    inner_depth
22448                )?;
22449                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22450                {
22451                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22452                }
22453                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22454                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22455                }
22456            }
22457
22458            next_offset += envelope_size;
22459            _next_ordinal_to_read += 1;
22460            if next_offset >= end_offset {
22461                return Ok(());
22462            }
22463
22464            // Decode unknown envelopes for gaps in ordinals.
22465            while _next_ordinal_to_read < 2 {
22466                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22467                _next_ordinal_to_read += 1;
22468                next_offset += envelope_size;
22469            }
22470
22471            let next_out_of_line = decoder.next_out_of_line();
22472            let handles_before = decoder.remaining_handles();
22473            if let Some((inlined, num_bytes, num_handles)) =
22474                fidl::encoding::decode_envelope_header(decoder, next_offset)?
22475            {
22476                let member_inline_size = <fidl::encoding::Endpoint<
22477                    fidl::endpoints::ClientEnd<DictionaryMarker>,
22478                > as fidl::encoding::TypeMarker>::inline_size(
22479                    decoder.context
22480                );
22481                if inlined != (member_inline_size <= 4) {
22482                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
22483                }
22484                let inner_offset;
22485                let mut inner_depth = depth.clone();
22486                if inlined {
22487                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22488                    inner_offset = next_offset;
22489                } else {
22490                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22491                    inner_depth.increment()?;
22492                }
22493                let val_ref = self.metadata.get_or_insert_with(|| {
22494                    fidl::new_empty!(
22495                        fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>,
22496                        fidl::encoding::DefaultFuchsiaResourceDialect
22497                    )
22498                });
22499                fidl::decode!(
22500                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>,
22501                    fidl::encoding::DefaultFuchsiaResourceDialect,
22502                    val_ref,
22503                    decoder,
22504                    inner_offset,
22505                    inner_depth
22506                )?;
22507                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22508                {
22509                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
22510                }
22511                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22512                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22513                }
22514            }
22515
22516            next_offset += envelope_size;
22517
22518            // Decode the remaining unknown envelopes.
22519            while next_offset < end_offset {
22520                _next_ordinal_to_read += 1;
22521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22522                next_offset += envelope_size;
22523            }
22524
22525            Ok(())
22526        }
22527    }
22528
22529    impl fidl::encoding::ResourceTypeMarker for CapabilityDeprecated {
22530        type Borrowed<'a> = &'a mut Self;
22531        fn take_or_borrow<'a>(
22532            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
22533        ) -> Self::Borrowed<'a> {
22534            value
22535        }
22536    }
22537
22538    unsafe impl fidl::encoding::TypeMarker for CapabilityDeprecated {
22539        type Owned = Self;
22540
22541        #[inline(always)]
22542        fn inline_align(_context: fidl::encoding::Context) -> usize {
22543            8
22544        }
22545
22546        #[inline(always)]
22547        fn inline_size(_context: fidl::encoding::Context) -> usize {
22548            16
22549        }
22550    }
22551
22552    unsafe impl
22553        fidl::encoding::Encode<CapabilityDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
22554        for &mut CapabilityDeprecated
22555    {
22556        #[inline]
22557        unsafe fn encode(
22558            self,
22559            encoder: &mut fidl::encoding::Encoder<
22560                '_,
22561                fidl::encoding::DefaultFuchsiaResourceDialect,
22562            >,
22563            offset: usize,
22564            _depth: fidl::encoding::Depth,
22565        ) -> fidl::Result<()> {
22566            encoder.debug_check_bounds::<CapabilityDeprecated>(offset);
22567            encoder.write_num::<u64>(self.ordinal(), offset);
22568            match self {
22569            CapabilityDeprecated::Connector(ref mut val) => {
22570                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22571                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22572                    encoder, offset + 8, _depth
22573                )
22574            }
22575            CapabilityDeprecated::DirConnector(ref mut val) => {
22576                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22577                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22578                    encoder, offset + 8, _depth
22579                )
22580            }
22581            CapabilityDeprecated::Dictionary(ref mut val) => {
22582                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22583                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22584                    encoder, offset + 8, _depth
22585                )
22586            }
22587            CapabilityDeprecated::Data(ref val) => {
22588                fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
22589                    <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
22590                    encoder, offset + 8, _depth
22591                )
22592            }
22593            CapabilityDeprecated::ConnectorRouter(ref mut val) => {
22594                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22595                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22596                    encoder, offset + 8, _depth
22597                )
22598            }
22599            CapabilityDeprecated::DirConnectorRouter(ref mut val) => {
22600                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22601                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22602                    encoder, offset + 8, _depth
22603                )
22604            }
22605            CapabilityDeprecated::DictionaryRouter(ref mut val) => {
22606                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22607                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22608                    encoder, offset + 8, _depth
22609                )
22610            }
22611            CapabilityDeprecated::DataRouter(ref mut val) => {
22612                fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
22613                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
22614                    encoder, offset + 8, _depth
22615                )
22616            }
22617            CapabilityDeprecated::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
22618        }
22619        }
22620    }
22621
22622    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
22623        for CapabilityDeprecated
22624    {
22625        #[inline(always)]
22626        fn new_empty() -> Self {
22627            Self::__SourceBreaking { unknown_ordinal: 0 }
22628        }
22629
22630        #[inline]
22631        unsafe fn decode(
22632            &mut self,
22633            decoder: &mut fidl::encoding::Decoder<
22634                '_,
22635                fidl::encoding::DefaultFuchsiaResourceDialect,
22636            >,
22637            offset: usize,
22638            mut depth: fidl::encoding::Depth,
22639        ) -> fidl::Result<()> {
22640            decoder.debug_check_bounds::<Self>(offset);
22641            #[allow(unused_variables)]
22642            let next_out_of_line = decoder.next_out_of_line();
22643            let handles_before = decoder.remaining_handles();
22644            let (ordinal, inlined, num_bytes, num_handles) =
22645                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
22646
22647            let member_inline_size = match ordinal {
22648            1 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22649            2 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22650            3 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22651            4 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22652            5 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22653            6 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22654            7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22655            8 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22656            0 => return Err(fidl::Error::UnknownUnionTag),
22657            _ => num_bytes as usize,
22658        };
22659
22660            if inlined != (member_inline_size <= 4) {
22661                return Err(fidl::Error::InvalidInlineBitInEnvelope);
22662            }
22663            let _inner_offset;
22664            if inlined {
22665                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
22666                _inner_offset = offset + 8;
22667            } else {
22668                depth.increment()?;
22669                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22670            }
22671            match ordinal {
22672                1 => {
22673                    #[allow(irrefutable_let_patterns)]
22674                    if let CapabilityDeprecated::Connector(_) = self {
22675                        // Do nothing, read the value into the object
22676                    } else {
22677                        // Initialize `self` to the right variant
22678                        *self = CapabilityDeprecated::Connector(fidl::new_empty!(
22679                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorMarker>>,
22680                            fidl::encoding::DefaultFuchsiaResourceDialect
22681                        ));
22682                    }
22683                    #[allow(irrefutable_let_patterns)]
22684                    if let CapabilityDeprecated::Connector(ref mut val) = self {
22685                        fidl::decode!(
22686                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorMarker>>,
22687                            fidl::encoding::DefaultFuchsiaResourceDialect,
22688                            val,
22689                            decoder,
22690                            _inner_offset,
22691                            depth
22692                        )?;
22693                    } else {
22694                        unreachable!()
22695                    }
22696                }
22697                2 => {
22698                    #[allow(irrefutable_let_patterns)]
22699                    if let CapabilityDeprecated::DirConnector(_) = self {
22700                        // Do nothing, read the value into the object
22701                    } else {
22702                        // Initialize `self` to the right variant
22703                        *self = CapabilityDeprecated::DirConnector(fidl::new_empty!(
22704                            fidl::encoding::Endpoint<
22705                                fidl::endpoints::ClientEnd<DirConnectorMarker>,
22706                            >,
22707                            fidl::encoding::DefaultFuchsiaResourceDialect
22708                        ));
22709                    }
22710                    #[allow(irrefutable_let_patterns)]
22711                    if let CapabilityDeprecated::DirConnector(ref mut val) = self {
22712                        fidl::decode!(
22713                            fidl::encoding::Endpoint<
22714                                fidl::endpoints::ClientEnd<DirConnectorMarker>,
22715                            >,
22716                            fidl::encoding::DefaultFuchsiaResourceDialect,
22717                            val,
22718                            decoder,
22719                            _inner_offset,
22720                            depth
22721                        )?;
22722                    } else {
22723                        unreachable!()
22724                    }
22725                }
22726                3 => {
22727                    #[allow(irrefutable_let_patterns)]
22728                    if let CapabilityDeprecated::Dictionary(_) = self {
22729                        // Do nothing, read the value into the object
22730                    } else {
22731                        // Initialize `self` to the right variant
22732                        *self = CapabilityDeprecated::Dictionary(fidl::new_empty!(
22733                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>,
22734                            fidl::encoding::DefaultFuchsiaResourceDialect
22735                        ));
22736                    }
22737                    #[allow(irrefutable_let_patterns)]
22738                    if let CapabilityDeprecated::Dictionary(ref mut val) = self {
22739                        fidl::decode!(
22740                            fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryMarker>>,
22741                            fidl::encoding::DefaultFuchsiaResourceDialect,
22742                            val,
22743                            decoder,
22744                            _inner_offset,
22745                            depth
22746                        )?;
22747                    } else {
22748                        unreachable!()
22749                    }
22750                }
22751                4 => {
22752                    #[allow(irrefutable_let_patterns)]
22753                    if let CapabilityDeprecated::Data(_) = self {
22754                        // Do nothing, read the value into the object
22755                    } else {
22756                        // Initialize `self` to the right variant
22757                        *self = CapabilityDeprecated::Data(fidl::new_empty!(
22758                            Data,
22759                            fidl::encoding::DefaultFuchsiaResourceDialect
22760                        ));
22761                    }
22762                    #[allow(irrefutable_let_patterns)]
22763                    if let CapabilityDeprecated::Data(ref mut val) = self {
22764                        fidl::decode!(
22765                            Data,
22766                            fidl::encoding::DefaultFuchsiaResourceDialect,
22767                            val,
22768                            decoder,
22769                            _inner_offset,
22770                            depth
22771                        )?;
22772                    } else {
22773                        unreachable!()
22774                    }
22775                }
22776                5 => {
22777                    #[allow(irrefutable_let_patterns)]
22778                    if let CapabilityDeprecated::ConnectorRouter(_) = self {
22779                        // Do nothing, read the value into the object
22780                    } else {
22781                        // Initialize `self` to the right variant
22782                        *self = CapabilityDeprecated::ConnectorRouter(fidl::new_empty!(
22783                            fidl::encoding::Endpoint<
22784                                fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
22785                            >,
22786                            fidl::encoding::DefaultFuchsiaResourceDialect
22787                        ));
22788                    }
22789                    #[allow(irrefutable_let_patterns)]
22790                    if let CapabilityDeprecated::ConnectorRouter(ref mut val) = self {
22791                        fidl::decode!(
22792                            fidl::encoding::Endpoint<
22793                                fidl::endpoints::ClientEnd<ConnectorRouterDeprecatedMarker>,
22794                            >,
22795                            fidl::encoding::DefaultFuchsiaResourceDialect,
22796                            val,
22797                            decoder,
22798                            _inner_offset,
22799                            depth
22800                        )?;
22801                    } else {
22802                        unreachable!()
22803                    }
22804                }
22805                6 => {
22806                    #[allow(irrefutable_let_patterns)]
22807                    if let CapabilityDeprecated::DirConnectorRouter(_) = self {
22808                        // Do nothing, read the value into the object
22809                    } else {
22810                        // Initialize `self` to the right variant
22811                        *self = CapabilityDeprecated::DirConnectorRouter(fidl::new_empty!(
22812                            fidl::encoding::Endpoint<
22813                                fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
22814                            >,
22815                            fidl::encoding::DefaultFuchsiaResourceDialect
22816                        ));
22817                    }
22818                    #[allow(irrefutable_let_patterns)]
22819                    if let CapabilityDeprecated::DirConnectorRouter(ref mut val) = self {
22820                        fidl::decode!(
22821                            fidl::encoding::Endpoint<
22822                                fidl::endpoints::ClientEnd<DirConnectorRouterDeprecatedMarker>,
22823                            >,
22824                            fidl::encoding::DefaultFuchsiaResourceDialect,
22825                            val,
22826                            decoder,
22827                            _inner_offset,
22828                            depth
22829                        )?;
22830                    } else {
22831                        unreachable!()
22832                    }
22833                }
22834                7 => {
22835                    #[allow(irrefutable_let_patterns)]
22836                    if let CapabilityDeprecated::DictionaryRouter(_) = self {
22837                        // Do nothing, read the value into the object
22838                    } else {
22839                        // Initialize `self` to the right variant
22840                        *self = CapabilityDeprecated::DictionaryRouter(fidl::new_empty!(
22841                            fidl::encoding::Endpoint<
22842                                fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
22843                            >,
22844                            fidl::encoding::DefaultFuchsiaResourceDialect
22845                        ));
22846                    }
22847                    #[allow(irrefutable_let_patterns)]
22848                    if let CapabilityDeprecated::DictionaryRouter(ref mut val) = self {
22849                        fidl::decode!(
22850                            fidl::encoding::Endpoint<
22851                                fidl::endpoints::ClientEnd<DictionaryRouterDeprecatedMarker>,
22852                            >,
22853                            fidl::encoding::DefaultFuchsiaResourceDialect,
22854                            val,
22855                            decoder,
22856                            _inner_offset,
22857                            depth
22858                        )?;
22859                    } else {
22860                        unreachable!()
22861                    }
22862                }
22863                8 => {
22864                    #[allow(irrefutable_let_patterns)]
22865                    if let CapabilityDeprecated::DataRouter(_) = self {
22866                        // Do nothing, read the value into the object
22867                    } else {
22868                        // Initialize `self` to the right variant
22869                        *self = CapabilityDeprecated::DataRouter(fidl::new_empty!(
22870                            fidl::encoding::Endpoint<
22871                                fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
22872                            >,
22873                            fidl::encoding::DefaultFuchsiaResourceDialect
22874                        ));
22875                    }
22876                    #[allow(irrefutable_let_patterns)]
22877                    if let CapabilityDeprecated::DataRouter(ref mut val) = self {
22878                        fidl::decode!(
22879                            fidl::encoding::Endpoint<
22880                                fidl::endpoints::ClientEnd<DataRouterDeprecatedMarker>,
22881                            >,
22882                            fidl::encoding::DefaultFuchsiaResourceDialect,
22883                            val,
22884                            decoder,
22885                            _inner_offset,
22886                            depth
22887                        )?;
22888                    } else {
22889                        unreachable!()
22890                    }
22891                }
22892                #[allow(deprecated)]
22893                ordinal => {
22894                    for _ in 0..num_handles {
22895                        decoder.drop_next_handle()?;
22896                    }
22897                    *self = CapabilityDeprecated::__SourceBreaking { unknown_ordinal: ordinal };
22898                }
22899            }
22900            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
22901                return Err(fidl::Error::InvalidNumBytesInEnvelope);
22902            }
22903            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22904                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22905            }
22906            Ok(())
22907        }
22908    }
22909}