fidl_fuchsia_component_runtime__common/
fidl_fuchsia_component_runtime__common.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::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const MAX_DATA_LENGTH: u32 = 8192;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14pub enum CapabilitiesError {
15    NoSuchCapability,
16    InvalidName,
17    HandleDoesNotReferenceCapability,
18    InvalidCapabilityType,
19    UnregisteredCapability,
20    InvalidHandle,
21    HandleAlreadyRegistered,
22    InvalidData,
23    InvalidArgs,
24    #[doc(hidden)]
25    __SourceBreaking {
26        unknown_ordinal: u32,
27    },
28}
29
30/// Pattern that matches an unknown `CapabilitiesError` member.
31#[macro_export]
32macro_rules! CapabilitiesErrorUnknown {
33    () => {
34        _
35    };
36}
37
38impl CapabilitiesError {
39    #[inline]
40    pub fn from_primitive(prim: u32) -> Option<Self> {
41        match prim {
42            1 => Some(Self::NoSuchCapability),
43            2 => Some(Self::InvalidName),
44            3 => Some(Self::HandleDoesNotReferenceCapability),
45            4 => Some(Self::InvalidCapabilityType),
46            5 => Some(Self::UnregisteredCapability),
47            6 => Some(Self::InvalidHandle),
48            7 => Some(Self::HandleAlreadyRegistered),
49            8 => Some(Self::InvalidData),
50            9 => Some(Self::InvalidArgs),
51            _ => None,
52        }
53    }
54
55    #[inline]
56    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
57        match prim {
58            1 => Self::NoSuchCapability,
59            2 => Self::InvalidName,
60            3 => Self::HandleDoesNotReferenceCapability,
61            4 => Self::InvalidCapabilityType,
62            5 => Self::UnregisteredCapability,
63            6 => Self::InvalidHandle,
64            7 => Self::HandleAlreadyRegistered,
65            8 => Self::InvalidData,
66            9 => Self::InvalidArgs,
67            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
68        }
69    }
70
71    #[inline]
72    pub fn unknown() -> Self {
73        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
74    }
75
76    #[inline]
77    pub const fn into_primitive(self) -> u32 {
78        match self {
79            Self::NoSuchCapability => 1,
80            Self::InvalidName => 2,
81            Self::HandleDoesNotReferenceCapability => 3,
82            Self::InvalidCapabilityType => 4,
83            Self::UnregisteredCapability => 5,
84            Self::InvalidHandle => 6,
85            Self::HandleAlreadyRegistered => 7,
86            Self::InvalidData => 8,
87            Self::InvalidArgs => 9,
88            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
89        }
90    }
91
92    #[inline]
93    pub fn is_unknown(&self) -> bool {
94        match self {
95            Self::__SourceBreaking { unknown_ordinal: _ } => true,
96            _ => false,
97        }
98    }
99}
100
101#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
102pub enum CapabilityType {
103    Connector,
104    DirConnector,
105    Dictionary,
106    Data,
107    ConnectorRouter,
108    DirConnectorRouter,
109    DictionaryRouter,
110    DataRouter,
111    InstanceToken,
112    #[doc(hidden)]
113    __SourceBreaking {
114        unknown_ordinal: u32,
115    },
116}
117
118/// Pattern that matches an unknown `CapabilityType` member.
119#[macro_export]
120macro_rules! CapabilityTypeUnknown {
121    () => {
122        _
123    };
124}
125
126impl CapabilityType {
127    #[inline]
128    pub fn from_primitive(prim: u32) -> Option<Self> {
129        match prim {
130            1 => Some(Self::Connector),
131            2 => Some(Self::DirConnector),
132            3 => Some(Self::Dictionary),
133            4 => Some(Self::Data),
134            5 => Some(Self::ConnectorRouter),
135            6 => Some(Self::DirConnectorRouter),
136            7 => Some(Self::DictionaryRouter),
137            8 => Some(Self::DataRouter),
138            9 => Some(Self::InstanceToken),
139            _ => None,
140        }
141    }
142
143    #[inline]
144    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
145        match prim {
146            1 => Self::Connector,
147            2 => Self::DirConnector,
148            3 => Self::Dictionary,
149            4 => Self::Data,
150            5 => Self::ConnectorRouter,
151            6 => Self::DirConnectorRouter,
152            7 => Self::DictionaryRouter,
153            8 => Self::DataRouter,
154            9 => Self::InstanceToken,
155            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
156        }
157    }
158
159    #[inline]
160    pub fn unknown() -> Self {
161        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
162    }
163
164    #[inline]
165    pub const fn into_primitive(self) -> u32 {
166        match self {
167            Self::Connector => 1,
168            Self::DirConnector => 2,
169            Self::Dictionary => 3,
170            Self::Data => 4,
171            Self::ConnectorRouter => 5,
172            Self::DirConnectorRouter => 6,
173            Self::DictionaryRouter => 7,
174            Self::DataRouter => 8,
175            Self::InstanceToken => 9,
176            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
177        }
178    }
179
180    #[inline]
181    pub fn is_unknown(&self) -> bool {
182        match self {
183            Self::__SourceBreaking { unknown_ordinal: _ } => true,
184            _ => false,
185        }
186    }
187}
188
189/// The error values returned when a route operation fails.
190#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
191pub enum RouterError {
192    /// The router failed to find the capability.
193    NotFound,
194    /// The arguments provided to the function are invalid.
195    InvalidArgs,
196    /// The operation is not supported.
197    NotSupported,
198    /// An internal error occurred.
199    Internal,
200    /// An unknown error occurred.
201    Unknown,
202    #[doc(hidden)]
203    __SourceBreaking { unknown_ordinal: u32 },
204}
205
206/// Pattern that matches an unknown `RouterError` member.
207#[macro_export]
208macro_rules! RouterErrorUnknown {
209    () => {
210        _
211    };
212}
213
214impl RouterError {
215    #[inline]
216    pub fn from_primitive(prim: u32) -> Option<Self> {
217        match prim {
218            1 => Some(Self::NotFound),
219            2 => Some(Self::InvalidArgs),
220            3 => Some(Self::NotSupported),
221            4 => Some(Self::Internal),
222            5 => Some(Self::Unknown),
223            _ => None,
224        }
225    }
226
227    #[inline]
228    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
229        match prim {
230            1 => Self::NotFound,
231            2 => Self::InvalidArgs,
232            3 => Self::NotSupported,
233            4 => Self::Internal,
234            5 => Self::Unknown,
235            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
236        }
237    }
238
239    #[inline]
240    pub fn unknown() -> Self {
241        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
242    }
243
244    #[inline]
245    pub const fn into_primitive(self) -> u32 {
246        match self {
247            Self::NotFound => 1,
248            Self::InvalidArgs => 2,
249            Self::NotSupported => 3,
250            Self::Internal => 4,
251            Self::Unknown => 5,
252            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
253        }
254    }
255
256    #[inline]
257    pub fn is_unknown(&self) -> bool {
258        match self {
259            Self::__SourceBreaking { unknown_ordinal: _ } => true,
260            _ => false,
261        }
262    }
263}
264
265/// The error values returned when a route operation succeeds.
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
267pub enum RouterResponse {
268    /// The server end has been connected to a valid object.
269    Success,
270    /// The capability was marked as unavailable.
271    Unavailable,
272    #[doc(hidden)]
273    __SourceBreaking { unknown_ordinal: u32 },
274}
275
276/// Pattern that matches an unknown `RouterResponse` member.
277#[macro_export]
278macro_rules! RouterResponseUnknown {
279    () => {
280        _
281    };
282}
283
284impl RouterResponse {
285    #[inline]
286    pub fn from_primitive(prim: u32) -> Option<Self> {
287        match prim {
288            1 => Some(Self::Success),
289            2 => Some(Self::Unavailable),
290            _ => None,
291        }
292    }
293
294    #[inline]
295    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
296        match prim {
297            1 => Self::Success,
298            2 => Self::Unavailable,
299            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
300        }
301    }
302
303    #[inline]
304    pub fn unknown() -> Self {
305        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
306    }
307
308    #[inline]
309    pub const fn into_primitive(self) -> u32 {
310        match self {
311            Self::Success => 1,
312            Self::Unavailable => 2,
313            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
314        }
315    }
316
317    #[inline]
318    pub fn is_unknown(&self) -> bool {
319        match self {
320            Self::__SourceBreaking { unknown_ordinal: _ } => true,
321            _ => false,
322        }
323    }
324}
325
326#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
327pub struct CapabilitiesConnectorRouterRouteResponse {
328    pub response: RouterResponse,
329}
330
331impl fidl::Persistable for CapabilitiesConnectorRouterRouteResponse {}
332
333#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
334pub struct CapabilitiesDataRouterRouteResponse {
335    pub response: RouterResponse,
336}
337
338impl fidl::Persistable for CapabilitiesDataRouterRouteResponse {}
339
340#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
341pub struct CapabilitiesDictionaryRouterRouteResponse {
342    pub response: RouterResponse,
343}
344
345impl fidl::Persistable for CapabilitiesDictionaryRouterRouteResponse {}
346
347#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
348pub struct CapabilitiesDirConnectorRouterRouteResponse {
349    pub response: RouterResponse,
350}
351
352impl fidl::Persistable for CapabilitiesDirConnectorRouterRouteResponse {}
353
354#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
355pub struct ConnectorRouterRouteResponse {
356    pub response: RouterResponse,
357}
358
359impl fidl::Persistable for ConnectorRouterRouteResponse {}
360
361#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
362pub struct DataRouterRouteResponse {
363    pub response: RouterResponse,
364}
365
366impl fidl::Persistable for DataRouterRouteResponse {}
367
368#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
369pub struct DictionaryKeyIteratorGetNextResponse {
370    pub keys: Vec<String>,
371}
372
373impl fidl::Persistable for DictionaryKeyIteratorGetNextResponse {}
374
375#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
376pub struct DictionaryRouterRouteResponse {
377    pub response: RouterResponse,
378}
379
380impl fidl::Persistable for DictionaryRouterRouteResponse {}
381
382#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
383pub struct DirConnectorRouterRouteResponse {
384    pub response: RouterResponse,
385}
386
387impl fidl::Persistable for DirConnectorRouterRouteResponse {}
388
389/// Static data which may be put in a dictionary or returned by a router. This
390/// is useful for setting values in the metadata of a `RouteRequest`.
391#[derive(Clone, Debug)]
392pub enum Data {
393    Bytes(Vec<u8>),
394    String(String),
395    Int64(i64),
396    Uint64(u64),
397    #[doc(hidden)]
398    __SourceBreaking {
399        unknown_ordinal: u64,
400    },
401}
402
403/// Pattern that matches an unknown `Data` member.
404#[macro_export]
405macro_rules! DataUnknown {
406    () => {
407        _
408    };
409}
410
411// Custom PartialEq so that unknown variants are not equal to themselves.
412impl PartialEq for Data {
413    fn eq(&self, other: &Self) -> bool {
414        match (self, other) {
415            (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
416            (Self::String(x), Self::String(y)) => *x == *y,
417            (Self::Int64(x), Self::Int64(y)) => *x == *y,
418            (Self::Uint64(x), Self::Uint64(y)) => *x == *y,
419            _ => false,
420        }
421    }
422}
423
424impl Data {
425    #[inline]
426    pub fn ordinal(&self) -> u64 {
427        match *self {
428            Self::Bytes(_) => 1,
429            Self::String(_) => 2,
430            Self::Int64(_) => 3,
431            Self::Uint64(_) => 4,
432            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
433        }
434    }
435
436    #[inline]
437    pub fn unknown_variant_for_testing() -> Self {
438        Self::__SourceBreaking { unknown_ordinal: 0 }
439    }
440
441    #[inline]
442    pub fn is_unknown(&self) -> bool {
443        match self {
444            Self::__SourceBreaking { .. } => true,
445            _ => false,
446        }
447    }
448}
449
450impl fidl::Persistable for Data {}
451
452pub mod capabilities_ordinals {
453    pub const CONNECTOR_CREATE: u64 = 0xac2bc2dbd7033d1;
454    pub const DIR_CONNECTOR_CREATE: u64 = 0x721911e05da2a3bf;
455    pub const DICTIONARY_CREATE: u64 = 0x7f8bd91f0942a36e;
456    pub const DATA_CREATE: u64 = 0x40ef43e45372ee6a;
457    pub const CONNECTOR_ROUTER_CREATE: u64 = 0x7f7e7fbafcdf1761;
458    pub const DIR_CONNECTOR_ROUTER_CREATE: u64 = 0x56520da453fad19f;
459    pub const DICTIONARY_ROUTER_CREATE: u64 = 0x37acef18cd423d42;
460    pub const DATA_ROUTER_CREATE: u64 = 0x24e471395b95088;
461    pub const INSTANCE_TOKEN_CREATE: u64 = 0x3576e31727c40813;
462    pub const CONNECTOR_OPEN: u64 = 0xc0646965f1884eb;
463    pub const DIR_CONNECTOR_OPEN: u64 = 0x1332bbf5debd6c20;
464    pub const DICTIONARY_INSERT: u64 = 0x5972e3061a760e7a;
465    pub const DICTIONARY_GET: u64 = 0x31fafe2280a283d5;
466    pub const DICTIONARY_REMOVE: u64 = 0x6827c83106ac5a2c;
467    pub const DICTIONARY_ITERATE_KEYS: u64 = 0x3d4ea59c80df9bb8;
468    pub const DATA_GET: u64 = 0x65ae25b59f9e0daf;
469    pub const CONNECTOR_ROUTER_ROUTE: u64 = 0x1bd9c6e7e3dd487e;
470    pub const DIR_CONNECTOR_ROUTER_ROUTE: u64 = 0x3afdcc1b79e0799d;
471    pub const DICTIONARY_ROUTER_ROUTE: u64 = 0xcf72de10714a708;
472    pub const DATA_ROUTER_ROUTE: u64 = 0x61ab188455ed0643;
473    pub const CAPABILITY_ASSOCIATE_HANDLE: u64 = 0x1d69bb61953d8e7;
474}
475
476pub mod connector_router_ordinals {
477    pub const ROUTE: u64 = 0x57a912c92a38f9f8;
478}
479
480pub mod data_router_ordinals {
481    pub const ROUTE: u64 = 0x646885ba7e10ceeb;
482}
483
484pub mod dictionary_key_iterator_ordinals {
485    pub const GET_NEXT: u64 = 0x3806bda34433db54;
486}
487
488pub mod dictionary_router_ordinals {
489    pub const ROUTE: u64 = 0x199389f437b3937b;
490}
491
492pub mod dir_connector_router_ordinals {
493    pub const ROUTE: u64 = 0x233f2ac038127462;
494}
495
496pub mod dir_receiver_ordinals {
497    pub const RECEIVE: u64 = 0x4ac564d726bb325e;
498}
499
500pub mod receiver_ordinals {
501    pub const RECEIVE: u64 = 0x609ca5c7943b58d0;
502}
503
504mod internal {
505    use super::*;
506    unsafe impl fidl::encoding::TypeMarker for CapabilitiesError {
507        type Owned = Self;
508
509        #[inline(always)]
510        fn inline_align(_context: fidl::encoding::Context) -> usize {
511            std::mem::align_of::<u32>()
512        }
513
514        #[inline(always)]
515        fn inline_size(_context: fidl::encoding::Context) -> usize {
516            std::mem::size_of::<u32>()
517        }
518
519        #[inline(always)]
520        fn encode_is_copy() -> bool {
521            false
522        }
523
524        #[inline(always)]
525        fn decode_is_copy() -> bool {
526            false
527        }
528    }
529
530    impl fidl::encoding::ValueTypeMarker for CapabilitiesError {
531        type Borrowed<'a> = Self;
532        #[inline(always)]
533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
534            *value
535        }
536    }
537
538    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
539        for CapabilitiesError
540    {
541        #[inline]
542        unsafe fn encode(
543            self,
544            encoder: &mut fidl::encoding::Encoder<'_, D>,
545            offset: usize,
546            _depth: fidl::encoding::Depth,
547        ) -> fidl::Result<()> {
548            encoder.debug_check_bounds::<Self>(offset);
549            encoder.write_num(self.into_primitive(), offset);
550            Ok(())
551        }
552    }
553
554    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilitiesError {
555        #[inline(always)]
556        fn new_empty() -> Self {
557            Self::unknown()
558        }
559
560        #[inline]
561        unsafe fn decode(
562            &mut self,
563            decoder: &mut fidl::encoding::Decoder<'_, D>,
564            offset: usize,
565            _depth: fidl::encoding::Depth,
566        ) -> fidl::Result<()> {
567            decoder.debug_check_bounds::<Self>(offset);
568            let prim = decoder.read_num::<u32>(offset);
569
570            *self = Self::from_primitive_allow_unknown(prim);
571            Ok(())
572        }
573    }
574    unsafe impl fidl::encoding::TypeMarker for CapabilityType {
575        type Owned = Self;
576
577        #[inline(always)]
578        fn inline_align(_context: fidl::encoding::Context) -> usize {
579            std::mem::align_of::<u32>()
580        }
581
582        #[inline(always)]
583        fn inline_size(_context: fidl::encoding::Context) -> usize {
584            std::mem::size_of::<u32>()
585        }
586
587        #[inline(always)]
588        fn encode_is_copy() -> bool {
589            false
590        }
591
592        #[inline(always)]
593        fn decode_is_copy() -> bool {
594            false
595        }
596    }
597
598    impl fidl::encoding::ValueTypeMarker for CapabilityType {
599        type Borrowed<'a> = Self;
600        #[inline(always)]
601        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
602            *value
603        }
604    }
605
606    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CapabilityType {
607        #[inline]
608        unsafe fn encode(
609            self,
610            encoder: &mut fidl::encoding::Encoder<'_, D>,
611            offset: usize,
612            _depth: fidl::encoding::Depth,
613        ) -> fidl::Result<()> {
614            encoder.debug_check_bounds::<Self>(offset);
615            encoder.write_num(self.into_primitive(), offset);
616            Ok(())
617        }
618    }
619
620    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilityType {
621        #[inline(always)]
622        fn new_empty() -> Self {
623            Self::unknown()
624        }
625
626        #[inline]
627        unsafe fn decode(
628            &mut self,
629            decoder: &mut fidl::encoding::Decoder<'_, D>,
630            offset: usize,
631            _depth: fidl::encoding::Depth,
632        ) -> fidl::Result<()> {
633            decoder.debug_check_bounds::<Self>(offset);
634            let prim = decoder.read_num::<u32>(offset);
635
636            *self = Self::from_primitive_allow_unknown(prim);
637            Ok(())
638        }
639    }
640    unsafe impl fidl::encoding::TypeMarker for RouterError {
641        type Owned = Self;
642
643        #[inline(always)]
644        fn inline_align(_context: fidl::encoding::Context) -> usize {
645            std::mem::align_of::<u32>()
646        }
647
648        #[inline(always)]
649        fn inline_size(_context: fidl::encoding::Context) -> usize {
650            std::mem::size_of::<u32>()
651        }
652
653        #[inline(always)]
654        fn encode_is_copy() -> bool {
655            false
656        }
657
658        #[inline(always)]
659        fn decode_is_copy() -> bool {
660            false
661        }
662    }
663
664    impl fidl::encoding::ValueTypeMarker for RouterError {
665        type Borrowed<'a> = Self;
666        #[inline(always)]
667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
668            *value
669        }
670    }
671
672    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterError {
673        #[inline]
674        unsafe fn encode(
675            self,
676            encoder: &mut fidl::encoding::Encoder<'_, D>,
677            offset: usize,
678            _depth: fidl::encoding::Depth,
679        ) -> fidl::Result<()> {
680            encoder.debug_check_bounds::<Self>(offset);
681            encoder.write_num(self.into_primitive(), offset);
682            Ok(())
683        }
684    }
685
686    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterError {
687        #[inline(always)]
688        fn new_empty() -> Self {
689            Self::unknown()
690        }
691
692        #[inline]
693        unsafe fn decode(
694            &mut self,
695            decoder: &mut fidl::encoding::Decoder<'_, D>,
696            offset: usize,
697            _depth: fidl::encoding::Depth,
698        ) -> fidl::Result<()> {
699            decoder.debug_check_bounds::<Self>(offset);
700            let prim = decoder.read_num::<u32>(offset);
701
702            *self = Self::from_primitive_allow_unknown(prim);
703            Ok(())
704        }
705    }
706    unsafe impl fidl::encoding::TypeMarker for RouterResponse {
707        type Owned = Self;
708
709        #[inline(always)]
710        fn inline_align(_context: fidl::encoding::Context) -> usize {
711            std::mem::align_of::<u32>()
712        }
713
714        #[inline(always)]
715        fn inline_size(_context: fidl::encoding::Context) -> usize {
716            std::mem::size_of::<u32>()
717        }
718
719        #[inline(always)]
720        fn encode_is_copy() -> bool {
721            false
722        }
723
724        #[inline(always)]
725        fn decode_is_copy() -> bool {
726            false
727        }
728    }
729
730    impl fidl::encoding::ValueTypeMarker for RouterResponse {
731        type Borrowed<'a> = Self;
732        #[inline(always)]
733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
734            *value
735        }
736    }
737
738    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterResponse {
739        #[inline]
740        unsafe fn encode(
741            self,
742            encoder: &mut fidl::encoding::Encoder<'_, D>,
743            offset: usize,
744            _depth: fidl::encoding::Depth,
745        ) -> fidl::Result<()> {
746            encoder.debug_check_bounds::<Self>(offset);
747            encoder.write_num(self.into_primitive(), offset);
748            Ok(())
749        }
750    }
751
752    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterResponse {
753        #[inline(always)]
754        fn new_empty() -> Self {
755            Self::unknown()
756        }
757
758        #[inline]
759        unsafe fn decode(
760            &mut self,
761            decoder: &mut fidl::encoding::Decoder<'_, D>,
762            offset: usize,
763            _depth: fidl::encoding::Depth,
764        ) -> fidl::Result<()> {
765            decoder.debug_check_bounds::<Self>(offset);
766            let prim = decoder.read_num::<u32>(offset);
767
768            *self = Self::from_primitive_allow_unknown(prim);
769            Ok(())
770        }
771    }
772
773    impl fidl::encoding::ValueTypeMarker for CapabilitiesConnectorRouterRouteResponse {
774        type Borrowed<'a> = &'a Self;
775        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
776            value
777        }
778    }
779
780    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteResponse {
781        type Owned = Self;
782
783        #[inline(always)]
784        fn inline_align(_context: fidl::encoding::Context) -> usize {
785            4
786        }
787
788        #[inline(always)]
789        fn inline_size(_context: fidl::encoding::Context) -> usize {
790            4
791        }
792    }
793
794    unsafe impl<D: fidl::encoding::ResourceDialect>
795        fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D>
796        for &CapabilitiesConnectorRouterRouteResponse
797    {
798        #[inline]
799        unsafe fn encode(
800            self,
801            encoder: &mut fidl::encoding::Encoder<'_, D>,
802            offset: usize,
803            _depth: fidl::encoding::Depth,
804        ) -> fidl::Result<()> {
805            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
806            // Delegate to tuple encoding.
807            fidl::encoding::Encode::<CapabilitiesConnectorRouterRouteResponse, D>::encode(
808                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
809                encoder,
810                offset,
811                _depth,
812            )
813        }
814    }
815    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
816        fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D> for (T0,)
817    {
818        #[inline]
819        unsafe fn encode(
820            self,
821            encoder: &mut fidl::encoding::Encoder<'_, D>,
822            offset: usize,
823            depth: fidl::encoding::Depth,
824        ) -> fidl::Result<()> {
825            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
826            // Zero out padding regions. There's no need to apply masks
827            // because the unmasked parts will be overwritten by fields.
828            // Write the fields.
829            self.0.encode(encoder, offset + 0, depth)?;
830            Ok(())
831        }
832    }
833
834    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
835        for CapabilitiesConnectorRouterRouteResponse
836    {
837        #[inline(always)]
838        fn new_empty() -> Self {
839            Self { response: fidl::new_empty!(RouterResponse, D) }
840        }
841
842        #[inline]
843        unsafe fn decode(
844            &mut self,
845            decoder: &mut fidl::encoding::Decoder<'_, D>,
846            offset: usize,
847            _depth: fidl::encoding::Depth,
848        ) -> fidl::Result<()> {
849            decoder.debug_check_bounds::<Self>(offset);
850            // Verify that padding bytes are zero.
851            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
852            Ok(())
853        }
854    }
855
856    impl fidl::encoding::ValueTypeMarker for CapabilitiesDataRouterRouteResponse {
857        type Borrowed<'a> = &'a Self;
858        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
859            value
860        }
861    }
862
863    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteResponse {
864        type Owned = Self;
865
866        #[inline(always)]
867        fn inline_align(_context: fidl::encoding::Context) -> usize {
868            4
869        }
870
871        #[inline(always)]
872        fn inline_size(_context: fidl::encoding::Context) -> usize {
873            4
874        }
875    }
876
877    unsafe impl<D: fidl::encoding::ResourceDialect>
878        fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D>
879        for &CapabilitiesDataRouterRouteResponse
880    {
881        #[inline]
882        unsafe fn encode(
883            self,
884            encoder: &mut fidl::encoding::Encoder<'_, D>,
885            offset: usize,
886            _depth: fidl::encoding::Depth,
887        ) -> fidl::Result<()> {
888            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
889            // Delegate to tuple encoding.
890            fidl::encoding::Encode::<CapabilitiesDataRouterRouteResponse, D>::encode(
891                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
892                encoder,
893                offset,
894                _depth,
895            )
896        }
897    }
898    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
899        fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D> for (T0,)
900    {
901        #[inline]
902        unsafe fn encode(
903            self,
904            encoder: &mut fidl::encoding::Encoder<'_, D>,
905            offset: usize,
906            depth: fidl::encoding::Depth,
907        ) -> fidl::Result<()> {
908            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
909            // Zero out padding regions. There's no need to apply masks
910            // because the unmasked parts will be overwritten by fields.
911            // Write the fields.
912            self.0.encode(encoder, offset + 0, depth)?;
913            Ok(())
914        }
915    }
916
917    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
918        for CapabilitiesDataRouterRouteResponse
919    {
920        #[inline(always)]
921        fn new_empty() -> Self {
922            Self { response: fidl::new_empty!(RouterResponse, D) }
923        }
924
925        #[inline]
926        unsafe fn decode(
927            &mut self,
928            decoder: &mut fidl::encoding::Decoder<'_, D>,
929            offset: usize,
930            _depth: fidl::encoding::Depth,
931        ) -> fidl::Result<()> {
932            decoder.debug_check_bounds::<Self>(offset);
933            // Verify that padding bytes are zero.
934            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
935            Ok(())
936        }
937    }
938
939    impl fidl::encoding::ValueTypeMarker for CapabilitiesDictionaryRouterRouteResponse {
940        type Borrowed<'a> = &'a Self;
941        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
942            value
943        }
944    }
945
946    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteResponse {
947        type Owned = Self;
948
949        #[inline(always)]
950        fn inline_align(_context: fidl::encoding::Context) -> usize {
951            4
952        }
953
954        #[inline(always)]
955        fn inline_size(_context: fidl::encoding::Context) -> usize {
956            4
957        }
958    }
959
960    unsafe impl<D: fidl::encoding::ResourceDialect>
961        fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D>
962        for &CapabilitiesDictionaryRouterRouteResponse
963    {
964        #[inline]
965        unsafe fn encode(
966            self,
967            encoder: &mut fidl::encoding::Encoder<'_, D>,
968            offset: usize,
969            _depth: fidl::encoding::Depth,
970        ) -> fidl::Result<()> {
971            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
972            // Delegate to tuple encoding.
973            fidl::encoding::Encode::<CapabilitiesDictionaryRouterRouteResponse, D>::encode(
974                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
975                encoder,
976                offset,
977                _depth,
978            )
979        }
980    }
981    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
982        fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D> for (T0,)
983    {
984        #[inline]
985        unsafe fn encode(
986            self,
987            encoder: &mut fidl::encoding::Encoder<'_, D>,
988            offset: usize,
989            depth: fidl::encoding::Depth,
990        ) -> fidl::Result<()> {
991            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
992            // Zero out padding regions. There's no need to apply masks
993            // because the unmasked parts will be overwritten by fields.
994            // Write the fields.
995            self.0.encode(encoder, offset + 0, depth)?;
996            Ok(())
997        }
998    }
999
1000    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1001        for CapabilitiesDictionaryRouterRouteResponse
1002    {
1003        #[inline(always)]
1004        fn new_empty() -> Self {
1005            Self { response: fidl::new_empty!(RouterResponse, D) }
1006        }
1007
1008        #[inline]
1009        unsafe fn decode(
1010            &mut self,
1011            decoder: &mut fidl::encoding::Decoder<'_, D>,
1012            offset: usize,
1013            _depth: fidl::encoding::Depth,
1014        ) -> fidl::Result<()> {
1015            decoder.debug_check_bounds::<Self>(offset);
1016            // Verify that padding bytes are zero.
1017            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1018            Ok(())
1019        }
1020    }
1021
1022    impl fidl::encoding::ValueTypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1023        type Borrowed<'a> = &'a Self;
1024        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1025            value
1026        }
1027    }
1028
1029    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1030        type Owned = Self;
1031
1032        #[inline(always)]
1033        fn inline_align(_context: fidl::encoding::Context) -> usize {
1034            4
1035        }
1036
1037        #[inline(always)]
1038        fn inline_size(_context: fidl::encoding::Context) -> usize {
1039            4
1040        }
1041    }
1042
1043    unsafe impl<D: fidl::encoding::ResourceDialect>
1044        fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D>
1045        for &CapabilitiesDirConnectorRouterRouteResponse
1046    {
1047        #[inline]
1048        unsafe fn encode(
1049            self,
1050            encoder: &mut fidl::encoding::Encoder<'_, D>,
1051            offset: usize,
1052            _depth: fidl::encoding::Depth,
1053        ) -> fidl::Result<()> {
1054            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1055            // Delegate to tuple encoding.
1056            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterRouteResponse, D>::encode(
1057                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1058                encoder,
1059                offset,
1060                _depth,
1061            )
1062        }
1063    }
1064    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1065        fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D> for (T0,)
1066    {
1067        #[inline]
1068        unsafe fn encode(
1069            self,
1070            encoder: &mut fidl::encoding::Encoder<'_, D>,
1071            offset: usize,
1072            depth: fidl::encoding::Depth,
1073        ) -> fidl::Result<()> {
1074            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1075            // Zero out padding regions. There's no need to apply masks
1076            // because the unmasked parts will be overwritten by fields.
1077            // Write the fields.
1078            self.0.encode(encoder, offset + 0, depth)?;
1079            Ok(())
1080        }
1081    }
1082
1083    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1084        for CapabilitiesDirConnectorRouterRouteResponse
1085    {
1086        #[inline(always)]
1087        fn new_empty() -> Self {
1088            Self { response: fidl::new_empty!(RouterResponse, D) }
1089        }
1090
1091        #[inline]
1092        unsafe fn decode(
1093            &mut self,
1094            decoder: &mut fidl::encoding::Decoder<'_, D>,
1095            offset: usize,
1096            _depth: fidl::encoding::Depth,
1097        ) -> fidl::Result<()> {
1098            decoder.debug_check_bounds::<Self>(offset);
1099            // Verify that padding bytes are zero.
1100            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1101            Ok(())
1102        }
1103    }
1104
1105    impl fidl::encoding::ValueTypeMarker for ConnectorRouterRouteResponse {
1106        type Borrowed<'a> = &'a Self;
1107        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1108            value
1109        }
1110    }
1111
1112    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
1113        type Owned = Self;
1114
1115        #[inline(always)]
1116        fn inline_align(_context: fidl::encoding::Context) -> usize {
1117            4
1118        }
1119
1120        #[inline(always)]
1121        fn inline_size(_context: fidl::encoding::Context) -> usize {
1122            4
1123        }
1124    }
1125
1126    unsafe impl<D: fidl::encoding::ResourceDialect>
1127        fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for &ConnectorRouterRouteResponse
1128    {
1129        #[inline]
1130        unsafe fn encode(
1131            self,
1132            encoder: &mut fidl::encoding::Encoder<'_, D>,
1133            offset: usize,
1134            _depth: fidl::encoding::Depth,
1135        ) -> fidl::Result<()> {
1136            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1137            // Delegate to tuple encoding.
1138            fidl::encoding::Encode::<ConnectorRouterRouteResponse, D>::encode(
1139                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1140                encoder,
1141                offset,
1142                _depth,
1143            )
1144        }
1145    }
1146    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1147        fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for (T0,)
1148    {
1149        #[inline]
1150        unsafe fn encode(
1151            self,
1152            encoder: &mut fidl::encoding::Encoder<'_, D>,
1153            offset: usize,
1154            depth: fidl::encoding::Depth,
1155        ) -> fidl::Result<()> {
1156            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1157            // Zero out padding regions. There's no need to apply masks
1158            // because the unmasked parts will be overwritten by fields.
1159            // Write the fields.
1160            self.0.encode(encoder, offset + 0, depth)?;
1161            Ok(())
1162        }
1163    }
1164
1165    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1166        for ConnectorRouterRouteResponse
1167    {
1168        #[inline(always)]
1169        fn new_empty() -> Self {
1170            Self { response: fidl::new_empty!(RouterResponse, D) }
1171        }
1172
1173        #[inline]
1174        unsafe fn decode(
1175            &mut self,
1176            decoder: &mut fidl::encoding::Decoder<'_, D>,
1177            offset: usize,
1178            _depth: fidl::encoding::Depth,
1179        ) -> fidl::Result<()> {
1180            decoder.debug_check_bounds::<Self>(offset);
1181            // Verify that padding bytes are zero.
1182            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1183            Ok(())
1184        }
1185    }
1186
1187    impl fidl::encoding::ValueTypeMarker for DataRouterRouteResponse {
1188        type Borrowed<'a> = &'a Self;
1189        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1190            value
1191        }
1192    }
1193
1194    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
1195        type Owned = Self;
1196
1197        #[inline(always)]
1198        fn inline_align(_context: fidl::encoding::Context) -> usize {
1199            4
1200        }
1201
1202        #[inline(always)]
1203        fn inline_size(_context: fidl::encoding::Context) -> usize {
1204            4
1205        }
1206    }
1207
1208    unsafe impl<D: fidl::encoding::ResourceDialect>
1209        fidl::encoding::Encode<DataRouterRouteResponse, D> for &DataRouterRouteResponse
1210    {
1211        #[inline]
1212        unsafe fn encode(
1213            self,
1214            encoder: &mut fidl::encoding::Encoder<'_, D>,
1215            offset: usize,
1216            _depth: fidl::encoding::Depth,
1217        ) -> fidl::Result<()> {
1218            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1219            // Delegate to tuple encoding.
1220            fidl::encoding::Encode::<DataRouterRouteResponse, D>::encode(
1221                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1222                encoder,
1223                offset,
1224                _depth,
1225            )
1226        }
1227    }
1228    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1229        fidl::encoding::Encode<DataRouterRouteResponse, D> for (T0,)
1230    {
1231        #[inline]
1232        unsafe fn encode(
1233            self,
1234            encoder: &mut fidl::encoding::Encoder<'_, D>,
1235            offset: usize,
1236            depth: fidl::encoding::Depth,
1237        ) -> fidl::Result<()> {
1238            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1239            // Zero out padding regions. There's no need to apply masks
1240            // because the unmasked parts will be overwritten by fields.
1241            // Write the fields.
1242            self.0.encode(encoder, offset + 0, depth)?;
1243            Ok(())
1244        }
1245    }
1246
1247    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1248        for DataRouterRouteResponse
1249    {
1250        #[inline(always)]
1251        fn new_empty() -> Self {
1252            Self { response: fidl::new_empty!(RouterResponse, D) }
1253        }
1254
1255        #[inline]
1256        unsafe fn decode(
1257            &mut self,
1258            decoder: &mut fidl::encoding::Decoder<'_, D>,
1259            offset: usize,
1260            _depth: fidl::encoding::Depth,
1261        ) -> fidl::Result<()> {
1262            decoder.debug_check_bounds::<Self>(offset);
1263            // Verify that padding bytes are zero.
1264            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1265            Ok(())
1266        }
1267    }
1268
1269    impl fidl::encoding::ValueTypeMarker for DictionaryKeyIteratorGetNextResponse {
1270        type Borrowed<'a> = &'a Self;
1271        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1272            value
1273        }
1274    }
1275
1276    unsafe impl fidl::encoding::TypeMarker for DictionaryKeyIteratorGetNextResponse {
1277        type Owned = Self;
1278
1279        #[inline(always)]
1280        fn inline_align(_context: fidl::encoding::Context) -> usize {
1281            8
1282        }
1283
1284        #[inline(always)]
1285        fn inline_size(_context: fidl::encoding::Context) -> usize {
1286            16
1287        }
1288    }
1289
1290    unsafe impl<D: fidl::encoding::ResourceDialect>
1291        fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D>
1292        for &DictionaryKeyIteratorGetNextResponse
1293    {
1294        #[inline]
1295        unsafe fn encode(
1296            self,
1297            encoder: &mut fidl::encoding::Encoder<'_, D>,
1298            offset: usize,
1299            _depth: fidl::encoding::Depth,
1300        ) -> fidl::Result<()> {
1301            encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1302            // Delegate to tuple encoding.
1303            fidl::encoding::Encode::<DictionaryKeyIteratorGetNextResponse, D>::encode(
1304                (
1305                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
1306                ),
1307                encoder, offset, _depth
1308            )
1309        }
1310    }
1311    unsafe impl<
1312        D: fidl::encoding::ResourceDialect,
1313        T0: fidl::encoding::Encode<
1314                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1315                D,
1316            >,
1317    > fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D> for (T0,)
1318    {
1319        #[inline]
1320        unsafe fn encode(
1321            self,
1322            encoder: &mut fidl::encoding::Encoder<'_, D>,
1323            offset: usize,
1324            depth: fidl::encoding::Depth,
1325        ) -> fidl::Result<()> {
1326            encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1327            // Zero out padding regions. There's no need to apply masks
1328            // because the unmasked parts will be overwritten by fields.
1329            // Write the fields.
1330            self.0.encode(encoder, offset + 0, depth)?;
1331            Ok(())
1332        }
1333    }
1334
1335    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1336        for DictionaryKeyIteratorGetNextResponse
1337    {
1338        #[inline(always)]
1339        fn new_empty() -> Self {
1340            Self {
1341                keys: fidl::new_empty!(
1342                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1343                    D
1344                ),
1345            }
1346        }
1347
1348        #[inline]
1349        unsafe fn decode(
1350            &mut self,
1351            decoder: &mut fidl::encoding::Decoder<'_, D>,
1352            offset: usize,
1353            _depth: fidl::encoding::Depth,
1354        ) -> fidl::Result<()> {
1355            decoder.debug_check_bounds::<Self>(offset);
1356            // Verify that padding bytes are zero.
1357            fidl::decode!(
1358                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1359                D,
1360                &mut self.keys,
1361                decoder,
1362                offset + 0,
1363                _depth
1364            )?;
1365            Ok(())
1366        }
1367    }
1368
1369    impl fidl::encoding::ValueTypeMarker for DictionaryRouterRouteResponse {
1370        type Borrowed<'a> = &'a Self;
1371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1372            value
1373        }
1374    }
1375
1376    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
1377        type Owned = Self;
1378
1379        #[inline(always)]
1380        fn inline_align(_context: fidl::encoding::Context) -> usize {
1381            4
1382        }
1383
1384        #[inline(always)]
1385        fn inline_size(_context: fidl::encoding::Context) -> usize {
1386            4
1387        }
1388    }
1389
1390    unsafe impl<D: fidl::encoding::ResourceDialect>
1391        fidl::encoding::Encode<DictionaryRouterRouteResponse, D>
1392        for &DictionaryRouterRouteResponse
1393    {
1394        #[inline]
1395        unsafe fn encode(
1396            self,
1397            encoder: &mut fidl::encoding::Encoder<'_, D>,
1398            offset: usize,
1399            _depth: fidl::encoding::Depth,
1400        ) -> fidl::Result<()> {
1401            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1402            // Delegate to tuple encoding.
1403            fidl::encoding::Encode::<DictionaryRouterRouteResponse, D>::encode(
1404                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1405                encoder,
1406                offset,
1407                _depth,
1408            )
1409        }
1410    }
1411    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1412        fidl::encoding::Encode<DictionaryRouterRouteResponse, D> for (T0,)
1413    {
1414        #[inline]
1415        unsafe fn encode(
1416            self,
1417            encoder: &mut fidl::encoding::Encoder<'_, D>,
1418            offset: usize,
1419            depth: fidl::encoding::Depth,
1420        ) -> fidl::Result<()> {
1421            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1422            // Zero out padding regions. There's no need to apply masks
1423            // because the unmasked parts will be overwritten by fields.
1424            // Write the fields.
1425            self.0.encode(encoder, offset + 0, depth)?;
1426            Ok(())
1427        }
1428    }
1429
1430    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1431        for DictionaryRouterRouteResponse
1432    {
1433        #[inline(always)]
1434        fn new_empty() -> Self {
1435            Self { response: fidl::new_empty!(RouterResponse, D) }
1436        }
1437
1438        #[inline]
1439        unsafe fn decode(
1440            &mut self,
1441            decoder: &mut fidl::encoding::Decoder<'_, D>,
1442            offset: usize,
1443            _depth: fidl::encoding::Depth,
1444        ) -> fidl::Result<()> {
1445            decoder.debug_check_bounds::<Self>(offset);
1446            // Verify that padding bytes are zero.
1447            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1448            Ok(())
1449        }
1450    }
1451
1452    impl fidl::encoding::ValueTypeMarker for DirConnectorRouterRouteResponse {
1453        type Borrowed<'a> = &'a Self;
1454        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1455            value
1456        }
1457    }
1458
1459    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
1460        type Owned = Self;
1461
1462        #[inline(always)]
1463        fn inline_align(_context: fidl::encoding::Context) -> usize {
1464            4
1465        }
1466
1467        #[inline(always)]
1468        fn inline_size(_context: fidl::encoding::Context) -> usize {
1469            4
1470        }
1471    }
1472
1473    unsafe impl<D: fidl::encoding::ResourceDialect>
1474        fidl::encoding::Encode<DirConnectorRouterRouteResponse, D>
1475        for &DirConnectorRouterRouteResponse
1476    {
1477        #[inline]
1478        unsafe fn encode(
1479            self,
1480            encoder: &mut fidl::encoding::Encoder<'_, D>,
1481            offset: usize,
1482            _depth: fidl::encoding::Depth,
1483        ) -> fidl::Result<()> {
1484            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1485            // Delegate to tuple encoding.
1486            fidl::encoding::Encode::<DirConnectorRouterRouteResponse, D>::encode(
1487                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1488                encoder,
1489                offset,
1490                _depth,
1491            )
1492        }
1493    }
1494    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1495        fidl::encoding::Encode<DirConnectorRouterRouteResponse, D> for (T0,)
1496    {
1497        #[inline]
1498        unsafe fn encode(
1499            self,
1500            encoder: &mut fidl::encoding::Encoder<'_, D>,
1501            offset: usize,
1502            depth: fidl::encoding::Depth,
1503        ) -> fidl::Result<()> {
1504            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1505            // Zero out padding regions. There's no need to apply masks
1506            // because the unmasked parts will be overwritten by fields.
1507            // Write the fields.
1508            self.0.encode(encoder, offset + 0, depth)?;
1509            Ok(())
1510        }
1511    }
1512
1513    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1514        for DirConnectorRouterRouteResponse
1515    {
1516        #[inline(always)]
1517        fn new_empty() -> Self {
1518            Self { response: fidl::new_empty!(RouterResponse, D) }
1519        }
1520
1521        #[inline]
1522        unsafe fn decode(
1523            &mut self,
1524            decoder: &mut fidl::encoding::Decoder<'_, D>,
1525            offset: usize,
1526            _depth: fidl::encoding::Depth,
1527        ) -> fidl::Result<()> {
1528            decoder.debug_check_bounds::<Self>(offset);
1529            // Verify that padding bytes are zero.
1530            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1531            Ok(())
1532        }
1533    }
1534
1535    impl fidl::encoding::ValueTypeMarker for Data {
1536        type Borrowed<'a> = &'a Self;
1537        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1538            value
1539        }
1540    }
1541
1542    unsafe impl fidl::encoding::TypeMarker for Data {
1543        type Owned = Self;
1544
1545        #[inline(always)]
1546        fn inline_align(_context: fidl::encoding::Context) -> usize {
1547            8
1548        }
1549
1550        #[inline(always)]
1551        fn inline_size(_context: fidl::encoding::Context) -> usize {
1552            16
1553        }
1554    }
1555
1556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Data, D> for &Data {
1557        #[inline]
1558        unsafe fn encode(
1559            self,
1560            encoder: &mut fidl::encoding::Encoder<'_, D>,
1561            offset: usize,
1562            _depth: fidl::encoding::Depth,
1563        ) -> fidl::Result<()> {
1564            encoder.debug_check_bounds::<Data>(offset);
1565            encoder.write_num::<u64>(self.ordinal(), offset);
1566            match self {
1567            Data::Bytes(ref val) => {
1568                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u8, 8192>, D>(
1569                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
1570                    encoder, offset + 8, _depth
1571                )
1572            }
1573            Data::String(ref val) => {
1574                fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<8192>, D>(
1575                    <fidl::encoding::BoundedString<8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
1576                    encoder, offset + 8, _depth
1577                )
1578            }
1579            Data::Int64(ref val) => {
1580                fidl::encoding::encode_in_envelope::<i64, D>(
1581                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
1582                    encoder, offset + 8, _depth
1583                )
1584            }
1585            Data::Uint64(ref val) => {
1586                fidl::encoding::encode_in_envelope::<u64, D>(
1587                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
1588                    encoder, offset + 8, _depth
1589                )
1590            }
1591            Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1592        }
1593        }
1594    }
1595
1596    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Data {
1597        #[inline(always)]
1598        fn new_empty() -> Self {
1599            Self::__SourceBreaking { unknown_ordinal: 0 }
1600        }
1601
1602        #[inline]
1603        unsafe fn decode(
1604            &mut self,
1605            decoder: &mut fidl::encoding::Decoder<'_, D>,
1606            offset: usize,
1607            mut depth: fidl::encoding::Depth,
1608        ) -> fidl::Result<()> {
1609            decoder.debug_check_bounds::<Self>(offset);
1610            #[allow(unused_variables)]
1611            let next_out_of_line = decoder.next_out_of_line();
1612            let handles_before = decoder.remaining_handles();
1613            let (ordinal, inlined, num_bytes, num_handles) =
1614                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1615
1616            let member_inline_size = match ordinal {
1617                1 => <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
1618                    decoder.context,
1619                ),
1620                2 => {
1621                    <fidl::encoding::BoundedString<8192> as fidl::encoding::TypeMarker>::inline_size(
1622                        decoder.context,
1623                    )
1624                }
1625                3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1626                4 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1627                0 => return Err(fidl::Error::UnknownUnionTag),
1628                _ => num_bytes as usize,
1629            };
1630
1631            if inlined != (member_inline_size <= 4) {
1632                return Err(fidl::Error::InvalidInlineBitInEnvelope);
1633            }
1634            let _inner_offset;
1635            if inlined {
1636                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1637                _inner_offset = offset + 8;
1638            } else {
1639                depth.increment()?;
1640                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1641            }
1642            match ordinal {
1643                1 => {
1644                    #[allow(irrefutable_let_patterns)]
1645                    if let Data::Bytes(_) = self {
1646                        // Do nothing, read the value into the object
1647                    } else {
1648                        // Initialize `self` to the right variant
1649                        *self = Data::Bytes(fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D));
1650                    }
1651                    #[allow(irrefutable_let_patterns)]
1652                    if let Data::Bytes(ref mut val) = self {
1653                        fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, val, decoder, _inner_offset, depth)?;
1654                    } else {
1655                        unreachable!()
1656                    }
1657                }
1658                2 => {
1659                    #[allow(irrefutable_let_patterns)]
1660                    if let Data::String(_) = self {
1661                        // Do nothing, read the value into the object
1662                    } else {
1663                        // Initialize `self` to the right variant
1664                        *self =
1665                            Data::String(fidl::new_empty!(fidl::encoding::BoundedString<8192>, D));
1666                    }
1667                    #[allow(irrefutable_let_patterns)]
1668                    if let Data::String(ref mut val) = self {
1669                        fidl::decode!(
1670                            fidl::encoding::BoundedString<8192>,
1671                            D,
1672                            val,
1673                            decoder,
1674                            _inner_offset,
1675                            depth
1676                        )?;
1677                    } else {
1678                        unreachable!()
1679                    }
1680                }
1681                3 => {
1682                    #[allow(irrefutable_let_patterns)]
1683                    if let Data::Int64(_) = self {
1684                        // Do nothing, read the value into the object
1685                    } else {
1686                        // Initialize `self` to the right variant
1687                        *self = Data::Int64(fidl::new_empty!(i64, D));
1688                    }
1689                    #[allow(irrefutable_let_patterns)]
1690                    if let Data::Int64(ref mut val) = self {
1691                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
1692                    } else {
1693                        unreachable!()
1694                    }
1695                }
1696                4 => {
1697                    #[allow(irrefutable_let_patterns)]
1698                    if let Data::Uint64(_) = self {
1699                        // Do nothing, read the value into the object
1700                    } else {
1701                        // Initialize `self` to the right variant
1702                        *self = Data::Uint64(fidl::new_empty!(u64, D));
1703                    }
1704                    #[allow(irrefutable_let_patterns)]
1705                    if let Data::Uint64(ref mut val) = self {
1706                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
1707                    } else {
1708                        unreachable!()
1709                    }
1710                }
1711                #[allow(deprecated)]
1712                ordinal => {
1713                    for _ in 0..num_handles {
1714                        decoder.drop_next_handle()?;
1715                    }
1716                    *self = Data::__SourceBreaking { unknown_ordinal: ordinal };
1717                }
1718            }
1719            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1720                return Err(fidl::Error::InvalidNumBytesInEnvelope);
1721            }
1722            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1723                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1724            }
1725            Ok(())
1726        }
1727    }
1728}