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