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, Default, PartialEq)]
393pub struct RouteRequest {
394 pub build_type_name: Option<String>,
397 pub availability: Option<fidl_fuchsia_component_decl__common::Availability>,
399 pub directory_rights: Option<fidl_fuchsia_io__common::Flags>,
402 pub directory_intermediate_rights: Option<fidl_fuchsia_io__common::Flags>,
405 pub inherit_rights: Option<bool>,
409 pub sub_directory_path: Option<String>,
412 pub isolated_storage_path: Option<String>,
415 pub storage_sub_directory_path: Option<String>,
427 pub storage_source_moniker: Option<String>,
431 pub event_stream_scope_moniker: Option<String>,
434 pub event_stream_scope: Option<Vec<fidl_fuchsia_component_decl__common::Ref>>,
438 pub skip_policy_checks: Option<bool>,
443 #[doc(hidden)]
444 pub __source_breaking: fidl::marker::SourceBreaking,
445}
446
447impl fidl::Persistable for RouteRequest {}
448
449#[derive(Clone, Debug)]
452pub enum Data {
453 Bytes(Vec<u8>),
454 String(String),
455 Int64(i64),
456 Uint64(u64),
457 #[doc(hidden)]
458 __SourceBreaking {
459 unknown_ordinal: u64,
460 },
461}
462
463#[macro_export]
465macro_rules! DataUnknown {
466 () => {
467 _
468 };
469}
470
471impl PartialEq for Data {
473 fn eq(&self, other: &Self) -> bool {
474 match (self, other) {
475 (Self::Bytes(x), Self::Bytes(y)) => *x == *y,
476 (Self::String(x), Self::String(y)) => *x == *y,
477 (Self::Int64(x), Self::Int64(y)) => *x == *y,
478 (Self::Uint64(x), Self::Uint64(y)) => *x == *y,
479 _ => false,
480 }
481 }
482}
483
484impl Data {
485 #[inline]
486 pub fn ordinal(&self) -> u64 {
487 match *self {
488 Self::Bytes(_) => 1,
489 Self::String(_) => 2,
490 Self::Int64(_) => 3,
491 Self::Uint64(_) => 4,
492 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
493 }
494 }
495
496 #[inline]
497 pub fn unknown_variant_for_testing() -> Self {
498 Self::__SourceBreaking { unknown_ordinal: 0 }
499 }
500
501 #[inline]
502 pub fn is_unknown(&self) -> bool {
503 match self {
504 Self::__SourceBreaking { .. } => true,
505 _ => false,
506 }
507 }
508}
509
510impl fidl::Persistable for Data {}
511
512pub mod capabilities_ordinals {
513 pub const CONNECTOR_CREATE: u64 = 0xac2bc2dbd7033d1;
514 pub const DIR_CONNECTOR_CREATE: u64 = 0x721911e05da2a3bf;
515 pub const DICTIONARY_CREATE: u64 = 0x7f8bd91f0942a36e;
516 pub const DATA_CREATE: u64 = 0x40ef43e45372ee6a;
517 pub const CONNECTOR_ROUTER_CREATE: u64 = 0x7f7e7fbafcdf1761;
518 pub const DIR_CONNECTOR_ROUTER_CREATE: u64 = 0x56520da453fad19f;
519 pub const DICTIONARY_ROUTER_CREATE: u64 = 0x37acef18cd423d42;
520 pub const DATA_ROUTER_CREATE: u64 = 0x24e471395b95088;
521 pub const INSTANCE_TOKEN_CREATE: u64 = 0x3576e31727c40813;
522 pub const CONNECTOR_OPEN: u64 = 0xc0646965f1884eb;
523 pub const DIR_CONNECTOR_OPEN: u64 = 0x1332bbf5debd6c20;
524 pub const DICTIONARY_INSERT: u64 = 0x5972e3061a760e7a;
525 pub const DICTIONARY_GET: u64 = 0x31fafe2280a283d5;
526 pub const DICTIONARY_REMOVE: u64 = 0x6827c83106ac5a2c;
527 pub const DICTIONARY_ITERATE_KEYS: u64 = 0x3d4ea59c80df9bb8;
528 pub const DATA_GET: u64 = 0x65ae25b59f9e0daf;
529 pub const CONNECTOR_ROUTER_ROUTE: u64 = 0x1bd9c6e7e3dd487e;
530 pub const DIR_CONNECTOR_ROUTER_ROUTE: u64 = 0x3afdcc1b79e0799d;
531 pub const DICTIONARY_ROUTER_ROUTE: u64 = 0xcf72de10714a708;
532 pub const DATA_ROUTER_ROUTE: u64 = 0x61ab188455ed0643;
533 pub const CAPABILITY_ASSOCIATE_HANDLE: u64 = 0x1d69bb61953d8e7;
534}
535
536pub mod connector_router_ordinals {
537 pub const ROUTE: u64 = 0x57a912c92a38f9f8;
538}
539
540pub mod data_router_ordinals {
541 pub const ROUTE: u64 = 0x646885ba7e10ceeb;
542}
543
544pub mod dictionary_key_iterator_ordinals {
545 pub const GET_NEXT: u64 = 0x3806bda34433db54;
546}
547
548pub mod dictionary_router_ordinals {
549 pub const ROUTE: u64 = 0x199389f437b3937b;
550}
551
552pub mod dir_connector_router_ordinals {
553 pub const ROUTE: u64 = 0x233f2ac038127462;
554}
555
556pub mod dir_receiver_ordinals {
557 pub const RECEIVE: u64 = 0x4ac564d726bb325e;
558}
559
560pub mod receiver_ordinals {
561 pub const RECEIVE: u64 = 0x609ca5c7943b58d0;
562}
563
564mod internal {
565 use super::*;
566 unsafe impl fidl::encoding::TypeMarker for CapabilitiesError {
567 type Owned = Self;
568
569 #[inline(always)]
570 fn inline_align(_context: fidl::encoding::Context) -> usize {
571 std::mem::align_of::<u32>()
572 }
573
574 #[inline(always)]
575 fn inline_size(_context: fidl::encoding::Context) -> usize {
576 std::mem::size_of::<u32>()
577 }
578
579 #[inline(always)]
580 fn encode_is_copy() -> bool {
581 false
582 }
583
584 #[inline(always)]
585 fn decode_is_copy() -> bool {
586 false
587 }
588 }
589
590 impl fidl::encoding::ValueTypeMarker for CapabilitiesError {
591 type Borrowed<'a> = Self;
592 #[inline(always)]
593 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
594 *value
595 }
596 }
597
598 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
599 for CapabilitiesError
600 {
601 #[inline]
602 unsafe fn encode(
603 self,
604 encoder: &mut fidl::encoding::Encoder<'_, D>,
605 offset: usize,
606 _depth: fidl::encoding::Depth,
607 ) -> fidl::Result<()> {
608 encoder.debug_check_bounds::<Self>(offset);
609 encoder.write_num(self.into_primitive(), offset);
610 Ok(())
611 }
612 }
613
614 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilitiesError {
615 #[inline(always)]
616 fn new_empty() -> Self {
617 Self::unknown()
618 }
619
620 #[inline]
621 unsafe fn decode(
622 &mut self,
623 decoder: &mut fidl::encoding::Decoder<'_, D>,
624 offset: usize,
625 _depth: fidl::encoding::Depth,
626 ) -> fidl::Result<()> {
627 decoder.debug_check_bounds::<Self>(offset);
628 let prim = decoder.read_num::<u32>(offset);
629
630 *self = Self::from_primitive_allow_unknown(prim);
631 Ok(())
632 }
633 }
634 unsafe impl fidl::encoding::TypeMarker for CapabilityType {
635 type Owned = Self;
636
637 #[inline(always)]
638 fn inline_align(_context: fidl::encoding::Context) -> usize {
639 std::mem::align_of::<u32>()
640 }
641
642 #[inline(always)]
643 fn inline_size(_context: fidl::encoding::Context) -> usize {
644 std::mem::size_of::<u32>()
645 }
646
647 #[inline(always)]
648 fn encode_is_copy() -> bool {
649 false
650 }
651
652 #[inline(always)]
653 fn decode_is_copy() -> bool {
654 false
655 }
656 }
657
658 impl fidl::encoding::ValueTypeMarker for CapabilityType {
659 type Borrowed<'a> = Self;
660 #[inline(always)]
661 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
662 *value
663 }
664 }
665
666 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CapabilityType {
667 #[inline]
668 unsafe fn encode(
669 self,
670 encoder: &mut fidl::encoding::Encoder<'_, D>,
671 offset: usize,
672 _depth: fidl::encoding::Depth,
673 ) -> fidl::Result<()> {
674 encoder.debug_check_bounds::<Self>(offset);
675 encoder.write_num(self.into_primitive(), offset);
676 Ok(())
677 }
678 }
679
680 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CapabilityType {
681 #[inline(always)]
682 fn new_empty() -> Self {
683 Self::unknown()
684 }
685
686 #[inline]
687 unsafe fn decode(
688 &mut self,
689 decoder: &mut fidl::encoding::Decoder<'_, D>,
690 offset: usize,
691 _depth: fidl::encoding::Depth,
692 ) -> fidl::Result<()> {
693 decoder.debug_check_bounds::<Self>(offset);
694 let prim = decoder.read_num::<u32>(offset);
695
696 *self = Self::from_primitive_allow_unknown(prim);
697 Ok(())
698 }
699 }
700 unsafe impl fidl::encoding::TypeMarker for RouterError {
701 type Owned = Self;
702
703 #[inline(always)]
704 fn inline_align(_context: fidl::encoding::Context) -> usize {
705 std::mem::align_of::<u32>()
706 }
707
708 #[inline(always)]
709 fn inline_size(_context: fidl::encoding::Context) -> usize {
710 std::mem::size_of::<u32>()
711 }
712
713 #[inline(always)]
714 fn encode_is_copy() -> bool {
715 false
716 }
717
718 #[inline(always)]
719 fn decode_is_copy() -> bool {
720 false
721 }
722 }
723
724 impl fidl::encoding::ValueTypeMarker for RouterError {
725 type Borrowed<'a> = Self;
726 #[inline(always)]
727 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
728 *value
729 }
730 }
731
732 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterError {
733 #[inline]
734 unsafe fn encode(
735 self,
736 encoder: &mut fidl::encoding::Encoder<'_, D>,
737 offset: usize,
738 _depth: fidl::encoding::Depth,
739 ) -> fidl::Result<()> {
740 encoder.debug_check_bounds::<Self>(offset);
741 encoder.write_num(self.into_primitive(), offset);
742 Ok(())
743 }
744 }
745
746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterError {
747 #[inline(always)]
748 fn new_empty() -> Self {
749 Self::unknown()
750 }
751
752 #[inline]
753 unsafe fn decode(
754 &mut self,
755 decoder: &mut fidl::encoding::Decoder<'_, D>,
756 offset: usize,
757 _depth: fidl::encoding::Depth,
758 ) -> fidl::Result<()> {
759 decoder.debug_check_bounds::<Self>(offset);
760 let prim = decoder.read_num::<u32>(offset);
761
762 *self = Self::from_primitive_allow_unknown(prim);
763 Ok(())
764 }
765 }
766 unsafe impl fidl::encoding::TypeMarker for RouterResponse {
767 type Owned = Self;
768
769 #[inline(always)]
770 fn inline_align(_context: fidl::encoding::Context) -> usize {
771 std::mem::align_of::<u32>()
772 }
773
774 #[inline(always)]
775 fn inline_size(_context: fidl::encoding::Context) -> usize {
776 std::mem::size_of::<u32>()
777 }
778
779 #[inline(always)]
780 fn encode_is_copy() -> bool {
781 false
782 }
783
784 #[inline(always)]
785 fn decode_is_copy() -> bool {
786 false
787 }
788 }
789
790 impl fidl::encoding::ValueTypeMarker for RouterResponse {
791 type Borrowed<'a> = Self;
792 #[inline(always)]
793 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
794 *value
795 }
796 }
797
798 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouterResponse {
799 #[inline]
800 unsafe fn encode(
801 self,
802 encoder: &mut fidl::encoding::Encoder<'_, D>,
803 offset: usize,
804 _depth: fidl::encoding::Depth,
805 ) -> fidl::Result<()> {
806 encoder.debug_check_bounds::<Self>(offset);
807 encoder.write_num(self.into_primitive(), offset);
808 Ok(())
809 }
810 }
811
812 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouterResponse {
813 #[inline(always)]
814 fn new_empty() -> Self {
815 Self::unknown()
816 }
817
818 #[inline]
819 unsafe fn decode(
820 &mut self,
821 decoder: &mut fidl::encoding::Decoder<'_, D>,
822 offset: usize,
823 _depth: fidl::encoding::Depth,
824 ) -> fidl::Result<()> {
825 decoder.debug_check_bounds::<Self>(offset);
826 let prim = decoder.read_num::<u32>(offset);
827
828 *self = Self::from_primitive_allow_unknown(prim);
829 Ok(())
830 }
831 }
832
833 impl fidl::encoding::ValueTypeMarker for CapabilitiesConnectorRouterRouteResponse {
834 type Borrowed<'a> = &'a Self;
835 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
836 value
837 }
838 }
839
840 unsafe impl fidl::encoding::TypeMarker for CapabilitiesConnectorRouterRouteResponse {
841 type Owned = Self;
842
843 #[inline(always)]
844 fn inline_align(_context: fidl::encoding::Context) -> usize {
845 4
846 }
847
848 #[inline(always)]
849 fn inline_size(_context: fidl::encoding::Context) -> usize {
850 4
851 }
852 }
853
854 unsafe impl<D: fidl::encoding::ResourceDialect>
855 fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D>
856 for &CapabilitiesConnectorRouterRouteResponse
857 {
858 #[inline]
859 unsafe fn encode(
860 self,
861 encoder: &mut fidl::encoding::Encoder<'_, D>,
862 offset: usize,
863 _depth: fidl::encoding::Depth,
864 ) -> fidl::Result<()> {
865 encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
866 fidl::encoding::Encode::<CapabilitiesConnectorRouterRouteResponse, D>::encode(
868 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
869 encoder,
870 offset,
871 _depth,
872 )
873 }
874 }
875 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
876 fidl::encoding::Encode<CapabilitiesConnectorRouterRouteResponse, D> for (T0,)
877 {
878 #[inline]
879 unsafe fn encode(
880 self,
881 encoder: &mut fidl::encoding::Encoder<'_, D>,
882 offset: usize,
883 depth: fidl::encoding::Depth,
884 ) -> fidl::Result<()> {
885 encoder.debug_check_bounds::<CapabilitiesConnectorRouterRouteResponse>(offset);
886 self.0.encode(encoder, offset + 0, depth)?;
890 Ok(())
891 }
892 }
893
894 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
895 for CapabilitiesConnectorRouterRouteResponse
896 {
897 #[inline(always)]
898 fn new_empty() -> Self {
899 Self { response: fidl::new_empty!(RouterResponse, D) }
900 }
901
902 #[inline]
903 unsafe fn decode(
904 &mut self,
905 decoder: &mut fidl::encoding::Decoder<'_, D>,
906 offset: usize,
907 _depth: fidl::encoding::Depth,
908 ) -> fidl::Result<()> {
909 decoder.debug_check_bounds::<Self>(offset);
910 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
912 Ok(())
913 }
914 }
915
916 impl fidl::encoding::ValueTypeMarker for CapabilitiesDataRouterRouteResponse {
917 type Borrowed<'a> = &'a Self;
918 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
919 value
920 }
921 }
922
923 unsafe impl fidl::encoding::TypeMarker for CapabilitiesDataRouterRouteResponse {
924 type Owned = Self;
925
926 #[inline(always)]
927 fn inline_align(_context: fidl::encoding::Context) -> usize {
928 4
929 }
930
931 #[inline(always)]
932 fn inline_size(_context: fidl::encoding::Context) -> usize {
933 4
934 }
935 }
936
937 unsafe impl<D: fidl::encoding::ResourceDialect>
938 fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D>
939 for &CapabilitiesDataRouterRouteResponse
940 {
941 #[inline]
942 unsafe fn encode(
943 self,
944 encoder: &mut fidl::encoding::Encoder<'_, D>,
945 offset: usize,
946 _depth: fidl::encoding::Depth,
947 ) -> fidl::Result<()> {
948 encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
949 fidl::encoding::Encode::<CapabilitiesDataRouterRouteResponse, D>::encode(
951 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
952 encoder,
953 offset,
954 _depth,
955 )
956 }
957 }
958 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
959 fidl::encoding::Encode<CapabilitiesDataRouterRouteResponse, D> for (T0,)
960 {
961 #[inline]
962 unsafe fn encode(
963 self,
964 encoder: &mut fidl::encoding::Encoder<'_, D>,
965 offset: usize,
966 depth: fidl::encoding::Depth,
967 ) -> fidl::Result<()> {
968 encoder.debug_check_bounds::<CapabilitiesDataRouterRouteResponse>(offset);
969 self.0.encode(encoder, offset + 0, depth)?;
973 Ok(())
974 }
975 }
976
977 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
978 for CapabilitiesDataRouterRouteResponse
979 {
980 #[inline(always)]
981 fn new_empty() -> Self {
982 Self { response: fidl::new_empty!(RouterResponse, D) }
983 }
984
985 #[inline]
986 unsafe fn decode(
987 &mut self,
988 decoder: &mut fidl::encoding::Decoder<'_, D>,
989 offset: usize,
990 _depth: fidl::encoding::Depth,
991 ) -> fidl::Result<()> {
992 decoder.debug_check_bounds::<Self>(offset);
993 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
995 Ok(())
996 }
997 }
998
999 impl fidl::encoding::ValueTypeMarker for CapabilitiesDictionaryRouterRouteResponse {
1000 type Borrowed<'a> = &'a Self;
1001 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1002 value
1003 }
1004 }
1005
1006 unsafe impl fidl::encoding::TypeMarker for CapabilitiesDictionaryRouterRouteResponse {
1007 type Owned = Self;
1008
1009 #[inline(always)]
1010 fn inline_align(_context: fidl::encoding::Context) -> usize {
1011 4
1012 }
1013
1014 #[inline(always)]
1015 fn inline_size(_context: fidl::encoding::Context) -> usize {
1016 4
1017 }
1018 }
1019
1020 unsafe impl<D: fidl::encoding::ResourceDialect>
1021 fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D>
1022 for &CapabilitiesDictionaryRouterRouteResponse
1023 {
1024 #[inline]
1025 unsafe fn encode(
1026 self,
1027 encoder: &mut fidl::encoding::Encoder<'_, D>,
1028 offset: usize,
1029 _depth: fidl::encoding::Depth,
1030 ) -> fidl::Result<()> {
1031 encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
1032 fidl::encoding::Encode::<CapabilitiesDictionaryRouterRouteResponse, D>::encode(
1034 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1035 encoder,
1036 offset,
1037 _depth,
1038 )
1039 }
1040 }
1041 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1042 fidl::encoding::Encode<CapabilitiesDictionaryRouterRouteResponse, D> for (T0,)
1043 {
1044 #[inline]
1045 unsafe fn encode(
1046 self,
1047 encoder: &mut fidl::encoding::Encoder<'_, D>,
1048 offset: usize,
1049 depth: fidl::encoding::Depth,
1050 ) -> fidl::Result<()> {
1051 encoder.debug_check_bounds::<CapabilitiesDictionaryRouterRouteResponse>(offset);
1052 self.0.encode(encoder, offset + 0, depth)?;
1056 Ok(())
1057 }
1058 }
1059
1060 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1061 for CapabilitiesDictionaryRouterRouteResponse
1062 {
1063 #[inline(always)]
1064 fn new_empty() -> Self {
1065 Self { response: fidl::new_empty!(RouterResponse, D) }
1066 }
1067
1068 #[inline]
1069 unsafe fn decode(
1070 &mut self,
1071 decoder: &mut fidl::encoding::Decoder<'_, D>,
1072 offset: usize,
1073 _depth: fidl::encoding::Depth,
1074 ) -> fidl::Result<()> {
1075 decoder.debug_check_bounds::<Self>(offset);
1076 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1078 Ok(())
1079 }
1080 }
1081
1082 impl fidl::encoding::ValueTypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1083 type Borrowed<'a> = &'a Self;
1084 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1085 value
1086 }
1087 }
1088
1089 unsafe impl fidl::encoding::TypeMarker for CapabilitiesDirConnectorRouterRouteResponse {
1090 type Owned = Self;
1091
1092 #[inline(always)]
1093 fn inline_align(_context: fidl::encoding::Context) -> usize {
1094 4
1095 }
1096
1097 #[inline(always)]
1098 fn inline_size(_context: fidl::encoding::Context) -> usize {
1099 4
1100 }
1101 }
1102
1103 unsafe impl<D: fidl::encoding::ResourceDialect>
1104 fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D>
1105 for &CapabilitiesDirConnectorRouterRouteResponse
1106 {
1107 #[inline]
1108 unsafe fn encode(
1109 self,
1110 encoder: &mut fidl::encoding::Encoder<'_, D>,
1111 offset: usize,
1112 _depth: fidl::encoding::Depth,
1113 ) -> fidl::Result<()> {
1114 encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1115 fidl::encoding::Encode::<CapabilitiesDirConnectorRouterRouteResponse, D>::encode(
1117 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1118 encoder,
1119 offset,
1120 _depth,
1121 )
1122 }
1123 }
1124 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1125 fidl::encoding::Encode<CapabilitiesDirConnectorRouterRouteResponse, D> for (T0,)
1126 {
1127 #[inline]
1128 unsafe fn encode(
1129 self,
1130 encoder: &mut fidl::encoding::Encoder<'_, D>,
1131 offset: usize,
1132 depth: fidl::encoding::Depth,
1133 ) -> fidl::Result<()> {
1134 encoder.debug_check_bounds::<CapabilitiesDirConnectorRouterRouteResponse>(offset);
1135 self.0.encode(encoder, offset + 0, depth)?;
1139 Ok(())
1140 }
1141 }
1142
1143 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1144 for CapabilitiesDirConnectorRouterRouteResponse
1145 {
1146 #[inline(always)]
1147 fn new_empty() -> Self {
1148 Self { response: fidl::new_empty!(RouterResponse, D) }
1149 }
1150
1151 #[inline]
1152 unsafe fn decode(
1153 &mut self,
1154 decoder: &mut fidl::encoding::Decoder<'_, D>,
1155 offset: usize,
1156 _depth: fidl::encoding::Depth,
1157 ) -> fidl::Result<()> {
1158 decoder.debug_check_bounds::<Self>(offset);
1159 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1161 Ok(())
1162 }
1163 }
1164
1165 impl fidl::encoding::ValueTypeMarker for ConnectorRouterRouteResponse {
1166 type Borrowed<'a> = &'a Self;
1167 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1168 value
1169 }
1170 }
1171
1172 unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
1173 type Owned = Self;
1174
1175 #[inline(always)]
1176 fn inline_align(_context: fidl::encoding::Context) -> usize {
1177 4
1178 }
1179
1180 #[inline(always)]
1181 fn inline_size(_context: fidl::encoding::Context) -> usize {
1182 4
1183 }
1184 }
1185
1186 unsafe impl<D: fidl::encoding::ResourceDialect>
1187 fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for &ConnectorRouterRouteResponse
1188 {
1189 #[inline]
1190 unsafe fn encode(
1191 self,
1192 encoder: &mut fidl::encoding::Encoder<'_, D>,
1193 offset: usize,
1194 _depth: fidl::encoding::Depth,
1195 ) -> fidl::Result<()> {
1196 encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1197 fidl::encoding::Encode::<ConnectorRouterRouteResponse, D>::encode(
1199 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1200 encoder,
1201 offset,
1202 _depth,
1203 )
1204 }
1205 }
1206 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1207 fidl::encoding::Encode<ConnectorRouterRouteResponse, D> for (T0,)
1208 {
1209 #[inline]
1210 unsafe fn encode(
1211 self,
1212 encoder: &mut fidl::encoding::Encoder<'_, D>,
1213 offset: usize,
1214 depth: fidl::encoding::Depth,
1215 ) -> fidl::Result<()> {
1216 encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
1217 self.0.encode(encoder, offset + 0, depth)?;
1221 Ok(())
1222 }
1223 }
1224
1225 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1226 for ConnectorRouterRouteResponse
1227 {
1228 #[inline(always)]
1229 fn new_empty() -> Self {
1230 Self { response: fidl::new_empty!(RouterResponse, D) }
1231 }
1232
1233 #[inline]
1234 unsafe fn decode(
1235 &mut self,
1236 decoder: &mut fidl::encoding::Decoder<'_, D>,
1237 offset: usize,
1238 _depth: fidl::encoding::Depth,
1239 ) -> fidl::Result<()> {
1240 decoder.debug_check_bounds::<Self>(offset);
1241 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1243 Ok(())
1244 }
1245 }
1246
1247 impl fidl::encoding::ValueTypeMarker for DataRouterRouteResponse {
1248 type Borrowed<'a> = &'a Self;
1249 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1250 value
1251 }
1252 }
1253
1254 unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
1255 type Owned = Self;
1256
1257 #[inline(always)]
1258 fn inline_align(_context: fidl::encoding::Context) -> usize {
1259 4
1260 }
1261
1262 #[inline(always)]
1263 fn inline_size(_context: fidl::encoding::Context) -> usize {
1264 4
1265 }
1266 }
1267
1268 unsafe impl<D: fidl::encoding::ResourceDialect>
1269 fidl::encoding::Encode<DataRouterRouteResponse, D> for &DataRouterRouteResponse
1270 {
1271 #[inline]
1272 unsafe fn encode(
1273 self,
1274 encoder: &mut fidl::encoding::Encoder<'_, D>,
1275 offset: usize,
1276 _depth: fidl::encoding::Depth,
1277 ) -> fidl::Result<()> {
1278 encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1279 fidl::encoding::Encode::<DataRouterRouteResponse, D>::encode(
1281 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1282 encoder,
1283 offset,
1284 _depth,
1285 )
1286 }
1287 }
1288 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1289 fidl::encoding::Encode<DataRouterRouteResponse, D> for (T0,)
1290 {
1291 #[inline]
1292 unsafe fn encode(
1293 self,
1294 encoder: &mut fidl::encoding::Encoder<'_, D>,
1295 offset: usize,
1296 depth: fidl::encoding::Depth,
1297 ) -> fidl::Result<()> {
1298 encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
1299 self.0.encode(encoder, offset + 0, depth)?;
1303 Ok(())
1304 }
1305 }
1306
1307 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1308 for DataRouterRouteResponse
1309 {
1310 #[inline(always)]
1311 fn new_empty() -> Self {
1312 Self { response: fidl::new_empty!(RouterResponse, D) }
1313 }
1314
1315 #[inline]
1316 unsafe fn decode(
1317 &mut self,
1318 decoder: &mut fidl::encoding::Decoder<'_, D>,
1319 offset: usize,
1320 _depth: fidl::encoding::Depth,
1321 ) -> fidl::Result<()> {
1322 decoder.debug_check_bounds::<Self>(offset);
1323 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1325 Ok(())
1326 }
1327 }
1328
1329 impl fidl::encoding::ValueTypeMarker for DictionaryKeyIteratorGetNextResponse {
1330 type Borrowed<'a> = &'a Self;
1331 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1332 value
1333 }
1334 }
1335
1336 unsafe impl fidl::encoding::TypeMarker for DictionaryKeyIteratorGetNextResponse {
1337 type Owned = Self;
1338
1339 #[inline(always)]
1340 fn inline_align(_context: fidl::encoding::Context) -> usize {
1341 8
1342 }
1343
1344 #[inline(always)]
1345 fn inline_size(_context: fidl::encoding::Context) -> usize {
1346 16
1347 }
1348 }
1349
1350 unsafe impl<D: fidl::encoding::ResourceDialect>
1351 fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D>
1352 for &DictionaryKeyIteratorGetNextResponse
1353 {
1354 #[inline]
1355 unsafe fn encode(
1356 self,
1357 encoder: &mut fidl::encoding::Encoder<'_, D>,
1358 offset: usize,
1359 _depth: fidl::encoding::Depth,
1360 ) -> fidl::Result<()> {
1361 encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1362 fidl::encoding::Encode::<DictionaryKeyIteratorGetNextResponse, D>::encode(
1364 (
1365 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
1366 ),
1367 encoder, offset, _depth
1368 )
1369 }
1370 }
1371 unsafe impl<
1372 D: fidl::encoding::ResourceDialect,
1373 T0: fidl::encoding::Encode<
1374 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1375 D,
1376 >,
1377 > fidl::encoding::Encode<DictionaryKeyIteratorGetNextResponse, D> for (T0,)
1378 {
1379 #[inline]
1380 unsafe fn encode(
1381 self,
1382 encoder: &mut fidl::encoding::Encoder<'_, D>,
1383 offset: usize,
1384 depth: fidl::encoding::Depth,
1385 ) -> fidl::Result<()> {
1386 encoder.debug_check_bounds::<DictionaryKeyIteratorGetNextResponse>(offset);
1387 self.0.encode(encoder, offset + 0, depth)?;
1391 Ok(())
1392 }
1393 }
1394
1395 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1396 for DictionaryKeyIteratorGetNextResponse
1397 {
1398 #[inline(always)]
1399 fn new_empty() -> Self {
1400 Self {
1401 keys: fidl::new_empty!(
1402 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1403 D
1404 ),
1405 }
1406 }
1407
1408 #[inline]
1409 unsafe fn decode(
1410 &mut self,
1411 decoder: &mut fidl::encoding::Decoder<'_, D>,
1412 offset: usize,
1413 _depth: fidl::encoding::Depth,
1414 ) -> fidl::Result<()> {
1415 decoder.debug_check_bounds::<Self>(offset);
1416 fidl::decode!(
1418 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<100>>,
1419 D,
1420 &mut self.keys,
1421 decoder,
1422 offset + 0,
1423 _depth
1424 )?;
1425 Ok(())
1426 }
1427 }
1428
1429 impl fidl::encoding::ValueTypeMarker for DictionaryRouterRouteResponse {
1430 type Borrowed<'a> = &'a Self;
1431 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1432 value
1433 }
1434 }
1435
1436 unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
1437 type Owned = Self;
1438
1439 #[inline(always)]
1440 fn inline_align(_context: fidl::encoding::Context) -> usize {
1441 4
1442 }
1443
1444 #[inline(always)]
1445 fn inline_size(_context: fidl::encoding::Context) -> usize {
1446 4
1447 }
1448 }
1449
1450 unsafe impl<D: fidl::encoding::ResourceDialect>
1451 fidl::encoding::Encode<DictionaryRouterRouteResponse, D>
1452 for &DictionaryRouterRouteResponse
1453 {
1454 #[inline]
1455 unsafe fn encode(
1456 self,
1457 encoder: &mut fidl::encoding::Encoder<'_, D>,
1458 offset: usize,
1459 _depth: fidl::encoding::Depth,
1460 ) -> fidl::Result<()> {
1461 encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1462 fidl::encoding::Encode::<DictionaryRouterRouteResponse, D>::encode(
1464 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1465 encoder,
1466 offset,
1467 _depth,
1468 )
1469 }
1470 }
1471 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1472 fidl::encoding::Encode<DictionaryRouterRouteResponse, D> for (T0,)
1473 {
1474 #[inline]
1475 unsafe fn encode(
1476 self,
1477 encoder: &mut fidl::encoding::Encoder<'_, D>,
1478 offset: usize,
1479 depth: fidl::encoding::Depth,
1480 ) -> fidl::Result<()> {
1481 encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
1482 self.0.encode(encoder, offset + 0, depth)?;
1486 Ok(())
1487 }
1488 }
1489
1490 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1491 for DictionaryRouterRouteResponse
1492 {
1493 #[inline(always)]
1494 fn new_empty() -> Self {
1495 Self { response: fidl::new_empty!(RouterResponse, D) }
1496 }
1497
1498 #[inline]
1499 unsafe fn decode(
1500 &mut self,
1501 decoder: &mut fidl::encoding::Decoder<'_, D>,
1502 offset: usize,
1503 _depth: fidl::encoding::Depth,
1504 ) -> fidl::Result<()> {
1505 decoder.debug_check_bounds::<Self>(offset);
1506 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1508 Ok(())
1509 }
1510 }
1511
1512 impl fidl::encoding::ValueTypeMarker for DirConnectorRouterRouteResponse {
1513 type Borrowed<'a> = &'a Self;
1514 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1515 value
1516 }
1517 }
1518
1519 unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
1520 type Owned = Self;
1521
1522 #[inline(always)]
1523 fn inline_align(_context: fidl::encoding::Context) -> usize {
1524 4
1525 }
1526
1527 #[inline(always)]
1528 fn inline_size(_context: fidl::encoding::Context) -> usize {
1529 4
1530 }
1531 }
1532
1533 unsafe impl<D: fidl::encoding::ResourceDialect>
1534 fidl::encoding::Encode<DirConnectorRouterRouteResponse, D>
1535 for &DirConnectorRouterRouteResponse
1536 {
1537 #[inline]
1538 unsafe fn encode(
1539 self,
1540 encoder: &mut fidl::encoding::Encoder<'_, D>,
1541 offset: usize,
1542 _depth: fidl::encoding::Depth,
1543 ) -> fidl::Result<()> {
1544 encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1545 fidl::encoding::Encode::<DirConnectorRouterRouteResponse, D>::encode(
1547 (<RouterResponse as fidl::encoding::ValueTypeMarker>::borrow(&self.response),),
1548 encoder,
1549 offset,
1550 _depth,
1551 )
1552 }
1553 }
1554 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RouterResponse, D>>
1555 fidl::encoding::Encode<DirConnectorRouterRouteResponse, D> for (T0,)
1556 {
1557 #[inline]
1558 unsafe fn encode(
1559 self,
1560 encoder: &mut fidl::encoding::Encoder<'_, D>,
1561 offset: usize,
1562 depth: fidl::encoding::Depth,
1563 ) -> fidl::Result<()> {
1564 encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
1565 self.0.encode(encoder, offset + 0, depth)?;
1569 Ok(())
1570 }
1571 }
1572
1573 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1574 for DirConnectorRouterRouteResponse
1575 {
1576 #[inline(always)]
1577 fn new_empty() -> Self {
1578 Self { response: fidl::new_empty!(RouterResponse, D) }
1579 }
1580
1581 #[inline]
1582 unsafe fn decode(
1583 &mut self,
1584 decoder: &mut fidl::encoding::Decoder<'_, D>,
1585 offset: usize,
1586 _depth: fidl::encoding::Depth,
1587 ) -> fidl::Result<()> {
1588 decoder.debug_check_bounds::<Self>(offset);
1589 fidl::decode!(RouterResponse, D, &mut self.response, decoder, offset + 0, _depth)?;
1591 Ok(())
1592 }
1593 }
1594
1595 impl RouteRequest {
1596 #[inline(always)]
1597 fn max_ordinal_present(&self) -> u64 {
1598 if let Some(_) = self.skip_policy_checks {
1599 return 12;
1600 }
1601 if let Some(_) = self.event_stream_scope {
1602 return 11;
1603 }
1604 if let Some(_) = self.event_stream_scope_moniker {
1605 return 10;
1606 }
1607 if let Some(_) = self.storage_source_moniker {
1608 return 9;
1609 }
1610 if let Some(_) = self.storage_sub_directory_path {
1611 return 8;
1612 }
1613 if let Some(_) = self.isolated_storage_path {
1614 return 7;
1615 }
1616 if let Some(_) = self.sub_directory_path {
1617 return 6;
1618 }
1619 if let Some(_) = self.inherit_rights {
1620 return 5;
1621 }
1622 if let Some(_) = self.directory_intermediate_rights {
1623 return 4;
1624 }
1625 if let Some(_) = self.directory_rights {
1626 return 3;
1627 }
1628 if let Some(_) = self.availability {
1629 return 2;
1630 }
1631 if let Some(_) = self.build_type_name {
1632 return 1;
1633 }
1634 0
1635 }
1636 }
1637
1638 impl fidl::encoding::ValueTypeMarker for RouteRequest {
1639 type Borrowed<'a> = &'a Self;
1640 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1641 value
1642 }
1643 }
1644
1645 unsafe impl fidl::encoding::TypeMarker for RouteRequest {
1646 type Owned = Self;
1647
1648 #[inline(always)]
1649 fn inline_align(_context: fidl::encoding::Context) -> usize {
1650 8
1651 }
1652
1653 #[inline(always)]
1654 fn inline_size(_context: fidl::encoding::Context) -> usize {
1655 16
1656 }
1657 }
1658
1659 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteRequest, D>
1660 for &RouteRequest
1661 {
1662 unsafe fn encode(
1663 self,
1664 encoder: &mut fidl::encoding::Encoder<'_, D>,
1665 offset: usize,
1666 mut depth: fidl::encoding::Depth,
1667 ) -> fidl::Result<()> {
1668 encoder.debug_check_bounds::<RouteRequest>(offset);
1669 let max_ordinal: u64 = self.max_ordinal_present();
1671 encoder.write_num(max_ordinal, offset);
1672 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1673 if max_ordinal == 0 {
1675 return Ok(());
1676 }
1677 depth.increment()?;
1678 let envelope_size = 8;
1679 let bytes_len = max_ordinal as usize * envelope_size;
1680 #[allow(unused_variables)]
1681 let offset = encoder.out_of_line_offset(bytes_len);
1682 let mut _prev_end_offset: usize = 0;
1683 if 1 > max_ordinal {
1684 return Ok(());
1685 }
1686
1687 let cur_offset: usize = (1 - 1) * envelope_size;
1690
1691 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1693
1694 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<100>, D>(
1699 self.build_type_name.as_ref().map(
1700 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow,
1701 ),
1702 encoder,
1703 offset + cur_offset,
1704 depth,
1705 )?;
1706
1707 _prev_end_offset = cur_offset + envelope_size;
1708 if 2 > max_ordinal {
1709 return Ok(());
1710 }
1711
1712 let cur_offset: usize = (2 - 1) * envelope_size;
1715
1716 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1718
1719 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_decl__common::Availability, D>(
1724 self.availability.as_ref().map(<fidl_fuchsia_component_decl__common::Availability as fidl::encoding::ValueTypeMarker>::borrow),
1725 encoder, offset + cur_offset, depth
1726 )?;
1727
1728 _prev_end_offset = cur_offset + envelope_size;
1729 if 3 > max_ordinal {
1730 return Ok(());
1731 }
1732
1733 let cur_offset: usize = (3 - 1) * envelope_size;
1736
1737 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1739
1740 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io__common::Flags, D>(
1745 self.directory_rights.as_ref().map(
1746 <fidl_fuchsia_io__common::Flags as fidl::encoding::ValueTypeMarker>::borrow,
1747 ),
1748 encoder,
1749 offset + cur_offset,
1750 depth,
1751 )?;
1752
1753 _prev_end_offset = cur_offset + envelope_size;
1754 if 4 > max_ordinal {
1755 return Ok(());
1756 }
1757
1758 let cur_offset: usize = (4 - 1) * envelope_size;
1761
1762 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1764
1765 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_io__common::Flags, D>(
1770 self.directory_intermediate_rights.as_ref().map(
1771 <fidl_fuchsia_io__common::Flags as fidl::encoding::ValueTypeMarker>::borrow,
1772 ),
1773 encoder,
1774 offset + cur_offset,
1775 depth,
1776 )?;
1777
1778 _prev_end_offset = cur_offset + envelope_size;
1779 if 5 > max_ordinal {
1780 return Ok(());
1781 }
1782
1783 let cur_offset: usize = (5 - 1) * envelope_size;
1786
1787 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1789
1790 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1795 self.inherit_rights.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1796 encoder,
1797 offset + cur_offset,
1798 depth,
1799 )?;
1800
1801 _prev_end_offset = cur_offset + envelope_size;
1802 if 6 > max_ordinal {
1803 return Ok(());
1804 }
1805
1806 let cur_offset: usize = (6 - 1) * envelope_size;
1809
1810 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1812
1813 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
1818 self.sub_directory_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
1819 encoder, offset + cur_offset, depth
1820 )?;
1821
1822 _prev_end_offset = cur_offset + envelope_size;
1823 if 7 > max_ordinal {
1824 return Ok(());
1825 }
1826
1827 let cur_offset: usize = (7 - 1) * envelope_size;
1830
1831 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1833
1834 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
1839 self.isolated_storage_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
1840 encoder, offset + cur_offset, depth
1841 )?;
1842
1843 _prev_end_offset = cur_offset + envelope_size;
1844 if 8 > max_ordinal {
1845 return Ok(());
1846 }
1847
1848 let cur_offset: usize = (8 - 1) * envelope_size;
1851
1852 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1854
1855 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
1860 self.storage_sub_directory_path.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
1861 encoder, offset + cur_offset, depth
1862 )?;
1863
1864 _prev_end_offset = cur_offset + envelope_size;
1865 if 9 > max_ordinal {
1866 return Ok(());
1867 }
1868
1869 let cur_offset: usize = (9 - 1) * envelope_size;
1872
1873 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1875
1876 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1881 self.storage_source_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1882 encoder, offset + cur_offset, depth
1883 )?;
1884
1885 _prev_end_offset = cur_offset + envelope_size;
1886 if 10 > max_ordinal {
1887 return Ok(());
1888 }
1889
1890 let cur_offset: usize = (10 - 1) * envelope_size;
1893
1894 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1896
1897 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
1902 self.event_stream_scope_moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
1903 encoder, offset + cur_offset, depth
1904 )?;
1905
1906 _prev_end_offset = cur_offset + envelope_size;
1907 if 11 > max_ordinal {
1908 return Ok(());
1909 }
1910
1911 let cur_offset: usize = (11 - 1) * envelope_size;
1914
1915 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1917
1918 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl__common::Ref>, D>(
1923 self.event_stream_scope.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl__common::Ref> as fidl::encoding::ValueTypeMarker>::borrow),
1924 encoder, offset + cur_offset, depth
1925 )?;
1926
1927 _prev_end_offset = cur_offset + envelope_size;
1928 if 12 > max_ordinal {
1929 return Ok(());
1930 }
1931
1932 let cur_offset: usize = (12 - 1) * envelope_size;
1935
1936 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1938
1939 fidl::encoding::encode_in_envelope_optional::<bool, D>(
1944 self.skip_policy_checks
1945 .as_ref()
1946 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1947 encoder,
1948 offset + cur_offset,
1949 depth,
1950 )?;
1951
1952 _prev_end_offset = cur_offset + envelope_size;
1953
1954 Ok(())
1955 }
1956 }
1957
1958 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteRequest {
1959 #[inline(always)]
1960 fn new_empty() -> Self {
1961 Self::default()
1962 }
1963
1964 unsafe fn decode(
1965 &mut self,
1966 decoder: &mut fidl::encoding::Decoder<'_, D>,
1967 offset: usize,
1968 mut depth: fidl::encoding::Depth,
1969 ) -> fidl::Result<()> {
1970 decoder.debug_check_bounds::<Self>(offset);
1971 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1972 None => return Err(fidl::Error::NotNullable),
1973 Some(len) => len,
1974 };
1975 if len == 0 {
1977 return Ok(());
1978 };
1979 depth.increment()?;
1980 let envelope_size = 8;
1981 let bytes_len = len * envelope_size;
1982 let offset = decoder.out_of_line_offset(bytes_len)?;
1983 let mut _next_ordinal_to_read = 0;
1985 let mut next_offset = offset;
1986 let end_offset = offset + bytes_len;
1987 _next_ordinal_to_read += 1;
1988 if next_offset >= end_offset {
1989 return Ok(());
1990 }
1991
1992 while _next_ordinal_to_read < 1 {
1994 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1995 _next_ordinal_to_read += 1;
1996 next_offset += envelope_size;
1997 }
1998
1999 let next_out_of_line = decoder.next_out_of_line();
2000 let handles_before = decoder.remaining_handles();
2001 if let Some((inlined, num_bytes, num_handles)) =
2002 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2003 {
2004 let member_inline_size =
2005 <fidl::encoding::BoundedString<100> as fidl::encoding::TypeMarker>::inline_size(
2006 decoder.context,
2007 );
2008 if inlined != (member_inline_size <= 4) {
2009 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2010 }
2011 let inner_offset;
2012 let mut inner_depth = depth.clone();
2013 if inlined {
2014 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2015 inner_offset = next_offset;
2016 } else {
2017 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2018 inner_depth.increment()?;
2019 }
2020 let val_ref = self
2021 .build_type_name
2022 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<100>, D));
2023 fidl::decode!(
2024 fidl::encoding::BoundedString<100>,
2025 D,
2026 val_ref,
2027 decoder,
2028 inner_offset,
2029 inner_depth
2030 )?;
2031 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2032 {
2033 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2034 }
2035 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2036 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2037 }
2038 }
2039
2040 next_offset += envelope_size;
2041 _next_ordinal_to_read += 1;
2042 if next_offset >= end_offset {
2043 return Ok(());
2044 }
2045
2046 while _next_ordinal_to_read < 2 {
2048 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2049 _next_ordinal_to_read += 1;
2050 next_offset += envelope_size;
2051 }
2052
2053 let next_out_of_line = decoder.next_out_of_line();
2054 let handles_before = decoder.remaining_handles();
2055 if let Some((inlined, num_bytes, num_handles)) =
2056 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2057 {
2058 let member_inline_size = <fidl_fuchsia_component_decl__common::Availability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2059 if inlined != (member_inline_size <= 4) {
2060 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2061 }
2062 let inner_offset;
2063 let mut inner_depth = depth.clone();
2064 if inlined {
2065 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2066 inner_offset = next_offset;
2067 } else {
2068 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2069 inner_depth.increment()?;
2070 }
2071 let val_ref = self.availability.get_or_insert_with(|| {
2072 fidl::new_empty!(fidl_fuchsia_component_decl__common::Availability, D)
2073 });
2074 fidl::decode!(
2075 fidl_fuchsia_component_decl__common::Availability,
2076 D,
2077 val_ref,
2078 decoder,
2079 inner_offset,
2080 inner_depth
2081 )?;
2082 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2083 {
2084 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2085 }
2086 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2087 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2088 }
2089 }
2090
2091 next_offset += envelope_size;
2092 _next_ordinal_to_read += 1;
2093 if next_offset >= end_offset {
2094 return Ok(());
2095 }
2096
2097 while _next_ordinal_to_read < 3 {
2099 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2100 _next_ordinal_to_read += 1;
2101 next_offset += envelope_size;
2102 }
2103
2104 let next_out_of_line = decoder.next_out_of_line();
2105 let handles_before = decoder.remaining_handles();
2106 if let Some((inlined, num_bytes, num_handles)) =
2107 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2108 {
2109 let member_inline_size =
2110 <fidl_fuchsia_io__common::Flags as fidl::encoding::TypeMarker>::inline_size(
2111 decoder.context,
2112 );
2113 if inlined != (member_inline_size <= 4) {
2114 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2115 }
2116 let inner_offset;
2117 let mut inner_depth = depth.clone();
2118 if inlined {
2119 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2120 inner_offset = next_offset;
2121 } else {
2122 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2123 inner_depth.increment()?;
2124 }
2125 let val_ref = self
2126 .directory_rights
2127 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io__common::Flags, D));
2128 fidl::decode!(
2129 fidl_fuchsia_io__common::Flags,
2130 D,
2131 val_ref,
2132 decoder,
2133 inner_offset,
2134 inner_depth
2135 )?;
2136 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2137 {
2138 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2139 }
2140 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2141 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2142 }
2143 }
2144
2145 next_offset += envelope_size;
2146 _next_ordinal_to_read += 1;
2147 if next_offset >= end_offset {
2148 return Ok(());
2149 }
2150
2151 while _next_ordinal_to_read < 4 {
2153 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2154 _next_ordinal_to_read += 1;
2155 next_offset += envelope_size;
2156 }
2157
2158 let next_out_of_line = decoder.next_out_of_line();
2159 let handles_before = decoder.remaining_handles();
2160 if let Some((inlined, num_bytes, num_handles)) =
2161 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2162 {
2163 let member_inline_size =
2164 <fidl_fuchsia_io__common::Flags as fidl::encoding::TypeMarker>::inline_size(
2165 decoder.context,
2166 );
2167 if inlined != (member_inline_size <= 4) {
2168 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2169 }
2170 let inner_offset;
2171 let mut inner_depth = depth.clone();
2172 if inlined {
2173 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2174 inner_offset = next_offset;
2175 } else {
2176 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2177 inner_depth.increment()?;
2178 }
2179 let val_ref = self
2180 .directory_intermediate_rights
2181 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_io__common::Flags, D));
2182 fidl::decode!(
2183 fidl_fuchsia_io__common::Flags,
2184 D,
2185 val_ref,
2186 decoder,
2187 inner_offset,
2188 inner_depth
2189 )?;
2190 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2191 {
2192 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2193 }
2194 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2195 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2196 }
2197 }
2198
2199 next_offset += envelope_size;
2200 _next_ordinal_to_read += 1;
2201 if next_offset >= end_offset {
2202 return Ok(());
2203 }
2204
2205 while _next_ordinal_to_read < 5 {
2207 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2208 _next_ordinal_to_read += 1;
2209 next_offset += envelope_size;
2210 }
2211
2212 let next_out_of_line = decoder.next_out_of_line();
2213 let handles_before = decoder.remaining_handles();
2214 if let Some((inlined, num_bytes, num_handles)) =
2215 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2216 {
2217 let member_inline_size =
2218 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2219 if inlined != (member_inline_size <= 4) {
2220 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2221 }
2222 let inner_offset;
2223 let mut inner_depth = depth.clone();
2224 if inlined {
2225 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2226 inner_offset = next_offset;
2227 } else {
2228 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2229 inner_depth.increment()?;
2230 }
2231 let val_ref = self.inherit_rights.get_or_insert_with(|| fidl::new_empty!(bool, D));
2232 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2233 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2234 {
2235 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2236 }
2237 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2238 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2239 }
2240 }
2241
2242 next_offset += envelope_size;
2243 _next_ordinal_to_read += 1;
2244 if next_offset >= end_offset {
2245 return Ok(());
2246 }
2247
2248 while _next_ordinal_to_read < 6 {
2250 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2251 _next_ordinal_to_read += 1;
2252 next_offset += envelope_size;
2253 }
2254
2255 let next_out_of_line = decoder.next_out_of_line();
2256 let handles_before = decoder.remaining_handles();
2257 if let Some((inlined, num_bytes, num_handles)) =
2258 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2259 {
2260 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2261 if inlined != (member_inline_size <= 4) {
2262 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2263 }
2264 let inner_offset;
2265 let mut inner_depth = depth.clone();
2266 if inlined {
2267 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2268 inner_offset = next_offset;
2269 } else {
2270 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2271 inner_depth.increment()?;
2272 }
2273 let val_ref = self.sub_directory_path.get_or_insert_with(|| {
2274 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
2275 });
2276 fidl::decode!(
2277 fidl::encoding::BoundedString<1024>,
2278 D,
2279 val_ref,
2280 decoder,
2281 inner_offset,
2282 inner_depth
2283 )?;
2284 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2285 {
2286 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2287 }
2288 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2289 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2290 }
2291 }
2292
2293 next_offset += envelope_size;
2294 _next_ordinal_to_read += 1;
2295 if next_offset >= end_offset {
2296 return Ok(());
2297 }
2298
2299 while _next_ordinal_to_read < 7 {
2301 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2302 _next_ordinal_to_read += 1;
2303 next_offset += envelope_size;
2304 }
2305
2306 let next_out_of_line = decoder.next_out_of_line();
2307 let handles_before = decoder.remaining_handles();
2308 if let Some((inlined, num_bytes, num_handles)) =
2309 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2310 {
2311 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2312 if inlined != (member_inline_size <= 4) {
2313 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2314 }
2315 let inner_offset;
2316 let mut inner_depth = depth.clone();
2317 if inlined {
2318 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2319 inner_offset = next_offset;
2320 } else {
2321 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2322 inner_depth.increment()?;
2323 }
2324 let val_ref = self.isolated_storage_path.get_or_insert_with(|| {
2325 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
2326 });
2327 fidl::decode!(
2328 fidl::encoding::BoundedString<1024>,
2329 D,
2330 val_ref,
2331 decoder,
2332 inner_offset,
2333 inner_depth
2334 )?;
2335 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2336 {
2337 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2338 }
2339 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2340 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2341 }
2342 }
2343
2344 next_offset += envelope_size;
2345 _next_ordinal_to_read += 1;
2346 if next_offset >= end_offset {
2347 return Ok(());
2348 }
2349
2350 while _next_ordinal_to_read < 8 {
2352 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2353 _next_ordinal_to_read += 1;
2354 next_offset += envelope_size;
2355 }
2356
2357 let next_out_of_line = decoder.next_out_of_line();
2358 let handles_before = decoder.remaining_handles();
2359 if let Some((inlined, num_bytes, num_handles)) =
2360 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2361 {
2362 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2363 if inlined != (member_inline_size <= 4) {
2364 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2365 }
2366 let inner_offset;
2367 let mut inner_depth = depth.clone();
2368 if inlined {
2369 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2370 inner_offset = next_offset;
2371 } else {
2372 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2373 inner_depth.increment()?;
2374 }
2375 let val_ref = self.storage_sub_directory_path.get_or_insert_with(|| {
2376 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
2377 });
2378 fidl::decode!(
2379 fidl::encoding::BoundedString<1024>,
2380 D,
2381 val_ref,
2382 decoder,
2383 inner_offset,
2384 inner_depth
2385 )?;
2386 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2387 {
2388 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2389 }
2390 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2391 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2392 }
2393 }
2394
2395 next_offset += envelope_size;
2396 _next_ordinal_to_read += 1;
2397 if next_offset >= end_offset {
2398 return Ok(());
2399 }
2400
2401 while _next_ordinal_to_read < 9 {
2403 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2404 _next_ordinal_to_read += 1;
2405 next_offset += envelope_size;
2406 }
2407
2408 let next_out_of_line = decoder.next_out_of_line();
2409 let handles_before = decoder.remaining_handles();
2410 if let Some((inlined, num_bytes, num_handles)) =
2411 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2412 {
2413 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2414 if inlined != (member_inline_size <= 4) {
2415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2416 }
2417 let inner_offset;
2418 let mut inner_depth = depth.clone();
2419 if inlined {
2420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2421 inner_offset = next_offset;
2422 } else {
2423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2424 inner_depth.increment()?;
2425 }
2426 let val_ref = self.storage_source_moniker.get_or_insert_with(|| {
2427 fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2428 });
2429 fidl::decode!(
2430 fidl::encoding::BoundedString<4096>,
2431 D,
2432 val_ref,
2433 decoder,
2434 inner_offset,
2435 inner_depth
2436 )?;
2437 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2438 {
2439 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2440 }
2441 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2442 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2443 }
2444 }
2445
2446 next_offset += envelope_size;
2447 _next_ordinal_to_read += 1;
2448 if next_offset >= end_offset {
2449 return Ok(());
2450 }
2451
2452 while _next_ordinal_to_read < 10 {
2454 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2455 _next_ordinal_to_read += 1;
2456 next_offset += envelope_size;
2457 }
2458
2459 let next_out_of_line = decoder.next_out_of_line();
2460 let handles_before = decoder.remaining_handles();
2461 if let Some((inlined, num_bytes, num_handles)) =
2462 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2463 {
2464 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2465 if inlined != (member_inline_size <= 4) {
2466 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2467 }
2468 let inner_offset;
2469 let mut inner_depth = depth.clone();
2470 if inlined {
2471 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2472 inner_offset = next_offset;
2473 } else {
2474 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2475 inner_depth.increment()?;
2476 }
2477 let val_ref = self.event_stream_scope_moniker.get_or_insert_with(|| {
2478 fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
2479 });
2480 fidl::decode!(
2481 fidl::encoding::BoundedString<4096>,
2482 D,
2483 val_ref,
2484 decoder,
2485 inner_offset,
2486 inner_depth
2487 )?;
2488 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2489 {
2490 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2491 }
2492 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2493 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2494 }
2495 }
2496
2497 next_offset += envelope_size;
2498 _next_ordinal_to_read += 1;
2499 if next_offset >= end_offset {
2500 return Ok(());
2501 }
2502
2503 while _next_ordinal_to_read < 11 {
2505 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2506 _next_ordinal_to_read += 1;
2507 next_offset += envelope_size;
2508 }
2509
2510 let next_out_of_line = decoder.next_out_of_line();
2511 let handles_before = decoder.remaining_handles();
2512 if let Some((inlined, num_bytes, num_handles)) =
2513 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2514 {
2515 let member_inline_size = <fidl::encoding::UnboundedVector<
2516 fidl_fuchsia_component_decl__common::Ref,
2517 > as fidl::encoding::TypeMarker>::inline_size(
2518 decoder.context
2519 );
2520 if inlined != (member_inline_size <= 4) {
2521 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2522 }
2523 let inner_offset;
2524 let mut inner_depth = depth.clone();
2525 if inlined {
2526 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2527 inner_offset = next_offset;
2528 } else {
2529 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2530 inner_depth.increment()?;
2531 }
2532 let val_ref = self.event_stream_scope.get_or_insert_with(|| {
2533 fidl::new_empty!(
2534 fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl__common::Ref>,
2535 D
2536 )
2537 });
2538 fidl::decode!(
2539 fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl__common::Ref>,
2540 D,
2541 val_ref,
2542 decoder,
2543 inner_offset,
2544 inner_depth
2545 )?;
2546 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2547 {
2548 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2549 }
2550 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2551 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2552 }
2553 }
2554
2555 next_offset += envelope_size;
2556 _next_ordinal_to_read += 1;
2557 if next_offset >= end_offset {
2558 return Ok(());
2559 }
2560
2561 while _next_ordinal_to_read < 12 {
2563 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2564 _next_ordinal_to_read += 1;
2565 next_offset += envelope_size;
2566 }
2567
2568 let next_out_of_line = decoder.next_out_of_line();
2569 let handles_before = decoder.remaining_handles();
2570 if let Some((inlined, num_bytes, num_handles)) =
2571 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2572 {
2573 let member_inline_size =
2574 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2575 if inlined != (member_inline_size <= 4) {
2576 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2577 }
2578 let inner_offset;
2579 let mut inner_depth = depth.clone();
2580 if inlined {
2581 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2582 inner_offset = next_offset;
2583 } else {
2584 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2585 inner_depth.increment()?;
2586 }
2587 let val_ref =
2588 self.skip_policy_checks.get_or_insert_with(|| fidl::new_empty!(bool, D));
2589 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2590 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2591 {
2592 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2593 }
2594 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2595 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2596 }
2597 }
2598
2599 next_offset += envelope_size;
2600
2601 while next_offset < end_offset {
2603 _next_ordinal_to_read += 1;
2604 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2605 next_offset += envelope_size;
2606 }
2607
2608 Ok(())
2609 }
2610 }
2611
2612 impl fidl::encoding::ValueTypeMarker for Data {
2613 type Borrowed<'a> = &'a Self;
2614 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2615 value
2616 }
2617 }
2618
2619 unsafe impl fidl::encoding::TypeMarker for Data {
2620 type Owned = Self;
2621
2622 #[inline(always)]
2623 fn inline_align(_context: fidl::encoding::Context) -> usize {
2624 8
2625 }
2626
2627 #[inline(always)]
2628 fn inline_size(_context: fidl::encoding::Context) -> usize {
2629 16
2630 }
2631 }
2632
2633 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Data, D> for &Data {
2634 #[inline]
2635 unsafe fn encode(
2636 self,
2637 encoder: &mut fidl::encoding::Encoder<'_, D>,
2638 offset: usize,
2639 _depth: fidl::encoding::Depth,
2640 ) -> fidl::Result<()> {
2641 encoder.debug_check_bounds::<Data>(offset);
2642 encoder.write_num::<u64>(self.ordinal(), offset);
2643 match self {
2644 Data::Bytes(ref val) => {
2645 fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u8, 8192>, D>(
2646 <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
2647 encoder, offset + 8, _depth
2648 )
2649 }
2650 Data::String(ref val) => {
2651 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<8192>, D>(
2652 <fidl::encoding::BoundedString<8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
2653 encoder, offset + 8, _depth
2654 )
2655 }
2656 Data::Int64(ref val) => {
2657 fidl::encoding::encode_in_envelope::<i64, D>(
2658 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
2659 encoder, offset + 8, _depth
2660 )
2661 }
2662 Data::Uint64(ref val) => {
2663 fidl::encoding::encode_in_envelope::<u64, D>(
2664 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
2665 encoder, offset + 8, _depth
2666 )
2667 }
2668 Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
2669 }
2670 }
2671 }
2672
2673 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Data {
2674 #[inline(always)]
2675 fn new_empty() -> Self {
2676 Self::__SourceBreaking { unknown_ordinal: 0 }
2677 }
2678
2679 #[inline]
2680 unsafe fn decode(
2681 &mut self,
2682 decoder: &mut fidl::encoding::Decoder<'_, D>,
2683 offset: usize,
2684 mut depth: fidl::encoding::Depth,
2685 ) -> fidl::Result<()> {
2686 decoder.debug_check_bounds::<Self>(offset);
2687 #[allow(unused_variables)]
2688 let next_out_of_line = decoder.next_out_of_line();
2689 let handles_before = decoder.remaining_handles();
2690 let (ordinal, inlined, num_bytes, num_handles) =
2691 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2692
2693 let member_inline_size = match ordinal {
2694 1 => <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
2695 decoder.context,
2696 ),
2697 2 => {
2698 <fidl::encoding::BoundedString<8192> as fidl::encoding::TypeMarker>::inline_size(
2699 decoder.context,
2700 )
2701 }
2702 3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2703 4 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2704 0 => return Err(fidl::Error::UnknownUnionTag),
2705 _ => num_bytes as usize,
2706 };
2707
2708 if inlined != (member_inline_size <= 4) {
2709 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2710 }
2711 let _inner_offset;
2712 if inlined {
2713 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2714 _inner_offset = offset + 8;
2715 } else {
2716 depth.increment()?;
2717 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2718 }
2719 match ordinal {
2720 1 => {
2721 #[allow(irrefutable_let_patterns)]
2722 if let Data::Bytes(_) = self {
2723 } else {
2725 *self = Data::Bytes(fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D));
2727 }
2728 #[allow(irrefutable_let_patterns)]
2729 if let Data::Bytes(ref mut val) = self {
2730 fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, val, decoder, _inner_offset, depth)?;
2731 } else {
2732 unreachable!()
2733 }
2734 }
2735 2 => {
2736 #[allow(irrefutable_let_patterns)]
2737 if let Data::String(_) = self {
2738 } else {
2740 *self =
2742 Data::String(fidl::new_empty!(fidl::encoding::BoundedString<8192>, D));
2743 }
2744 #[allow(irrefutable_let_patterns)]
2745 if let Data::String(ref mut val) = self {
2746 fidl::decode!(
2747 fidl::encoding::BoundedString<8192>,
2748 D,
2749 val,
2750 decoder,
2751 _inner_offset,
2752 depth
2753 )?;
2754 } else {
2755 unreachable!()
2756 }
2757 }
2758 3 => {
2759 #[allow(irrefutable_let_patterns)]
2760 if let Data::Int64(_) = self {
2761 } else {
2763 *self = Data::Int64(fidl::new_empty!(i64, D));
2765 }
2766 #[allow(irrefutable_let_patterns)]
2767 if let Data::Int64(ref mut val) = self {
2768 fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
2769 } else {
2770 unreachable!()
2771 }
2772 }
2773 4 => {
2774 #[allow(irrefutable_let_patterns)]
2775 if let Data::Uint64(_) = self {
2776 } else {
2778 *self = Data::Uint64(fidl::new_empty!(u64, D));
2780 }
2781 #[allow(irrefutable_let_patterns)]
2782 if let Data::Uint64(ref mut val) = self {
2783 fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
2784 } else {
2785 unreachable!()
2786 }
2787 }
2788 #[allow(deprecated)]
2789 ordinal => {
2790 for _ in 0..num_handles {
2791 decoder.drop_next_handle()?;
2792 }
2793 *self = Data::__SourceBreaking { unknown_ordinal: ordinal };
2794 }
2795 }
2796 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2797 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2798 }
2799 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2800 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2801 }
2802 Ok(())
2803 }
2804 }
2805}