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
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
13#[repr(u32)]
14pub enum AddressRemovalReason {
15 Invalid = 1,
17 AlreadyAssigned = 2,
19 DadFailed = 3,
23 InterfaceRemoved = 4,
25 UserRemoved = 5,
27 InvalidProperties = 6,
30}
31
32impl AddressRemovalReason {
33 #[inline]
34 pub fn from_primitive(prim: u32) -> Option<Self> {
35 match prim {
36 1 => Some(Self::Invalid),
37 2 => Some(Self::AlreadyAssigned),
38 3 => Some(Self::DadFailed),
39 4 => Some(Self::InterfaceRemoved),
40 5 => Some(Self::UserRemoved),
41 6 => Some(Self::InvalidProperties),
42 _ => None,
43 }
44 }
45
46 #[inline]
47 pub const fn into_primitive(self) -> u32 {
48 self as u32
49 }
50
51 #[deprecated = "Strict enums should not use `is_unknown`"]
52 #[inline]
53 pub fn is_unknown(&self) -> bool {
54 false
55 }
56}
57
58#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
59pub enum ControlDisableError {
60 #[doc(hidden)]
61 __SourceBreaking { unknown_ordinal: u32 },
62}
63
64#[macro_export]
66macro_rules! ControlDisableErrorUnknown {
67 () => {
68 _
69 };
70}
71
72impl ControlDisableError {
73 #[inline]
74 pub fn from_primitive(prim: u32) -> Option<Self> {
75 match prim {
76 _ => None,
77 }
78 }
79
80 #[inline]
81 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
82 match prim {
83 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
84 }
85 }
86
87 #[inline]
88 pub fn unknown() -> Self {
89 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
90 }
91
92 #[inline]
93 pub const fn into_primitive(self) -> u32 {
94 match self {
95 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
96 }
97 }
98
99 #[inline]
100 pub fn is_unknown(&self) -> bool {
101 match self {
102 Self::__SourceBreaking { unknown_ordinal: _ } => true,
103 }
104 }
105}
106
107#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
108pub enum ControlEnableError {
109 #[doc(hidden)]
110 __SourceBreaking { unknown_ordinal: u32 },
111}
112
113#[macro_export]
115macro_rules! ControlEnableErrorUnknown {
116 () => {
117 _
118 };
119}
120
121impl ControlEnableError {
122 #[inline]
123 pub fn from_primitive(prim: u32) -> Option<Self> {
124 match prim {
125 _ => None,
126 }
127 }
128
129 #[inline]
130 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
131 match prim {
132 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
133 }
134 }
135
136 #[inline]
137 pub fn unknown() -> Self {
138 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
139 }
140
141 #[inline]
142 pub const fn into_primitive(self) -> u32 {
143 match self {
144 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
145 }
146 }
147
148 #[inline]
149 pub fn is_unknown(&self) -> bool {
150 match self {
151 Self::__SourceBreaking { unknown_ordinal: _ } => true,
152 }
153 }
154}
155
156#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
157pub enum ControlGetConfigurationError {
158 #[doc(hidden)]
159 __SourceBreaking { unknown_ordinal: u32 },
160}
161
162#[macro_export]
164macro_rules! ControlGetConfigurationErrorUnknown {
165 () => {
166 _
167 };
168}
169
170impl ControlGetConfigurationError {
171 #[inline]
172 pub fn from_primitive(prim: u32) -> Option<Self> {
173 match prim {
174 _ => None,
175 }
176 }
177
178 #[inline]
179 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
180 match prim {
181 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
182 }
183 }
184
185 #[inline]
186 pub fn unknown() -> Self {
187 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
188 }
189
190 #[inline]
191 pub const fn into_primitive(self) -> u32 {
192 match self {
193 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
194 }
195 }
196
197 #[inline]
198 pub fn is_unknown(&self) -> bool {
199 match self {
200 Self::__SourceBreaking { unknown_ordinal: _ } => true,
201 }
202 }
203}
204
205#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
206pub enum ControlRemoveAddressError {
207 #[doc(hidden)]
208 __SourceBreaking { unknown_ordinal: u32 },
209}
210
211#[macro_export]
213macro_rules! ControlRemoveAddressErrorUnknown {
214 () => {
215 _
216 };
217}
218
219impl ControlRemoveAddressError {
220 #[inline]
221 pub fn from_primitive(prim: u32) -> Option<Self> {
222 match prim {
223 _ => None,
224 }
225 }
226
227 #[inline]
228 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
229 match prim {
230 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
231 }
232 }
233
234 #[inline]
235 pub fn unknown() -> Self {
236 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
237 }
238
239 #[inline]
240 pub const fn into_primitive(self) -> u32 {
241 match self {
242 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
243 }
244 }
245
246 #[inline]
247 pub fn is_unknown(&self) -> bool {
248 match self {
249 Self::__SourceBreaking { unknown_ordinal: _ } => true,
250 }
251 }
252}
253
254#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
255pub enum ControlRemoveError {
256 NotAllowed,
258 #[doc(hidden)]
259 __SourceBreaking { unknown_ordinal: u32 },
260}
261
262#[macro_export]
264macro_rules! ControlRemoveErrorUnknown {
265 () => {
266 _
267 };
268}
269
270impl ControlRemoveError {
271 #[inline]
272 pub fn from_primitive(prim: u32) -> Option<Self> {
273 match prim {
274 1 => Some(Self::NotAllowed),
275 _ => None,
276 }
277 }
278
279 #[inline]
280 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
281 match prim {
282 1 => Self::NotAllowed,
283 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
284 }
285 }
286
287 #[inline]
288 pub fn unknown() -> Self {
289 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
290 }
291
292 #[inline]
293 pub const fn into_primitive(self) -> u32 {
294 match self {
295 Self::NotAllowed => 1,
296 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
297 }
298 }
299
300 #[inline]
301 pub fn is_unknown(&self) -> bool {
302 match self {
303 Self::__SourceBreaking { unknown_ordinal: _ } => true,
304 _ => false,
305 }
306 }
307}
308
309#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
310pub enum ControlSetConfigurationError {
311 Ipv4ForwardingUnsupported,
314 Ipv4MulticastForwardingUnsupported,
317 Ipv4IgmpVersionUnsupported,
320 Ipv6ForwardingUnsupported,
323 Ipv6MulticastForwardingUnsupported,
326 Ipv6MldVersionUnsupported,
329 IllegalZeroValue,
332 ArpNotSupported,
336 NdpNotSupported,
340 IllegalNegativeValue,
343 #[doc(hidden)]
344 __SourceBreaking { unknown_ordinal: u32 },
345}
346
347#[macro_export]
349macro_rules! ControlSetConfigurationErrorUnknown {
350 () => {
351 _
352 };
353}
354
355impl ControlSetConfigurationError {
356 #[inline]
357 pub fn from_primitive(prim: u32) -> Option<Self> {
358 match prim {
359 1 => Some(Self::Ipv4ForwardingUnsupported),
360 2 => Some(Self::Ipv4MulticastForwardingUnsupported),
361 3 => Some(Self::Ipv4IgmpVersionUnsupported),
362 4 => Some(Self::Ipv6ForwardingUnsupported),
363 5 => Some(Self::Ipv6MulticastForwardingUnsupported),
364 6 => Some(Self::Ipv6MldVersionUnsupported),
365 7 => Some(Self::IllegalZeroValue),
366 8 => Some(Self::ArpNotSupported),
367 9 => Some(Self::NdpNotSupported),
368 10 => Some(Self::IllegalNegativeValue),
369 _ => None,
370 }
371 }
372
373 #[inline]
374 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
375 match prim {
376 1 => Self::Ipv4ForwardingUnsupported,
377 2 => Self::Ipv4MulticastForwardingUnsupported,
378 3 => Self::Ipv4IgmpVersionUnsupported,
379 4 => Self::Ipv6ForwardingUnsupported,
380 5 => Self::Ipv6MulticastForwardingUnsupported,
381 6 => Self::Ipv6MldVersionUnsupported,
382 7 => Self::IllegalZeroValue,
383 8 => Self::ArpNotSupported,
384 9 => Self::NdpNotSupported,
385 10 => Self::IllegalNegativeValue,
386 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
387 }
388 }
389
390 #[inline]
391 pub fn unknown() -> Self {
392 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
393 }
394
395 #[inline]
396 pub const fn into_primitive(self) -> u32 {
397 match self {
398 Self::Ipv4ForwardingUnsupported => 1,
399 Self::Ipv4MulticastForwardingUnsupported => 2,
400 Self::Ipv4IgmpVersionUnsupported => 3,
401 Self::Ipv6ForwardingUnsupported => 4,
402 Self::Ipv6MulticastForwardingUnsupported => 5,
403 Self::Ipv6MldVersionUnsupported => 6,
404 Self::IllegalZeroValue => 7,
405 Self::ArpNotSupported => 8,
406 Self::NdpNotSupported => 9,
407 Self::IllegalNegativeValue => 10,
408 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
409 }
410 }
411
412 #[inline]
413 pub fn is_unknown(&self) -> bool {
414 match self {
415 Self::__SourceBreaking { unknown_ordinal: _ } => true,
416 _ => false,
417 }
418 }
419}
420
421#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
422pub enum IgmpVersion {
423 V1,
425 V2,
427 V3,
429 #[doc(hidden)]
430 __SourceBreaking { unknown_ordinal: u8 },
431}
432
433#[macro_export]
435macro_rules! IgmpVersionUnknown {
436 () => {
437 _
438 };
439}
440
441impl IgmpVersion {
442 #[inline]
443 pub fn from_primitive(prim: u8) -> Option<Self> {
444 match prim {
445 1 => Some(Self::V1),
446 2 => Some(Self::V2),
447 3 => Some(Self::V3),
448 _ => None,
449 }
450 }
451
452 #[inline]
453 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
454 match prim {
455 1 => Self::V1,
456 2 => Self::V2,
457 3 => Self::V3,
458 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
459 }
460 }
461
462 #[inline]
463 pub fn unknown() -> Self {
464 Self::__SourceBreaking { unknown_ordinal: 0xff }
465 }
466
467 #[inline]
468 pub const fn into_primitive(self) -> u8 {
469 match self {
470 Self::V1 => 1,
471 Self::V2 => 2,
472 Self::V3 => 3,
473 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
474 }
475 }
476
477 #[inline]
478 pub fn is_unknown(&self) -> bool {
479 match self {
480 Self::__SourceBreaking { unknown_ordinal: _ } => true,
481 _ => false,
482 }
483 }
484}
485
486#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
487pub enum InterfaceRemovedReason {
488 DuplicateName,
491 PortAlreadyBound,
493 BadPort,
496 PortClosed,
498 User,
500 #[doc(hidden)]
501 __SourceBreaking { unknown_ordinal: u32 },
502}
503
504#[macro_export]
506macro_rules! InterfaceRemovedReasonUnknown {
507 () => {
508 _
509 };
510}
511
512impl InterfaceRemovedReason {
513 #[inline]
514 pub fn from_primitive(prim: u32) -> Option<Self> {
515 match prim {
516 1 => Some(Self::DuplicateName),
517 2 => Some(Self::PortAlreadyBound),
518 3 => Some(Self::BadPort),
519 4 => Some(Self::PortClosed),
520 5 => Some(Self::User),
521 _ => None,
522 }
523 }
524
525 #[inline]
526 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
527 match prim {
528 1 => Self::DuplicateName,
529 2 => Self::PortAlreadyBound,
530 3 => Self::BadPort,
531 4 => Self::PortClosed,
532 5 => Self::User,
533 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
534 }
535 }
536
537 #[inline]
538 pub fn unknown() -> Self {
539 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
540 }
541
542 #[inline]
543 pub const fn into_primitive(self) -> u32 {
544 match self {
545 Self::DuplicateName => 1,
546 Self::PortAlreadyBound => 2,
547 Self::BadPort => 3,
548 Self::PortClosed => 4,
549 Self::User => 5,
550 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
551 }
552 }
553
554 #[inline]
555 pub fn is_unknown(&self) -> bool {
556 match self {
557 Self::__SourceBreaking { unknown_ordinal: _ } => true,
558 _ => false,
559 }
560 }
561}
562
563#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
564pub enum MldVersion {
565 V1,
567 V2,
569 #[doc(hidden)]
570 __SourceBreaking { unknown_ordinal: u8 },
571}
572
573#[macro_export]
575macro_rules! MldVersionUnknown {
576 () => {
577 _
578 };
579}
580
581impl MldVersion {
582 #[inline]
583 pub fn from_primitive(prim: u8) -> Option<Self> {
584 match prim {
585 1 => Some(Self::V1),
586 2 => Some(Self::V2),
587 _ => None,
588 }
589 }
590
591 #[inline]
592 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
593 match prim {
594 1 => Self::V1,
595 2 => Self::V2,
596 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
597 }
598 }
599
600 #[inline]
601 pub fn unknown() -> Self {
602 Self::__SourceBreaking { unknown_ordinal: 0xff }
603 }
604
605 #[inline]
606 pub const fn into_primitive(self) -> u8 {
607 match self {
608 Self::V1 => 1,
609 Self::V2 => 2,
610 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
611 }
612 }
613
614 #[inline]
615 pub fn is_unknown(&self) -> bool {
616 match self {
617 Self::__SourceBreaking { unknown_ordinal: _ } => true,
618 _ => false,
619 }
620 }
621}
622
623#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
624pub struct AddressStateProviderOnAddressRemovedRequest {
625 pub error: AddressRemovalReason,
626}
627
628impl fidl::Persistable for AddressStateProviderOnAddressRemovedRequest {}
629
630#[derive(Clone, Debug, PartialEq)]
631pub struct AddressStateProviderUpdateAddressPropertiesRequest {
632 pub address_properties: AddressProperties,
633}
634
635impl fidl::Persistable for AddressStateProviderUpdateAddressPropertiesRequest {}
636
637#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
638pub struct AddressStateProviderWatchAddressAssignmentStateResponse {
639 pub assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
640}
641
642impl fidl::Persistable for AddressStateProviderWatchAddressAssignmentStateResponse {}
643
644#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
645#[repr(C)]
646pub struct ControlGetIdResponse {
647 pub id: u64,
648}
649
650impl fidl::Persistable for ControlGetIdResponse {}
651
652#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
653pub struct ControlOnInterfaceRemovedRequest {
654 pub reason: InterfaceRemovedReason,
655}
656
657impl fidl::Persistable for ControlOnInterfaceRemovedRequest {}
658
659#[derive(Clone, Debug, PartialEq)]
660pub struct ControlRemoveAddressRequest {
661 pub address: fidl_fuchsia_net::Subnet,
662}
663
664impl fidl::Persistable for ControlRemoveAddressRequest {}
665
666#[derive(Clone, Debug, PartialEq)]
667pub struct ControlSetConfigurationRequest {
668 pub config: Configuration,
669}
670
671impl fidl::Persistable for ControlSetConfigurationRequest {}
672
673#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
674pub struct ControlDisableResponse {
675 pub did_disable: bool,
676}
677
678impl fidl::Persistable for ControlDisableResponse {}
679
680#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
681pub struct ControlEnableResponse {
682 pub did_enable: bool,
683}
684
685impl fidl::Persistable for ControlEnableResponse {}
686
687#[derive(Clone, Debug, PartialEq)]
688pub struct ControlGetConfigurationResponse {
689 pub config: Configuration,
690}
691
692impl fidl::Persistable for ControlGetConfigurationResponse {}
693
694#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
695pub struct ControlRemoveAddressResponse {
696 pub did_remove: bool,
697}
698
699impl fidl::Persistable for ControlRemoveAddressResponse {}
700
701#[derive(Clone, Debug, PartialEq)]
702pub struct ControlSetConfigurationResponse {
703 pub previous_config: Configuration,
704}
705
706impl fidl::Persistable for ControlSetConfigurationResponse {}
707
708#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
709pub struct Empty;
710
711impl fidl::Persistable for Empty {}
712
713#[derive(Clone, Debug, Default, PartialEq)]
715pub struct AddressParameters {
716 pub initial_properties: Option<AddressProperties>,
720 pub temporary: Option<bool>,
737 pub add_subnet_route: Option<bool>,
746 #[doc(hidden)]
747 pub __source_breaking: fidl::marker::SourceBreaking,
748}
749
750impl fidl::Persistable for AddressParameters {}
751
752#[derive(Clone, Debug, Default, PartialEq)]
754pub struct AddressProperties {
755 pub preferred_lifetime_info: Option<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo>,
760 pub valid_lifetime_end: Option<i64>,
774 #[doc(hidden)]
775 pub __source_breaking: fidl::marker::SourceBreaking,
776}
777
778impl fidl::Persistable for AddressProperties {}
779
780#[derive(Clone, Debug, Default, PartialEq)]
781pub struct ArpConfiguration {
782 pub nud: Option<NudConfiguration>,
784 #[doc(hidden)]
785 pub __source_breaking: fidl::marker::SourceBreaking,
786}
787
788impl fidl::Persistable for ArpConfiguration {}
789
790#[derive(Clone, Debug, Default, PartialEq)]
792pub struct Configuration {
793 pub ipv4: Option<Ipv4Configuration>,
795 pub ipv6: Option<Ipv6Configuration>,
797 #[doc(hidden)]
798 pub __source_breaking: fidl::marker::SourceBreaking,
799}
800
801impl fidl::Persistable for Configuration {}
802
803#[derive(Clone, Debug, Default, PartialEq)]
805pub struct DadConfiguration {
806 pub transmits: Option<u16>,
811 #[doc(hidden)]
812 pub __source_breaking: fidl::marker::SourceBreaking,
813}
814
815impl fidl::Persistable for DadConfiguration {}
816
817#[derive(Clone, Debug, Default, PartialEq)]
818pub struct IgmpConfiguration {
819 pub version: Option<IgmpVersion>,
825 #[doc(hidden)]
826 pub __source_breaking: fidl::marker::SourceBreaking,
827}
828
829impl fidl::Persistable for IgmpConfiguration {}
830
831#[derive(Clone, Debug, Default, PartialEq)]
832pub struct Ipv4Configuration {
833 pub unicast_forwarding: Option<bool>,
836 pub multicast_forwarding: Option<bool>,
838 pub igmp: Option<IgmpConfiguration>,
840 pub arp: Option<ArpConfiguration>,
842 #[doc(hidden)]
843 pub __source_breaking: fidl::marker::SourceBreaking,
844}
845
846impl fidl::Persistable for Ipv4Configuration {}
847
848#[derive(Clone, Debug, Default, PartialEq)]
849pub struct Ipv6Configuration {
850 pub unicast_forwarding: Option<bool>,
853 pub multicast_forwarding: Option<bool>,
855 pub mld: Option<MldConfiguration>,
857 pub ndp: Option<NdpConfiguration>,
859 #[doc(hidden)]
860 pub __source_breaking: fidl::marker::SourceBreaking,
861}
862
863impl fidl::Persistable for Ipv6Configuration {}
864
865#[derive(Clone, Debug, Default, PartialEq)]
866pub struct MldConfiguration {
867 pub version: Option<MldVersion>,
873 #[doc(hidden)]
874 pub __source_breaking: fidl::marker::SourceBreaking,
875}
876
877impl fidl::Persistable for MldConfiguration {}
878
879#[derive(Clone, Debug, Default, PartialEq)]
880pub struct NdpConfiguration {
881 pub nud: Option<NudConfiguration>,
883 pub dad: Option<DadConfiguration>,
885 pub slaac: Option<SlaacConfiguration>,
887 #[doc(hidden)]
888 pub __source_breaking: fidl::marker::SourceBreaking,
889}
890
891impl fidl::Persistable for NdpConfiguration {}
892
893#[derive(Clone, Debug, Default, PartialEq)]
897pub struct NudConfiguration {
898 pub max_multicast_solicitations: Option<u16>,
904 pub max_unicast_solicitations: Option<u16>,
909 pub base_reachable_time: Option<i64>,
919 #[doc(hidden)]
920 pub __source_breaking: fidl::marker::SourceBreaking,
921}
922
923impl fidl::Persistable for NudConfiguration {}
924
925#[derive(Clone, Debug, Default, PartialEq)]
927pub struct Options {
928 pub name: Option<String>,
932 pub metric: Option<u32>,
936 #[doc(hidden)]
937 pub __source_breaking: fidl::marker::SourceBreaking,
938}
939
940impl fidl::Persistable for Options {}
941
942#[derive(Clone, Debug, Default, PartialEq)]
943pub struct SlaacConfiguration {
944 pub temporary_address: Option<bool>,
953 #[doc(hidden)]
954 pub __source_breaking: fidl::marker::SourceBreaking,
955}
956
957impl fidl::Persistable for SlaacConfiguration {}
958
959mod internal {
960 use super::*;
961 unsafe impl fidl::encoding::TypeMarker for AddressRemovalReason {
962 type Owned = Self;
963
964 #[inline(always)]
965 fn inline_align(_context: fidl::encoding::Context) -> usize {
966 std::mem::align_of::<u32>()
967 }
968
969 #[inline(always)]
970 fn inline_size(_context: fidl::encoding::Context) -> usize {
971 std::mem::size_of::<u32>()
972 }
973
974 #[inline(always)]
975 fn encode_is_copy() -> bool {
976 true
977 }
978
979 #[inline(always)]
980 fn decode_is_copy() -> bool {
981 false
982 }
983 }
984
985 impl fidl::encoding::ValueTypeMarker for AddressRemovalReason {
986 type Borrowed<'a> = Self;
987 #[inline(always)]
988 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
989 *value
990 }
991 }
992
993 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
994 for AddressRemovalReason
995 {
996 #[inline]
997 unsafe fn encode(
998 self,
999 encoder: &mut fidl::encoding::Encoder<'_, D>,
1000 offset: usize,
1001 _depth: fidl::encoding::Depth,
1002 ) -> fidl::Result<()> {
1003 encoder.debug_check_bounds::<Self>(offset);
1004 encoder.write_num(self.into_primitive(), offset);
1005 Ok(())
1006 }
1007 }
1008
1009 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressRemovalReason {
1010 #[inline(always)]
1011 fn new_empty() -> Self {
1012 Self::Invalid
1013 }
1014
1015 #[inline]
1016 unsafe fn decode(
1017 &mut self,
1018 decoder: &mut fidl::encoding::Decoder<'_, D>,
1019 offset: usize,
1020 _depth: fidl::encoding::Depth,
1021 ) -> fidl::Result<()> {
1022 decoder.debug_check_bounds::<Self>(offset);
1023 let prim = decoder.read_num::<u32>(offset);
1024
1025 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1026 Ok(())
1027 }
1028 }
1029 unsafe impl fidl::encoding::TypeMarker for ControlDisableError {
1030 type Owned = Self;
1031
1032 #[inline(always)]
1033 fn inline_align(_context: fidl::encoding::Context) -> usize {
1034 std::mem::align_of::<u32>()
1035 }
1036
1037 #[inline(always)]
1038 fn inline_size(_context: fidl::encoding::Context) -> usize {
1039 std::mem::size_of::<u32>()
1040 }
1041
1042 #[inline(always)]
1043 fn encode_is_copy() -> bool {
1044 false
1045 }
1046
1047 #[inline(always)]
1048 fn decode_is_copy() -> bool {
1049 false
1050 }
1051 }
1052
1053 impl fidl::encoding::ValueTypeMarker for ControlDisableError {
1054 type Borrowed<'a> = Self;
1055 #[inline(always)]
1056 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1057 *value
1058 }
1059 }
1060
1061 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1062 for ControlDisableError
1063 {
1064 #[inline]
1065 unsafe fn encode(
1066 self,
1067 encoder: &mut fidl::encoding::Encoder<'_, D>,
1068 offset: usize,
1069 _depth: fidl::encoding::Depth,
1070 ) -> fidl::Result<()> {
1071 encoder.debug_check_bounds::<Self>(offset);
1072 encoder.write_num(self.into_primitive(), offset);
1073 Ok(())
1074 }
1075 }
1076
1077 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlDisableError {
1078 #[inline(always)]
1079 fn new_empty() -> Self {
1080 Self::unknown()
1081 }
1082
1083 #[inline]
1084 unsafe fn decode(
1085 &mut self,
1086 decoder: &mut fidl::encoding::Decoder<'_, D>,
1087 offset: usize,
1088 _depth: fidl::encoding::Depth,
1089 ) -> fidl::Result<()> {
1090 decoder.debug_check_bounds::<Self>(offset);
1091 let prim = decoder.read_num::<u32>(offset);
1092
1093 *self = Self::from_primitive_allow_unknown(prim);
1094 Ok(())
1095 }
1096 }
1097 unsafe impl fidl::encoding::TypeMarker for ControlEnableError {
1098 type Owned = Self;
1099
1100 #[inline(always)]
1101 fn inline_align(_context: fidl::encoding::Context) -> usize {
1102 std::mem::align_of::<u32>()
1103 }
1104
1105 #[inline(always)]
1106 fn inline_size(_context: fidl::encoding::Context) -> usize {
1107 std::mem::size_of::<u32>()
1108 }
1109
1110 #[inline(always)]
1111 fn encode_is_copy() -> bool {
1112 false
1113 }
1114
1115 #[inline(always)]
1116 fn decode_is_copy() -> bool {
1117 false
1118 }
1119 }
1120
1121 impl fidl::encoding::ValueTypeMarker for ControlEnableError {
1122 type Borrowed<'a> = Self;
1123 #[inline(always)]
1124 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1125 *value
1126 }
1127 }
1128
1129 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1130 for ControlEnableError
1131 {
1132 #[inline]
1133 unsafe fn encode(
1134 self,
1135 encoder: &mut fidl::encoding::Encoder<'_, D>,
1136 offset: usize,
1137 _depth: fidl::encoding::Depth,
1138 ) -> fidl::Result<()> {
1139 encoder.debug_check_bounds::<Self>(offset);
1140 encoder.write_num(self.into_primitive(), offset);
1141 Ok(())
1142 }
1143 }
1144
1145 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlEnableError {
1146 #[inline(always)]
1147 fn new_empty() -> Self {
1148 Self::unknown()
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 let prim = decoder.read_num::<u32>(offset);
1160
1161 *self = Self::from_primitive_allow_unknown(prim);
1162 Ok(())
1163 }
1164 }
1165 unsafe impl fidl::encoding::TypeMarker for ControlGetConfigurationError {
1166 type Owned = Self;
1167
1168 #[inline(always)]
1169 fn inline_align(_context: fidl::encoding::Context) -> usize {
1170 std::mem::align_of::<u32>()
1171 }
1172
1173 #[inline(always)]
1174 fn inline_size(_context: fidl::encoding::Context) -> usize {
1175 std::mem::size_of::<u32>()
1176 }
1177
1178 #[inline(always)]
1179 fn encode_is_copy() -> bool {
1180 false
1181 }
1182
1183 #[inline(always)]
1184 fn decode_is_copy() -> bool {
1185 false
1186 }
1187 }
1188
1189 impl fidl::encoding::ValueTypeMarker for ControlGetConfigurationError {
1190 type Borrowed<'a> = Self;
1191 #[inline(always)]
1192 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1193 *value
1194 }
1195 }
1196
1197 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1198 for ControlGetConfigurationError
1199 {
1200 #[inline]
1201 unsafe fn encode(
1202 self,
1203 encoder: &mut fidl::encoding::Encoder<'_, D>,
1204 offset: usize,
1205 _depth: fidl::encoding::Depth,
1206 ) -> fidl::Result<()> {
1207 encoder.debug_check_bounds::<Self>(offset);
1208 encoder.write_num(self.into_primitive(), offset);
1209 Ok(())
1210 }
1211 }
1212
1213 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1214 for ControlGetConfigurationError
1215 {
1216 #[inline(always)]
1217 fn new_empty() -> Self {
1218 Self::unknown()
1219 }
1220
1221 #[inline]
1222 unsafe fn decode(
1223 &mut self,
1224 decoder: &mut fidl::encoding::Decoder<'_, D>,
1225 offset: usize,
1226 _depth: fidl::encoding::Depth,
1227 ) -> fidl::Result<()> {
1228 decoder.debug_check_bounds::<Self>(offset);
1229 let prim = decoder.read_num::<u32>(offset);
1230
1231 *self = Self::from_primitive_allow_unknown(prim);
1232 Ok(())
1233 }
1234 }
1235 unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressError {
1236 type Owned = Self;
1237
1238 #[inline(always)]
1239 fn inline_align(_context: fidl::encoding::Context) -> usize {
1240 std::mem::align_of::<u32>()
1241 }
1242
1243 #[inline(always)]
1244 fn inline_size(_context: fidl::encoding::Context) -> usize {
1245 std::mem::size_of::<u32>()
1246 }
1247
1248 #[inline(always)]
1249 fn encode_is_copy() -> bool {
1250 false
1251 }
1252
1253 #[inline(always)]
1254 fn decode_is_copy() -> bool {
1255 false
1256 }
1257 }
1258
1259 impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressError {
1260 type Borrowed<'a> = Self;
1261 #[inline(always)]
1262 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1263 *value
1264 }
1265 }
1266
1267 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1268 for ControlRemoveAddressError
1269 {
1270 #[inline]
1271 unsafe fn encode(
1272 self,
1273 encoder: &mut fidl::encoding::Encoder<'_, D>,
1274 offset: usize,
1275 _depth: fidl::encoding::Depth,
1276 ) -> fidl::Result<()> {
1277 encoder.debug_check_bounds::<Self>(offset);
1278 encoder.write_num(self.into_primitive(), offset);
1279 Ok(())
1280 }
1281 }
1282
1283 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1284 for ControlRemoveAddressError
1285 {
1286 #[inline(always)]
1287 fn new_empty() -> Self {
1288 Self::unknown()
1289 }
1290
1291 #[inline]
1292 unsafe fn decode(
1293 &mut self,
1294 decoder: &mut fidl::encoding::Decoder<'_, D>,
1295 offset: usize,
1296 _depth: fidl::encoding::Depth,
1297 ) -> fidl::Result<()> {
1298 decoder.debug_check_bounds::<Self>(offset);
1299 let prim = decoder.read_num::<u32>(offset);
1300
1301 *self = Self::from_primitive_allow_unknown(prim);
1302 Ok(())
1303 }
1304 }
1305 unsafe impl fidl::encoding::TypeMarker for ControlRemoveError {
1306 type Owned = Self;
1307
1308 #[inline(always)]
1309 fn inline_align(_context: fidl::encoding::Context) -> usize {
1310 std::mem::align_of::<u32>()
1311 }
1312
1313 #[inline(always)]
1314 fn inline_size(_context: fidl::encoding::Context) -> usize {
1315 std::mem::size_of::<u32>()
1316 }
1317
1318 #[inline(always)]
1319 fn encode_is_copy() -> bool {
1320 false
1321 }
1322
1323 #[inline(always)]
1324 fn decode_is_copy() -> bool {
1325 false
1326 }
1327 }
1328
1329 impl fidl::encoding::ValueTypeMarker for ControlRemoveError {
1330 type Borrowed<'a> = Self;
1331 #[inline(always)]
1332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1333 *value
1334 }
1335 }
1336
1337 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1338 for ControlRemoveError
1339 {
1340 #[inline]
1341 unsafe fn encode(
1342 self,
1343 encoder: &mut fidl::encoding::Encoder<'_, D>,
1344 offset: usize,
1345 _depth: fidl::encoding::Depth,
1346 ) -> fidl::Result<()> {
1347 encoder.debug_check_bounds::<Self>(offset);
1348 encoder.write_num(self.into_primitive(), offset);
1349 Ok(())
1350 }
1351 }
1352
1353 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlRemoveError {
1354 #[inline(always)]
1355 fn new_empty() -> Self {
1356 Self::unknown()
1357 }
1358
1359 #[inline]
1360 unsafe fn decode(
1361 &mut self,
1362 decoder: &mut fidl::encoding::Decoder<'_, D>,
1363 offset: usize,
1364 _depth: fidl::encoding::Depth,
1365 ) -> fidl::Result<()> {
1366 decoder.debug_check_bounds::<Self>(offset);
1367 let prim = decoder.read_num::<u32>(offset);
1368
1369 *self = Self::from_primitive_allow_unknown(prim);
1370 Ok(())
1371 }
1372 }
1373 unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationError {
1374 type Owned = Self;
1375
1376 #[inline(always)]
1377 fn inline_align(_context: fidl::encoding::Context) -> usize {
1378 std::mem::align_of::<u32>()
1379 }
1380
1381 #[inline(always)]
1382 fn inline_size(_context: fidl::encoding::Context) -> usize {
1383 std::mem::size_of::<u32>()
1384 }
1385
1386 #[inline(always)]
1387 fn encode_is_copy() -> bool {
1388 false
1389 }
1390
1391 #[inline(always)]
1392 fn decode_is_copy() -> bool {
1393 false
1394 }
1395 }
1396
1397 impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationError {
1398 type Borrowed<'a> = Self;
1399 #[inline(always)]
1400 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1401 *value
1402 }
1403 }
1404
1405 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1406 for ControlSetConfigurationError
1407 {
1408 #[inline]
1409 unsafe fn encode(
1410 self,
1411 encoder: &mut fidl::encoding::Encoder<'_, D>,
1412 offset: usize,
1413 _depth: fidl::encoding::Depth,
1414 ) -> fidl::Result<()> {
1415 encoder.debug_check_bounds::<Self>(offset);
1416 encoder.write_num(self.into_primitive(), offset);
1417 Ok(())
1418 }
1419 }
1420
1421 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1422 for ControlSetConfigurationError
1423 {
1424 #[inline(always)]
1425 fn new_empty() -> Self {
1426 Self::unknown()
1427 }
1428
1429 #[inline]
1430 unsafe fn decode(
1431 &mut self,
1432 decoder: &mut fidl::encoding::Decoder<'_, D>,
1433 offset: usize,
1434 _depth: fidl::encoding::Depth,
1435 ) -> fidl::Result<()> {
1436 decoder.debug_check_bounds::<Self>(offset);
1437 let prim = decoder.read_num::<u32>(offset);
1438
1439 *self = Self::from_primitive_allow_unknown(prim);
1440 Ok(())
1441 }
1442 }
1443 unsafe impl fidl::encoding::TypeMarker for IgmpVersion {
1444 type Owned = Self;
1445
1446 #[inline(always)]
1447 fn inline_align(_context: fidl::encoding::Context) -> usize {
1448 std::mem::align_of::<u8>()
1449 }
1450
1451 #[inline(always)]
1452 fn inline_size(_context: fidl::encoding::Context) -> usize {
1453 std::mem::size_of::<u8>()
1454 }
1455
1456 #[inline(always)]
1457 fn encode_is_copy() -> bool {
1458 false
1459 }
1460
1461 #[inline(always)]
1462 fn decode_is_copy() -> bool {
1463 false
1464 }
1465 }
1466
1467 impl fidl::encoding::ValueTypeMarker for IgmpVersion {
1468 type Borrowed<'a> = Self;
1469 #[inline(always)]
1470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1471 *value
1472 }
1473 }
1474
1475 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for IgmpVersion {
1476 #[inline]
1477 unsafe fn encode(
1478 self,
1479 encoder: &mut fidl::encoding::Encoder<'_, D>,
1480 offset: usize,
1481 _depth: fidl::encoding::Depth,
1482 ) -> fidl::Result<()> {
1483 encoder.debug_check_bounds::<Self>(offset);
1484 encoder.write_num(self.into_primitive(), offset);
1485 Ok(())
1486 }
1487 }
1488
1489 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IgmpVersion {
1490 #[inline(always)]
1491 fn new_empty() -> Self {
1492 Self::unknown()
1493 }
1494
1495 #[inline]
1496 unsafe fn decode(
1497 &mut self,
1498 decoder: &mut fidl::encoding::Decoder<'_, D>,
1499 offset: usize,
1500 _depth: fidl::encoding::Depth,
1501 ) -> fidl::Result<()> {
1502 decoder.debug_check_bounds::<Self>(offset);
1503 let prim = decoder.read_num::<u8>(offset);
1504
1505 *self = Self::from_primitive_allow_unknown(prim);
1506 Ok(())
1507 }
1508 }
1509 unsafe impl fidl::encoding::TypeMarker for InterfaceRemovedReason {
1510 type Owned = Self;
1511
1512 #[inline(always)]
1513 fn inline_align(_context: fidl::encoding::Context) -> usize {
1514 std::mem::align_of::<u32>()
1515 }
1516
1517 #[inline(always)]
1518 fn inline_size(_context: fidl::encoding::Context) -> usize {
1519 std::mem::size_of::<u32>()
1520 }
1521
1522 #[inline(always)]
1523 fn encode_is_copy() -> bool {
1524 false
1525 }
1526
1527 #[inline(always)]
1528 fn decode_is_copy() -> bool {
1529 false
1530 }
1531 }
1532
1533 impl fidl::encoding::ValueTypeMarker for InterfaceRemovedReason {
1534 type Borrowed<'a> = Self;
1535 #[inline(always)]
1536 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1537 *value
1538 }
1539 }
1540
1541 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1542 for InterfaceRemovedReason
1543 {
1544 #[inline]
1545 unsafe fn encode(
1546 self,
1547 encoder: &mut fidl::encoding::Encoder<'_, D>,
1548 offset: usize,
1549 _depth: fidl::encoding::Depth,
1550 ) -> fidl::Result<()> {
1551 encoder.debug_check_bounds::<Self>(offset);
1552 encoder.write_num(self.into_primitive(), offset);
1553 Ok(())
1554 }
1555 }
1556
1557 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1558 for InterfaceRemovedReason
1559 {
1560 #[inline(always)]
1561 fn new_empty() -> Self {
1562 Self::unknown()
1563 }
1564
1565 #[inline]
1566 unsafe fn decode(
1567 &mut self,
1568 decoder: &mut fidl::encoding::Decoder<'_, D>,
1569 offset: usize,
1570 _depth: fidl::encoding::Depth,
1571 ) -> fidl::Result<()> {
1572 decoder.debug_check_bounds::<Self>(offset);
1573 let prim = decoder.read_num::<u32>(offset);
1574
1575 *self = Self::from_primitive_allow_unknown(prim);
1576 Ok(())
1577 }
1578 }
1579 unsafe impl fidl::encoding::TypeMarker for MldVersion {
1580 type Owned = Self;
1581
1582 #[inline(always)]
1583 fn inline_align(_context: fidl::encoding::Context) -> usize {
1584 std::mem::align_of::<u8>()
1585 }
1586
1587 #[inline(always)]
1588 fn inline_size(_context: fidl::encoding::Context) -> usize {
1589 std::mem::size_of::<u8>()
1590 }
1591
1592 #[inline(always)]
1593 fn encode_is_copy() -> bool {
1594 false
1595 }
1596
1597 #[inline(always)]
1598 fn decode_is_copy() -> bool {
1599 false
1600 }
1601 }
1602
1603 impl fidl::encoding::ValueTypeMarker for MldVersion {
1604 type Borrowed<'a> = Self;
1605 #[inline(always)]
1606 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1607 *value
1608 }
1609 }
1610
1611 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MldVersion {
1612 #[inline]
1613 unsafe fn encode(
1614 self,
1615 encoder: &mut fidl::encoding::Encoder<'_, D>,
1616 offset: usize,
1617 _depth: fidl::encoding::Depth,
1618 ) -> fidl::Result<()> {
1619 encoder.debug_check_bounds::<Self>(offset);
1620 encoder.write_num(self.into_primitive(), offset);
1621 Ok(())
1622 }
1623 }
1624
1625 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MldVersion {
1626 #[inline(always)]
1627 fn new_empty() -> Self {
1628 Self::unknown()
1629 }
1630
1631 #[inline]
1632 unsafe fn decode(
1633 &mut self,
1634 decoder: &mut fidl::encoding::Decoder<'_, D>,
1635 offset: usize,
1636 _depth: fidl::encoding::Depth,
1637 ) -> fidl::Result<()> {
1638 decoder.debug_check_bounds::<Self>(offset);
1639 let prim = decoder.read_num::<u8>(offset);
1640
1641 *self = Self::from_primitive_allow_unknown(prim);
1642 Ok(())
1643 }
1644 }
1645
1646 impl fidl::encoding::ValueTypeMarker for AddressStateProviderOnAddressRemovedRequest {
1647 type Borrowed<'a> = &'a Self;
1648 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1649 value
1650 }
1651 }
1652
1653 unsafe impl fidl::encoding::TypeMarker for AddressStateProviderOnAddressRemovedRequest {
1654 type Owned = Self;
1655
1656 #[inline(always)]
1657 fn inline_align(_context: fidl::encoding::Context) -> usize {
1658 4
1659 }
1660
1661 #[inline(always)]
1662 fn inline_size(_context: fidl::encoding::Context) -> usize {
1663 4
1664 }
1665 }
1666
1667 unsafe impl<D: fidl::encoding::ResourceDialect>
1668 fidl::encoding::Encode<AddressStateProviderOnAddressRemovedRequest, D>
1669 for &AddressStateProviderOnAddressRemovedRequest
1670 {
1671 #[inline]
1672 unsafe fn encode(
1673 self,
1674 encoder: &mut fidl::encoding::Encoder<'_, D>,
1675 offset: usize,
1676 _depth: fidl::encoding::Depth,
1677 ) -> fidl::Result<()> {
1678 encoder.debug_check_bounds::<AddressStateProviderOnAddressRemovedRequest>(offset);
1679 fidl::encoding::Encode::<AddressStateProviderOnAddressRemovedRequest, D>::encode(
1681 (<AddressRemovalReason as fidl::encoding::ValueTypeMarker>::borrow(&self.error),),
1682 encoder,
1683 offset,
1684 _depth,
1685 )
1686 }
1687 }
1688 unsafe impl<
1689 D: fidl::encoding::ResourceDialect,
1690 T0: fidl::encoding::Encode<AddressRemovalReason, D>,
1691 > fidl::encoding::Encode<AddressStateProviderOnAddressRemovedRequest, D> for (T0,)
1692 {
1693 #[inline]
1694 unsafe fn encode(
1695 self,
1696 encoder: &mut fidl::encoding::Encoder<'_, D>,
1697 offset: usize,
1698 depth: fidl::encoding::Depth,
1699 ) -> fidl::Result<()> {
1700 encoder.debug_check_bounds::<AddressStateProviderOnAddressRemovedRequest>(offset);
1701 self.0.encode(encoder, offset + 0, depth)?;
1705 Ok(())
1706 }
1707 }
1708
1709 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1710 for AddressStateProviderOnAddressRemovedRequest
1711 {
1712 #[inline(always)]
1713 fn new_empty() -> Self {
1714 Self { error: fidl::new_empty!(AddressRemovalReason, D) }
1715 }
1716
1717 #[inline]
1718 unsafe fn decode(
1719 &mut self,
1720 decoder: &mut fidl::encoding::Decoder<'_, D>,
1721 offset: usize,
1722 _depth: fidl::encoding::Depth,
1723 ) -> fidl::Result<()> {
1724 decoder.debug_check_bounds::<Self>(offset);
1725 fidl::decode!(AddressRemovalReason, D, &mut self.error, decoder, offset + 0, _depth)?;
1727 Ok(())
1728 }
1729 }
1730
1731 impl fidl::encoding::ValueTypeMarker for AddressStateProviderUpdateAddressPropertiesRequest {
1732 type Borrowed<'a> = &'a Self;
1733 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1734 value
1735 }
1736 }
1737
1738 unsafe impl fidl::encoding::TypeMarker for AddressStateProviderUpdateAddressPropertiesRequest {
1739 type Owned = Self;
1740
1741 #[inline(always)]
1742 fn inline_align(_context: fidl::encoding::Context) -> usize {
1743 8
1744 }
1745
1746 #[inline(always)]
1747 fn inline_size(_context: fidl::encoding::Context) -> usize {
1748 16
1749 }
1750 }
1751
1752 unsafe impl<D: fidl::encoding::ResourceDialect>
1753 fidl::encoding::Encode<AddressStateProviderUpdateAddressPropertiesRequest, D>
1754 for &AddressStateProviderUpdateAddressPropertiesRequest
1755 {
1756 #[inline]
1757 unsafe fn encode(
1758 self,
1759 encoder: &mut fidl::encoding::Encoder<'_, D>,
1760 offset: usize,
1761 _depth: fidl::encoding::Depth,
1762 ) -> fidl::Result<()> {
1763 encoder
1764 .debug_check_bounds::<AddressStateProviderUpdateAddressPropertiesRequest>(offset);
1765 fidl::encoding::Encode::<AddressStateProviderUpdateAddressPropertiesRequest, D>::encode(
1767 (<AddressProperties as fidl::encoding::ValueTypeMarker>::borrow(
1768 &self.address_properties,
1769 ),),
1770 encoder,
1771 offset,
1772 _depth,
1773 )
1774 }
1775 }
1776 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AddressProperties, D>>
1777 fidl::encoding::Encode<AddressStateProviderUpdateAddressPropertiesRequest, D> for (T0,)
1778 {
1779 #[inline]
1780 unsafe fn encode(
1781 self,
1782 encoder: &mut fidl::encoding::Encoder<'_, D>,
1783 offset: usize,
1784 depth: fidl::encoding::Depth,
1785 ) -> fidl::Result<()> {
1786 encoder
1787 .debug_check_bounds::<AddressStateProviderUpdateAddressPropertiesRequest>(offset);
1788 self.0.encode(encoder, offset + 0, depth)?;
1792 Ok(())
1793 }
1794 }
1795
1796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1797 for AddressStateProviderUpdateAddressPropertiesRequest
1798 {
1799 #[inline(always)]
1800 fn new_empty() -> Self {
1801 Self { address_properties: fidl::new_empty!(AddressProperties, D) }
1802 }
1803
1804 #[inline]
1805 unsafe fn decode(
1806 &mut self,
1807 decoder: &mut fidl::encoding::Decoder<'_, D>,
1808 offset: usize,
1809 _depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 decoder.debug_check_bounds::<Self>(offset);
1812 fidl::decode!(
1814 AddressProperties,
1815 D,
1816 &mut self.address_properties,
1817 decoder,
1818 offset + 0,
1819 _depth
1820 )?;
1821 Ok(())
1822 }
1823 }
1824
1825 impl fidl::encoding::ValueTypeMarker for AddressStateProviderWatchAddressAssignmentStateResponse {
1826 type Borrowed<'a> = &'a Self;
1827 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1828 value
1829 }
1830 }
1831
1832 unsafe impl fidl::encoding::TypeMarker for AddressStateProviderWatchAddressAssignmentStateResponse {
1833 type Owned = Self;
1834
1835 #[inline(always)]
1836 fn inline_align(_context: fidl::encoding::Context) -> usize {
1837 4
1838 }
1839
1840 #[inline(always)]
1841 fn inline_size(_context: fidl::encoding::Context) -> usize {
1842 4
1843 }
1844 }
1845
1846 unsafe impl<D: fidl::encoding::ResourceDialect>
1847 fidl::encoding::Encode<AddressStateProviderWatchAddressAssignmentStateResponse, D>
1848 for &AddressStateProviderWatchAddressAssignmentStateResponse
1849 {
1850 #[inline]
1851 unsafe fn encode(
1852 self,
1853 encoder: &mut fidl::encoding::Encoder<'_, D>,
1854 offset: usize,
1855 _depth: fidl::encoding::Depth,
1856 ) -> fidl::Result<()> {
1857 encoder.debug_check_bounds::<AddressStateProviderWatchAddressAssignmentStateResponse>(
1858 offset,
1859 );
1860 fidl::encoding::Encode::<AddressStateProviderWatchAddressAssignmentStateResponse, D>::encode(
1862 (
1863 <fidl_fuchsia_net_interfaces::AddressAssignmentState as fidl::encoding::ValueTypeMarker>::borrow(&self.assignment_state),
1864 ),
1865 encoder, offset, _depth
1866 )
1867 }
1868 }
1869 unsafe impl<
1870 D: fidl::encoding::ResourceDialect,
1871 T0: fidl::encoding::Encode<fidl_fuchsia_net_interfaces::AddressAssignmentState, D>,
1872 > fidl::encoding::Encode<AddressStateProviderWatchAddressAssignmentStateResponse, D>
1873 for (T0,)
1874 {
1875 #[inline]
1876 unsafe fn encode(
1877 self,
1878 encoder: &mut fidl::encoding::Encoder<'_, D>,
1879 offset: usize,
1880 depth: fidl::encoding::Depth,
1881 ) -> fidl::Result<()> {
1882 encoder.debug_check_bounds::<AddressStateProviderWatchAddressAssignmentStateResponse>(
1883 offset,
1884 );
1885 self.0.encode(encoder, offset + 0, depth)?;
1889 Ok(())
1890 }
1891 }
1892
1893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1894 for AddressStateProviderWatchAddressAssignmentStateResponse
1895 {
1896 #[inline(always)]
1897 fn new_empty() -> Self {
1898 Self {
1899 assignment_state: fidl::new_empty!(
1900 fidl_fuchsia_net_interfaces::AddressAssignmentState,
1901 D
1902 ),
1903 }
1904 }
1905
1906 #[inline]
1907 unsafe fn decode(
1908 &mut self,
1909 decoder: &mut fidl::encoding::Decoder<'_, D>,
1910 offset: usize,
1911 _depth: fidl::encoding::Depth,
1912 ) -> fidl::Result<()> {
1913 decoder.debug_check_bounds::<Self>(offset);
1914 fidl::decode!(
1916 fidl_fuchsia_net_interfaces::AddressAssignmentState,
1917 D,
1918 &mut self.assignment_state,
1919 decoder,
1920 offset + 0,
1921 _depth
1922 )?;
1923 Ok(())
1924 }
1925 }
1926
1927 impl fidl::encoding::ValueTypeMarker for ControlGetIdResponse {
1928 type Borrowed<'a> = &'a Self;
1929 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1930 value
1931 }
1932 }
1933
1934 unsafe impl fidl::encoding::TypeMarker for ControlGetIdResponse {
1935 type Owned = Self;
1936
1937 #[inline(always)]
1938 fn inline_align(_context: fidl::encoding::Context) -> usize {
1939 8
1940 }
1941
1942 #[inline(always)]
1943 fn inline_size(_context: fidl::encoding::Context) -> usize {
1944 8
1945 }
1946 #[inline(always)]
1947 fn encode_is_copy() -> bool {
1948 true
1949 }
1950
1951 #[inline(always)]
1952 fn decode_is_copy() -> bool {
1953 true
1954 }
1955 }
1956
1957 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ControlGetIdResponse, D>
1958 for &ControlGetIdResponse
1959 {
1960 #[inline]
1961 unsafe fn encode(
1962 self,
1963 encoder: &mut fidl::encoding::Encoder<'_, D>,
1964 offset: usize,
1965 _depth: fidl::encoding::Depth,
1966 ) -> fidl::Result<()> {
1967 encoder.debug_check_bounds::<ControlGetIdResponse>(offset);
1968 unsafe {
1969 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1971 (buf_ptr as *mut ControlGetIdResponse)
1972 .write_unaligned((self as *const ControlGetIdResponse).read());
1973 }
1976 Ok(())
1977 }
1978 }
1979 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
1980 fidl::encoding::Encode<ControlGetIdResponse, D> for (T0,)
1981 {
1982 #[inline]
1983 unsafe fn encode(
1984 self,
1985 encoder: &mut fidl::encoding::Encoder<'_, D>,
1986 offset: usize,
1987 depth: fidl::encoding::Depth,
1988 ) -> fidl::Result<()> {
1989 encoder.debug_check_bounds::<ControlGetIdResponse>(offset);
1990 self.0.encode(encoder, offset + 0, depth)?;
1994 Ok(())
1995 }
1996 }
1997
1998 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlGetIdResponse {
1999 #[inline(always)]
2000 fn new_empty() -> Self {
2001 Self { id: fidl::new_empty!(u64, D) }
2002 }
2003
2004 #[inline]
2005 unsafe fn decode(
2006 &mut self,
2007 decoder: &mut fidl::encoding::Decoder<'_, D>,
2008 offset: usize,
2009 _depth: fidl::encoding::Depth,
2010 ) -> fidl::Result<()> {
2011 decoder.debug_check_bounds::<Self>(offset);
2012 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2013 unsafe {
2016 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2017 }
2018 Ok(())
2019 }
2020 }
2021
2022 impl fidl::encoding::ValueTypeMarker for ControlOnInterfaceRemovedRequest {
2023 type Borrowed<'a> = &'a Self;
2024 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2025 value
2026 }
2027 }
2028
2029 unsafe impl fidl::encoding::TypeMarker for ControlOnInterfaceRemovedRequest {
2030 type Owned = Self;
2031
2032 #[inline(always)]
2033 fn inline_align(_context: fidl::encoding::Context) -> usize {
2034 4
2035 }
2036
2037 #[inline(always)]
2038 fn inline_size(_context: fidl::encoding::Context) -> usize {
2039 4
2040 }
2041 }
2042
2043 unsafe impl<D: fidl::encoding::ResourceDialect>
2044 fidl::encoding::Encode<ControlOnInterfaceRemovedRequest, D>
2045 for &ControlOnInterfaceRemovedRequest
2046 {
2047 #[inline]
2048 unsafe fn encode(
2049 self,
2050 encoder: &mut fidl::encoding::Encoder<'_, D>,
2051 offset: usize,
2052 _depth: fidl::encoding::Depth,
2053 ) -> fidl::Result<()> {
2054 encoder.debug_check_bounds::<ControlOnInterfaceRemovedRequest>(offset);
2055 fidl::encoding::Encode::<ControlOnInterfaceRemovedRequest, D>::encode(
2057 (<InterfaceRemovedReason as fidl::encoding::ValueTypeMarker>::borrow(&self.reason),),
2058 encoder,
2059 offset,
2060 _depth,
2061 )
2062 }
2063 }
2064 unsafe impl<
2065 D: fidl::encoding::ResourceDialect,
2066 T0: fidl::encoding::Encode<InterfaceRemovedReason, D>,
2067 > fidl::encoding::Encode<ControlOnInterfaceRemovedRequest, D> for (T0,)
2068 {
2069 #[inline]
2070 unsafe fn encode(
2071 self,
2072 encoder: &mut fidl::encoding::Encoder<'_, D>,
2073 offset: usize,
2074 depth: fidl::encoding::Depth,
2075 ) -> fidl::Result<()> {
2076 encoder.debug_check_bounds::<ControlOnInterfaceRemovedRequest>(offset);
2077 self.0.encode(encoder, offset + 0, depth)?;
2081 Ok(())
2082 }
2083 }
2084
2085 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2086 for ControlOnInterfaceRemovedRequest
2087 {
2088 #[inline(always)]
2089 fn new_empty() -> Self {
2090 Self { reason: fidl::new_empty!(InterfaceRemovedReason, D) }
2091 }
2092
2093 #[inline]
2094 unsafe fn decode(
2095 &mut self,
2096 decoder: &mut fidl::encoding::Decoder<'_, D>,
2097 offset: usize,
2098 _depth: fidl::encoding::Depth,
2099 ) -> fidl::Result<()> {
2100 decoder.debug_check_bounds::<Self>(offset);
2101 fidl::decode!(
2103 InterfaceRemovedReason,
2104 D,
2105 &mut self.reason,
2106 decoder,
2107 offset + 0,
2108 _depth
2109 )?;
2110 Ok(())
2111 }
2112 }
2113
2114 impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressRequest {
2115 type Borrowed<'a> = &'a Self;
2116 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2117 value
2118 }
2119 }
2120
2121 unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressRequest {
2122 type Owned = Self;
2123
2124 #[inline(always)]
2125 fn inline_align(_context: fidl::encoding::Context) -> usize {
2126 8
2127 }
2128
2129 #[inline(always)]
2130 fn inline_size(_context: fidl::encoding::Context) -> usize {
2131 24
2132 }
2133 }
2134
2135 unsafe impl<D: fidl::encoding::ResourceDialect>
2136 fidl::encoding::Encode<ControlRemoveAddressRequest, D> for &ControlRemoveAddressRequest
2137 {
2138 #[inline]
2139 unsafe fn encode(
2140 self,
2141 encoder: &mut fidl::encoding::Encoder<'_, D>,
2142 offset: usize,
2143 _depth: fidl::encoding::Depth,
2144 ) -> fidl::Result<()> {
2145 encoder.debug_check_bounds::<ControlRemoveAddressRequest>(offset);
2146 fidl::encoding::Encode::<ControlRemoveAddressRequest, D>::encode(
2148 (<fidl_fuchsia_net::Subnet as fidl::encoding::ValueTypeMarker>::borrow(
2149 &self.address,
2150 ),),
2151 encoder,
2152 offset,
2153 _depth,
2154 )
2155 }
2156 }
2157 unsafe impl<
2158 D: fidl::encoding::ResourceDialect,
2159 T0: fidl::encoding::Encode<fidl_fuchsia_net::Subnet, D>,
2160 > fidl::encoding::Encode<ControlRemoveAddressRequest, D> for (T0,)
2161 {
2162 #[inline]
2163 unsafe fn encode(
2164 self,
2165 encoder: &mut fidl::encoding::Encoder<'_, D>,
2166 offset: usize,
2167 depth: fidl::encoding::Depth,
2168 ) -> fidl::Result<()> {
2169 encoder.debug_check_bounds::<ControlRemoveAddressRequest>(offset);
2170 self.0.encode(encoder, offset + 0, depth)?;
2174 Ok(())
2175 }
2176 }
2177
2178 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2179 for ControlRemoveAddressRequest
2180 {
2181 #[inline(always)]
2182 fn new_empty() -> Self {
2183 Self { address: fidl::new_empty!(fidl_fuchsia_net::Subnet, D) }
2184 }
2185
2186 #[inline]
2187 unsafe fn decode(
2188 &mut self,
2189 decoder: &mut fidl::encoding::Decoder<'_, D>,
2190 offset: usize,
2191 _depth: fidl::encoding::Depth,
2192 ) -> fidl::Result<()> {
2193 decoder.debug_check_bounds::<Self>(offset);
2194 fidl::decode!(
2196 fidl_fuchsia_net::Subnet,
2197 D,
2198 &mut self.address,
2199 decoder,
2200 offset + 0,
2201 _depth
2202 )?;
2203 Ok(())
2204 }
2205 }
2206
2207 impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationRequest {
2208 type Borrowed<'a> = &'a Self;
2209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2210 value
2211 }
2212 }
2213
2214 unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationRequest {
2215 type Owned = Self;
2216
2217 #[inline(always)]
2218 fn inline_align(_context: fidl::encoding::Context) -> usize {
2219 8
2220 }
2221
2222 #[inline(always)]
2223 fn inline_size(_context: fidl::encoding::Context) -> usize {
2224 16
2225 }
2226 }
2227
2228 unsafe impl<D: fidl::encoding::ResourceDialect>
2229 fidl::encoding::Encode<ControlSetConfigurationRequest, D>
2230 for &ControlSetConfigurationRequest
2231 {
2232 #[inline]
2233 unsafe fn encode(
2234 self,
2235 encoder: &mut fidl::encoding::Encoder<'_, D>,
2236 offset: usize,
2237 _depth: fidl::encoding::Depth,
2238 ) -> fidl::Result<()> {
2239 encoder.debug_check_bounds::<ControlSetConfigurationRequest>(offset);
2240 fidl::encoding::Encode::<ControlSetConfigurationRequest, D>::encode(
2242 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2243 encoder,
2244 offset,
2245 _depth,
2246 )
2247 }
2248 }
2249 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
2250 fidl::encoding::Encode<ControlSetConfigurationRequest, D> for (T0,)
2251 {
2252 #[inline]
2253 unsafe fn encode(
2254 self,
2255 encoder: &mut fidl::encoding::Encoder<'_, D>,
2256 offset: usize,
2257 depth: fidl::encoding::Depth,
2258 ) -> fidl::Result<()> {
2259 encoder.debug_check_bounds::<ControlSetConfigurationRequest>(offset);
2260 self.0.encode(encoder, offset + 0, depth)?;
2264 Ok(())
2265 }
2266 }
2267
2268 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2269 for ControlSetConfigurationRequest
2270 {
2271 #[inline(always)]
2272 fn new_empty() -> Self {
2273 Self { config: fidl::new_empty!(Configuration, D) }
2274 }
2275
2276 #[inline]
2277 unsafe fn decode(
2278 &mut self,
2279 decoder: &mut fidl::encoding::Decoder<'_, D>,
2280 offset: usize,
2281 _depth: fidl::encoding::Depth,
2282 ) -> fidl::Result<()> {
2283 decoder.debug_check_bounds::<Self>(offset);
2284 fidl::decode!(Configuration, D, &mut self.config, decoder, offset + 0, _depth)?;
2286 Ok(())
2287 }
2288 }
2289
2290 impl fidl::encoding::ValueTypeMarker for ControlDisableResponse {
2291 type Borrowed<'a> = &'a Self;
2292 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2293 value
2294 }
2295 }
2296
2297 unsafe impl fidl::encoding::TypeMarker for ControlDisableResponse {
2298 type Owned = Self;
2299
2300 #[inline(always)]
2301 fn inline_align(_context: fidl::encoding::Context) -> usize {
2302 1
2303 }
2304
2305 #[inline(always)]
2306 fn inline_size(_context: fidl::encoding::Context) -> usize {
2307 1
2308 }
2309 }
2310
2311 unsafe impl<D: fidl::encoding::ResourceDialect>
2312 fidl::encoding::Encode<ControlDisableResponse, D> for &ControlDisableResponse
2313 {
2314 #[inline]
2315 unsafe fn encode(
2316 self,
2317 encoder: &mut fidl::encoding::Encoder<'_, D>,
2318 offset: usize,
2319 _depth: fidl::encoding::Depth,
2320 ) -> fidl::Result<()> {
2321 encoder.debug_check_bounds::<ControlDisableResponse>(offset);
2322 fidl::encoding::Encode::<ControlDisableResponse, D>::encode(
2324 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_disable),),
2325 encoder,
2326 offset,
2327 _depth,
2328 )
2329 }
2330 }
2331 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2332 fidl::encoding::Encode<ControlDisableResponse, D> for (T0,)
2333 {
2334 #[inline]
2335 unsafe fn encode(
2336 self,
2337 encoder: &mut fidl::encoding::Encoder<'_, D>,
2338 offset: usize,
2339 depth: fidl::encoding::Depth,
2340 ) -> fidl::Result<()> {
2341 encoder.debug_check_bounds::<ControlDisableResponse>(offset);
2342 self.0.encode(encoder, offset + 0, depth)?;
2346 Ok(())
2347 }
2348 }
2349
2350 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2351 for ControlDisableResponse
2352 {
2353 #[inline(always)]
2354 fn new_empty() -> Self {
2355 Self { did_disable: fidl::new_empty!(bool, D) }
2356 }
2357
2358 #[inline]
2359 unsafe fn decode(
2360 &mut self,
2361 decoder: &mut fidl::encoding::Decoder<'_, D>,
2362 offset: usize,
2363 _depth: fidl::encoding::Depth,
2364 ) -> fidl::Result<()> {
2365 decoder.debug_check_bounds::<Self>(offset);
2366 fidl::decode!(bool, D, &mut self.did_disable, decoder, offset + 0, _depth)?;
2368 Ok(())
2369 }
2370 }
2371
2372 impl fidl::encoding::ValueTypeMarker for ControlEnableResponse {
2373 type Borrowed<'a> = &'a Self;
2374 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2375 value
2376 }
2377 }
2378
2379 unsafe impl fidl::encoding::TypeMarker for ControlEnableResponse {
2380 type Owned = Self;
2381
2382 #[inline(always)]
2383 fn inline_align(_context: fidl::encoding::Context) -> usize {
2384 1
2385 }
2386
2387 #[inline(always)]
2388 fn inline_size(_context: fidl::encoding::Context) -> usize {
2389 1
2390 }
2391 }
2392
2393 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ControlEnableResponse, D>
2394 for &ControlEnableResponse
2395 {
2396 #[inline]
2397 unsafe fn encode(
2398 self,
2399 encoder: &mut fidl::encoding::Encoder<'_, D>,
2400 offset: usize,
2401 _depth: fidl::encoding::Depth,
2402 ) -> fidl::Result<()> {
2403 encoder.debug_check_bounds::<ControlEnableResponse>(offset);
2404 fidl::encoding::Encode::<ControlEnableResponse, D>::encode(
2406 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_enable),),
2407 encoder,
2408 offset,
2409 _depth,
2410 )
2411 }
2412 }
2413 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2414 fidl::encoding::Encode<ControlEnableResponse, D> for (T0,)
2415 {
2416 #[inline]
2417 unsafe fn encode(
2418 self,
2419 encoder: &mut fidl::encoding::Encoder<'_, D>,
2420 offset: usize,
2421 depth: fidl::encoding::Depth,
2422 ) -> fidl::Result<()> {
2423 encoder.debug_check_bounds::<ControlEnableResponse>(offset);
2424 self.0.encode(encoder, offset + 0, depth)?;
2428 Ok(())
2429 }
2430 }
2431
2432 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlEnableResponse {
2433 #[inline(always)]
2434 fn new_empty() -> Self {
2435 Self { did_enable: fidl::new_empty!(bool, D) }
2436 }
2437
2438 #[inline]
2439 unsafe fn decode(
2440 &mut self,
2441 decoder: &mut fidl::encoding::Decoder<'_, D>,
2442 offset: usize,
2443 _depth: fidl::encoding::Depth,
2444 ) -> fidl::Result<()> {
2445 decoder.debug_check_bounds::<Self>(offset);
2446 fidl::decode!(bool, D, &mut self.did_enable, decoder, offset + 0, _depth)?;
2448 Ok(())
2449 }
2450 }
2451
2452 impl fidl::encoding::ValueTypeMarker for ControlGetConfigurationResponse {
2453 type Borrowed<'a> = &'a Self;
2454 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2455 value
2456 }
2457 }
2458
2459 unsafe impl fidl::encoding::TypeMarker for ControlGetConfigurationResponse {
2460 type Owned = Self;
2461
2462 #[inline(always)]
2463 fn inline_align(_context: fidl::encoding::Context) -> usize {
2464 8
2465 }
2466
2467 #[inline(always)]
2468 fn inline_size(_context: fidl::encoding::Context) -> usize {
2469 16
2470 }
2471 }
2472
2473 unsafe impl<D: fidl::encoding::ResourceDialect>
2474 fidl::encoding::Encode<ControlGetConfigurationResponse, D>
2475 for &ControlGetConfigurationResponse
2476 {
2477 #[inline]
2478 unsafe fn encode(
2479 self,
2480 encoder: &mut fidl::encoding::Encoder<'_, D>,
2481 offset: usize,
2482 _depth: fidl::encoding::Depth,
2483 ) -> fidl::Result<()> {
2484 encoder.debug_check_bounds::<ControlGetConfigurationResponse>(offset);
2485 fidl::encoding::Encode::<ControlGetConfigurationResponse, D>::encode(
2487 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2488 encoder,
2489 offset,
2490 _depth,
2491 )
2492 }
2493 }
2494 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
2495 fidl::encoding::Encode<ControlGetConfigurationResponse, D> for (T0,)
2496 {
2497 #[inline]
2498 unsafe fn encode(
2499 self,
2500 encoder: &mut fidl::encoding::Encoder<'_, D>,
2501 offset: usize,
2502 depth: fidl::encoding::Depth,
2503 ) -> fidl::Result<()> {
2504 encoder.debug_check_bounds::<ControlGetConfigurationResponse>(offset);
2505 self.0.encode(encoder, offset + 0, depth)?;
2509 Ok(())
2510 }
2511 }
2512
2513 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2514 for ControlGetConfigurationResponse
2515 {
2516 #[inline(always)]
2517 fn new_empty() -> Self {
2518 Self { config: fidl::new_empty!(Configuration, D) }
2519 }
2520
2521 #[inline]
2522 unsafe fn decode(
2523 &mut self,
2524 decoder: &mut fidl::encoding::Decoder<'_, D>,
2525 offset: usize,
2526 _depth: fidl::encoding::Depth,
2527 ) -> fidl::Result<()> {
2528 decoder.debug_check_bounds::<Self>(offset);
2529 fidl::decode!(Configuration, D, &mut self.config, decoder, offset + 0, _depth)?;
2531 Ok(())
2532 }
2533 }
2534
2535 impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressResponse {
2536 type Borrowed<'a> = &'a Self;
2537 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2538 value
2539 }
2540 }
2541
2542 unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressResponse {
2543 type Owned = Self;
2544
2545 #[inline(always)]
2546 fn inline_align(_context: fidl::encoding::Context) -> usize {
2547 1
2548 }
2549
2550 #[inline(always)]
2551 fn inline_size(_context: fidl::encoding::Context) -> usize {
2552 1
2553 }
2554 }
2555
2556 unsafe impl<D: fidl::encoding::ResourceDialect>
2557 fidl::encoding::Encode<ControlRemoveAddressResponse, D> for &ControlRemoveAddressResponse
2558 {
2559 #[inline]
2560 unsafe fn encode(
2561 self,
2562 encoder: &mut fidl::encoding::Encoder<'_, D>,
2563 offset: usize,
2564 _depth: fidl::encoding::Depth,
2565 ) -> fidl::Result<()> {
2566 encoder.debug_check_bounds::<ControlRemoveAddressResponse>(offset);
2567 fidl::encoding::Encode::<ControlRemoveAddressResponse, D>::encode(
2569 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_remove),),
2570 encoder,
2571 offset,
2572 _depth,
2573 )
2574 }
2575 }
2576 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2577 fidl::encoding::Encode<ControlRemoveAddressResponse, D> for (T0,)
2578 {
2579 #[inline]
2580 unsafe fn encode(
2581 self,
2582 encoder: &mut fidl::encoding::Encoder<'_, D>,
2583 offset: usize,
2584 depth: fidl::encoding::Depth,
2585 ) -> fidl::Result<()> {
2586 encoder.debug_check_bounds::<ControlRemoveAddressResponse>(offset);
2587 self.0.encode(encoder, offset + 0, depth)?;
2591 Ok(())
2592 }
2593 }
2594
2595 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2596 for ControlRemoveAddressResponse
2597 {
2598 #[inline(always)]
2599 fn new_empty() -> Self {
2600 Self { did_remove: fidl::new_empty!(bool, D) }
2601 }
2602
2603 #[inline]
2604 unsafe fn decode(
2605 &mut self,
2606 decoder: &mut fidl::encoding::Decoder<'_, D>,
2607 offset: usize,
2608 _depth: fidl::encoding::Depth,
2609 ) -> fidl::Result<()> {
2610 decoder.debug_check_bounds::<Self>(offset);
2611 fidl::decode!(bool, D, &mut self.did_remove, decoder, offset + 0, _depth)?;
2613 Ok(())
2614 }
2615 }
2616
2617 impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationResponse {
2618 type Borrowed<'a> = &'a Self;
2619 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2620 value
2621 }
2622 }
2623
2624 unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationResponse {
2625 type Owned = Self;
2626
2627 #[inline(always)]
2628 fn inline_align(_context: fidl::encoding::Context) -> usize {
2629 8
2630 }
2631
2632 #[inline(always)]
2633 fn inline_size(_context: fidl::encoding::Context) -> usize {
2634 16
2635 }
2636 }
2637
2638 unsafe impl<D: fidl::encoding::ResourceDialect>
2639 fidl::encoding::Encode<ControlSetConfigurationResponse, D>
2640 for &ControlSetConfigurationResponse
2641 {
2642 #[inline]
2643 unsafe fn encode(
2644 self,
2645 encoder: &mut fidl::encoding::Encoder<'_, D>,
2646 offset: usize,
2647 _depth: fidl::encoding::Depth,
2648 ) -> fidl::Result<()> {
2649 encoder.debug_check_bounds::<ControlSetConfigurationResponse>(offset);
2650 fidl::encoding::Encode::<ControlSetConfigurationResponse, D>::encode(
2652 (<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.previous_config),),
2653 encoder,
2654 offset,
2655 _depth,
2656 )
2657 }
2658 }
2659 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
2660 fidl::encoding::Encode<ControlSetConfigurationResponse, D> for (T0,)
2661 {
2662 #[inline]
2663 unsafe fn encode(
2664 self,
2665 encoder: &mut fidl::encoding::Encoder<'_, D>,
2666 offset: usize,
2667 depth: fidl::encoding::Depth,
2668 ) -> fidl::Result<()> {
2669 encoder.debug_check_bounds::<ControlSetConfigurationResponse>(offset);
2670 self.0.encode(encoder, offset + 0, depth)?;
2674 Ok(())
2675 }
2676 }
2677
2678 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2679 for ControlSetConfigurationResponse
2680 {
2681 #[inline(always)]
2682 fn new_empty() -> Self {
2683 Self { previous_config: fidl::new_empty!(Configuration, D) }
2684 }
2685
2686 #[inline]
2687 unsafe fn decode(
2688 &mut self,
2689 decoder: &mut fidl::encoding::Decoder<'_, D>,
2690 offset: usize,
2691 _depth: fidl::encoding::Depth,
2692 ) -> fidl::Result<()> {
2693 decoder.debug_check_bounds::<Self>(offset);
2694 fidl::decode!(
2696 Configuration,
2697 D,
2698 &mut self.previous_config,
2699 decoder,
2700 offset + 0,
2701 _depth
2702 )?;
2703 Ok(())
2704 }
2705 }
2706
2707 impl fidl::encoding::ValueTypeMarker for Empty {
2708 type Borrowed<'a> = &'a Self;
2709 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2710 value
2711 }
2712 }
2713
2714 unsafe impl fidl::encoding::TypeMarker for Empty {
2715 type Owned = Self;
2716
2717 #[inline(always)]
2718 fn inline_align(_context: fidl::encoding::Context) -> usize {
2719 1
2720 }
2721
2722 #[inline(always)]
2723 fn inline_size(_context: fidl::encoding::Context) -> usize {
2724 1
2725 }
2726 }
2727
2728 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
2729 #[inline]
2730 unsafe fn encode(
2731 self,
2732 encoder: &mut fidl::encoding::Encoder<'_, D>,
2733 offset: usize,
2734 _depth: fidl::encoding::Depth,
2735 ) -> fidl::Result<()> {
2736 encoder.debug_check_bounds::<Empty>(offset);
2737 encoder.write_num(0u8, offset);
2738 Ok(())
2739 }
2740 }
2741
2742 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
2743 #[inline(always)]
2744 fn new_empty() -> Self {
2745 Self
2746 }
2747
2748 #[inline]
2749 unsafe fn decode(
2750 &mut self,
2751 decoder: &mut fidl::encoding::Decoder<'_, D>,
2752 offset: usize,
2753 _depth: fidl::encoding::Depth,
2754 ) -> fidl::Result<()> {
2755 decoder.debug_check_bounds::<Self>(offset);
2756 match decoder.read_num::<u8>(offset) {
2757 0 => Ok(()),
2758 _ => Err(fidl::Error::Invalid),
2759 }
2760 }
2761 }
2762
2763 impl AddressParameters {
2764 #[inline(always)]
2765 fn max_ordinal_present(&self) -> u64 {
2766 if let Some(_) = self.add_subnet_route {
2767 return 3;
2768 }
2769 if let Some(_) = self.temporary {
2770 return 2;
2771 }
2772 if let Some(_) = self.initial_properties {
2773 return 1;
2774 }
2775 0
2776 }
2777 }
2778
2779 impl fidl::encoding::ValueTypeMarker for AddressParameters {
2780 type Borrowed<'a> = &'a Self;
2781 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2782 value
2783 }
2784 }
2785
2786 unsafe impl fidl::encoding::TypeMarker for AddressParameters {
2787 type Owned = Self;
2788
2789 #[inline(always)]
2790 fn inline_align(_context: fidl::encoding::Context) -> usize {
2791 8
2792 }
2793
2794 #[inline(always)]
2795 fn inline_size(_context: fidl::encoding::Context) -> usize {
2796 16
2797 }
2798 }
2799
2800 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressParameters, D>
2801 for &AddressParameters
2802 {
2803 unsafe fn encode(
2804 self,
2805 encoder: &mut fidl::encoding::Encoder<'_, D>,
2806 offset: usize,
2807 mut depth: fidl::encoding::Depth,
2808 ) -> fidl::Result<()> {
2809 encoder.debug_check_bounds::<AddressParameters>(offset);
2810 let max_ordinal: u64 = self.max_ordinal_present();
2812 encoder.write_num(max_ordinal, offset);
2813 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2814 if max_ordinal == 0 {
2816 return Ok(());
2817 }
2818 depth.increment()?;
2819 let envelope_size = 8;
2820 let bytes_len = max_ordinal as usize * envelope_size;
2821 #[allow(unused_variables)]
2822 let offset = encoder.out_of_line_offset(bytes_len);
2823 let mut _prev_end_offset: usize = 0;
2824 if 1 > max_ordinal {
2825 return Ok(());
2826 }
2827
2828 let cur_offset: usize = (1 - 1) * envelope_size;
2831
2832 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2834
2835 fidl::encoding::encode_in_envelope_optional::<AddressProperties, D>(
2840 self.initial_properties
2841 .as_ref()
2842 .map(<AddressProperties as fidl::encoding::ValueTypeMarker>::borrow),
2843 encoder,
2844 offset + cur_offset,
2845 depth,
2846 )?;
2847
2848 _prev_end_offset = cur_offset + envelope_size;
2849 if 2 > max_ordinal {
2850 return Ok(());
2851 }
2852
2853 let cur_offset: usize = (2 - 1) * envelope_size;
2856
2857 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2859
2860 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2865 self.temporary.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2866 encoder,
2867 offset + cur_offset,
2868 depth,
2869 )?;
2870
2871 _prev_end_offset = cur_offset + envelope_size;
2872 if 3 > max_ordinal {
2873 return Ok(());
2874 }
2875
2876 let cur_offset: usize = (3 - 1) * envelope_size;
2879
2880 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2882
2883 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2888 self.add_subnet_route
2889 .as_ref()
2890 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2891 encoder,
2892 offset + cur_offset,
2893 depth,
2894 )?;
2895
2896 _prev_end_offset = cur_offset + envelope_size;
2897
2898 Ok(())
2899 }
2900 }
2901
2902 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressParameters {
2903 #[inline(always)]
2904 fn new_empty() -> Self {
2905 Self::default()
2906 }
2907
2908 unsafe fn decode(
2909 &mut self,
2910 decoder: &mut fidl::encoding::Decoder<'_, D>,
2911 offset: usize,
2912 mut depth: fidl::encoding::Depth,
2913 ) -> fidl::Result<()> {
2914 decoder.debug_check_bounds::<Self>(offset);
2915 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2916 None => return Err(fidl::Error::NotNullable),
2917 Some(len) => len,
2918 };
2919 if len == 0 {
2921 return Ok(());
2922 };
2923 depth.increment()?;
2924 let envelope_size = 8;
2925 let bytes_len = len * envelope_size;
2926 let offset = decoder.out_of_line_offset(bytes_len)?;
2927 let mut _next_ordinal_to_read = 0;
2929 let mut next_offset = offset;
2930 let end_offset = offset + bytes_len;
2931 _next_ordinal_to_read += 1;
2932 if next_offset >= end_offset {
2933 return Ok(());
2934 }
2935
2936 while _next_ordinal_to_read < 1 {
2938 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2939 _next_ordinal_to_read += 1;
2940 next_offset += envelope_size;
2941 }
2942
2943 let next_out_of_line = decoder.next_out_of_line();
2944 let handles_before = decoder.remaining_handles();
2945 if let Some((inlined, num_bytes, num_handles)) =
2946 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2947 {
2948 let member_inline_size =
2949 <AddressProperties as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2950 if inlined != (member_inline_size <= 4) {
2951 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2952 }
2953 let inner_offset;
2954 let mut inner_depth = depth.clone();
2955 if inlined {
2956 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2957 inner_offset = next_offset;
2958 } else {
2959 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2960 inner_depth.increment()?;
2961 }
2962 let val_ref = self
2963 .initial_properties
2964 .get_or_insert_with(|| fidl::new_empty!(AddressProperties, D));
2965 fidl::decode!(AddressProperties, D, val_ref, decoder, inner_offset, inner_depth)?;
2966 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2967 {
2968 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2969 }
2970 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2971 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2972 }
2973 }
2974
2975 next_offset += envelope_size;
2976 _next_ordinal_to_read += 1;
2977 if next_offset >= end_offset {
2978 return Ok(());
2979 }
2980
2981 while _next_ordinal_to_read < 2 {
2983 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2984 _next_ordinal_to_read += 1;
2985 next_offset += envelope_size;
2986 }
2987
2988 let next_out_of_line = decoder.next_out_of_line();
2989 let handles_before = decoder.remaining_handles();
2990 if let Some((inlined, num_bytes, num_handles)) =
2991 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2992 {
2993 let member_inline_size =
2994 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2995 if inlined != (member_inline_size <= 4) {
2996 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2997 }
2998 let inner_offset;
2999 let mut inner_depth = depth.clone();
3000 if inlined {
3001 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3002 inner_offset = next_offset;
3003 } else {
3004 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3005 inner_depth.increment()?;
3006 }
3007 let val_ref = self.temporary.get_or_insert_with(|| fidl::new_empty!(bool, D));
3008 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3009 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3010 {
3011 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3012 }
3013 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3014 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3015 }
3016 }
3017
3018 next_offset += envelope_size;
3019 _next_ordinal_to_read += 1;
3020 if next_offset >= end_offset {
3021 return Ok(());
3022 }
3023
3024 while _next_ordinal_to_read < 3 {
3026 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3027 _next_ordinal_to_read += 1;
3028 next_offset += envelope_size;
3029 }
3030
3031 let next_out_of_line = decoder.next_out_of_line();
3032 let handles_before = decoder.remaining_handles();
3033 if let Some((inlined, num_bytes, num_handles)) =
3034 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3035 {
3036 let member_inline_size =
3037 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3038 if inlined != (member_inline_size <= 4) {
3039 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3040 }
3041 let inner_offset;
3042 let mut inner_depth = depth.clone();
3043 if inlined {
3044 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3045 inner_offset = next_offset;
3046 } else {
3047 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3048 inner_depth.increment()?;
3049 }
3050 let val_ref =
3051 self.add_subnet_route.get_or_insert_with(|| fidl::new_empty!(bool, D));
3052 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3053 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3054 {
3055 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3056 }
3057 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3058 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3059 }
3060 }
3061
3062 next_offset += envelope_size;
3063
3064 while next_offset < end_offset {
3066 _next_ordinal_to_read += 1;
3067 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3068 next_offset += envelope_size;
3069 }
3070
3071 Ok(())
3072 }
3073 }
3074
3075 impl AddressProperties {
3076 #[inline(always)]
3077 fn max_ordinal_present(&self) -> u64 {
3078 if let Some(_) = self.valid_lifetime_end {
3079 return 2;
3080 }
3081 if let Some(_) = self.preferred_lifetime_info {
3082 return 1;
3083 }
3084 0
3085 }
3086 }
3087
3088 impl fidl::encoding::ValueTypeMarker for AddressProperties {
3089 type Borrowed<'a> = &'a Self;
3090 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3091 value
3092 }
3093 }
3094
3095 unsafe impl fidl::encoding::TypeMarker for AddressProperties {
3096 type Owned = Self;
3097
3098 #[inline(always)]
3099 fn inline_align(_context: fidl::encoding::Context) -> usize {
3100 8
3101 }
3102
3103 #[inline(always)]
3104 fn inline_size(_context: fidl::encoding::Context) -> usize {
3105 16
3106 }
3107 }
3108
3109 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressProperties, D>
3110 for &AddressProperties
3111 {
3112 unsafe fn encode(
3113 self,
3114 encoder: &mut fidl::encoding::Encoder<'_, D>,
3115 offset: usize,
3116 mut depth: fidl::encoding::Depth,
3117 ) -> fidl::Result<()> {
3118 encoder.debug_check_bounds::<AddressProperties>(offset);
3119 let max_ordinal: u64 = self.max_ordinal_present();
3121 encoder.write_num(max_ordinal, offset);
3122 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3123 if max_ordinal == 0 {
3125 return Ok(());
3126 }
3127 depth.increment()?;
3128 let envelope_size = 8;
3129 let bytes_len = max_ordinal as usize * envelope_size;
3130 #[allow(unused_variables)]
3131 let offset = encoder.out_of_line_offset(bytes_len);
3132 let mut _prev_end_offset: usize = 0;
3133 if 1 > max_ordinal {
3134 return Ok(());
3135 }
3136
3137 let cur_offset: usize = (1 - 1) * envelope_size;
3140
3141 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3143
3144 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo, D>(
3149 self.preferred_lifetime_info.as_ref().map(<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo as fidl::encoding::ValueTypeMarker>::borrow),
3150 encoder, offset + cur_offset, depth
3151 )?;
3152
3153 _prev_end_offset = cur_offset + envelope_size;
3154 if 2 > max_ordinal {
3155 return Ok(());
3156 }
3157
3158 let cur_offset: usize = (2 - 1) * envelope_size;
3161
3162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3164
3165 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3170 self.valid_lifetime_end
3171 .as_ref()
3172 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3173 encoder,
3174 offset + cur_offset,
3175 depth,
3176 )?;
3177
3178 _prev_end_offset = cur_offset + envelope_size;
3179
3180 Ok(())
3181 }
3182 }
3183
3184 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressProperties {
3185 #[inline(always)]
3186 fn new_empty() -> Self {
3187 Self::default()
3188 }
3189
3190 unsafe fn decode(
3191 &mut self,
3192 decoder: &mut fidl::encoding::Decoder<'_, D>,
3193 offset: usize,
3194 mut depth: fidl::encoding::Depth,
3195 ) -> fidl::Result<()> {
3196 decoder.debug_check_bounds::<Self>(offset);
3197 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3198 None => return Err(fidl::Error::NotNullable),
3199 Some(len) => len,
3200 };
3201 if len == 0 {
3203 return Ok(());
3204 };
3205 depth.increment()?;
3206 let envelope_size = 8;
3207 let bytes_len = len * envelope_size;
3208 let offset = decoder.out_of_line_offset(bytes_len)?;
3209 let mut _next_ordinal_to_read = 0;
3211 let mut next_offset = offset;
3212 let end_offset = offset + bytes_len;
3213 _next_ordinal_to_read += 1;
3214 if next_offset >= end_offset {
3215 return Ok(());
3216 }
3217
3218 while _next_ordinal_to_read < 1 {
3220 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3221 _next_ordinal_to_read += 1;
3222 next_offset += envelope_size;
3223 }
3224
3225 let next_out_of_line = decoder.next_out_of_line();
3226 let handles_before = decoder.remaining_handles();
3227 if let Some((inlined, num_bytes, num_handles)) =
3228 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3229 {
3230 let member_inline_size = <fidl_fuchsia_net_interfaces::PreferredLifetimeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3231 if inlined != (member_inline_size <= 4) {
3232 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3233 }
3234 let inner_offset;
3235 let mut inner_depth = depth.clone();
3236 if inlined {
3237 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3238 inner_offset = next_offset;
3239 } else {
3240 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3241 inner_depth.increment()?;
3242 }
3243 let val_ref = self.preferred_lifetime_info.get_or_insert_with(|| {
3244 fidl::new_empty!(fidl_fuchsia_net_interfaces::PreferredLifetimeInfo, D)
3245 });
3246 fidl::decode!(
3247 fidl_fuchsia_net_interfaces::PreferredLifetimeInfo,
3248 D,
3249 val_ref,
3250 decoder,
3251 inner_offset,
3252 inner_depth
3253 )?;
3254 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3255 {
3256 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3257 }
3258 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3259 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3260 }
3261 }
3262
3263 next_offset += envelope_size;
3264 _next_ordinal_to_read += 1;
3265 if next_offset >= end_offset {
3266 return Ok(());
3267 }
3268
3269 while _next_ordinal_to_read < 2 {
3271 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3272 _next_ordinal_to_read += 1;
3273 next_offset += envelope_size;
3274 }
3275
3276 let next_out_of_line = decoder.next_out_of_line();
3277 let handles_before = decoder.remaining_handles();
3278 if let Some((inlined, num_bytes, num_handles)) =
3279 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3280 {
3281 let member_inline_size =
3282 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3283 if inlined != (member_inline_size <= 4) {
3284 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3285 }
3286 let inner_offset;
3287 let mut inner_depth = depth.clone();
3288 if inlined {
3289 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3290 inner_offset = next_offset;
3291 } else {
3292 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3293 inner_depth.increment()?;
3294 }
3295 let val_ref =
3296 self.valid_lifetime_end.get_or_insert_with(|| fidl::new_empty!(i64, D));
3297 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3298 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3299 {
3300 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3301 }
3302 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3303 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3304 }
3305 }
3306
3307 next_offset += envelope_size;
3308
3309 while next_offset < end_offset {
3311 _next_ordinal_to_read += 1;
3312 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3313 next_offset += envelope_size;
3314 }
3315
3316 Ok(())
3317 }
3318 }
3319
3320 impl ArpConfiguration {
3321 #[inline(always)]
3322 fn max_ordinal_present(&self) -> u64 {
3323 if let Some(_) = self.nud {
3324 return 1;
3325 }
3326 0
3327 }
3328 }
3329
3330 impl fidl::encoding::ValueTypeMarker for ArpConfiguration {
3331 type Borrowed<'a> = &'a Self;
3332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3333 value
3334 }
3335 }
3336
3337 unsafe impl fidl::encoding::TypeMarker for ArpConfiguration {
3338 type Owned = Self;
3339
3340 #[inline(always)]
3341 fn inline_align(_context: fidl::encoding::Context) -> usize {
3342 8
3343 }
3344
3345 #[inline(always)]
3346 fn inline_size(_context: fidl::encoding::Context) -> usize {
3347 16
3348 }
3349 }
3350
3351 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArpConfiguration, D>
3352 for &ArpConfiguration
3353 {
3354 unsafe fn encode(
3355 self,
3356 encoder: &mut fidl::encoding::Encoder<'_, D>,
3357 offset: usize,
3358 mut depth: fidl::encoding::Depth,
3359 ) -> fidl::Result<()> {
3360 encoder.debug_check_bounds::<ArpConfiguration>(offset);
3361 let max_ordinal: u64 = self.max_ordinal_present();
3363 encoder.write_num(max_ordinal, offset);
3364 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3365 if max_ordinal == 0 {
3367 return Ok(());
3368 }
3369 depth.increment()?;
3370 let envelope_size = 8;
3371 let bytes_len = max_ordinal as usize * envelope_size;
3372 #[allow(unused_variables)]
3373 let offset = encoder.out_of_line_offset(bytes_len);
3374 let mut _prev_end_offset: usize = 0;
3375 if 1 > max_ordinal {
3376 return Ok(());
3377 }
3378
3379 let cur_offset: usize = (1 - 1) * envelope_size;
3382
3383 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3385
3386 fidl::encoding::encode_in_envelope_optional::<NudConfiguration, D>(
3391 self.nud
3392 .as_ref()
3393 .map(<NudConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
3394 encoder,
3395 offset + cur_offset,
3396 depth,
3397 )?;
3398
3399 _prev_end_offset = cur_offset + envelope_size;
3400
3401 Ok(())
3402 }
3403 }
3404
3405 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArpConfiguration {
3406 #[inline(always)]
3407 fn new_empty() -> Self {
3408 Self::default()
3409 }
3410
3411 unsafe fn decode(
3412 &mut self,
3413 decoder: &mut fidl::encoding::Decoder<'_, D>,
3414 offset: usize,
3415 mut depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 decoder.debug_check_bounds::<Self>(offset);
3418 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3419 None => return Err(fidl::Error::NotNullable),
3420 Some(len) => len,
3421 };
3422 if len == 0 {
3424 return Ok(());
3425 };
3426 depth.increment()?;
3427 let envelope_size = 8;
3428 let bytes_len = len * envelope_size;
3429 let offset = decoder.out_of_line_offset(bytes_len)?;
3430 let mut _next_ordinal_to_read = 0;
3432 let mut next_offset = offset;
3433 let end_offset = offset + bytes_len;
3434 _next_ordinal_to_read += 1;
3435 if next_offset >= end_offset {
3436 return Ok(());
3437 }
3438
3439 while _next_ordinal_to_read < 1 {
3441 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3442 _next_ordinal_to_read += 1;
3443 next_offset += envelope_size;
3444 }
3445
3446 let next_out_of_line = decoder.next_out_of_line();
3447 let handles_before = decoder.remaining_handles();
3448 if let Some((inlined, num_bytes, num_handles)) =
3449 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3450 {
3451 let member_inline_size =
3452 <NudConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3453 if inlined != (member_inline_size <= 4) {
3454 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3455 }
3456 let inner_offset;
3457 let mut inner_depth = depth.clone();
3458 if inlined {
3459 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3460 inner_offset = next_offset;
3461 } else {
3462 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3463 inner_depth.increment()?;
3464 }
3465 let val_ref = self.nud.get_or_insert_with(|| fidl::new_empty!(NudConfiguration, D));
3466 fidl::decode!(NudConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
3467 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3468 {
3469 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3470 }
3471 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3472 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3473 }
3474 }
3475
3476 next_offset += envelope_size;
3477
3478 while next_offset < end_offset {
3480 _next_ordinal_to_read += 1;
3481 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3482 next_offset += envelope_size;
3483 }
3484
3485 Ok(())
3486 }
3487 }
3488
3489 impl Configuration {
3490 #[inline(always)]
3491 fn max_ordinal_present(&self) -> u64 {
3492 if let Some(_) = self.ipv6 {
3493 return 2;
3494 }
3495 if let Some(_) = self.ipv4 {
3496 return 1;
3497 }
3498 0
3499 }
3500 }
3501
3502 impl fidl::encoding::ValueTypeMarker for Configuration {
3503 type Borrowed<'a> = &'a Self;
3504 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3505 value
3506 }
3507 }
3508
3509 unsafe impl fidl::encoding::TypeMarker for Configuration {
3510 type Owned = Self;
3511
3512 #[inline(always)]
3513 fn inline_align(_context: fidl::encoding::Context) -> usize {
3514 8
3515 }
3516
3517 #[inline(always)]
3518 fn inline_size(_context: fidl::encoding::Context) -> usize {
3519 16
3520 }
3521 }
3522
3523 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Configuration, D>
3524 for &Configuration
3525 {
3526 unsafe fn encode(
3527 self,
3528 encoder: &mut fidl::encoding::Encoder<'_, D>,
3529 offset: usize,
3530 mut depth: fidl::encoding::Depth,
3531 ) -> fidl::Result<()> {
3532 encoder.debug_check_bounds::<Configuration>(offset);
3533 let max_ordinal: u64 = self.max_ordinal_present();
3535 encoder.write_num(max_ordinal, offset);
3536 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3537 if max_ordinal == 0 {
3539 return Ok(());
3540 }
3541 depth.increment()?;
3542 let envelope_size = 8;
3543 let bytes_len = max_ordinal as usize * envelope_size;
3544 #[allow(unused_variables)]
3545 let offset = encoder.out_of_line_offset(bytes_len);
3546 let mut _prev_end_offset: usize = 0;
3547 if 1 > max_ordinal {
3548 return Ok(());
3549 }
3550
3551 let cur_offset: usize = (1 - 1) * envelope_size;
3554
3555 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3557
3558 fidl::encoding::encode_in_envelope_optional::<Ipv4Configuration, D>(
3563 self.ipv4
3564 .as_ref()
3565 .map(<Ipv4Configuration as fidl::encoding::ValueTypeMarker>::borrow),
3566 encoder,
3567 offset + cur_offset,
3568 depth,
3569 )?;
3570
3571 _prev_end_offset = cur_offset + envelope_size;
3572 if 2 > max_ordinal {
3573 return Ok(());
3574 }
3575
3576 let cur_offset: usize = (2 - 1) * envelope_size;
3579
3580 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3582
3583 fidl::encoding::encode_in_envelope_optional::<Ipv6Configuration, D>(
3588 self.ipv6
3589 .as_ref()
3590 .map(<Ipv6Configuration as fidl::encoding::ValueTypeMarker>::borrow),
3591 encoder,
3592 offset + cur_offset,
3593 depth,
3594 )?;
3595
3596 _prev_end_offset = cur_offset + envelope_size;
3597
3598 Ok(())
3599 }
3600 }
3601
3602 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
3603 #[inline(always)]
3604 fn new_empty() -> Self {
3605 Self::default()
3606 }
3607
3608 unsafe fn decode(
3609 &mut self,
3610 decoder: &mut fidl::encoding::Decoder<'_, D>,
3611 offset: usize,
3612 mut depth: fidl::encoding::Depth,
3613 ) -> fidl::Result<()> {
3614 decoder.debug_check_bounds::<Self>(offset);
3615 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3616 None => return Err(fidl::Error::NotNullable),
3617 Some(len) => len,
3618 };
3619 if len == 0 {
3621 return Ok(());
3622 };
3623 depth.increment()?;
3624 let envelope_size = 8;
3625 let bytes_len = len * envelope_size;
3626 let offset = decoder.out_of_line_offset(bytes_len)?;
3627 let mut _next_ordinal_to_read = 0;
3629 let mut next_offset = offset;
3630 let end_offset = offset + bytes_len;
3631 _next_ordinal_to_read += 1;
3632 if next_offset >= end_offset {
3633 return Ok(());
3634 }
3635
3636 while _next_ordinal_to_read < 1 {
3638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3639 _next_ordinal_to_read += 1;
3640 next_offset += envelope_size;
3641 }
3642
3643 let next_out_of_line = decoder.next_out_of_line();
3644 let handles_before = decoder.remaining_handles();
3645 if let Some((inlined, num_bytes, num_handles)) =
3646 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3647 {
3648 let member_inline_size =
3649 <Ipv4Configuration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3650 if inlined != (member_inline_size <= 4) {
3651 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3652 }
3653 let inner_offset;
3654 let mut inner_depth = depth.clone();
3655 if inlined {
3656 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3657 inner_offset = next_offset;
3658 } else {
3659 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3660 inner_depth.increment()?;
3661 }
3662 let val_ref =
3663 self.ipv4.get_or_insert_with(|| fidl::new_empty!(Ipv4Configuration, D));
3664 fidl::decode!(Ipv4Configuration, D, val_ref, decoder, inner_offset, inner_depth)?;
3665 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3666 {
3667 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3668 }
3669 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3670 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3671 }
3672 }
3673
3674 next_offset += envelope_size;
3675 _next_ordinal_to_read += 1;
3676 if next_offset >= end_offset {
3677 return Ok(());
3678 }
3679
3680 while _next_ordinal_to_read < 2 {
3682 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3683 _next_ordinal_to_read += 1;
3684 next_offset += envelope_size;
3685 }
3686
3687 let next_out_of_line = decoder.next_out_of_line();
3688 let handles_before = decoder.remaining_handles();
3689 if let Some((inlined, num_bytes, num_handles)) =
3690 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3691 {
3692 let member_inline_size =
3693 <Ipv6Configuration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3694 if inlined != (member_inline_size <= 4) {
3695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3696 }
3697 let inner_offset;
3698 let mut inner_depth = depth.clone();
3699 if inlined {
3700 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3701 inner_offset = next_offset;
3702 } else {
3703 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3704 inner_depth.increment()?;
3705 }
3706 let val_ref =
3707 self.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6Configuration, D));
3708 fidl::decode!(Ipv6Configuration, D, val_ref, decoder, inner_offset, inner_depth)?;
3709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3710 {
3711 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3712 }
3713 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3714 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3715 }
3716 }
3717
3718 next_offset += envelope_size;
3719
3720 while next_offset < end_offset {
3722 _next_ordinal_to_read += 1;
3723 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3724 next_offset += envelope_size;
3725 }
3726
3727 Ok(())
3728 }
3729 }
3730
3731 impl DadConfiguration {
3732 #[inline(always)]
3733 fn max_ordinal_present(&self) -> u64 {
3734 if let Some(_) = self.transmits {
3735 return 1;
3736 }
3737 0
3738 }
3739 }
3740
3741 impl fidl::encoding::ValueTypeMarker for DadConfiguration {
3742 type Borrowed<'a> = &'a Self;
3743 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3744 value
3745 }
3746 }
3747
3748 unsafe impl fidl::encoding::TypeMarker for DadConfiguration {
3749 type Owned = Self;
3750
3751 #[inline(always)]
3752 fn inline_align(_context: fidl::encoding::Context) -> usize {
3753 8
3754 }
3755
3756 #[inline(always)]
3757 fn inline_size(_context: fidl::encoding::Context) -> usize {
3758 16
3759 }
3760 }
3761
3762 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DadConfiguration, D>
3763 for &DadConfiguration
3764 {
3765 unsafe fn encode(
3766 self,
3767 encoder: &mut fidl::encoding::Encoder<'_, D>,
3768 offset: usize,
3769 mut depth: fidl::encoding::Depth,
3770 ) -> fidl::Result<()> {
3771 encoder.debug_check_bounds::<DadConfiguration>(offset);
3772 let max_ordinal: u64 = self.max_ordinal_present();
3774 encoder.write_num(max_ordinal, offset);
3775 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3776 if max_ordinal == 0 {
3778 return Ok(());
3779 }
3780 depth.increment()?;
3781 let envelope_size = 8;
3782 let bytes_len = max_ordinal as usize * envelope_size;
3783 #[allow(unused_variables)]
3784 let offset = encoder.out_of_line_offset(bytes_len);
3785 let mut _prev_end_offset: usize = 0;
3786 if 1 > max_ordinal {
3787 return Ok(());
3788 }
3789
3790 let cur_offset: usize = (1 - 1) * envelope_size;
3793
3794 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3796
3797 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3802 self.transmits.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3803 encoder,
3804 offset + cur_offset,
3805 depth,
3806 )?;
3807
3808 _prev_end_offset = cur_offset + envelope_size;
3809
3810 Ok(())
3811 }
3812 }
3813
3814 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DadConfiguration {
3815 #[inline(always)]
3816 fn new_empty() -> Self {
3817 Self::default()
3818 }
3819
3820 unsafe fn decode(
3821 &mut self,
3822 decoder: &mut fidl::encoding::Decoder<'_, D>,
3823 offset: usize,
3824 mut depth: fidl::encoding::Depth,
3825 ) -> fidl::Result<()> {
3826 decoder.debug_check_bounds::<Self>(offset);
3827 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3828 None => return Err(fidl::Error::NotNullable),
3829 Some(len) => len,
3830 };
3831 if len == 0 {
3833 return Ok(());
3834 };
3835 depth.increment()?;
3836 let envelope_size = 8;
3837 let bytes_len = len * envelope_size;
3838 let offset = decoder.out_of_line_offset(bytes_len)?;
3839 let mut _next_ordinal_to_read = 0;
3841 let mut next_offset = offset;
3842 let end_offset = offset + bytes_len;
3843 _next_ordinal_to_read += 1;
3844 if next_offset >= end_offset {
3845 return Ok(());
3846 }
3847
3848 while _next_ordinal_to_read < 1 {
3850 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3851 _next_ordinal_to_read += 1;
3852 next_offset += envelope_size;
3853 }
3854
3855 let next_out_of_line = decoder.next_out_of_line();
3856 let handles_before = decoder.remaining_handles();
3857 if let Some((inlined, num_bytes, num_handles)) =
3858 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3859 {
3860 let member_inline_size =
3861 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3862 if inlined != (member_inline_size <= 4) {
3863 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3864 }
3865 let inner_offset;
3866 let mut inner_depth = depth.clone();
3867 if inlined {
3868 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3869 inner_offset = next_offset;
3870 } else {
3871 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3872 inner_depth.increment()?;
3873 }
3874 let val_ref = self.transmits.get_or_insert_with(|| fidl::new_empty!(u16, D));
3875 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3876 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3877 {
3878 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3879 }
3880 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3881 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3882 }
3883 }
3884
3885 next_offset += envelope_size;
3886
3887 while next_offset < end_offset {
3889 _next_ordinal_to_read += 1;
3890 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3891 next_offset += envelope_size;
3892 }
3893
3894 Ok(())
3895 }
3896 }
3897
3898 impl IgmpConfiguration {
3899 #[inline(always)]
3900 fn max_ordinal_present(&self) -> u64 {
3901 if let Some(_) = self.version {
3902 return 1;
3903 }
3904 0
3905 }
3906 }
3907
3908 impl fidl::encoding::ValueTypeMarker for IgmpConfiguration {
3909 type Borrowed<'a> = &'a Self;
3910 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3911 value
3912 }
3913 }
3914
3915 unsafe impl fidl::encoding::TypeMarker for IgmpConfiguration {
3916 type Owned = Self;
3917
3918 #[inline(always)]
3919 fn inline_align(_context: fidl::encoding::Context) -> usize {
3920 8
3921 }
3922
3923 #[inline(always)]
3924 fn inline_size(_context: fidl::encoding::Context) -> usize {
3925 16
3926 }
3927 }
3928
3929 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IgmpConfiguration, D>
3930 for &IgmpConfiguration
3931 {
3932 unsafe fn encode(
3933 self,
3934 encoder: &mut fidl::encoding::Encoder<'_, D>,
3935 offset: usize,
3936 mut depth: fidl::encoding::Depth,
3937 ) -> fidl::Result<()> {
3938 encoder.debug_check_bounds::<IgmpConfiguration>(offset);
3939 let max_ordinal: u64 = self.max_ordinal_present();
3941 encoder.write_num(max_ordinal, offset);
3942 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3943 if max_ordinal == 0 {
3945 return Ok(());
3946 }
3947 depth.increment()?;
3948 let envelope_size = 8;
3949 let bytes_len = max_ordinal as usize * envelope_size;
3950 #[allow(unused_variables)]
3951 let offset = encoder.out_of_line_offset(bytes_len);
3952 let mut _prev_end_offset: usize = 0;
3953 if 1 > max_ordinal {
3954 return Ok(());
3955 }
3956
3957 let cur_offset: usize = (1 - 1) * envelope_size;
3960
3961 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3963
3964 fidl::encoding::encode_in_envelope_optional::<IgmpVersion, D>(
3969 self.version.as_ref().map(<IgmpVersion as fidl::encoding::ValueTypeMarker>::borrow),
3970 encoder,
3971 offset + cur_offset,
3972 depth,
3973 )?;
3974
3975 _prev_end_offset = cur_offset + envelope_size;
3976
3977 Ok(())
3978 }
3979 }
3980
3981 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IgmpConfiguration {
3982 #[inline(always)]
3983 fn new_empty() -> Self {
3984 Self::default()
3985 }
3986
3987 unsafe fn decode(
3988 &mut self,
3989 decoder: &mut fidl::encoding::Decoder<'_, D>,
3990 offset: usize,
3991 mut depth: fidl::encoding::Depth,
3992 ) -> fidl::Result<()> {
3993 decoder.debug_check_bounds::<Self>(offset);
3994 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3995 None => return Err(fidl::Error::NotNullable),
3996 Some(len) => len,
3997 };
3998 if len == 0 {
4000 return Ok(());
4001 };
4002 depth.increment()?;
4003 let envelope_size = 8;
4004 let bytes_len = len * envelope_size;
4005 let offset = decoder.out_of_line_offset(bytes_len)?;
4006 let mut _next_ordinal_to_read = 0;
4008 let mut next_offset = offset;
4009 let end_offset = offset + bytes_len;
4010 _next_ordinal_to_read += 1;
4011 if next_offset >= end_offset {
4012 return Ok(());
4013 }
4014
4015 while _next_ordinal_to_read < 1 {
4017 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4018 _next_ordinal_to_read += 1;
4019 next_offset += envelope_size;
4020 }
4021
4022 let next_out_of_line = decoder.next_out_of_line();
4023 let handles_before = decoder.remaining_handles();
4024 if let Some((inlined, num_bytes, num_handles)) =
4025 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4026 {
4027 let member_inline_size =
4028 <IgmpVersion as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4029 if inlined != (member_inline_size <= 4) {
4030 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4031 }
4032 let inner_offset;
4033 let mut inner_depth = depth.clone();
4034 if inlined {
4035 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4036 inner_offset = next_offset;
4037 } else {
4038 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4039 inner_depth.increment()?;
4040 }
4041 let val_ref = self.version.get_or_insert_with(|| fidl::new_empty!(IgmpVersion, D));
4042 fidl::decode!(IgmpVersion, D, val_ref, decoder, inner_offset, inner_depth)?;
4043 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4044 {
4045 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4046 }
4047 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4048 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4049 }
4050 }
4051
4052 next_offset += envelope_size;
4053
4054 while next_offset < end_offset {
4056 _next_ordinal_to_read += 1;
4057 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4058 next_offset += envelope_size;
4059 }
4060
4061 Ok(())
4062 }
4063 }
4064
4065 impl Ipv4Configuration {
4066 #[inline(always)]
4067 fn max_ordinal_present(&self) -> u64 {
4068 if let Some(_) = self.arp {
4069 return 4;
4070 }
4071 if let Some(_) = self.igmp {
4072 return 3;
4073 }
4074 if let Some(_) = self.multicast_forwarding {
4075 return 2;
4076 }
4077 if let Some(_) = self.unicast_forwarding {
4078 return 1;
4079 }
4080 0
4081 }
4082 }
4083
4084 impl fidl::encoding::ValueTypeMarker for Ipv4Configuration {
4085 type Borrowed<'a> = &'a Self;
4086 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4087 value
4088 }
4089 }
4090
4091 unsafe impl fidl::encoding::TypeMarker for Ipv4Configuration {
4092 type Owned = Self;
4093
4094 #[inline(always)]
4095 fn inline_align(_context: fidl::encoding::Context) -> usize {
4096 8
4097 }
4098
4099 #[inline(always)]
4100 fn inline_size(_context: fidl::encoding::Context) -> usize {
4101 16
4102 }
4103 }
4104
4105 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv4Configuration, D>
4106 for &Ipv4Configuration
4107 {
4108 unsafe fn encode(
4109 self,
4110 encoder: &mut fidl::encoding::Encoder<'_, D>,
4111 offset: usize,
4112 mut depth: fidl::encoding::Depth,
4113 ) -> fidl::Result<()> {
4114 encoder.debug_check_bounds::<Ipv4Configuration>(offset);
4115 let max_ordinal: u64 = self.max_ordinal_present();
4117 encoder.write_num(max_ordinal, offset);
4118 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4119 if max_ordinal == 0 {
4121 return Ok(());
4122 }
4123 depth.increment()?;
4124 let envelope_size = 8;
4125 let bytes_len = max_ordinal as usize * envelope_size;
4126 #[allow(unused_variables)]
4127 let offset = encoder.out_of_line_offset(bytes_len);
4128 let mut _prev_end_offset: usize = 0;
4129 if 1 > max_ordinal {
4130 return Ok(());
4131 }
4132
4133 let cur_offset: usize = (1 - 1) * envelope_size;
4136
4137 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4139
4140 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4145 self.unicast_forwarding
4146 .as_ref()
4147 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4148 encoder,
4149 offset + cur_offset,
4150 depth,
4151 )?;
4152
4153 _prev_end_offset = cur_offset + envelope_size;
4154 if 2 > max_ordinal {
4155 return Ok(());
4156 }
4157
4158 let cur_offset: usize = (2 - 1) * envelope_size;
4161
4162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4164
4165 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4170 self.multicast_forwarding
4171 .as_ref()
4172 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4173 encoder,
4174 offset + cur_offset,
4175 depth,
4176 )?;
4177
4178 _prev_end_offset = cur_offset + envelope_size;
4179 if 3 > max_ordinal {
4180 return Ok(());
4181 }
4182
4183 let cur_offset: usize = (3 - 1) * envelope_size;
4186
4187 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4189
4190 fidl::encoding::encode_in_envelope_optional::<IgmpConfiguration, D>(
4195 self.igmp
4196 .as_ref()
4197 .map(<IgmpConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
4198 encoder,
4199 offset + cur_offset,
4200 depth,
4201 )?;
4202
4203 _prev_end_offset = cur_offset + envelope_size;
4204 if 4 > max_ordinal {
4205 return Ok(());
4206 }
4207
4208 let cur_offset: usize = (4 - 1) * envelope_size;
4211
4212 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4214
4215 fidl::encoding::encode_in_envelope_optional::<ArpConfiguration, D>(
4220 self.arp
4221 .as_ref()
4222 .map(<ArpConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
4223 encoder,
4224 offset + cur_offset,
4225 depth,
4226 )?;
4227
4228 _prev_end_offset = cur_offset + envelope_size;
4229
4230 Ok(())
4231 }
4232 }
4233
4234 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv4Configuration {
4235 #[inline(always)]
4236 fn new_empty() -> Self {
4237 Self::default()
4238 }
4239
4240 unsafe fn decode(
4241 &mut self,
4242 decoder: &mut fidl::encoding::Decoder<'_, D>,
4243 offset: usize,
4244 mut depth: fidl::encoding::Depth,
4245 ) -> fidl::Result<()> {
4246 decoder.debug_check_bounds::<Self>(offset);
4247 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4248 None => return Err(fidl::Error::NotNullable),
4249 Some(len) => len,
4250 };
4251 if len == 0 {
4253 return Ok(());
4254 };
4255 depth.increment()?;
4256 let envelope_size = 8;
4257 let bytes_len = len * envelope_size;
4258 let offset = decoder.out_of_line_offset(bytes_len)?;
4259 let mut _next_ordinal_to_read = 0;
4261 let mut next_offset = offset;
4262 let end_offset = offset + bytes_len;
4263 _next_ordinal_to_read += 1;
4264 if next_offset >= end_offset {
4265 return Ok(());
4266 }
4267
4268 while _next_ordinal_to_read < 1 {
4270 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4271 _next_ordinal_to_read += 1;
4272 next_offset += envelope_size;
4273 }
4274
4275 let next_out_of_line = decoder.next_out_of_line();
4276 let handles_before = decoder.remaining_handles();
4277 if let Some((inlined, num_bytes, num_handles)) =
4278 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4279 {
4280 let member_inline_size =
4281 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4282 if inlined != (member_inline_size <= 4) {
4283 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4284 }
4285 let inner_offset;
4286 let mut inner_depth = depth.clone();
4287 if inlined {
4288 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4289 inner_offset = next_offset;
4290 } else {
4291 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4292 inner_depth.increment()?;
4293 }
4294 let val_ref =
4295 self.unicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
4296 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4297 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4298 {
4299 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4300 }
4301 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4302 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4303 }
4304 }
4305
4306 next_offset += envelope_size;
4307 _next_ordinal_to_read += 1;
4308 if next_offset >= end_offset {
4309 return Ok(());
4310 }
4311
4312 while _next_ordinal_to_read < 2 {
4314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4315 _next_ordinal_to_read += 1;
4316 next_offset += envelope_size;
4317 }
4318
4319 let next_out_of_line = decoder.next_out_of_line();
4320 let handles_before = decoder.remaining_handles();
4321 if let Some((inlined, num_bytes, num_handles)) =
4322 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4323 {
4324 let member_inline_size =
4325 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4326 if inlined != (member_inline_size <= 4) {
4327 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4328 }
4329 let inner_offset;
4330 let mut inner_depth = depth.clone();
4331 if inlined {
4332 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4333 inner_offset = next_offset;
4334 } else {
4335 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4336 inner_depth.increment()?;
4337 }
4338 let val_ref =
4339 self.multicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
4340 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4342 {
4343 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4344 }
4345 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4346 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4347 }
4348 }
4349
4350 next_offset += envelope_size;
4351 _next_ordinal_to_read += 1;
4352 if next_offset >= end_offset {
4353 return Ok(());
4354 }
4355
4356 while _next_ordinal_to_read < 3 {
4358 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4359 _next_ordinal_to_read += 1;
4360 next_offset += envelope_size;
4361 }
4362
4363 let next_out_of_line = decoder.next_out_of_line();
4364 let handles_before = decoder.remaining_handles();
4365 if let Some((inlined, num_bytes, num_handles)) =
4366 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4367 {
4368 let member_inline_size =
4369 <IgmpConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4370 if inlined != (member_inline_size <= 4) {
4371 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4372 }
4373 let inner_offset;
4374 let mut inner_depth = depth.clone();
4375 if inlined {
4376 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4377 inner_offset = next_offset;
4378 } else {
4379 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4380 inner_depth.increment()?;
4381 }
4382 let val_ref =
4383 self.igmp.get_or_insert_with(|| fidl::new_empty!(IgmpConfiguration, D));
4384 fidl::decode!(IgmpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
4385 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4386 {
4387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4388 }
4389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4391 }
4392 }
4393
4394 next_offset += envelope_size;
4395 _next_ordinal_to_read += 1;
4396 if next_offset >= end_offset {
4397 return Ok(());
4398 }
4399
4400 while _next_ordinal_to_read < 4 {
4402 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4403 _next_ordinal_to_read += 1;
4404 next_offset += envelope_size;
4405 }
4406
4407 let next_out_of_line = decoder.next_out_of_line();
4408 let handles_before = decoder.remaining_handles();
4409 if let Some((inlined, num_bytes, num_handles)) =
4410 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4411 {
4412 let member_inline_size =
4413 <ArpConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4414 if inlined != (member_inline_size <= 4) {
4415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4416 }
4417 let inner_offset;
4418 let mut inner_depth = depth.clone();
4419 if inlined {
4420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4421 inner_offset = next_offset;
4422 } else {
4423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4424 inner_depth.increment()?;
4425 }
4426 let val_ref = self.arp.get_or_insert_with(|| fidl::new_empty!(ArpConfiguration, D));
4427 fidl::decode!(ArpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
4428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4429 {
4430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4431 }
4432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4434 }
4435 }
4436
4437 next_offset += envelope_size;
4438
4439 while next_offset < end_offset {
4441 _next_ordinal_to_read += 1;
4442 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4443 next_offset += envelope_size;
4444 }
4445
4446 Ok(())
4447 }
4448 }
4449
4450 impl Ipv6Configuration {
4451 #[inline(always)]
4452 fn max_ordinal_present(&self) -> u64 {
4453 if let Some(_) = self.ndp {
4454 return 4;
4455 }
4456 if let Some(_) = self.mld {
4457 return 3;
4458 }
4459 if let Some(_) = self.multicast_forwarding {
4460 return 2;
4461 }
4462 if let Some(_) = self.unicast_forwarding {
4463 return 1;
4464 }
4465 0
4466 }
4467 }
4468
4469 impl fidl::encoding::ValueTypeMarker for Ipv6Configuration {
4470 type Borrowed<'a> = &'a Self;
4471 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4472 value
4473 }
4474 }
4475
4476 unsafe impl fidl::encoding::TypeMarker for Ipv6Configuration {
4477 type Owned = Self;
4478
4479 #[inline(always)]
4480 fn inline_align(_context: fidl::encoding::Context) -> usize {
4481 8
4482 }
4483
4484 #[inline(always)]
4485 fn inline_size(_context: fidl::encoding::Context) -> usize {
4486 16
4487 }
4488 }
4489
4490 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6Configuration, D>
4491 for &Ipv6Configuration
4492 {
4493 unsafe fn encode(
4494 self,
4495 encoder: &mut fidl::encoding::Encoder<'_, D>,
4496 offset: usize,
4497 mut depth: fidl::encoding::Depth,
4498 ) -> fidl::Result<()> {
4499 encoder.debug_check_bounds::<Ipv6Configuration>(offset);
4500 let max_ordinal: u64 = self.max_ordinal_present();
4502 encoder.write_num(max_ordinal, offset);
4503 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4504 if max_ordinal == 0 {
4506 return Ok(());
4507 }
4508 depth.increment()?;
4509 let envelope_size = 8;
4510 let bytes_len = max_ordinal as usize * envelope_size;
4511 #[allow(unused_variables)]
4512 let offset = encoder.out_of_line_offset(bytes_len);
4513 let mut _prev_end_offset: usize = 0;
4514 if 1 > max_ordinal {
4515 return Ok(());
4516 }
4517
4518 let cur_offset: usize = (1 - 1) * envelope_size;
4521
4522 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4524
4525 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4530 self.unicast_forwarding
4531 .as_ref()
4532 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4533 encoder,
4534 offset + cur_offset,
4535 depth,
4536 )?;
4537
4538 _prev_end_offset = cur_offset + envelope_size;
4539 if 2 > max_ordinal {
4540 return Ok(());
4541 }
4542
4543 let cur_offset: usize = (2 - 1) * envelope_size;
4546
4547 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4549
4550 fidl::encoding::encode_in_envelope_optional::<bool, D>(
4555 self.multicast_forwarding
4556 .as_ref()
4557 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4558 encoder,
4559 offset + cur_offset,
4560 depth,
4561 )?;
4562
4563 _prev_end_offset = cur_offset + envelope_size;
4564 if 3 > max_ordinal {
4565 return Ok(());
4566 }
4567
4568 let cur_offset: usize = (3 - 1) * envelope_size;
4571
4572 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4574
4575 fidl::encoding::encode_in_envelope_optional::<MldConfiguration, D>(
4580 self.mld
4581 .as_ref()
4582 .map(<MldConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
4583 encoder,
4584 offset + cur_offset,
4585 depth,
4586 )?;
4587
4588 _prev_end_offset = cur_offset + envelope_size;
4589 if 4 > max_ordinal {
4590 return Ok(());
4591 }
4592
4593 let cur_offset: usize = (4 - 1) * envelope_size;
4596
4597 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4599
4600 fidl::encoding::encode_in_envelope_optional::<NdpConfiguration, D>(
4605 self.ndp
4606 .as_ref()
4607 .map(<NdpConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
4608 encoder,
4609 offset + cur_offset,
4610 depth,
4611 )?;
4612
4613 _prev_end_offset = cur_offset + envelope_size;
4614
4615 Ok(())
4616 }
4617 }
4618
4619 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6Configuration {
4620 #[inline(always)]
4621 fn new_empty() -> Self {
4622 Self::default()
4623 }
4624
4625 unsafe fn decode(
4626 &mut self,
4627 decoder: &mut fidl::encoding::Decoder<'_, D>,
4628 offset: usize,
4629 mut depth: fidl::encoding::Depth,
4630 ) -> fidl::Result<()> {
4631 decoder.debug_check_bounds::<Self>(offset);
4632 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4633 None => return Err(fidl::Error::NotNullable),
4634 Some(len) => len,
4635 };
4636 if len == 0 {
4638 return Ok(());
4639 };
4640 depth.increment()?;
4641 let envelope_size = 8;
4642 let bytes_len = len * envelope_size;
4643 let offset = decoder.out_of_line_offset(bytes_len)?;
4644 let mut _next_ordinal_to_read = 0;
4646 let mut next_offset = offset;
4647 let end_offset = offset + bytes_len;
4648 _next_ordinal_to_read += 1;
4649 if next_offset >= end_offset {
4650 return Ok(());
4651 }
4652
4653 while _next_ordinal_to_read < 1 {
4655 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4656 _next_ordinal_to_read += 1;
4657 next_offset += envelope_size;
4658 }
4659
4660 let next_out_of_line = decoder.next_out_of_line();
4661 let handles_before = decoder.remaining_handles();
4662 if let Some((inlined, num_bytes, num_handles)) =
4663 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4664 {
4665 let member_inline_size =
4666 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4667 if inlined != (member_inline_size <= 4) {
4668 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4669 }
4670 let inner_offset;
4671 let mut inner_depth = depth.clone();
4672 if inlined {
4673 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4674 inner_offset = next_offset;
4675 } else {
4676 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4677 inner_depth.increment()?;
4678 }
4679 let val_ref =
4680 self.unicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
4681 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4682 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4683 {
4684 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4685 }
4686 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4687 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4688 }
4689 }
4690
4691 next_offset += envelope_size;
4692 _next_ordinal_to_read += 1;
4693 if next_offset >= end_offset {
4694 return Ok(());
4695 }
4696
4697 while _next_ordinal_to_read < 2 {
4699 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4700 _next_ordinal_to_read += 1;
4701 next_offset += envelope_size;
4702 }
4703
4704 let next_out_of_line = decoder.next_out_of_line();
4705 let handles_before = decoder.remaining_handles();
4706 if let Some((inlined, num_bytes, num_handles)) =
4707 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4708 {
4709 let member_inline_size =
4710 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4711 if inlined != (member_inline_size <= 4) {
4712 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4713 }
4714 let inner_offset;
4715 let mut inner_depth = depth.clone();
4716 if inlined {
4717 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4718 inner_offset = next_offset;
4719 } else {
4720 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4721 inner_depth.increment()?;
4722 }
4723 let val_ref =
4724 self.multicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
4725 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4726 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4727 {
4728 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4729 }
4730 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4731 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4732 }
4733 }
4734
4735 next_offset += envelope_size;
4736 _next_ordinal_to_read += 1;
4737 if next_offset >= end_offset {
4738 return Ok(());
4739 }
4740
4741 while _next_ordinal_to_read < 3 {
4743 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4744 _next_ordinal_to_read += 1;
4745 next_offset += envelope_size;
4746 }
4747
4748 let next_out_of_line = decoder.next_out_of_line();
4749 let handles_before = decoder.remaining_handles();
4750 if let Some((inlined, num_bytes, num_handles)) =
4751 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4752 {
4753 let member_inline_size =
4754 <MldConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4755 if inlined != (member_inline_size <= 4) {
4756 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4757 }
4758 let inner_offset;
4759 let mut inner_depth = depth.clone();
4760 if inlined {
4761 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4762 inner_offset = next_offset;
4763 } else {
4764 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4765 inner_depth.increment()?;
4766 }
4767 let val_ref = self.mld.get_or_insert_with(|| fidl::new_empty!(MldConfiguration, D));
4768 fidl::decode!(MldConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
4769 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4770 {
4771 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4772 }
4773 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4774 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4775 }
4776 }
4777
4778 next_offset += envelope_size;
4779 _next_ordinal_to_read += 1;
4780 if next_offset >= end_offset {
4781 return Ok(());
4782 }
4783
4784 while _next_ordinal_to_read < 4 {
4786 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4787 _next_ordinal_to_read += 1;
4788 next_offset += envelope_size;
4789 }
4790
4791 let next_out_of_line = decoder.next_out_of_line();
4792 let handles_before = decoder.remaining_handles();
4793 if let Some((inlined, num_bytes, num_handles)) =
4794 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4795 {
4796 let member_inline_size =
4797 <NdpConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4798 if inlined != (member_inline_size <= 4) {
4799 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4800 }
4801 let inner_offset;
4802 let mut inner_depth = depth.clone();
4803 if inlined {
4804 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4805 inner_offset = next_offset;
4806 } else {
4807 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4808 inner_depth.increment()?;
4809 }
4810 let val_ref = self.ndp.get_or_insert_with(|| fidl::new_empty!(NdpConfiguration, D));
4811 fidl::decode!(NdpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
4812 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4813 {
4814 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4815 }
4816 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4817 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4818 }
4819 }
4820
4821 next_offset += envelope_size;
4822
4823 while next_offset < end_offset {
4825 _next_ordinal_to_read += 1;
4826 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4827 next_offset += envelope_size;
4828 }
4829
4830 Ok(())
4831 }
4832 }
4833
4834 impl MldConfiguration {
4835 #[inline(always)]
4836 fn max_ordinal_present(&self) -> u64 {
4837 if let Some(_) = self.version {
4838 return 1;
4839 }
4840 0
4841 }
4842 }
4843
4844 impl fidl::encoding::ValueTypeMarker for MldConfiguration {
4845 type Borrowed<'a> = &'a Self;
4846 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4847 value
4848 }
4849 }
4850
4851 unsafe impl fidl::encoding::TypeMarker for MldConfiguration {
4852 type Owned = Self;
4853
4854 #[inline(always)]
4855 fn inline_align(_context: fidl::encoding::Context) -> usize {
4856 8
4857 }
4858
4859 #[inline(always)]
4860 fn inline_size(_context: fidl::encoding::Context) -> usize {
4861 16
4862 }
4863 }
4864
4865 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MldConfiguration, D>
4866 for &MldConfiguration
4867 {
4868 unsafe fn encode(
4869 self,
4870 encoder: &mut fidl::encoding::Encoder<'_, D>,
4871 offset: usize,
4872 mut depth: fidl::encoding::Depth,
4873 ) -> fidl::Result<()> {
4874 encoder.debug_check_bounds::<MldConfiguration>(offset);
4875 let max_ordinal: u64 = self.max_ordinal_present();
4877 encoder.write_num(max_ordinal, offset);
4878 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4879 if max_ordinal == 0 {
4881 return Ok(());
4882 }
4883 depth.increment()?;
4884 let envelope_size = 8;
4885 let bytes_len = max_ordinal as usize * envelope_size;
4886 #[allow(unused_variables)]
4887 let offset = encoder.out_of_line_offset(bytes_len);
4888 let mut _prev_end_offset: usize = 0;
4889 if 1 > max_ordinal {
4890 return Ok(());
4891 }
4892
4893 let cur_offset: usize = (1 - 1) * envelope_size;
4896
4897 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4899
4900 fidl::encoding::encode_in_envelope_optional::<MldVersion, D>(
4905 self.version.as_ref().map(<MldVersion as fidl::encoding::ValueTypeMarker>::borrow),
4906 encoder,
4907 offset + cur_offset,
4908 depth,
4909 )?;
4910
4911 _prev_end_offset = cur_offset + envelope_size;
4912
4913 Ok(())
4914 }
4915 }
4916
4917 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MldConfiguration {
4918 #[inline(always)]
4919 fn new_empty() -> Self {
4920 Self::default()
4921 }
4922
4923 unsafe fn decode(
4924 &mut self,
4925 decoder: &mut fidl::encoding::Decoder<'_, D>,
4926 offset: usize,
4927 mut depth: fidl::encoding::Depth,
4928 ) -> fidl::Result<()> {
4929 decoder.debug_check_bounds::<Self>(offset);
4930 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4931 None => return Err(fidl::Error::NotNullable),
4932 Some(len) => len,
4933 };
4934 if len == 0 {
4936 return Ok(());
4937 };
4938 depth.increment()?;
4939 let envelope_size = 8;
4940 let bytes_len = len * envelope_size;
4941 let offset = decoder.out_of_line_offset(bytes_len)?;
4942 let mut _next_ordinal_to_read = 0;
4944 let mut next_offset = offset;
4945 let end_offset = offset + bytes_len;
4946 _next_ordinal_to_read += 1;
4947 if next_offset >= end_offset {
4948 return Ok(());
4949 }
4950
4951 while _next_ordinal_to_read < 1 {
4953 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4954 _next_ordinal_to_read += 1;
4955 next_offset += envelope_size;
4956 }
4957
4958 let next_out_of_line = decoder.next_out_of_line();
4959 let handles_before = decoder.remaining_handles();
4960 if let Some((inlined, num_bytes, num_handles)) =
4961 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4962 {
4963 let member_inline_size =
4964 <MldVersion as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4965 if inlined != (member_inline_size <= 4) {
4966 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4967 }
4968 let inner_offset;
4969 let mut inner_depth = depth.clone();
4970 if inlined {
4971 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4972 inner_offset = next_offset;
4973 } else {
4974 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4975 inner_depth.increment()?;
4976 }
4977 let val_ref = self.version.get_or_insert_with(|| fidl::new_empty!(MldVersion, D));
4978 fidl::decode!(MldVersion, D, val_ref, decoder, inner_offset, inner_depth)?;
4979 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4980 {
4981 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4982 }
4983 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4984 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4985 }
4986 }
4987
4988 next_offset += envelope_size;
4989
4990 while next_offset < end_offset {
4992 _next_ordinal_to_read += 1;
4993 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4994 next_offset += envelope_size;
4995 }
4996
4997 Ok(())
4998 }
4999 }
5000
5001 impl NdpConfiguration {
5002 #[inline(always)]
5003 fn max_ordinal_present(&self) -> u64 {
5004 if let Some(_) = self.slaac {
5005 return 3;
5006 }
5007 if let Some(_) = self.dad {
5008 return 2;
5009 }
5010 if let Some(_) = self.nud {
5011 return 1;
5012 }
5013 0
5014 }
5015 }
5016
5017 impl fidl::encoding::ValueTypeMarker for NdpConfiguration {
5018 type Borrowed<'a> = &'a Self;
5019 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5020 value
5021 }
5022 }
5023
5024 unsafe impl fidl::encoding::TypeMarker for NdpConfiguration {
5025 type Owned = Self;
5026
5027 #[inline(always)]
5028 fn inline_align(_context: fidl::encoding::Context) -> usize {
5029 8
5030 }
5031
5032 #[inline(always)]
5033 fn inline_size(_context: fidl::encoding::Context) -> usize {
5034 16
5035 }
5036 }
5037
5038 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NdpConfiguration, D>
5039 for &NdpConfiguration
5040 {
5041 unsafe fn encode(
5042 self,
5043 encoder: &mut fidl::encoding::Encoder<'_, D>,
5044 offset: usize,
5045 mut depth: fidl::encoding::Depth,
5046 ) -> fidl::Result<()> {
5047 encoder.debug_check_bounds::<NdpConfiguration>(offset);
5048 let max_ordinal: u64 = self.max_ordinal_present();
5050 encoder.write_num(max_ordinal, offset);
5051 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5052 if max_ordinal == 0 {
5054 return Ok(());
5055 }
5056 depth.increment()?;
5057 let envelope_size = 8;
5058 let bytes_len = max_ordinal as usize * envelope_size;
5059 #[allow(unused_variables)]
5060 let offset = encoder.out_of_line_offset(bytes_len);
5061 let mut _prev_end_offset: usize = 0;
5062 if 1 > max_ordinal {
5063 return Ok(());
5064 }
5065
5066 let cur_offset: usize = (1 - 1) * envelope_size;
5069
5070 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5072
5073 fidl::encoding::encode_in_envelope_optional::<NudConfiguration, D>(
5078 self.nud
5079 .as_ref()
5080 .map(<NudConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
5081 encoder,
5082 offset + cur_offset,
5083 depth,
5084 )?;
5085
5086 _prev_end_offset = cur_offset + envelope_size;
5087 if 2 > max_ordinal {
5088 return Ok(());
5089 }
5090
5091 let cur_offset: usize = (2 - 1) * envelope_size;
5094
5095 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5097
5098 fidl::encoding::encode_in_envelope_optional::<DadConfiguration, D>(
5103 self.dad
5104 .as_ref()
5105 .map(<DadConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
5106 encoder,
5107 offset + cur_offset,
5108 depth,
5109 )?;
5110
5111 _prev_end_offset = cur_offset + envelope_size;
5112 if 3 > max_ordinal {
5113 return Ok(());
5114 }
5115
5116 let cur_offset: usize = (3 - 1) * envelope_size;
5119
5120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5122
5123 fidl::encoding::encode_in_envelope_optional::<SlaacConfiguration, D>(
5128 self.slaac
5129 .as_ref()
5130 .map(<SlaacConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
5131 encoder,
5132 offset + cur_offset,
5133 depth,
5134 )?;
5135
5136 _prev_end_offset = cur_offset + envelope_size;
5137
5138 Ok(())
5139 }
5140 }
5141
5142 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NdpConfiguration {
5143 #[inline(always)]
5144 fn new_empty() -> Self {
5145 Self::default()
5146 }
5147
5148 unsafe fn decode(
5149 &mut self,
5150 decoder: &mut fidl::encoding::Decoder<'_, D>,
5151 offset: usize,
5152 mut depth: fidl::encoding::Depth,
5153 ) -> fidl::Result<()> {
5154 decoder.debug_check_bounds::<Self>(offset);
5155 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5156 None => return Err(fidl::Error::NotNullable),
5157 Some(len) => len,
5158 };
5159 if len == 0 {
5161 return Ok(());
5162 };
5163 depth.increment()?;
5164 let envelope_size = 8;
5165 let bytes_len = len * envelope_size;
5166 let offset = decoder.out_of_line_offset(bytes_len)?;
5167 let mut _next_ordinal_to_read = 0;
5169 let mut next_offset = offset;
5170 let end_offset = offset + bytes_len;
5171 _next_ordinal_to_read += 1;
5172 if next_offset >= end_offset {
5173 return Ok(());
5174 }
5175
5176 while _next_ordinal_to_read < 1 {
5178 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5179 _next_ordinal_to_read += 1;
5180 next_offset += envelope_size;
5181 }
5182
5183 let next_out_of_line = decoder.next_out_of_line();
5184 let handles_before = decoder.remaining_handles();
5185 if let Some((inlined, num_bytes, num_handles)) =
5186 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5187 {
5188 let member_inline_size =
5189 <NudConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5190 if inlined != (member_inline_size <= 4) {
5191 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5192 }
5193 let inner_offset;
5194 let mut inner_depth = depth.clone();
5195 if inlined {
5196 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5197 inner_offset = next_offset;
5198 } else {
5199 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5200 inner_depth.increment()?;
5201 }
5202 let val_ref = self.nud.get_or_insert_with(|| fidl::new_empty!(NudConfiguration, D));
5203 fidl::decode!(NudConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
5204 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5205 {
5206 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5207 }
5208 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5209 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5210 }
5211 }
5212
5213 next_offset += envelope_size;
5214 _next_ordinal_to_read += 1;
5215 if next_offset >= end_offset {
5216 return Ok(());
5217 }
5218
5219 while _next_ordinal_to_read < 2 {
5221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5222 _next_ordinal_to_read += 1;
5223 next_offset += envelope_size;
5224 }
5225
5226 let next_out_of_line = decoder.next_out_of_line();
5227 let handles_before = decoder.remaining_handles();
5228 if let Some((inlined, num_bytes, num_handles)) =
5229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5230 {
5231 let member_inline_size =
5232 <DadConfiguration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5233 if inlined != (member_inline_size <= 4) {
5234 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5235 }
5236 let inner_offset;
5237 let mut inner_depth = depth.clone();
5238 if inlined {
5239 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5240 inner_offset = next_offset;
5241 } else {
5242 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5243 inner_depth.increment()?;
5244 }
5245 let val_ref = self.dad.get_or_insert_with(|| fidl::new_empty!(DadConfiguration, D));
5246 fidl::decode!(DadConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
5247 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5248 {
5249 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5250 }
5251 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5252 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5253 }
5254 }
5255
5256 next_offset += envelope_size;
5257 _next_ordinal_to_read += 1;
5258 if next_offset >= end_offset {
5259 return Ok(());
5260 }
5261
5262 while _next_ordinal_to_read < 3 {
5264 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5265 _next_ordinal_to_read += 1;
5266 next_offset += envelope_size;
5267 }
5268
5269 let next_out_of_line = decoder.next_out_of_line();
5270 let handles_before = decoder.remaining_handles();
5271 if let Some((inlined, num_bytes, num_handles)) =
5272 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5273 {
5274 let member_inline_size =
5275 <SlaacConfiguration as fidl::encoding::TypeMarker>::inline_size(
5276 decoder.context,
5277 );
5278 if inlined != (member_inline_size <= 4) {
5279 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5280 }
5281 let inner_offset;
5282 let mut inner_depth = depth.clone();
5283 if inlined {
5284 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5285 inner_offset = next_offset;
5286 } else {
5287 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5288 inner_depth.increment()?;
5289 }
5290 let val_ref =
5291 self.slaac.get_or_insert_with(|| fidl::new_empty!(SlaacConfiguration, D));
5292 fidl::decode!(SlaacConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
5293 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5294 {
5295 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5296 }
5297 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5298 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5299 }
5300 }
5301
5302 next_offset += envelope_size;
5303
5304 while next_offset < end_offset {
5306 _next_ordinal_to_read += 1;
5307 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5308 next_offset += envelope_size;
5309 }
5310
5311 Ok(())
5312 }
5313 }
5314
5315 impl NudConfiguration {
5316 #[inline(always)]
5317 fn max_ordinal_present(&self) -> u64 {
5318 if let Some(_) = self.base_reachable_time {
5319 return 3;
5320 }
5321 if let Some(_) = self.max_unicast_solicitations {
5322 return 2;
5323 }
5324 if let Some(_) = self.max_multicast_solicitations {
5325 return 1;
5326 }
5327 0
5328 }
5329 }
5330
5331 impl fidl::encoding::ValueTypeMarker for NudConfiguration {
5332 type Borrowed<'a> = &'a Self;
5333 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5334 value
5335 }
5336 }
5337
5338 unsafe impl fidl::encoding::TypeMarker for NudConfiguration {
5339 type Owned = Self;
5340
5341 #[inline(always)]
5342 fn inline_align(_context: fidl::encoding::Context) -> usize {
5343 8
5344 }
5345
5346 #[inline(always)]
5347 fn inline_size(_context: fidl::encoding::Context) -> usize {
5348 16
5349 }
5350 }
5351
5352 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NudConfiguration, D>
5353 for &NudConfiguration
5354 {
5355 unsafe fn encode(
5356 self,
5357 encoder: &mut fidl::encoding::Encoder<'_, D>,
5358 offset: usize,
5359 mut depth: fidl::encoding::Depth,
5360 ) -> fidl::Result<()> {
5361 encoder.debug_check_bounds::<NudConfiguration>(offset);
5362 let max_ordinal: u64 = self.max_ordinal_present();
5364 encoder.write_num(max_ordinal, offset);
5365 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5366 if max_ordinal == 0 {
5368 return Ok(());
5369 }
5370 depth.increment()?;
5371 let envelope_size = 8;
5372 let bytes_len = max_ordinal as usize * envelope_size;
5373 #[allow(unused_variables)]
5374 let offset = encoder.out_of_line_offset(bytes_len);
5375 let mut _prev_end_offset: usize = 0;
5376 if 1 > max_ordinal {
5377 return Ok(());
5378 }
5379
5380 let cur_offset: usize = (1 - 1) * envelope_size;
5383
5384 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5386
5387 fidl::encoding::encode_in_envelope_optional::<u16, D>(
5392 self.max_multicast_solicitations
5393 .as_ref()
5394 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5395 encoder,
5396 offset + cur_offset,
5397 depth,
5398 )?;
5399
5400 _prev_end_offset = cur_offset + envelope_size;
5401 if 2 > max_ordinal {
5402 return Ok(());
5403 }
5404
5405 let cur_offset: usize = (2 - 1) * envelope_size;
5408
5409 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5411
5412 fidl::encoding::encode_in_envelope_optional::<u16, D>(
5417 self.max_unicast_solicitations
5418 .as_ref()
5419 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5420 encoder,
5421 offset + cur_offset,
5422 depth,
5423 )?;
5424
5425 _prev_end_offset = cur_offset + envelope_size;
5426 if 3 > max_ordinal {
5427 return Ok(());
5428 }
5429
5430 let cur_offset: usize = (3 - 1) * envelope_size;
5433
5434 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5436
5437 fidl::encoding::encode_in_envelope_optional::<i64, D>(
5442 self.base_reachable_time
5443 .as_ref()
5444 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5445 encoder,
5446 offset + cur_offset,
5447 depth,
5448 )?;
5449
5450 _prev_end_offset = cur_offset + envelope_size;
5451
5452 Ok(())
5453 }
5454 }
5455
5456 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NudConfiguration {
5457 #[inline(always)]
5458 fn new_empty() -> Self {
5459 Self::default()
5460 }
5461
5462 unsafe fn decode(
5463 &mut self,
5464 decoder: &mut fidl::encoding::Decoder<'_, D>,
5465 offset: usize,
5466 mut depth: fidl::encoding::Depth,
5467 ) -> fidl::Result<()> {
5468 decoder.debug_check_bounds::<Self>(offset);
5469 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5470 None => return Err(fidl::Error::NotNullable),
5471 Some(len) => len,
5472 };
5473 if len == 0 {
5475 return Ok(());
5476 };
5477 depth.increment()?;
5478 let envelope_size = 8;
5479 let bytes_len = len * envelope_size;
5480 let offset = decoder.out_of_line_offset(bytes_len)?;
5481 let mut _next_ordinal_to_read = 0;
5483 let mut next_offset = offset;
5484 let end_offset = offset + bytes_len;
5485 _next_ordinal_to_read += 1;
5486 if next_offset >= end_offset {
5487 return Ok(());
5488 }
5489
5490 while _next_ordinal_to_read < 1 {
5492 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5493 _next_ordinal_to_read += 1;
5494 next_offset += envelope_size;
5495 }
5496
5497 let next_out_of_line = decoder.next_out_of_line();
5498 let handles_before = decoder.remaining_handles();
5499 if let Some((inlined, num_bytes, num_handles)) =
5500 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5501 {
5502 let member_inline_size =
5503 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5504 if inlined != (member_inline_size <= 4) {
5505 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5506 }
5507 let inner_offset;
5508 let mut inner_depth = depth.clone();
5509 if inlined {
5510 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5511 inner_offset = next_offset;
5512 } else {
5513 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5514 inner_depth.increment()?;
5515 }
5516 let val_ref = self
5517 .max_multicast_solicitations
5518 .get_or_insert_with(|| fidl::new_empty!(u16, D));
5519 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
5520 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5521 {
5522 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5523 }
5524 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5525 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5526 }
5527 }
5528
5529 next_offset += envelope_size;
5530 _next_ordinal_to_read += 1;
5531 if next_offset >= end_offset {
5532 return Ok(());
5533 }
5534
5535 while _next_ordinal_to_read < 2 {
5537 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5538 _next_ordinal_to_read += 1;
5539 next_offset += envelope_size;
5540 }
5541
5542 let next_out_of_line = decoder.next_out_of_line();
5543 let handles_before = decoder.remaining_handles();
5544 if let Some((inlined, num_bytes, num_handles)) =
5545 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5546 {
5547 let member_inline_size =
5548 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5549 if inlined != (member_inline_size <= 4) {
5550 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5551 }
5552 let inner_offset;
5553 let mut inner_depth = depth.clone();
5554 if inlined {
5555 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5556 inner_offset = next_offset;
5557 } else {
5558 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5559 inner_depth.increment()?;
5560 }
5561 let val_ref =
5562 self.max_unicast_solicitations.get_or_insert_with(|| fidl::new_empty!(u16, D));
5563 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
5564 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5565 {
5566 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5567 }
5568 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5569 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5570 }
5571 }
5572
5573 next_offset += envelope_size;
5574 _next_ordinal_to_read += 1;
5575 if next_offset >= end_offset {
5576 return Ok(());
5577 }
5578
5579 while _next_ordinal_to_read < 3 {
5581 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5582 _next_ordinal_to_read += 1;
5583 next_offset += envelope_size;
5584 }
5585
5586 let next_out_of_line = decoder.next_out_of_line();
5587 let handles_before = decoder.remaining_handles();
5588 if let Some((inlined, num_bytes, num_handles)) =
5589 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5590 {
5591 let member_inline_size =
5592 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5593 if inlined != (member_inline_size <= 4) {
5594 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5595 }
5596 let inner_offset;
5597 let mut inner_depth = depth.clone();
5598 if inlined {
5599 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5600 inner_offset = next_offset;
5601 } else {
5602 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5603 inner_depth.increment()?;
5604 }
5605 let val_ref =
5606 self.base_reachable_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
5607 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5609 {
5610 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5611 }
5612 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5613 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5614 }
5615 }
5616
5617 next_offset += envelope_size;
5618
5619 while next_offset < end_offset {
5621 _next_ordinal_to_read += 1;
5622 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5623 next_offset += envelope_size;
5624 }
5625
5626 Ok(())
5627 }
5628 }
5629
5630 impl Options {
5631 #[inline(always)]
5632 fn max_ordinal_present(&self) -> u64 {
5633 if let Some(_) = self.metric {
5634 return 2;
5635 }
5636 if let Some(_) = self.name {
5637 return 1;
5638 }
5639 0
5640 }
5641 }
5642
5643 impl fidl::encoding::ValueTypeMarker for Options {
5644 type Borrowed<'a> = &'a Self;
5645 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5646 value
5647 }
5648 }
5649
5650 unsafe impl fidl::encoding::TypeMarker for Options {
5651 type Owned = Self;
5652
5653 #[inline(always)]
5654 fn inline_align(_context: fidl::encoding::Context) -> usize {
5655 8
5656 }
5657
5658 #[inline(always)]
5659 fn inline_size(_context: fidl::encoding::Context) -> usize {
5660 16
5661 }
5662 }
5663
5664 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
5665 unsafe fn encode(
5666 self,
5667 encoder: &mut fidl::encoding::Encoder<'_, D>,
5668 offset: usize,
5669 mut depth: fidl::encoding::Depth,
5670 ) -> fidl::Result<()> {
5671 encoder.debug_check_bounds::<Options>(offset);
5672 let max_ordinal: u64 = self.max_ordinal_present();
5674 encoder.write_num(max_ordinal, offset);
5675 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5676 if max_ordinal == 0 {
5678 return Ok(());
5679 }
5680 depth.increment()?;
5681 let envelope_size = 8;
5682 let bytes_len = max_ordinal as usize * envelope_size;
5683 #[allow(unused_variables)]
5684 let offset = encoder.out_of_line_offset(bytes_len);
5685 let mut _prev_end_offset: usize = 0;
5686 if 1 > max_ordinal {
5687 return Ok(());
5688 }
5689
5690 let cur_offset: usize = (1 - 1) * envelope_size;
5693
5694 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5696
5697 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
5702 self.name.as_ref().map(
5703 <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow,
5704 ),
5705 encoder,
5706 offset + cur_offset,
5707 depth,
5708 )?;
5709
5710 _prev_end_offset = cur_offset + envelope_size;
5711 if 2 > max_ordinal {
5712 return Ok(());
5713 }
5714
5715 let cur_offset: usize = (2 - 1) * envelope_size;
5718
5719 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5721
5722 fidl::encoding::encode_in_envelope_optional::<u32, D>(
5727 self.metric.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5728 encoder,
5729 offset + cur_offset,
5730 depth,
5731 )?;
5732
5733 _prev_end_offset = cur_offset + envelope_size;
5734
5735 Ok(())
5736 }
5737 }
5738
5739 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
5740 #[inline(always)]
5741 fn new_empty() -> Self {
5742 Self::default()
5743 }
5744
5745 unsafe fn decode(
5746 &mut self,
5747 decoder: &mut fidl::encoding::Decoder<'_, D>,
5748 offset: usize,
5749 mut depth: fidl::encoding::Depth,
5750 ) -> fidl::Result<()> {
5751 decoder.debug_check_bounds::<Self>(offset);
5752 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5753 None => return Err(fidl::Error::NotNullable),
5754 Some(len) => len,
5755 };
5756 if len == 0 {
5758 return Ok(());
5759 };
5760 depth.increment()?;
5761 let envelope_size = 8;
5762 let bytes_len = len * envelope_size;
5763 let offset = decoder.out_of_line_offset(bytes_len)?;
5764 let mut _next_ordinal_to_read = 0;
5766 let mut next_offset = offset;
5767 let end_offset = offset + bytes_len;
5768 _next_ordinal_to_read += 1;
5769 if next_offset >= end_offset {
5770 return Ok(());
5771 }
5772
5773 while _next_ordinal_to_read < 1 {
5775 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5776 _next_ordinal_to_read += 1;
5777 next_offset += envelope_size;
5778 }
5779
5780 let next_out_of_line = decoder.next_out_of_line();
5781 let handles_before = decoder.remaining_handles();
5782 if let Some((inlined, num_bytes, num_handles)) =
5783 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5784 {
5785 let member_inline_size =
5786 <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
5787 decoder.context,
5788 );
5789 if inlined != (member_inline_size <= 4) {
5790 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5791 }
5792 let inner_offset;
5793 let mut inner_depth = depth.clone();
5794 if inlined {
5795 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5796 inner_offset = next_offset;
5797 } else {
5798 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5799 inner_depth.increment()?;
5800 }
5801 let val_ref = self
5802 .name
5803 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
5804 fidl::decode!(
5805 fidl::encoding::BoundedString<15>,
5806 D,
5807 val_ref,
5808 decoder,
5809 inner_offset,
5810 inner_depth
5811 )?;
5812 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5813 {
5814 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5815 }
5816 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5817 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5818 }
5819 }
5820
5821 next_offset += envelope_size;
5822 _next_ordinal_to_read += 1;
5823 if next_offset >= end_offset {
5824 return Ok(());
5825 }
5826
5827 while _next_ordinal_to_read < 2 {
5829 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5830 _next_ordinal_to_read += 1;
5831 next_offset += envelope_size;
5832 }
5833
5834 let next_out_of_line = decoder.next_out_of_line();
5835 let handles_before = decoder.remaining_handles();
5836 if let Some((inlined, num_bytes, num_handles)) =
5837 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5838 {
5839 let member_inline_size =
5840 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5841 if inlined != (member_inline_size <= 4) {
5842 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5843 }
5844 let inner_offset;
5845 let mut inner_depth = depth.clone();
5846 if inlined {
5847 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5848 inner_offset = next_offset;
5849 } else {
5850 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5851 inner_depth.increment()?;
5852 }
5853 let val_ref = self.metric.get_or_insert_with(|| fidl::new_empty!(u32, D));
5854 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5855 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5856 {
5857 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5858 }
5859 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5860 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5861 }
5862 }
5863
5864 next_offset += envelope_size;
5865
5866 while next_offset < end_offset {
5868 _next_ordinal_to_read += 1;
5869 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5870 next_offset += envelope_size;
5871 }
5872
5873 Ok(())
5874 }
5875 }
5876
5877 impl SlaacConfiguration {
5878 #[inline(always)]
5879 fn max_ordinal_present(&self) -> u64 {
5880 if let Some(_) = self.temporary_address {
5881 return 1;
5882 }
5883 0
5884 }
5885 }
5886
5887 impl fidl::encoding::ValueTypeMarker for SlaacConfiguration {
5888 type Borrowed<'a> = &'a Self;
5889 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5890 value
5891 }
5892 }
5893
5894 unsafe impl fidl::encoding::TypeMarker for SlaacConfiguration {
5895 type Owned = Self;
5896
5897 #[inline(always)]
5898 fn inline_align(_context: fidl::encoding::Context) -> usize {
5899 8
5900 }
5901
5902 #[inline(always)]
5903 fn inline_size(_context: fidl::encoding::Context) -> usize {
5904 16
5905 }
5906 }
5907
5908 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SlaacConfiguration, D>
5909 for &SlaacConfiguration
5910 {
5911 unsafe fn encode(
5912 self,
5913 encoder: &mut fidl::encoding::Encoder<'_, D>,
5914 offset: usize,
5915 mut depth: fidl::encoding::Depth,
5916 ) -> fidl::Result<()> {
5917 encoder.debug_check_bounds::<SlaacConfiguration>(offset);
5918 let max_ordinal: u64 = self.max_ordinal_present();
5920 encoder.write_num(max_ordinal, offset);
5921 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5922 if max_ordinal == 0 {
5924 return Ok(());
5925 }
5926 depth.increment()?;
5927 let envelope_size = 8;
5928 let bytes_len = max_ordinal as usize * envelope_size;
5929 #[allow(unused_variables)]
5930 let offset = encoder.out_of_line_offset(bytes_len);
5931 let mut _prev_end_offset: usize = 0;
5932 if 1 > max_ordinal {
5933 return Ok(());
5934 }
5935
5936 let cur_offset: usize = (1 - 1) * envelope_size;
5939
5940 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5942
5943 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5948 self.temporary_address
5949 .as_ref()
5950 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5951 encoder,
5952 offset + cur_offset,
5953 depth,
5954 )?;
5955
5956 _prev_end_offset = cur_offset + envelope_size;
5957
5958 Ok(())
5959 }
5960 }
5961
5962 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SlaacConfiguration {
5963 #[inline(always)]
5964 fn new_empty() -> Self {
5965 Self::default()
5966 }
5967
5968 unsafe fn decode(
5969 &mut self,
5970 decoder: &mut fidl::encoding::Decoder<'_, D>,
5971 offset: usize,
5972 mut depth: fidl::encoding::Depth,
5973 ) -> fidl::Result<()> {
5974 decoder.debug_check_bounds::<Self>(offset);
5975 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5976 None => return Err(fidl::Error::NotNullable),
5977 Some(len) => len,
5978 };
5979 if len == 0 {
5981 return Ok(());
5982 };
5983 depth.increment()?;
5984 let envelope_size = 8;
5985 let bytes_len = len * envelope_size;
5986 let offset = decoder.out_of_line_offset(bytes_len)?;
5987 let mut _next_ordinal_to_read = 0;
5989 let mut next_offset = offset;
5990 let end_offset = offset + bytes_len;
5991 _next_ordinal_to_read += 1;
5992 if next_offset >= end_offset {
5993 return Ok(());
5994 }
5995
5996 while _next_ordinal_to_read < 1 {
5998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5999 _next_ordinal_to_read += 1;
6000 next_offset += envelope_size;
6001 }
6002
6003 let next_out_of_line = decoder.next_out_of_line();
6004 let handles_before = decoder.remaining_handles();
6005 if let Some((inlined, num_bytes, num_handles)) =
6006 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6007 {
6008 let member_inline_size =
6009 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6010 if inlined != (member_inline_size <= 4) {
6011 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6012 }
6013 let inner_offset;
6014 let mut inner_depth = depth.clone();
6015 if inlined {
6016 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6017 inner_offset = next_offset;
6018 } else {
6019 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6020 inner_depth.increment()?;
6021 }
6022 let val_ref =
6023 self.temporary_address.get_or_insert_with(|| fidl::new_empty!(bool, D));
6024 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6025 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6026 {
6027 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6028 }
6029 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6030 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6031 }
6032 }
6033
6034 next_offset += envelope_size;
6035
6036 while next_offset < end_offset {
6038 _next_ordinal_to_read += 1;
6039 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6040 next_offset += envelope_size;
6041 }
6042
6043 Ok(())
6044 }
6045 }
6046}