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 capability_factory_ordinals {
477    pub const CREATE_CONNECTOR: u64 = 0x58be7506ad9c0d1b;
478    pub const CREATE_DIR_CONNECTOR: u64 = 0x47e63805e1a638fa;
479    pub const CREATE_DICTIONARY: u64 = 0x1d9473d8c1e82b02;
480    pub const CREATE_CONNECTOR_ROUTER: u64 = 0x10a5577bdd065d17;
481    pub const CREATE_DIR_CONNECTOR_ROUTER: u64 = 0x6da0f55bc0cb6916;
482    pub const CREATE_DICTIONARY_ROUTER: u64 = 0x22f371a3e3cbdf05;
483    pub const CREATE_DATA_ROUTER: u64 = 0x42ca43500520bd20;
484}
485
486pub mod connector_ordinals {
487    pub const CLONE: u64 = 0x20d8a7aba2168a79;
488    pub const CONNECT: u64 = 0x1c0c1727bd474e02;
489}
490
491pub mod connector_router_ordinals {
492    pub const ROUTE: u64 = 0x57a912c92a38f9f8;
493}
494
495pub mod connector_router_deprecated_ordinals {
496    pub const CLONE: u64 = 0x20d8a7aba2168a79;
497    pub const ROUTE: u64 = 0x1b7810fe6a37ff32;
498}
499
500pub mod data_router_ordinals {
501    pub const ROUTE: u64 = 0x646885ba7e10ceeb;
502}
503
504pub mod data_router_deprecated_ordinals {
505    pub const CLONE: u64 = 0x20d8a7aba2168a79;
506    pub const ROUTE: u64 = 0x9a0b381e65e9ed3;
507}
508
509pub mod dictionary_ordinals {
510    pub const CLONE: u64 = 0x20d8a7aba2168a79;
511    pub const INSERT: u64 = 0x673364c89c4b0ed7;
512    pub const GET: u64 = 0x46d4b1dcd30feed9;
513    pub const REMOVE: u64 = 0x7931ac0ea29dffe7;
514    pub const ITERATE_KEYS: u64 = 0x331df1e1e73158a1;
515    pub const LEGACY_EXPORT: u64 = 0x722a26456a1ee1d0;
516}
517
518pub mod dictionary_key_iterator_ordinals {
519    pub const GET_NEXT: u64 = 0x3806bda34433db54;
520}
521
522pub mod dictionary_router_ordinals {
523    pub const ROUTE: u64 = 0x199389f437b3937b;
524}
525
526pub mod dictionary_router_deprecated_ordinals {
527    pub const CLONE: u64 = 0x20d8a7aba2168a79;
528    pub const ROUTE: u64 = 0x10b86c8a8e9eb51a;
529}
530
531pub mod dir_connector_ordinals {
532    pub const CLONE: u64 = 0x20d8a7aba2168a79;
533    pub const CONNECT: u64 = 0x23fbb3d289ca7e5b;
534}
535
536pub mod dir_connector_router_ordinals {
537    pub const ROUTE: u64 = 0x233f2ac038127462;
538}
539
540pub mod dir_connector_router_deprecated_ordinals {
541    pub const CLONE: u64 = 0x20d8a7aba2168a79;
542    pub const ROUTE: u64 = 0x199e1dee6ba3d71a;
543}
544
545pub mod dir_receiver_ordinals {
546    pub const RECEIVE: u64 = 0x4ac564d726bb325e;
547}
548
549pub mod dir_receiver_deprecated_ordinals {
550    pub const RECEIVE: u64 = 0x6351363b40e73f58;
551}
552
553pub mod receiver_ordinals {
554    pub const RECEIVE: u64 = 0x609ca5c7943b58d0;
555}
556
557mod internal {
558    use super::*;
559    unsafe impl fidl::encoding::TypeMarker for CapabilitiesError {
560        type Owned = Self;
561
562        #[inline(always)]
563        fn inline_align(_context: fidl::encoding::Context) -> usize {
564            std::mem::align_of::<u32>()
565        }
566
567        #[inline(always)]
568        fn inline_size(_context: fidl::encoding::Context) -> usize {
569            std::mem::size_of::<u32>()
570        }
571
572        #[inline(always)]
573        fn encode_is_copy() -> bool {
574            false
575        }
576
577        #[inline(always)]
578        fn decode_is_copy() -> bool {
579            false
580        }
581    }
582
583    impl fidl::encoding::ValueTypeMarker for CapabilitiesError {
584        type Borrowed<'a> = Self;
585        #[inline(always)]
586        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
587            *value
588        }
589    }
590
591    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
592        for CapabilitiesError
593    {
594        #[inline]
595        unsafe fn encode(
596            self,
597            encoder: &mut fidl::encoding::Encoder<'_, D>,
598            offset: usize,
599            _depth: fidl::encoding::Depth,
600        ) -> fidl::Result<()> {
601            encoder.debug_check_bounds::<Self>(offset);
602            encoder.write_num(self.into_primitive(), offset);
603            Ok(())
604        }
605    }
606
607    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilitiesError {
608        #[inline(always)]
609        fn new_empty() -> Self {
610            Self::unknown()
611        }
612
613        #[inline]
614        unsafe fn decode(
615            &mut self,
616            decoder: &mut fidl::encoding::Decoder<'_, D>,
617            offset: usize,
618            _depth: fidl::encoding::Depth,
619        ) -> fidl::Result<()> {
620            decoder.debug_check_bounds::<Self>(offset);
621            let prim = decoder.read_num::<u32>(offset);
622
623            *self = Self::from_primitive_allow_unknown(prim);
624            Ok(())
625        }
626    }
627    unsafe impl fidl::encoding::TypeMarker for CapabilityType {
628        type Owned = Self;
629
630        #[inline(always)]
631        fn inline_align(_context: fidl::encoding::Context) -> usize {
632            std::mem::align_of::<u32>()
633        }
634
635        #[inline(always)]
636        fn inline_size(_context: fidl::encoding::Context) -> usize {
637            std::mem::size_of::<u32>()
638        }
639
640        #[inline(always)]
641        fn encode_is_copy() -> bool {
642            false
643        }
644
645        #[inline(always)]
646        fn decode_is_copy() -> bool {
647            false
648        }
649    }
650
651    impl fidl::encoding::ValueTypeMarker for CapabilityType {
652        type Borrowed<'a> = Self;
653        #[inline(always)]
654        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
655            *value
656        }
657    }
658
659    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CapabilityType {
660        #[inline]
661        unsafe fn encode(
662            self,
663            encoder: &mut fidl::encoding::Encoder<'_, D>,
664            offset: usize,
665            _depth: fidl::encoding::Depth,
666        ) -> fidl::Result<()> {
667            encoder.debug_check_bounds::<Self>(offset);
668            encoder.write_num(self.into_primitive(), offset);
669            Ok(())
670        }
671    }
672
673    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilityType {
674        #[inline(always)]
675        fn new_empty() -> Self {
676            Self::unknown()
677        }
678
679        #[inline]
680        unsafe fn decode(
681            &mut self,
682            decoder: &mut fidl::encoding::Decoder<'_, D>,
683            offset: usize,
684            _depth: fidl::encoding::Depth,
685        ) -> fidl::Result<()> {
686            decoder.debug_check_bounds::<Self>(offset);
687            let prim = decoder.read_num::<u32>(offset);
688
689            *self = Self::from_primitive_allow_unknown(prim);
690            Ok(())
691        }
692    }
693    unsafe impl fidl::encoding::TypeMarker for RouterError {
694        type Owned = Self;
695
696        #[inline(always)]
697        fn inline_align(_context: fidl::encoding::Context) -> usize {
698            std::mem::align_of::<u32>()
699        }
700
701        #[inline(always)]
702        fn inline_size(_context: fidl::encoding::Context) -> usize {
703            std::mem::size_of::<u32>()
704        }
705
706        #[inline(always)]
707        fn encode_is_copy() -> bool {
708            false
709        }
710
711        #[inline(always)]
712        fn decode_is_copy() -> bool {
713            false
714        }
715    }
716
717    impl fidl::encoding::ValueTypeMarker for RouterError {
718        type Borrowed<'a> = Self;
719        #[inline(always)]
720        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
721            *value
722        }
723    }
724
725    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterError {
726        #[inline]
727        unsafe fn encode(
728            self,
729            encoder: &mut fidl::encoding::Encoder<'_, D>,
730            offset: usize,
731            _depth: fidl::encoding::Depth,
732        ) -> fidl::Result<()> {
733            encoder.debug_check_bounds::<Self>(offset);
734            encoder.write_num(self.into_primitive(), offset);
735            Ok(())
736        }
737    }
738
739    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterError {
740        #[inline(always)]
741        fn new_empty() -> Self {
742            Self::unknown()
743        }
744
745        #[inline]
746        unsafe fn decode(
747            &mut self,
748            decoder: &mut fidl::encoding::Decoder<'_, D>,
749            offset: usize,
750            _depth: fidl::encoding::Depth,
751        ) -> fidl::Result<()> {
752            decoder.debug_check_bounds::<Self>(offset);
753            let prim = decoder.read_num::<u32>(offset);
754
755            *self = Self::from_primitive_allow_unknown(prim);
756            Ok(())
757        }
758    }
759    unsafe impl fidl::encoding::TypeMarker for RouterResponse {
760        type Owned = Self;
761
762        #[inline(always)]
763        fn inline_align(_context: fidl::encoding::Context) -> usize {
764            std::mem::align_of::<u32>()
765        }
766
767        #[inline(always)]
768        fn inline_size(_context: fidl::encoding::Context) -> usize {
769            std::mem::size_of::<u32>()
770        }
771
772        #[inline(always)]
773        fn encode_is_copy() -> bool {
774            false
775        }
776
777        #[inline(always)]
778        fn decode_is_copy() -> bool {
779            false
780        }
781    }
782
783    impl fidl::encoding::ValueTypeMarker for RouterResponse {
784        type Borrowed<'a> = Self;
785        #[inline(always)]
786        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
787            *value
788        }
789    }
790
791    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterResponse {
792        #[inline]
793        unsafe fn encode(
794            self,
795            encoder: &mut fidl::encoding::Encoder<'_, D>,
796            offset: usize,
797            _depth: fidl::encoding::Depth,
798        ) -> fidl::Result<()> {
799            encoder.debug_check_bounds::<Self>(offset);
800            encoder.write_num(self.into_primitive(), offset);
801            Ok(())
802        }
803    }
804
805    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterResponse {
806        #[inline(always)]
807        fn new_empty() -> Self {
808            Self::unknown()
809        }
810
811        #[inline]
812        unsafe fn decode(
813            &mut self,
814            decoder: &mut fidl::encoding::Decoder<'_, D>,
815            offset: usize,
816            _depth: fidl::encoding::Depth,
817        ) -> fidl::Result<()> {
818            decoder.debug_check_bounds::<Self>(offset);
819            let prim = decoder.read_num::<u32>(offset);
820
821            *self = Self::from_primitive_allow_unknown(prim);
822            Ok(())
823        }
824    }
825
826    impl fidl::encoding::ValueTypeMarker for CapabilitiesConnectorRouterRouteResponse {
827        type Borrowed<'a> = &'a Self;
828        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
829            value
830        }
831    }
832
833    unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteResponse {
834        type Owned = Self;
835
836        #[inline(always)]
837        fn inline_align(_context: fidl::encoding::Context) -> usize {
838            4
839        }
840
841        #[inline(always)]
842        fn inline_size(_context: fidl::encoding::Context) -> usize {
843            4
844        }
845    }
846
847    unsafe impl<D: fidl::encoding::ResourceDialect>
848        fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D>
849        for &CapabilitiesConnectorRouterRouteResponse
850    {
851        #[inline]
852        unsafe fn encode(
853            self,
854            encoder: &mut fidl::encoding::Encoder<'_, D>,
855            offset: usize,
856            _depth: fidl::encoding::Depth,
857        ) -> fidl::Result<()> {
858            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
859            // Delegate to tuple encoding.
860            fidl::encoding::Encode::<CapabilitiesConnectorRouterRouteResponse, D>::encode(
861                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
862                encoder,
863                offset,
864                _depth,
865            )
866        }
867    }
868    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
869        fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D> for (T0,)
870    {
871        #[inline]
872        unsafe fn encode(
873            self,
874            encoder: &mut fidl::encoding::Encoder<'_, D>,
875            offset: usize,
876            depth: fidl::encoding::Depth,
877        ) -> fidl::Result<()> {
878            encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
879            // Zero out padding regions. There's no need to apply masks
880            // because the unmasked parts will be overwritten by fields.
881            // Write the fields.
882            self.0.encode(encoder, offset + 0, depth)?;
883            Ok(())
884        }
885    }
886
887    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
888        for CapabilitiesConnectorRouterRouteResponse
889    {
890        #[inline(always)]
891        fn new_empty() -> Self {
892            Self { response: fidl::new_empty!(RouterResponse, D) }
893        }
894
895        #[inline]
896        unsafe fn decode(
897            &mut self,
898            decoder: &mut fidl::encoding::Decoder<'_, D>,
899            offset: usize,
900            _depth: fidl::encoding::Depth,
901        ) -> fidl::Result<()> {
902            decoder.debug_check_bounds::<Self>(offset);
903            // Verify that padding bytes are zero.
904            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
905            Ok(())
906        }
907    }
908
909    impl fidl::encoding::ValueTypeMarker for CapabilitiesDataRouterRouteResponse {
910        type Borrowed<'a> = &'a Self;
911        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
912            value
913        }
914    }
915
916    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteResponse {
917        type Owned = Self;
918
919        #[inline(always)]
920        fn inline_align(_context: fidl::encoding::Context) -> usize {
921            4
922        }
923
924        #[inline(always)]
925        fn inline_size(_context: fidl::encoding::Context) -> usize {
926            4
927        }
928    }
929
930    unsafe impl<D: fidl::encoding::ResourceDialect>
931        fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D>
932        for &CapabilitiesDataRouterRouteResponse
933    {
934        #[inline]
935        unsafe fn encode(
936            self,
937            encoder: &mut fidl::encoding::Encoder<'_, D>,
938            offset: usize,
939            _depth: fidl::encoding::Depth,
940        ) -> fidl::Result<()> {
941            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
942            // Delegate to tuple encoding.
943            fidl::encoding::Encode::<CapabilitiesDataRouterRouteResponse, D>::encode(
944                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
945                encoder,
946                offset,
947                _depth,
948            )
949        }
950    }
951    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
952        fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D> for (T0,)
953    {
954        #[inline]
955        unsafe fn encode(
956            self,
957            encoder: &mut fidl::encoding::Encoder<'_, D>,
958            offset: usize,
959            depth: fidl::encoding::Depth,
960        ) -> fidl::Result<()> {
961            encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
962            // Zero out padding regions. There's no need to apply masks
963            // because the unmasked parts will be overwritten by fields.
964            // Write the fields.
965            self.0.encode(encoder, offset + 0, depth)?;
966            Ok(())
967        }
968    }
969
970    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
971        for CapabilitiesDataRouterRouteResponse
972    {
973        #[inline(always)]
974        fn new_empty() -> Self {
975            Self { response: fidl::new_empty!(RouterResponse, D) }
976        }
977
978        #[inline]
979        unsafe fn decode(
980            &mut self,
981            decoder: &mut fidl::encoding::Decoder<'_, D>,
982            offset: usize,
983            _depth: fidl::encoding::Depth,
984        ) -> fidl::Result<()> {
985            decoder.debug_check_bounds::<Self>(offset);
986            // Verify that padding bytes are zero.
987            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
988            Ok(())
989        }
990    }
991
992    impl fidl::encoding::ValueTypeMarker for CapabilitiesDictionaryRouterRouteResponse {
993        type Borrowed<'a> = &'a Self;
994        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
995            value
996        }
997    }
998
999    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteResponse {
1000        type Owned = Self;
1001
1002        #[inline(always)]
1003        fn inline_align(_context: fidl::encoding::Context) -> usize {
1004            4
1005        }
1006
1007        #[inline(always)]
1008        fn inline_size(_context: fidl::encoding::Context) -> usize {
1009            4
1010        }
1011    }
1012
1013    unsafe impl<D: fidl::encoding::ResourceDialect>
1014        fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D>
1015        for &CapabilitiesDictionaryRouterRouteResponse
1016    {
1017        #[inline]
1018        unsafe fn encode(
1019            self,
1020            encoder: &mut fidl::encoding::Encoder<'_, D>,
1021            offset: usize,
1022            _depth: fidl::encoding::Depth,
1023        ) -> fidl::Result<()> {
1024            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
1025            // Delegate to tuple encoding.
1026            fidl::encoding::Encode::<CapabilitiesDictionaryRouterRouteResponse, D>::encode(
1027                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1028                encoder,
1029                offset,
1030                _depth,
1031            )
1032        }
1033    }
1034    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1035        fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D> for (T0,)
1036    {
1037        #[inline]
1038        unsafe fn encode(
1039            self,
1040            encoder: &mut fidl::encoding::Encoder<'_, D>,
1041            offset: usize,
1042            depth: fidl::encoding::Depth,
1043        ) -> fidl::Result<()> {
1044            encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
1045            // Zero out padding regions. There's no need to apply masks
1046            // because the unmasked parts will be overwritten by fields.
1047            // Write the fields.
1048            self.0.encode(encoder, offset + 0, depth)?;
1049            Ok(())
1050        }
1051    }
1052
1053    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1054        for CapabilitiesDictionaryRouterRouteResponse
1055    {
1056        #[inline(always)]
1057        fn new_empty() -> Self {
1058            Self { response: fidl::new_empty!(RouterResponse, D) }
1059        }
1060
1061        #[inline]
1062        unsafe fn decode(
1063            &mut self,
1064            decoder: &mut fidl::encoding::Decoder<'_, D>,
1065            offset: usize,
1066            _depth: fidl::encoding::Depth,
1067        ) -> fidl::Result<()> {
1068            decoder.debug_check_bounds::<Self>(offset);
1069            // Verify that padding bytes are zero.
1070            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1071            Ok(())
1072        }
1073    }
1074
1075    impl fidl::encoding::ValueTypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1076        type Borrowed<'a> = &'a Self;
1077        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1078            value
1079        }
1080    }
1081
1082    unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1083        type Owned = Self;
1084
1085        #[inline(always)]
1086        fn inline_align(_context: fidl::encoding::Context) -> usize {
1087            4
1088        }
1089
1090        #[inline(always)]
1091        fn inline_size(_context: fidl::encoding::Context) -> usize {
1092            4
1093        }
1094    }
1095
1096    unsafe impl<D: fidl::encoding::ResourceDialect>
1097        fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D>
1098        for &CapabilitiesDirConnectorRouterRouteResponse
1099    {
1100        #[inline]
1101        unsafe fn encode(
1102            self,
1103            encoder: &mut fidl::encoding::Encoder<'_, D>,
1104            offset: usize,
1105            _depth: fidl::encoding::Depth,
1106        ) -> fidl::Result<()> {
1107            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1108            // Delegate to tuple encoding.
1109            fidl::encoding::Encode::<CapabilitiesDirConnectorRouterRouteResponse, D>::encode(
1110                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1111                encoder,
1112                offset,
1113                _depth,
1114            )
1115        }
1116    }
1117    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1118        fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D> for (T0,)
1119    {
1120        #[inline]
1121        unsafe fn encode(
1122            self,
1123            encoder: &mut fidl::encoding::Encoder<'_, D>,
1124            offset: usize,
1125            depth: fidl::encoding::Depth,
1126        ) -> fidl::Result<()> {
1127            encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1128            // Zero out padding regions. There's no need to apply masks
1129            // because the unmasked parts will be overwritten by fields.
1130            // Write the fields.
1131            self.0.encode(encoder, offset + 0, depth)?;
1132            Ok(())
1133        }
1134    }
1135
1136    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1137        for CapabilitiesDirConnectorRouterRouteResponse
1138    {
1139        #[inline(always)]
1140        fn new_empty() -> Self {
1141            Self { response: fidl::new_empty!(RouterResponse, D) }
1142        }
1143
1144        #[inline]
1145        unsafe fn decode(
1146            &mut self,
1147            decoder: &mut fidl::encoding::Decoder<'_, D>,
1148            offset: usize,
1149            _depth: fidl::encoding::Depth,
1150        ) -> fidl::Result<()> {
1151            decoder.debug_check_bounds::<Self>(offset);
1152            // Verify that padding bytes are zero.
1153            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1154            Ok(())
1155        }
1156    }
1157
1158    impl fidl::encoding::ValueTypeMarker for ConnectorRouterRouteResponse {
1159        type Borrowed<'a> = &'a Self;
1160        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1161            value
1162        }
1163    }
1164
1165    unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
1166        type Owned = Self;
1167
1168        #[inline(always)]
1169        fn inline_align(_context: fidl::encoding::Context) -> usize {
1170            4
1171        }
1172
1173        #[inline(always)]
1174        fn inline_size(_context: fidl::encoding::Context) -> usize {
1175            4
1176        }
1177    }
1178
1179    unsafe impl<D: fidl::encoding::ResourceDialect>
1180        fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for &ConnectorRouterRouteResponse
1181    {
1182        #[inline]
1183        unsafe fn encode(
1184            self,
1185            encoder: &mut fidl::encoding::Encoder<'_, D>,
1186            offset: usize,
1187            _depth: fidl::encoding::Depth,
1188        ) -> fidl::Result<()> {
1189            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1190            // Delegate to tuple encoding.
1191            fidl::encoding::Encode::<ConnectorRouterRouteResponse, D>::encode(
1192                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1193                encoder,
1194                offset,
1195                _depth,
1196            )
1197        }
1198    }
1199    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1200        fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for (T0,)
1201    {
1202        #[inline]
1203        unsafe fn encode(
1204            self,
1205            encoder: &mut fidl::encoding::Encoder<'_, D>,
1206            offset: usize,
1207            depth: fidl::encoding::Depth,
1208        ) -> fidl::Result<()> {
1209            encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1210            // Zero out padding regions. There's no need to apply masks
1211            // because the unmasked parts will be overwritten by fields.
1212            // Write the fields.
1213            self.0.encode(encoder, offset + 0, depth)?;
1214            Ok(())
1215        }
1216    }
1217
1218    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1219        for ConnectorRouterRouteResponse
1220    {
1221        #[inline(always)]
1222        fn new_empty() -> Self {
1223            Self { response: fidl::new_empty!(RouterResponse, D) }
1224        }
1225
1226        #[inline]
1227        unsafe fn decode(
1228            &mut self,
1229            decoder: &mut fidl::encoding::Decoder<'_, D>,
1230            offset: usize,
1231            _depth: fidl::encoding::Depth,
1232        ) -> fidl::Result<()> {
1233            decoder.debug_check_bounds::<Self>(offset);
1234            // Verify that padding bytes are zero.
1235            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1236            Ok(())
1237        }
1238    }
1239
1240    impl fidl::encoding::ValueTypeMarker for DataRouterRouteResponse {
1241        type Borrowed<'a> = &'a Self;
1242        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1243            value
1244        }
1245    }
1246
1247    unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
1248        type Owned = Self;
1249
1250        #[inline(always)]
1251        fn inline_align(_context: fidl::encoding::Context) -> usize {
1252            4
1253        }
1254
1255        #[inline(always)]
1256        fn inline_size(_context: fidl::encoding::Context) -> usize {
1257            4
1258        }
1259    }
1260
1261    unsafe impl<D: fidl::encoding::ResourceDialect>
1262        fidl::encoding::Encode<DataRouterRouteResponse, D> for &DataRouterRouteResponse
1263    {
1264        #[inline]
1265        unsafe fn encode(
1266            self,
1267            encoder: &mut fidl::encoding::Encoder<'_, D>,
1268            offset: usize,
1269            _depth: fidl::encoding::Depth,
1270        ) -> fidl::Result<()> {
1271            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1272            // Delegate to tuple encoding.
1273            fidl::encoding::Encode::<DataRouterRouteResponse, D>::encode(
1274                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1275                encoder,
1276                offset,
1277                _depth,
1278            )
1279        }
1280    }
1281    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1282        fidl::encoding::Encode<DataRouterRouteResponse, D> for (T0,)
1283    {
1284        #[inline]
1285        unsafe fn encode(
1286            self,
1287            encoder: &mut fidl::encoding::Encoder<'_, D>,
1288            offset: usize,
1289            depth: fidl::encoding::Depth,
1290        ) -> fidl::Result<()> {
1291            encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1292            // Zero out padding regions. There's no need to apply masks
1293            // because the unmasked parts will be overwritten by fields.
1294            // Write the fields.
1295            self.0.encode(encoder, offset + 0, depth)?;
1296            Ok(())
1297        }
1298    }
1299
1300    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1301        for DataRouterRouteResponse
1302    {
1303        #[inline(always)]
1304        fn new_empty() -> Self {
1305            Self { response: fidl::new_empty!(RouterResponse, D) }
1306        }
1307
1308        #[inline]
1309        unsafe fn decode(
1310            &mut self,
1311            decoder: &mut fidl::encoding::Decoder<'_, D>,
1312            offset: usize,
1313            _depth: fidl::encoding::Depth,
1314        ) -> fidl::Result<()> {
1315            decoder.debug_check_bounds::<Self>(offset);
1316            // Verify that padding bytes are zero.
1317            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1318            Ok(())
1319        }
1320    }
1321
1322    impl fidl::encoding::ValueTypeMarker for DictionaryKeyIteratorGetNextResponse {
1323        type Borrowed<'a> = &'a Self;
1324        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1325            value
1326        }
1327    }
1328
1329    unsafe impl fidl::encoding::TypeMarker for DictionaryKeyIteratorGetNextResponse {
1330        type Owned = Self;
1331
1332        #[inline(always)]
1333        fn inline_align(_context: fidl::encoding::Context) -> usize {
1334            8
1335        }
1336
1337        #[inline(always)]
1338        fn inline_size(_context: fidl::encoding::Context) -> usize {
1339            16
1340        }
1341    }
1342
1343    unsafe impl<D: fidl::encoding::ResourceDialect>
1344        fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D>
1345        for &DictionaryKeyIteratorGetNextResponse
1346    {
1347        #[inline]
1348        unsafe fn encode(
1349            self,
1350            encoder: &mut fidl::encoding::Encoder<'_, D>,
1351            offset: usize,
1352            _depth: fidl::encoding::Depth,
1353        ) -> fidl::Result<()> {
1354            encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1355            // Delegate to tuple encoding.
1356            fidl::encoding::Encode::<DictionaryKeyIteratorGetNextResponse, D>::encode(
1357                (
1358                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
1359                ),
1360                encoder, offset, _depth
1361            )
1362        }
1363    }
1364    unsafe impl<
1365        D: fidl::encoding::ResourceDialect,
1366        T0: fidl::encoding::Encode<
1367                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1368                D,
1369            >,
1370    > fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D> for (T0,)
1371    {
1372        #[inline]
1373        unsafe fn encode(
1374            self,
1375            encoder: &mut fidl::encoding::Encoder<'_, D>,
1376            offset: usize,
1377            depth: fidl::encoding::Depth,
1378        ) -> fidl::Result<()> {
1379            encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1380            // Zero out padding regions. There's no need to apply masks
1381            // because the unmasked parts will be overwritten by fields.
1382            // Write the fields.
1383            self.0.encode(encoder, offset + 0, depth)?;
1384            Ok(())
1385        }
1386    }
1387
1388    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1389        for DictionaryKeyIteratorGetNextResponse
1390    {
1391        #[inline(always)]
1392        fn new_empty() -> Self {
1393            Self {
1394                keys: fidl::new_empty!(
1395                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1396                    D
1397                ),
1398            }
1399        }
1400
1401        #[inline]
1402        unsafe fn decode(
1403            &mut self,
1404            decoder: &mut fidl::encoding::Decoder<'_, D>,
1405            offset: usize,
1406            _depth: fidl::encoding::Depth,
1407        ) -> fidl::Result<()> {
1408            decoder.debug_check_bounds::<Self>(offset);
1409            // Verify that padding bytes are zero.
1410            fidl::decode!(
1411                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1412                D,
1413                &mut self.keys,
1414                decoder,
1415                offset + 0,
1416                _depth
1417            )?;
1418            Ok(())
1419        }
1420    }
1421
1422    impl fidl::encoding::ValueTypeMarker for DictionaryRouterRouteResponse {
1423        type Borrowed<'a> = &'a Self;
1424        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1425            value
1426        }
1427    }
1428
1429    unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
1430        type Owned = Self;
1431
1432        #[inline(always)]
1433        fn inline_align(_context: fidl::encoding::Context) -> usize {
1434            4
1435        }
1436
1437        #[inline(always)]
1438        fn inline_size(_context: fidl::encoding::Context) -> usize {
1439            4
1440        }
1441    }
1442
1443    unsafe impl<D: fidl::encoding::ResourceDialect>
1444        fidl::encoding::Encode<DictionaryRouterRouteResponse, D>
1445        for &DictionaryRouterRouteResponse
1446    {
1447        #[inline]
1448        unsafe fn encode(
1449            self,
1450            encoder: &mut fidl::encoding::Encoder<'_, D>,
1451            offset: usize,
1452            _depth: fidl::encoding::Depth,
1453        ) -> fidl::Result<()> {
1454            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1455            // Delegate to tuple encoding.
1456            fidl::encoding::Encode::<DictionaryRouterRouteResponse, D>::encode(
1457                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1458                encoder,
1459                offset,
1460                _depth,
1461            )
1462        }
1463    }
1464    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1465        fidl::encoding::Encode<DictionaryRouterRouteResponse, D> for (T0,)
1466    {
1467        #[inline]
1468        unsafe fn encode(
1469            self,
1470            encoder: &mut fidl::encoding::Encoder<'_, D>,
1471            offset: usize,
1472            depth: fidl::encoding::Depth,
1473        ) -> fidl::Result<()> {
1474            encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1475            // Zero out padding regions. There's no need to apply masks
1476            // because the unmasked parts will be overwritten by fields.
1477            // Write the fields.
1478            self.0.encode(encoder, offset + 0, depth)?;
1479            Ok(())
1480        }
1481    }
1482
1483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1484        for DictionaryRouterRouteResponse
1485    {
1486        #[inline(always)]
1487        fn new_empty() -> Self {
1488            Self { response: fidl::new_empty!(RouterResponse, D) }
1489        }
1490
1491        #[inline]
1492        unsafe fn decode(
1493            &mut self,
1494            decoder: &mut fidl::encoding::Decoder<'_, D>,
1495            offset: usize,
1496            _depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            decoder.debug_check_bounds::<Self>(offset);
1499            // Verify that padding bytes are zero.
1500            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1501            Ok(())
1502        }
1503    }
1504
1505    impl fidl::encoding::ValueTypeMarker for DirConnectorRouterRouteResponse {
1506        type Borrowed<'a> = &'a Self;
1507        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1508            value
1509        }
1510    }
1511
1512    unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
1513        type Owned = Self;
1514
1515        #[inline(always)]
1516        fn inline_align(_context: fidl::encoding::Context) -> usize {
1517            4
1518        }
1519
1520        #[inline(always)]
1521        fn inline_size(_context: fidl::encoding::Context) -> usize {
1522            4
1523        }
1524    }
1525
1526    unsafe impl<D: fidl::encoding::ResourceDialect>
1527        fidl::encoding::Encode<DirConnectorRouterRouteResponse, D>
1528        for &DirConnectorRouterRouteResponse
1529    {
1530        #[inline]
1531        unsafe fn encode(
1532            self,
1533            encoder: &mut fidl::encoding::Encoder<'_, D>,
1534            offset: usize,
1535            _depth: fidl::encoding::Depth,
1536        ) -> fidl::Result<()> {
1537            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1538            // Delegate to tuple encoding.
1539            fidl::encoding::Encode::<DirConnectorRouterRouteResponse, D>::encode(
1540                (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1541                encoder,
1542                offset,
1543                _depth,
1544            )
1545        }
1546    }
1547    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1548        fidl::encoding::Encode<DirConnectorRouterRouteResponse, D> for (T0,)
1549    {
1550        #[inline]
1551        unsafe fn encode(
1552            self,
1553            encoder: &mut fidl::encoding::Encoder<'_, D>,
1554            offset: usize,
1555            depth: fidl::encoding::Depth,
1556        ) -> fidl::Result<()> {
1557            encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1558            // Zero out padding regions. There's no need to apply masks
1559            // because the unmasked parts will be overwritten by fields.
1560            // Write the fields.
1561            self.0.encode(encoder, offset + 0, depth)?;
1562            Ok(())
1563        }
1564    }
1565
1566    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1567        for DirConnectorRouterRouteResponse
1568    {
1569        #[inline(always)]
1570        fn new_empty() -> Self {
1571            Self { response: fidl::new_empty!(RouterResponse, D) }
1572        }
1573
1574        #[inline]
1575        unsafe fn decode(
1576            &mut self,
1577            decoder: &mut fidl::encoding::Decoder<'_, D>,
1578            offset: usize,
1579            _depth: fidl::encoding::Depth,
1580        ) -> fidl::Result<()> {
1581            decoder.debug_check_bounds::<Self>(offset);
1582            // Verify that padding bytes are zero.
1583            fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1584            Ok(())
1585        }
1586    }
1587
1588    impl fidl::encoding::ValueTypeMarker for Data {
1589        type Borrowed<'a> = &'a Self;
1590        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1591            value
1592        }
1593    }
1594
1595    unsafe impl fidl::encoding::TypeMarker for Data {
1596        type Owned = Self;
1597
1598        #[inline(always)]
1599        fn inline_align(_context: fidl::encoding::Context) -> usize {
1600            8
1601        }
1602
1603        #[inline(always)]
1604        fn inline_size(_context: fidl::encoding::Context) -> usize {
1605            16
1606        }
1607    }
1608
1609    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Data, D> for &Data {
1610        #[inline]
1611        unsafe fn encode(
1612            self,
1613            encoder: &mut fidl::encoding::Encoder<'_, D>,
1614            offset: usize,
1615            _depth: fidl::encoding::Depth,
1616        ) -> fidl::Result<()> {
1617            encoder.debug_check_bounds::<Data>(offset);
1618            encoder.write_num::<u64>(self.ordinal(), offset);
1619            match self {
1620            Data::Bytes(ref val) => {
1621                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u8, 8192>, D>(
1622                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
1623                    encoder, offset + 8, _depth
1624                )
1625            }
1626            Data::String(ref val) => {
1627                fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<8192>, D>(
1628                    <fidl::encoding::BoundedString<8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
1629                    encoder, offset + 8, _depth
1630                )
1631            }
1632            Data::Int64(ref val) => {
1633                fidl::encoding::encode_in_envelope::<i64, D>(
1634                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
1635                    encoder, offset + 8, _depth
1636                )
1637            }
1638            Data::Uint64(ref val) => {
1639                fidl::encoding::encode_in_envelope::<u64, D>(
1640                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
1641                    encoder, offset + 8, _depth
1642                )
1643            }
1644            Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1645        }
1646        }
1647    }
1648
1649    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Data {
1650        #[inline(always)]
1651        fn new_empty() -> Self {
1652            Self::__SourceBreaking { unknown_ordinal: 0 }
1653        }
1654
1655        #[inline]
1656        unsafe fn decode(
1657            &mut self,
1658            decoder: &mut fidl::encoding::Decoder<'_, D>,
1659            offset: usize,
1660            mut depth: fidl::encoding::Depth,
1661        ) -> fidl::Result<()> {
1662            decoder.debug_check_bounds::<Self>(offset);
1663            #[allow(unused_variables)]
1664            let next_out_of_line = decoder.next_out_of_line();
1665            let handles_before = decoder.remaining_handles();
1666            let (ordinal, inlined, num_bytes, num_handles) =
1667                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1668
1669            let member_inline_size = match ordinal {
1670                1 => <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
1671                    decoder.context,
1672                ),
1673                2 => {
1674                    <fidl::encoding::BoundedString<8192> as fidl::encoding::TypeMarker>::inline_size(
1675                        decoder.context,
1676                    )
1677                }
1678                3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1679                4 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1680                0 => return Err(fidl::Error::UnknownUnionTag),
1681                _ => num_bytes as usize,
1682            };
1683
1684            if inlined != (member_inline_size <= 4) {
1685                return Err(fidl::Error::InvalidInlineBitInEnvelope);
1686            }
1687            let _inner_offset;
1688            if inlined {
1689                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1690                _inner_offset = offset + 8;
1691            } else {
1692                depth.increment()?;
1693                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1694            }
1695            match ordinal {
1696                1 => {
1697                    #[allow(irrefutable_let_patterns)]
1698                    if let Data::Bytes(_) = self {
1699                        // Do nothing, read the value into the object
1700                    } else {
1701                        // Initialize `self` to the right variant
1702                        *self = Data::Bytes(fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D));
1703                    }
1704                    #[allow(irrefutable_let_patterns)]
1705                    if let Data::Bytes(ref mut val) = self {
1706                        fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, val, decoder, _inner_offset, depth)?;
1707                    } else {
1708                        unreachable!()
1709                    }
1710                }
1711                2 => {
1712                    #[allow(irrefutable_let_patterns)]
1713                    if let Data::String(_) = self {
1714                        // Do nothing, read the value into the object
1715                    } else {
1716                        // Initialize `self` to the right variant
1717                        *self =
1718                            Data::String(fidl::new_empty!(fidl::encoding::BoundedString<8192>, D));
1719                    }
1720                    #[allow(irrefutable_let_patterns)]
1721                    if let Data::String(ref mut val) = self {
1722                        fidl::decode!(
1723                            fidl::encoding::BoundedString<8192>,
1724                            D,
1725                            val,
1726                            decoder,
1727                            _inner_offset,
1728                            depth
1729                        )?;
1730                    } else {
1731                        unreachable!()
1732                    }
1733                }
1734                3 => {
1735                    #[allow(irrefutable_let_patterns)]
1736                    if let Data::Int64(_) = self {
1737                        // Do nothing, read the value into the object
1738                    } else {
1739                        // Initialize `self` to the right variant
1740                        *self = Data::Int64(fidl::new_empty!(i64, D));
1741                    }
1742                    #[allow(irrefutable_let_patterns)]
1743                    if let Data::Int64(ref mut val) = self {
1744                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
1745                    } else {
1746                        unreachable!()
1747                    }
1748                }
1749                4 => {
1750                    #[allow(irrefutable_let_patterns)]
1751                    if let Data::Uint64(_) = self {
1752                        // Do nothing, read the value into the object
1753                    } else {
1754                        // Initialize `self` to the right variant
1755                        *self = Data::Uint64(fidl::new_empty!(u64, D));
1756                    }
1757                    #[allow(irrefutable_let_patterns)]
1758                    if let Data::Uint64(ref mut val) = self {
1759                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
1760                    } else {
1761                        unreachable!()
1762                    }
1763                }
1764                #[allow(deprecated)]
1765                ordinal => {
1766                    for _ in 0..num_handles {
1767                        decoder.drop_next_handle()?;
1768                    }
1769                    *self = Data::__SourceBreaking { unknown_ordinal: ordinal };
1770                }
1771            }
1772            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1773                return Err(fidl::Error::InvalidNumBytesInEnvelope);
1774            }
1775            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1776                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1777            }
1778            Ok(())
1779        }
1780    }
1781}