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)]
16#[repr(u32)]
17pub enum Compatibility {
18 Supported = 1,
21 DisallowedInsecure = 2,
23 DisallowedNotSupported = 3,
25}
26
27impl Compatibility {
28 #[inline]
29 pub fn from_primitive(prim: u32) -> Option<Self> {
30 match prim {
31 1 => Some(Self::Supported),
32 2 => Some(Self::DisallowedInsecure),
33 3 => Some(Self::DisallowedNotSupported),
34 _ => None,
35 }
36 }
37
38 #[inline]
39 pub const fn into_primitive(self) -> u32 {
40 self as u32
41 }
42
43 #[deprecated = "Strict enums should not use `is_unknown`"]
44 #[inline]
45 pub fn is_unknown(&self) -> bool {
46 false
47 }
48}
49
50#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
52#[repr(u32)]
53pub enum ConnectionState {
54 Failed = 1,
56 Disconnected = 2,
58 Connecting = 3,
60 Connected = 4,
63}
64
65impl ConnectionState {
66 #[inline]
67 pub fn from_primitive(prim: u32) -> Option<Self> {
68 match prim {
69 1 => Some(Self::Failed),
70 2 => Some(Self::Disconnected),
71 3 => Some(Self::Connecting),
72 4 => Some(Self::Connected),
73 _ => None,
74 }
75 }
76
77 #[inline]
78 pub const fn into_primitive(self) -> u32 {
79 self as u32
80 }
81
82 #[deprecated = "Strict enums should not use `is_unknown`"]
83 #[inline]
84 pub fn is_unknown(&self) -> bool {
85 false
86 }
87}
88
89#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
91#[repr(u32)]
92pub enum ConnectivityMode {
93 LocalOnly = 1,
96 Unrestricted = 2,
99}
100
101impl ConnectivityMode {
102 #[inline]
103 pub fn from_primitive(prim: u32) -> Option<Self> {
104 match prim {
105 1 => Some(Self::LocalOnly),
106 2 => Some(Self::Unrestricted),
107 _ => None,
108 }
109 }
110
111 #[inline]
112 pub const fn into_primitive(self) -> u32 {
113 self as u32
114 }
115
116 #[deprecated = "Strict enums should not use `is_unknown`"]
117 #[inline]
118 pub fn is_unknown(&self) -> bool {
119 false
120 }
121}
122
123#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
125#[repr(u32)]
126pub enum DisconnectStatus {
127 TimedOut = 1,
129 CredentialsFailed = 2,
131 ConnectionStopped = 3,
136 ConnectionFailed = 4,
141}
142
143impl DisconnectStatus {
144 #[inline]
145 pub fn from_primitive(prim: u32) -> Option<Self> {
146 match prim {
147 1 => Some(Self::TimedOut),
148 2 => Some(Self::CredentialsFailed),
149 3 => Some(Self::ConnectionStopped),
150 4 => Some(Self::ConnectionFailed),
151 _ => None,
152 }
153 }
154
155 #[inline]
156 pub const fn into_primitive(self) -> u32 {
157 self as u32
158 }
159
160 #[deprecated = "Strict enums should not use `is_unknown`"]
161 #[inline]
162 pub fn is_unknown(&self) -> bool {
163 false
164 }
165}
166
167#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
169#[repr(u32)]
170pub enum NetworkConfigChangeError {
171 GeneralError = 1,
172 NetworkConfigMissingFieldError = 2,
173 NetworkConfigWriteError = 3,
174 SsidEmptyError = 4,
175 CredentialLenError = 6,
176 InvalidSecurityCredentialError = 7,
177 UnsupportedCredentialError = 8,
178}
179
180impl NetworkConfigChangeError {
181 #[inline]
182 pub fn from_primitive(prim: u32) -> Option<Self> {
183 match prim {
184 1 => Some(Self::GeneralError),
185 2 => Some(Self::NetworkConfigMissingFieldError),
186 3 => Some(Self::NetworkConfigWriteError),
187 4 => Some(Self::SsidEmptyError),
188 6 => Some(Self::CredentialLenError),
189 7 => Some(Self::InvalidSecurityCredentialError),
190 8 => Some(Self::UnsupportedCredentialError),
191 _ => None,
192 }
193 }
194
195 #[inline]
196 pub const fn into_primitive(self) -> u32 {
197 self as u32
198 }
199
200 #[deprecated = "Strict enums should not use `is_unknown`"]
201 #[inline]
202 pub fn is_unknown(&self) -> bool {
203 false
204 }
205}
206
207#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
209#[repr(u32)]
210pub enum OperatingBand {
211 Any = 1,
213 Only24Ghz = 2,
215 Only5Ghz = 3,
217}
218
219impl OperatingBand {
220 #[inline]
221 pub fn from_primitive(prim: u32) -> Option<Self> {
222 match prim {
223 1 => Some(Self::Any),
224 2 => Some(Self::Only24Ghz),
225 3 => Some(Self::Only5Ghz),
226 _ => None,
227 }
228 }
229
230 #[inline]
231 pub const fn into_primitive(self) -> u32 {
232 self as u32
233 }
234
235 #[deprecated = "Strict enums should not use `is_unknown`"]
236 #[inline]
237 pub fn is_unknown(&self) -> bool {
238 false
239 }
240}
241
242#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
244#[repr(u32)]
245pub enum OperatingState {
246 Failed = 1,
250 Starting = 2,
252 Active = 3,
254}
255
256impl OperatingState {
257 #[inline]
258 pub fn from_primitive(prim: u32) -> Option<Self> {
259 match prim {
260 1 => Some(Self::Failed),
261 2 => Some(Self::Starting),
262 3 => Some(Self::Active),
263 _ => None,
264 }
265 }
266
267 #[inline]
268 pub const fn into_primitive(self) -> u32 {
269 self as u32
270 }
271
272 #[deprecated = "Strict enums should not use `is_unknown`"]
273 #[inline]
274 pub fn is_unknown(&self) -> bool {
275 false
276 }
277}
278
279#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
280#[repr(u32)]
281pub enum RequestStatus {
282 Acknowledged = 0,
283 RejectedNotSupported = 1,
284 RejectedIncompatibleMode = 2,
285 RejectedAlreadyInUse = 3,
286 RejectedDuplicateRequest = 4,
287}
288
289impl RequestStatus {
290 #[inline]
291 pub fn from_primitive(prim: u32) -> Option<Self> {
292 match prim {
293 0 => Some(Self::Acknowledged),
294 1 => Some(Self::RejectedNotSupported),
295 2 => Some(Self::RejectedIncompatibleMode),
296 3 => Some(Self::RejectedAlreadyInUse),
297 4 => Some(Self::RejectedDuplicateRequest),
298 _ => None,
299 }
300 }
301
302 #[inline]
303 pub const fn into_primitive(self) -> u32 {
304 self as u32
305 }
306
307 #[deprecated = "Strict enums should not use `is_unknown`"]
308 #[inline]
309 pub fn is_unknown(&self) -> bool {
310 false
311 }
312}
313
314#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
316#[repr(u32)]
317pub enum ScanErrorCode {
318 GeneralError = 1,
320 Cancelled = 2,
323}
324
325impl ScanErrorCode {
326 #[inline]
327 pub fn from_primitive(prim: u32) -> Option<Self> {
328 match prim {
329 1 => Some(Self::GeneralError),
330 2 => Some(Self::Cancelled),
331 _ => None,
332 }
333 }
334
335 #[inline]
336 pub const fn into_primitive(self) -> u32 {
337 self as u32
338 }
339
340 #[deprecated = "Strict enums should not use `is_unknown`"]
341 #[inline]
342 pub fn is_unknown(&self) -> bool {
343 false
344 }
345}
346
347#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
351#[repr(u32)]
352pub enum SecurityType {
353 None = 1,
354 Wep = 2,
355 Wpa = 3,
356 Wpa2 = 4,
357 Wpa3 = 5,
358}
359
360impl SecurityType {
361 #[inline]
362 pub fn from_primitive(prim: u32) -> Option<Self> {
363 match prim {
364 1 => Some(Self::None),
365 2 => Some(Self::Wep),
366 3 => Some(Self::Wpa),
367 4 => Some(Self::Wpa2),
368 5 => Some(Self::Wpa3),
369 _ => None,
370 }
371 }
372
373 #[inline]
374 pub const fn into_primitive(self) -> u32 {
375 self as u32
376 }
377
378 #[deprecated = "Strict enums should not use `is_unknown`"]
379 #[inline]
380 pub fn is_unknown(&self) -> bool {
381 false
382 }
383}
384
385#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
387#[repr(u32)]
388pub enum WlanClientState {
389 ConnectionsDisabled = 1,
390 ConnectionsEnabled = 2,
391}
392
393impl WlanClientState {
394 #[inline]
395 pub fn from_primitive(prim: u32) -> Option<Self> {
396 match prim {
397 1 => Some(Self::ConnectionsDisabled),
398 2 => Some(Self::ConnectionsEnabled),
399 _ => None,
400 }
401 }
402
403 #[inline]
404 pub const fn into_primitive(self) -> u32 {
405 self as u32
406 }
407
408 #[deprecated = "Strict enums should not use `is_unknown`"]
409 #[inline]
410 pub fn is_unknown(&self) -> bool {
411 false
412 }
413}
414
415#[derive(Clone, Debug, PartialEq)]
416pub struct AccessPointControllerStartAccessPointRequest {
417 pub config: NetworkConfig,
418 pub mode: ConnectivityMode,
419 pub band: OperatingBand,
420}
421
422impl fidl::Persistable for AccessPointControllerStartAccessPointRequest {}
423
424#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
425pub struct AccessPointControllerStartAccessPointResponse {
426 pub status: RequestStatus,
427}
428
429impl fidl::Persistable for AccessPointControllerStartAccessPointResponse {}
430
431#[derive(Clone, Debug, PartialEq)]
432pub struct AccessPointControllerStopAccessPointRequest {
433 pub config: NetworkConfig,
434}
435
436impl fidl::Persistable for AccessPointControllerStopAccessPointRequest {}
437
438#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
439pub struct AccessPointControllerStopAccessPointResponse {
440 pub status: RequestStatus,
441}
442
443impl fidl::Persistable for AccessPointControllerStopAccessPointResponse {}
444
445#[derive(Clone, Debug, PartialEq)]
446pub struct AccessPointStateUpdatesOnAccessPointStateUpdateRequest {
447 pub access_points: Vec<AccessPointState>,
448}
449
450impl fidl::Persistable for AccessPointStateUpdatesOnAccessPointStateUpdateRequest {}
451
452#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
453pub struct ClientControllerConnectRequest {
454 pub id: NetworkIdentifier,
455}
456
457impl fidl::Persistable for ClientControllerConnectRequest {}
458
459#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
460pub struct ClientControllerConnectResponse {
461 pub status: RequestStatus,
462}
463
464impl fidl::Persistable for ClientControllerConnectResponse {}
465
466#[derive(Clone, Debug, PartialEq)]
467pub struct ClientControllerRemoveNetworkRequest {
468 pub config: NetworkConfig,
469}
470
471impl fidl::Persistable for ClientControllerRemoveNetworkRequest {}
472
473#[derive(Clone, Debug, PartialEq)]
474pub struct ClientControllerSaveNetworkRequest {
475 pub config: NetworkConfig,
476}
477
478impl fidl::Persistable for ClientControllerSaveNetworkRequest {}
479
480#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
481pub struct ClientControllerStartClientConnectionsResponse {
482 pub status: RequestStatus,
483}
484
485impl fidl::Persistable for ClientControllerStartClientConnectionsResponse {}
486
487#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
488pub struct ClientControllerStopClientConnectionsResponse {
489 pub status: RequestStatus,
490}
491
492impl fidl::Persistable for ClientControllerStopClientConnectionsResponse {}
493
494#[derive(Clone, Debug, PartialEq)]
495pub struct ClientStateUpdatesOnClientStateUpdateRequest {
496 pub summary: ClientStateSummary,
497}
498
499impl fidl::Persistable for ClientStateUpdatesOnClientStateUpdateRequest {}
500
501#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
503pub struct Empty;
504
505impl fidl::Persistable for Empty {}
506
507#[derive(Clone, Debug, PartialEq)]
508pub struct NetworkConfigIteratorGetNextResponse {
509 pub configs: Vec<NetworkConfig>,
510}
511
512impl fidl::Persistable for NetworkConfigIteratorGetNextResponse {}
513
514#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
518pub struct NetworkIdentifier {
519 pub ssid: Vec<u8>,
521 pub type_: SecurityType,
523}
524
525impl fidl::Persistable for NetworkIdentifier {}
526
527#[derive(Clone, Debug, PartialEq)]
528pub struct ScanResultIteratorGetNextResponse {
529 pub scan_results: Vec<ScanResult>,
530}
531
532impl fidl::Persistable for ScanResultIteratorGetNextResponse {}
533
534#[derive(Clone, Debug, Default, PartialEq)]
537pub struct AccessPointState {
538 pub state: Option<OperatingState>,
540 pub mode: Option<ConnectivityMode>,
542 pub band: Option<OperatingBand>,
544 pub frequency: Option<u32>,
546 pub clients: Option<ConnectedClientInformation>,
548 pub id: Option<NetworkIdentifier>,
550 #[doc(hidden)]
551 pub __source_breaking: fidl::marker::SourceBreaking,
552}
553
554impl fidl::Persistable for AccessPointState {}
555
556#[derive(Clone, Debug, Default, PartialEq)]
558pub struct Bss {
559 pub bssid: Option<[u8; 6]>,
561 pub rssi: Option<i8>,
563 pub frequency: Option<u32>,
565 pub timestamp_nanos: Option<i64>,
568 #[doc(hidden)]
569 pub __source_breaking: fidl::marker::SourceBreaking,
570}
571
572impl fidl::Persistable for Bss {}
573
574#[derive(Clone, Debug, Default, PartialEq)]
578pub struct ClientStateSummary {
579 pub state: Option<WlanClientState>,
581 pub networks: Option<Vec<NetworkState>>,
583 #[doc(hidden)]
584 pub __source_breaking: fidl::marker::SourceBreaking,
585}
586
587impl fidl::Persistable for ClientStateSummary {}
588
589#[derive(Clone, Debug, Default, PartialEq)]
592pub struct ConnectedClientInformation {
593 pub count: Option<u8>,
595 #[doc(hidden)]
596 pub __source_breaking: fidl::marker::SourceBreaking,
597}
598
599impl fidl::Persistable for ConnectedClientInformation {}
600
601#[derive(Clone, Debug, Default, PartialEq)]
603pub struct NetworkConfig {
604 pub id: Option<NetworkIdentifier>,
606 pub credential: Option<Credential>,
608 #[doc(hidden)]
609 pub __source_breaking: fidl::marker::SourceBreaking,
610}
611
612impl fidl::Persistable for NetworkConfig {}
613
614#[derive(Clone, Debug, Default, PartialEq)]
616pub struct NetworkState {
617 pub id: Option<NetworkIdentifier>,
619 pub state: Option<ConnectionState>,
621 pub status: Option<DisconnectStatus>,
623 #[doc(hidden)]
624 pub __source_breaking: fidl::marker::SourceBreaking,
625}
626
627impl fidl::Persistable for NetworkState {}
628
629#[derive(Clone, Debug, Default, PartialEq)]
633pub struct ScanResult {
634 pub id: Option<NetworkIdentifier>,
637 pub entries: Option<Vec<Bss>>,
639 pub compatibility: Option<Compatibility>,
641 #[doc(hidden)]
642 pub __source_breaking: fidl::marker::SourceBreaking,
643}
644
645impl fidl::Persistable for ScanResult {}
646
647#[derive(Clone, Debug)]
649pub enum Credential {
650 None(Empty),
652 Password(Vec<u8>),
654 Psk(Vec<u8>),
656 #[doc(hidden)]
657 __SourceBreaking { unknown_ordinal: u64 },
658}
659
660#[macro_export]
662macro_rules! CredentialUnknown {
663 () => {
664 _
665 };
666}
667
668impl PartialEq for Credential {
670 fn eq(&self, other: &Self) -> bool {
671 match (self, other) {
672 (Self::None(x), Self::None(y)) => *x == *y,
673 (Self::Password(x), Self::Password(y)) => *x == *y,
674 (Self::Psk(x), Self::Psk(y)) => *x == *y,
675 _ => false,
676 }
677 }
678}
679
680impl Credential {
681 #[inline]
682 pub fn ordinal(&self) -> u64 {
683 match *self {
684 Self::None(_) => 1,
685 Self::Password(_) => 2,
686 Self::Psk(_) => 3,
687 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
688 }
689 }
690
691 #[inline]
692 pub fn unknown_variant_for_testing() -> Self {
693 Self::__SourceBreaking { unknown_ordinal: 0 }
694 }
695
696 #[inline]
697 pub fn is_unknown(&self) -> bool {
698 match self {
699 Self::__SourceBreaking { .. } => true,
700 _ => false,
701 }
702 }
703}
704
705impl fidl::Persistable for Credential {}
706
707mod internal {
708 use super::*;
709 unsafe impl fidl::encoding::TypeMarker for Compatibility {
710 type Owned = Self;
711
712 #[inline(always)]
713 fn inline_align(_context: fidl::encoding::Context) -> usize {
714 std::mem::align_of::<u32>()
715 }
716
717 #[inline(always)]
718 fn inline_size(_context: fidl::encoding::Context) -> usize {
719 std::mem::size_of::<u32>()
720 }
721
722 #[inline(always)]
723 fn encode_is_copy() -> bool {
724 true
725 }
726
727 #[inline(always)]
728 fn decode_is_copy() -> bool {
729 false
730 }
731 }
732
733 impl fidl::encoding::ValueTypeMarker for Compatibility {
734 type Borrowed<'a> = Self;
735 #[inline(always)]
736 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
737 *value
738 }
739 }
740
741 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Compatibility {
742 #[inline]
743 unsafe fn encode(
744 self,
745 encoder: &mut fidl::encoding::Encoder<'_, D>,
746 offset: usize,
747 _depth: fidl::encoding::Depth,
748 ) -> fidl::Result<()> {
749 encoder.debug_check_bounds::<Self>(offset);
750 encoder.write_num(self.into_primitive(), offset);
751 Ok(())
752 }
753 }
754
755 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Compatibility {
756 #[inline(always)]
757 fn new_empty() -> Self {
758 Self::Supported
759 }
760
761 #[inline]
762 unsafe fn decode(
763 &mut self,
764 decoder: &mut fidl::encoding::Decoder<'_, D>,
765 offset: usize,
766 _depth: fidl::encoding::Depth,
767 ) -> fidl::Result<()> {
768 decoder.debug_check_bounds::<Self>(offset);
769 let prim = decoder.read_num::<u32>(offset);
770
771 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
772 Ok(())
773 }
774 }
775 unsafe impl fidl::encoding::TypeMarker for ConnectionState {
776 type Owned = Self;
777
778 #[inline(always)]
779 fn inline_align(_context: fidl::encoding::Context) -> usize {
780 std::mem::align_of::<u32>()
781 }
782
783 #[inline(always)]
784 fn inline_size(_context: fidl::encoding::Context) -> usize {
785 std::mem::size_of::<u32>()
786 }
787
788 #[inline(always)]
789 fn encode_is_copy() -> bool {
790 true
791 }
792
793 #[inline(always)]
794 fn decode_is_copy() -> bool {
795 false
796 }
797 }
798
799 impl fidl::encoding::ValueTypeMarker for ConnectionState {
800 type Borrowed<'a> = Self;
801 #[inline(always)]
802 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
803 *value
804 }
805 }
806
807 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
808 for ConnectionState
809 {
810 #[inline]
811 unsafe fn encode(
812 self,
813 encoder: &mut fidl::encoding::Encoder<'_, D>,
814 offset: usize,
815 _depth: fidl::encoding::Depth,
816 ) -> fidl::Result<()> {
817 encoder.debug_check_bounds::<Self>(offset);
818 encoder.write_num(self.into_primitive(), offset);
819 Ok(())
820 }
821 }
822
823 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConnectionState {
824 #[inline(always)]
825 fn new_empty() -> Self {
826 Self::Failed
827 }
828
829 #[inline]
830 unsafe fn decode(
831 &mut self,
832 decoder: &mut fidl::encoding::Decoder<'_, D>,
833 offset: usize,
834 _depth: fidl::encoding::Depth,
835 ) -> fidl::Result<()> {
836 decoder.debug_check_bounds::<Self>(offset);
837 let prim = decoder.read_num::<u32>(offset);
838
839 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
840 Ok(())
841 }
842 }
843 unsafe impl fidl::encoding::TypeMarker for ConnectivityMode {
844 type Owned = Self;
845
846 #[inline(always)]
847 fn inline_align(_context: fidl::encoding::Context) -> usize {
848 std::mem::align_of::<u32>()
849 }
850
851 #[inline(always)]
852 fn inline_size(_context: fidl::encoding::Context) -> usize {
853 std::mem::size_of::<u32>()
854 }
855
856 #[inline(always)]
857 fn encode_is_copy() -> bool {
858 true
859 }
860
861 #[inline(always)]
862 fn decode_is_copy() -> bool {
863 false
864 }
865 }
866
867 impl fidl::encoding::ValueTypeMarker for ConnectivityMode {
868 type Borrowed<'a> = Self;
869 #[inline(always)]
870 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
871 *value
872 }
873 }
874
875 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
876 for ConnectivityMode
877 {
878 #[inline]
879 unsafe fn encode(
880 self,
881 encoder: &mut fidl::encoding::Encoder<'_, D>,
882 offset: usize,
883 _depth: fidl::encoding::Depth,
884 ) -> fidl::Result<()> {
885 encoder.debug_check_bounds::<Self>(offset);
886 encoder.write_num(self.into_primitive(), offset);
887 Ok(())
888 }
889 }
890
891 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConnectivityMode {
892 #[inline(always)]
893 fn new_empty() -> Self {
894 Self::LocalOnly
895 }
896
897 #[inline]
898 unsafe fn decode(
899 &mut self,
900 decoder: &mut fidl::encoding::Decoder<'_, D>,
901 offset: usize,
902 _depth: fidl::encoding::Depth,
903 ) -> fidl::Result<()> {
904 decoder.debug_check_bounds::<Self>(offset);
905 let prim = decoder.read_num::<u32>(offset);
906
907 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
908 Ok(())
909 }
910 }
911 unsafe impl fidl::encoding::TypeMarker for DisconnectStatus {
912 type Owned = Self;
913
914 #[inline(always)]
915 fn inline_align(_context: fidl::encoding::Context) -> usize {
916 std::mem::align_of::<u32>()
917 }
918
919 #[inline(always)]
920 fn inline_size(_context: fidl::encoding::Context) -> usize {
921 std::mem::size_of::<u32>()
922 }
923
924 #[inline(always)]
925 fn encode_is_copy() -> bool {
926 true
927 }
928
929 #[inline(always)]
930 fn decode_is_copy() -> bool {
931 false
932 }
933 }
934
935 impl fidl::encoding::ValueTypeMarker for DisconnectStatus {
936 type Borrowed<'a> = Self;
937 #[inline(always)]
938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
939 *value
940 }
941 }
942
943 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
944 for DisconnectStatus
945 {
946 #[inline]
947 unsafe fn encode(
948 self,
949 encoder: &mut fidl::encoding::Encoder<'_, D>,
950 offset: usize,
951 _depth: fidl::encoding::Depth,
952 ) -> fidl::Result<()> {
953 encoder.debug_check_bounds::<Self>(offset);
954 encoder.write_num(self.into_primitive(), offset);
955 Ok(())
956 }
957 }
958
959 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisconnectStatus {
960 #[inline(always)]
961 fn new_empty() -> Self {
962 Self::TimedOut
963 }
964
965 #[inline]
966 unsafe fn decode(
967 &mut self,
968 decoder: &mut fidl::encoding::Decoder<'_, D>,
969 offset: usize,
970 _depth: fidl::encoding::Depth,
971 ) -> fidl::Result<()> {
972 decoder.debug_check_bounds::<Self>(offset);
973 let prim = decoder.read_num::<u32>(offset);
974
975 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
976 Ok(())
977 }
978 }
979 unsafe impl fidl::encoding::TypeMarker for NetworkConfigChangeError {
980 type Owned = Self;
981
982 #[inline(always)]
983 fn inline_align(_context: fidl::encoding::Context) -> usize {
984 std::mem::align_of::<u32>()
985 }
986
987 #[inline(always)]
988 fn inline_size(_context: fidl::encoding::Context) -> usize {
989 std::mem::size_of::<u32>()
990 }
991
992 #[inline(always)]
993 fn encode_is_copy() -> bool {
994 true
995 }
996
997 #[inline(always)]
998 fn decode_is_copy() -> bool {
999 false
1000 }
1001 }
1002
1003 impl fidl::encoding::ValueTypeMarker for NetworkConfigChangeError {
1004 type Borrowed<'a> = Self;
1005 #[inline(always)]
1006 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1007 *value
1008 }
1009 }
1010
1011 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1012 for NetworkConfigChangeError
1013 {
1014 #[inline]
1015 unsafe fn encode(
1016 self,
1017 encoder: &mut fidl::encoding::Encoder<'_, D>,
1018 offset: usize,
1019 _depth: fidl::encoding::Depth,
1020 ) -> fidl::Result<()> {
1021 encoder.debug_check_bounds::<Self>(offset);
1022 encoder.write_num(self.into_primitive(), offset);
1023 Ok(())
1024 }
1025 }
1026
1027 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1028 for NetworkConfigChangeError
1029 {
1030 #[inline(always)]
1031 fn new_empty() -> Self {
1032 Self::GeneralError
1033 }
1034
1035 #[inline]
1036 unsafe fn decode(
1037 &mut self,
1038 decoder: &mut fidl::encoding::Decoder<'_, D>,
1039 offset: usize,
1040 _depth: fidl::encoding::Depth,
1041 ) -> fidl::Result<()> {
1042 decoder.debug_check_bounds::<Self>(offset);
1043 let prim = decoder.read_num::<u32>(offset);
1044
1045 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1046 Ok(())
1047 }
1048 }
1049 unsafe impl fidl::encoding::TypeMarker for OperatingBand {
1050 type Owned = Self;
1051
1052 #[inline(always)]
1053 fn inline_align(_context: fidl::encoding::Context) -> usize {
1054 std::mem::align_of::<u32>()
1055 }
1056
1057 #[inline(always)]
1058 fn inline_size(_context: fidl::encoding::Context) -> usize {
1059 std::mem::size_of::<u32>()
1060 }
1061
1062 #[inline(always)]
1063 fn encode_is_copy() -> bool {
1064 true
1065 }
1066
1067 #[inline(always)]
1068 fn decode_is_copy() -> bool {
1069 false
1070 }
1071 }
1072
1073 impl fidl::encoding::ValueTypeMarker for OperatingBand {
1074 type Borrowed<'a> = Self;
1075 #[inline(always)]
1076 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1077 *value
1078 }
1079 }
1080
1081 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OperatingBand {
1082 #[inline]
1083 unsafe fn encode(
1084 self,
1085 encoder: &mut fidl::encoding::Encoder<'_, D>,
1086 offset: usize,
1087 _depth: fidl::encoding::Depth,
1088 ) -> fidl::Result<()> {
1089 encoder.debug_check_bounds::<Self>(offset);
1090 encoder.write_num(self.into_primitive(), offset);
1091 Ok(())
1092 }
1093 }
1094
1095 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OperatingBand {
1096 #[inline(always)]
1097 fn new_empty() -> Self {
1098 Self::Any
1099 }
1100
1101 #[inline]
1102 unsafe fn decode(
1103 &mut self,
1104 decoder: &mut fidl::encoding::Decoder<'_, D>,
1105 offset: usize,
1106 _depth: fidl::encoding::Depth,
1107 ) -> fidl::Result<()> {
1108 decoder.debug_check_bounds::<Self>(offset);
1109 let prim = decoder.read_num::<u32>(offset);
1110
1111 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1112 Ok(())
1113 }
1114 }
1115 unsafe impl fidl::encoding::TypeMarker for OperatingState {
1116 type Owned = Self;
1117
1118 #[inline(always)]
1119 fn inline_align(_context: fidl::encoding::Context) -> usize {
1120 std::mem::align_of::<u32>()
1121 }
1122
1123 #[inline(always)]
1124 fn inline_size(_context: fidl::encoding::Context) -> usize {
1125 std::mem::size_of::<u32>()
1126 }
1127
1128 #[inline(always)]
1129 fn encode_is_copy() -> bool {
1130 true
1131 }
1132
1133 #[inline(always)]
1134 fn decode_is_copy() -> bool {
1135 false
1136 }
1137 }
1138
1139 impl fidl::encoding::ValueTypeMarker for OperatingState {
1140 type Borrowed<'a> = Self;
1141 #[inline(always)]
1142 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1143 *value
1144 }
1145 }
1146
1147 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OperatingState {
1148 #[inline]
1149 unsafe fn encode(
1150 self,
1151 encoder: &mut fidl::encoding::Encoder<'_, D>,
1152 offset: usize,
1153 _depth: fidl::encoding::Depth,
1154 ) -> fidl::Result<()> {
1155 encoder.debug_check_bounds::<Self>(offset);
1156 encoder.write_num(self.into_primitive(), offset);
1157 Ok(())
1158 }
1159 }
1160
1161 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OperatingState {
1162 #[inline(always)]
1163 fn new_empty() -> Self {
1164 Self::Failed
1165 }
1166
1167 #[inline]
1168 unsafe fn decode(
1169 &mut self,
1170 decoder: &mut fidl::encoding::Decoder<'_, D>,
1171 offset: usize,
1172 _depth: fidl::encoding::Depth,
1173 ) -> fidl::Result<()> {
1174 decoder.debug_check_bounds::<Self>(offset);
1175 let prim = decoder.read_num::<u32>(offset);
1176
1177 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1178 Ok(())
1179 }
1180 }
1181 unsafe impl fidl::encoding::TypeMarker for RequestStatus {
1182 type Owned = Self;
1183
1184 #[inline(always)]
1185 fn inline_align(_context: fidl::encoding::Context) -> usize {
1186 std::mem::align_of::<u32>()
1187 }
1188
1189 #[inline(always)]
1190 fn inline_size(_context: fidl::encoding::Context) -> usize {
1191 std::mem::size_of::<u32>()
1192 }
1193
1194 #[inline(always)]
1195 fn encode_is_copy() -> bool {
1196 true
1197 }
1198
1199 #[inline(always)]
1200 fn decode_is_copy() -> bool {
1201 false
1202 }
1203 }
1204
1205 impl fidl::encoding::ValueTypeMarker for RequestStatus {
1206 type Borrowed<'a> = Self;
1207 #[inline(always)]
1208 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1209 *value
1210 }
1211 }
1212
1213 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RequestStatus {
1214 #[inline]
1215 unsafe fn encode(
1216 self,
1217 encoder: &mut fidl::encoding::Encoder<'_, D>,
1218 offset: usize,
1219 _depth: fidl::encoding::Depth,
1220 ) -> fidl::Result<()> {
1221 encoder.debug_check_bounds::<Self>(offset);
1222 encoder.write_num(self.into_primitive(), offset);
1223 Ok(())
1224 }
1225 }
1226
1227 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RequestStatus {
1228 #[inline(always)]
1229 fn new_empty() -> Self {
1230 Self::Acknowledged
1231 }
1232
1233 #[inline]
1234 unsafe fn decode(
1235 &mut self,
1236 decoder: &mut fidl::encoding::Decoder<'_, D>,
1237 offset: usize,
1238 _depth: fidl::encoding::Depth,
1239 ) -> fidl::Result<()> {
1240 decoder.debug_check_bounds::<Self>(offset);
1241 let prim = decoder.read_num::<u32>(offset);
1242
1243 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1244 Ok(())
1245 }
1246 }
1247 unsafe impl fidl::encoding::TypeMarker for ScanErrorCode {
1248 type Owned = Self;
1249
1250 #[inline(always)]
1251 fn inline_align(_context: fidl::encoding::Context) -> usize {
1252 std::mem::align_of::<u32>()
1253 }
1254
1255 #[inline(always)]
1256 fn inline_size(_context: fidl::encoding::Context) -> usize {
1257 std::mem::size_of::<u32>()
1258 }
1259
1260 #[inline(always)]
1261 fn encode_is_copy() -> bool {
1262 true
1263 }
1264
1265 #[inline(always)]
1266 fn decode_is_copy() -> bool {
1267 false
1268 }
1269 }
1270
1271 impl fidl::encoding::ValueTypeMarker for ScanErrorCode {
1272 type Borrowed<'a> = Self;
1273 #[inline(always)]
1274 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1275 *value
1276 }
1277 }
1278
1279 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanErrorCode {
1280 #[inline]
1281 unsafe fn encode(
1282 self,
1283 encoder: &mut fidl::encoding::Encoder<'_, D>,
1284 offset: usize,
1285 _depth: fidl::encoding::Depth,
1286 ) -> fidl::Result<()> {
1287 encoder.debug_check_bounds::<Self>(offset);
1288 encoder.write_num(self.into_primitive(), offset);
1289 Ok(())
1290 }
1291 }
1292
1293 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanErrorCode {
1294 #[inline(always)]
1295 fn new_empty() -> Self {
1296 Self::GeneralError
1297 }
1298
1299 #[inline]
1300 unsafe fn decode(
1301 &mut self,
1302 decoder: &mut fidl::encoding::Decoder<'_, D>,
1303 offset: usize,
1304 _depth: fidl::encoding::Depth,
1305 ) -> fidl::Result<()> {
1306 decoder.debug_check_bounds::<Self>(offset);
1307 let prim = decoder.read_num::<u32>(offset);
1308
1309 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1310 Ok(())
1311 }
1312 }
1313 unsafe impl fidl::encoding::TypeMarker for SecurityType {
1314 type Owned = Self;
1315
1316 #[inline(always)]
1317 fn inline_align(_context: fidl::encoding::Context) -> usize {
1318 std::mem::align_of::<u32>()
1319 }
1320
1321 #[inline(always)]
1322 fn inline_size(_context: fidl::encoding::Context) -> usize {
1323 std::mem::size_of::<u32>()
1324 }
1325
1326 #[inline(always)]
1327 fn encode_is_copy() -> bool {
1328 true
1329 }
1330
1331 #[inline(always)]
1332 fn decode_is_copy() -> bool {
1333 false
1334 }
1335 }
1336
1337 impl fidl::encoding::ValueTypeMarker for SecurityType {
1338 type Borrowed<'a> = Self;
1339 #[inline(always)]
1340 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1341 *value
1342 }
1343 }
1344
1345 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SecurityType {
1346 #[inline]
1347 unsafe fn encode(
1348 self,
1349 encoder: &mut fidl::encoding::Encoder<'_, D>,
1350 offset: usize,
1351 _depth: fidl::encoding::Depth,
1352 ) -> fidl::Result<()> {
1353 encoder.debug_check_bounds::<Self>(offset);
1354 encoder.write_num(self.into_primitive(), offset);
1355 Ok(())
1356 }
1357 }
1358
1359 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecurityType {
1360 #[inline(always)]
1361 fn new_empty() -> Self {
1362 Self::None
1363 }
1364
1365 #[inline]
1366 unsafe fn decode(
1367 &mut self,
1368 decoder: &mut fidl::encoding::Decoder<'_, D>,
1369 offset: usize,
1370 _depth: fidl::encoding::Depth,
1371 ) -> fidl::Result<()> {
1372 decoder.debug_check_bounds::<Self>(offset);
1373 let prim = decoder.read_num::<u32>(offset);
1374
1375 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1376 Ok(())
1377 }
1378 }
1379 unsafe impl fidl::encoding::TypeMarker for WlanClientState {
1380 type Owned = Self;
1381
1382 #[inline(always)]
1383 fn inline_align(_context: fidl::encoding::Context) -> usize {
1384 std::mem::align_of::<u32>()
1385 }
1386
1387 #[inline(always)]
1388 fn inline_size(_context: fidl::encoding::Context) -> usize {
1389 std::mem::size_of::<u32>()
1390 }
1391
1392 #[inline(always)]
1393 fn encode_is_copy() -> bool {
1394 true
1395 }
1396
1397 #[inline(always)]
1398 fn decode_is_copy() -> bool {
1399 false
1400 }
1401 }
1402
1403 impl fidl::encoding::ValueTypeMarker for WlanClientState {
1404 type Borrowed<'a> = Self;
1405 #[inline(always)]
1406 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1407 *value
1408 }
1409 }
1410
1411 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1412 for WlanClientState
1413 {
1414 #[inline]
1415 unsafe fn encode(
1416 self,
1417 encoder: &mut fidl::encoding::Encoder<'_, D>,
1418 offset: usize,
1419 _depth: fidl::encoding::Depth,
1420 ) -> fidl::Result<()> {
1421 encoder.debug_check_bounds::<Self>(offset);
1422 encoder.write_num(self.into_primitive(), offset);
1423 Ok(())
1424 }
1425 }
1426
1427 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanClientState {
1428 #[inline(always)]
1429 fn new_empty() -> Self {
1430 Self::ConnectionsDisabled
1431 }
1432
1433 #[inline]
1434 unsafe fn decode(
1435 &mut self,
1436 decoder: &mut fidl::encoding::Decoder<'_, D>,
1437 offset: usize,
1438 _depth: fidl::encoding::Depth,
1439 ) -> fidl::Result<()> {
1440 decoder.debug_check_bounds::<Self>(offset);
1441 let prim = decoder.read_num::<u32>(offset);
1442
1443 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1444 Ok(())
1445 }
1446 }
1447
1448 impl fidl::encoding::ValueTypeMarker for AccessPointControllerStartAccessPointRequest {
1449 type Borrowed<'a> = &'a Self;
1450 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1451 value
1452 }
1453 }
1454
1455 unsafe impl fidl::encoding::TypeMarker for AccessPointControllerStartAccessPointRequest {
1456 type Owned = Self;
1457
1458 #[inline(always)]
1459 fn inline_align(_context: fidl::encoding::Context) -> usize {
1460 8
1461 }
1462
1463 #[inline(always)]
1464 fn inline_size(_context: fidl::encoding::Context) -> usize {
1465 24
1466 }
1467 }
1468
1469 unsafe impl<D: fidl::encoding::ResourceDialect>
1470 fidl::encoding::Encode<AccessPointControllerStartAccessPointRequest, D>
1471 for &AccessPointControllerStartAccessPointRequest
1472 {
1473 #[inline]
1474 unsafe fn encode(
1475 self,
1476 encoder: &mut fidl::encoding::Encoder<'_, D>,
1477 offset: usize,
1478 _depth: fidl::encoding::Depth,
1479 ) -> fidl::Result<()> {
1480 encoder.debug_check_bounds::<AccessPointControllerStartAccessPointRequest>(offset);
1481 fidl::encoding::Encode::<AccessPointControllerStartAccessPointRequest, D>::encode(
1483 (
1484 <NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
1485 <ConnectivityMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
1486 <OperatingBand as fidl::encoding::ValueTypeMarker>::borrow(&self.band),
1487 ),
1488 encoder,
1489 offset,
1490 _depth,
1491 )
1492 }
1493 }
1494 unsafe impl<
1495 D: fidl::encoding::ResourceDialect,
1496 T0: fidl::encoding::Encode<NetworkConfig, D>,
1497 T1: fidl::encoding::Encode<ConnectivityMode, D>,
1498 T2: fidl::encoding::Encode<OperatingBand, D>,
1499 > fidl::encoding::Encode<AccessPointControllerStartAccessPointRequest, D> for (T0, T1, T2)
1500 {
1501 #[inline]
1502 unsafe fn encode(
1503 self,
1504 encoder: &mut fidl::encoding::Encoder<'_, D>,
1505 offset: usize,
1506 depth: fidl::encoding::Depth,
1507 ) -> fidl::Result<()> {
1508 encoder.debug_check_bounds::<AccessPointControllerStartAccessPointRequest>(offset);
1509 self.0.encode(encoder, offset + 0, depth)?;
1513 self.1.encode(encoder, offset + 16, depth)?;
1514 self.2.encode(encoder, offset + 20, depth)?;
1515 Ok(())
1516 }
1517 }
1518
1519 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1520 for AccessPointControllerStartAccessPointRequest
1521 {
1522 #[inline(always)]
1523 fn new_empty() -> Self {
1524 Self {
1525 config: fidl::new_empty!(NetworkConfig, D),
1526 mode: fidl::new_empty!(ConnectivityMode, D),
1527 band: fidl::new_empty!(OperatingBand, D),
1528 }
1529 }
1530
1531 #[inline]
1532 unsafe fn decode(
1533 &mut self,
1534 decoder: &mut fidl::encoding::Decoder<'_, D>,
1535 offset: usize,
1536 _depth: fidl::encoding::Depth,
1537 ) -> fidl::Result<()> {
1538 decoder.debug_check_bounds::<Self>(offset);
1539 fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
1541 fidl::decode!(ConnectivityMode, D, &mut self.mode, decoder, offset + 16, _depth)?;
1542 fidl::decode!(OperatingBand, D, &mut self.band, decoder, offset + 20, _depth)?;
1543 Ok(())
1544 }
1545 }
1546
1547 impl fidl::encoding::ValueTypeMarker for AccessPointControllerStartAccessPointResponse {
1548 type Borrowed<'a> = &'a Self;
1549 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1550 value
1551 }
1552 }
1553
1554 unsafe impl fidl::encoding::TypeMarker for AccessPointControllerStartAccessPointResponse {
1555 type Owned = Self;
1556
1557 #[inline(always)]
1558 fn inline_align(_context: fidl::encoding::Context) -> usize {
1559 4
1560 }
1561
1562 #[inline(always)]
1563 fn inline_size(_context: fidl::encoding::Context) -> usize {
1564 4
1565 }
1566 }
1567
1568 unsafe impl<D: fidl::encoding::ResourceDialect>
1569 fidl::encoding::Encode<AccessPointControllerStartAccessPointResponse, D>
1570 for &AccessPointControllerStartAccessPointResponse
1571 {
1572 #[inline]
1573 unsafe fn encode(
1574 self,
1575 encoder: &mut fidl::encoding::Encoder<'_, D>,
1576 offset: usize,
1577 _depth: fidl::encoding::Depth,
1578 ) -> fidl::Result<()> {
1579 encoder.debug_check_bounds::<AccessPointControllerStartAccessPointResponse>(offset);
1580 fidl::encoding::Encode::<AccessPointControllerStartAccessPointResponse, D>::encode(
1582 (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1583 encoder,
1584 offset,
1585 _depth,
1586 )
1587 }
1588 }
1589 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
1590 fidl::encoding::Encode<AccessPointControllerStartAccessPointResponse, D> for (T0,)
1591 {
1592 #[inline]
1593 unsafe fn encode(
1594 self,
1595 encoder: &mut fidl::encoding::Encoder<'_, D>,
1596 offset: usize,
1597 depth: fidl::encoding::Depth,
1598 ) -> fidl::Result<()> {
1599 encoder.debug_check_bounds::<AccessPointControllerStartAccessPointResponse>(offset);
1600 self.0.encode(encoder, offset + 0, depth)?;
1604 Ok(())
1605 }
1606 }
1607
1608 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1609 for AccessPointControllerStartAccessPointResponse
1610 {
1611 #[inline(always)]
1612 fn new_empty() -> Self {
1613 Self { status: fidl::new_empty!(RequestStatus, D) }
1614 }
1615
1616 #[inline]
1617 unsafe fn decode(
1618 &mut self,
1619 decoder: &mut fidl::encoding::Decoder<'_, D>,
1620 offset: usize,
1621 _depth: fidl::encoding::Depth,
1622 ) -> fidl::Result<()> {
1623 decoder.debug_check_bounds::<Self>(offset);
1624 fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1626 Ok(())
1627 }
1628 }
1629
1630 impl fidl::encoding::ValueTypeMarker for AccessPointControllerStopAccessPointRequest {
1631 type Borrowed<'a> = &'a Self;
1632 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1633 value
1634 }
1635 }
1636
1637 unsafe impl fidl::encoding::TypeMarker for AccessPointControllerStopAccessPointRequest {
1638 type Owned = Self;
1639
1640 #[inline(always)]
1641 fn inline_align(_context: fidl::encoding::Context) -> usize {
1642 8
1643 }
1644
1645 #[inline(always)]
1646 fn inline_size(_context: fidl::encoding::Context) -> usize {
1647 16
1648 }
1649 }
1650
1651 unsafe impl<D: fidl::encoding::ResourceDialect>
1652 fidl::encoding::Encode<AccessPointControllerStopAccessPointRequest, D>
1653 for &AccessPointControllerStopAccessPointRequest
1654 {
1655 #[inline]
1656 unsafe fn encode(
1657 self,
1658 encoder: &mut fidl::encoding::Encoder<'_, D>,
1659 offset: usize,
1660 _depth: fidl::encoding::Depth,
1661 ) -> fidl::Result<()> {
1662 encoder.debug_check_bounds::<AccessPointControllerStopAccessPointRequest>(offset);
1663 fidl::encoding::Encode::<AccessPointControllerStopAccessPointRequest, D>::encode(
1665 (<NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
1666 encoder,
1667 offset,
1668 _depth,
1669 )
1670 }
1671 }
1672 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkConfig, D>>
1673 fidl::encoding::Encode<AccessPointControllerStopAccessPointRequest, D> for (T0,)
1674 {
1675 #[inline]
1676 unsafe fn encode(
1677 self,
1678 encoder: &mut fidl::encoding::Encoder<'_, D>,
1679 offset: usize,
1680 depth: fidl::encoding::Depth,
1681 ) -> fidl::Result<()> {
1682 encoder.debug_check_bounds::<AccessPointControllerStopAccessPointRequest>(offset);
1683 self.0.encode(encoder, offset + 0, depth)?;
1687 Ok(())
1688 }
1689 }
1690
1691 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1692 for AccessPointControllerStopAccessPointRequest
1693 {
1694 #[inline(always)]
1695 fn new_empty() -> Self {
1696 Self { config: fidl::new_empty!(NetworkConfig, D) }
1697 }
1698
1699 #[inline]
1700 unsafe fn decode(
1701 &mut self,
1702 decoder: &mut fidl::encoding::Decoder<'_, D>,
1703 offset: usize,
1704 _depth: fidl::encoding::Depth,
1705 ) -> fidl::Result<()> {
1706 decoder.debug_check_bounds::<Self>(offset);
1707 fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
1709 Ok(())
1710 }
1711 }
1712
1713 impl fidl::encoding::ValueTypeMarker for AccessPointControllerStopAccessPointResponse {
1714 type Borrowed<'a> = &'a Self;
1715 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1716 value
1717 }
1718 }
1719
1720 unsafe impl fidl::encoding::TypeMarker for AccessPointControllerStopAccessPointResponse {
1721 type Owned = Self;
1722
1723 #[inline(always)]
1724 fn inline_align(_context: fidl::encoding::Context) -> usize {
1725 4
1726 }
1727
1728 #[inline(always)]
1729 fn inline_size(_context: fidl::encoding::Context) -> usize {
1730 4
1731 }
1732 }
1733
1734 unsafe impl<D: fidl::encoding::ResourceDialect>
1735 fidl::encoding::Encode<AccessPointControllerStopAccessPointResponse, D>
1736 for &AccessPointControllerStopAccessPointResponse
1737 {
1738 #[inline]
1739 unsafe fn encode(
1740 self,
1741 encoder: &mut fidl::encoding::Encoder<'_, D>,
1742 offset: usize,
1743 _depth: fidl::encoding::Depth,
1744 ) -> fidl::Result<()> {
1745 encoder.debug_check_bounds::<AccessPointControllerStopAccessPointResponse>(offset);
1746 fidl::encoding::Encode::<AccessPointControllerStopAccessPointResponse, D>::encode(
1748 (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1749 encoder,
1750 offset,
1751 _depth,
1752 )
1753 }
1754 }
1755 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
1756 fidl::encoding::Encode<AccessPointControllerStopAccessPointResponse, D> for (T0,)
1757 {
1758 #[inline]
1759 unsafe fn encode(
1760 self,
1761 encoder: &mut fidl::encoding::Encoder<'_, D>,
1762 offset: usize,
1763 depth: fidl::encoding::Depth,
1764 ) -> fidl::Result<()> {
1765 encoder.debug_check_bounds::<AccessPointControllerStopAccessPointResponse>(offset);
1766 self.0.encode(encoder, offset + 0, depth)?;
1770 Ok(())
1771 }
1772 }
1773
1774 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1775 for AccessPointControllerStopAccessPointResponse
1776 {
1777 #[inline(always)]
1778 fn new_empty() -> Self {
1779 Self { status: fidl::new_empty!(RequestStatus, D) }
1780 }
1781
1782 #[inline]
1783 unsafe fn decode(
1784 &mut self,
1785 decoder: &mut fidl::encoding::Decoder<'_, D>,
1786 offset: usize,
1787 _depth: fidl::encoding::Depth,
1788 ) -> fidl::Result<()> {
1789 decoder.debug_check_bounds::<Self>(offset);
1790 fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1792 Ok(())
1793 }
1794 }
1795
1796 impl fidl::encoding::ValueTypeMarker for AccessPointStateUpdatesOnAccessPointStateUpdateRequest {
1797 type Borrowed<'a> = &'a Self;
1798 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1799 value
1800 }
1801 }
1802
1803 unsafe impl fidl::encoding::TypeMarker for AccessPointStateUpdatesOnAccessPointStateUpdateRequest {
1804 type Owned = Self;
1805
1806 #[inline(always)]
1807 fn inline_align(_context: fidl::encoding::Context) -> usize {
1808 8
1809 }
1810
1811 #[inline(always)]
1812 fn inline_size(_context: fidl::encoding::Context) -> usize {
1813 16
1814 }
1815 }
1816
1817 unsafe impl<D: fidl::encoding::ResourceDialect>
1818 fidl::encoding::Encode<AccessPointStateUpdatesOnAccessPointStateUpdateRequest, D>
1819 for &AccessPointStateUpdatesOnAccessPointStateUpdateRequest
1820 {
1821 #[inline]
1822 unsafe fn encode(
1823 self,
1824 encoder: &mut fidl::encoding::Encoder<'_, D>,
1825 offset: usize,
1826 _depth: fidl::encoding::Depth,
1827 ) -> fidl::Result<()> {
1828 encoder.debug_check_bounds::<AccessPointStateUpdatesOnAccessPointStateUpdateRequest>(
1829 offset,
1830 );
1831 fidl::encoding::Encode::<AccessPointStateUpdatesOnAccessPointStateUpdateRequest, D>::encode(
1833 (
1834 <fidl::encoding::UnboundedVector<AccessPointState> as fidl::encoding::ValueTypeMarker>::borrow(&self.access_points),
1835 ),
1836 encoder, offset, _depth
1837 )
1838 }
1839 }
1840 unsafe impl<
1841 D: fidl::encoding::ResourceDialect,
1842 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<AccessPointState>, D>,
1843 > fidl::encoding::Encode<AccessPointStateUpdatesOnAccessPointStateUpdateRequest, D>
1844 for (T0,)
1845 {
1846 #[inline]
1847 unsafe fn encode(
1848 self,
1849 encoder: &mut fidl::encoding::Encoder<'_, D>,
1850 offset: usize,
1851 depth: fidl::encoding::Depth,
1852 ) -> fidl::Result<()> {
1853 encoder.debug_check_bounds::<AccessPointStateUpdatesOnAccessPointStateUpdateRequest>(
1854 offset,
1855 );
1856 self.0.encode(encoder, offset + 0, depth)?;
1860 Ok(())
1861 }
1862 }
1863
1864 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1865 for AccessPointStateUpdatesOnAccessPointStateUpdateRequest
1866 {
1867 #[inline(always)]
1868 fn new_empty() -> Self {
1869 Self {
1870 access_points: fidl::new_empty!(
1871 fidl::encoding::UnboundedVector<AccessPointState>,
1872 D
1873 ),
1874 }
1875 }
1876
1877 #[inline]
1878 unsafe fn decode(
1879 &mut self,
1880 decoder: &mut fidl::encoding::Decoder<'_, D>,
1881 offset: usize,
1882 _depth: fidl::encoding::Depth,
1883 ) -> fidl::Result<()> {
1884 decoder.debug_check_bounds::<Self>(offset);
1885 fidl::decode!(
1887 fidl::encoding::UnboundedVector<AccessPointState>,
1888 D,
1889 &mut self.access_points,
1890 decoder,
1891 offset + 0,
1892 _depth
1893 )?;
1894 Ok(())
1895 }
1896 }
1897
1898 impl fidl::encoding::ValueTypeMarker for ClientControllerConnectRequest {
1899 type Borrowed<'a> = &'a Self;
1900 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1901 value
1902 }
1903 }
1904
1905 unsafe impl fidl::encoding::TypeMarker for ClientControllerConnectRequest {
1906 type Owned = Self;
1907
1908 #[inline(always)]
1909 fn inline_align(_context: fidl::encoding::Context) -> usize {
1910 8
1911 }
1912
1913 #[inline(always)]
1914 fn inline_size(_context: fidl::encoding::Context) -> usize {
1915 24
1916 }
1917 }
1918
1919 unsafe impl<D: fidl::encoding::ResourceDialect>
1920 fidl::encoding::Encode<ClientControllerConnectRequest, D>
1921 for &ClientControllerConnectRequest
1922 {
1923 #[inline]
1924 unsafe fn encode(
1925 self,
1926 encoder: &mut fidl::encoding::Encoder<'_, D>,
1927 offset: usize,
1928 _depth: fidl::encoding::Depth,
1929 ) -> fidl::Result<()> {
1930 encoder.debug_check_bounds::<ClientControllerConnectRequest>(offset);
1931 fidl::encoding::Encode::<ClientControllerConnectRequest, D>::encode(
1933 (<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow(&self.id),),
1934 encoder,
1935 offset,
1936 _depth,
1937 )
1938 }
1939 }
1940 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkIdentifier, D>>
1941 fidl::encoding::Encode<ClientControllerConnectRequest, D> for (T0,)
1942 {
1943 #[inline]
1944 unsafe fn encode(
1945 self,
1946 encoder: &mut fidl::encoding::Encoder<'_, D>,
1947 offset: usize,
1948 depth: fidl::encoding::Depth,
1949 ) -> fidl::Result<()> {
1950 encoder.debug_check_bounds::<ClientControllerConnectRequest>(offset);
1951 self.0.encode(encoder, offset + 0, depth)?;
1955 Ok(())
1956 }
1957 }
1958
1959 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1960 for ClientControllerConnectRequest
1961 {
1962 #[inline(always)]
1963 fn new_empty() -> Self {
1964 Self { id: fidl::new_empty!(NetworkIdentifier, D) }
1965 }
1966
1967 #[inline]
1968 unsafe fn decode(
1969 &mut self,
1970 decoder: &mut fidl::encoding::Decoder<'_, D>,
1971 offset: usize,
1972 _depth: fidl::encoding::Depth,
1973 ) -> fidl::Result<()> {
1974 decoder.debug_check_bounds::<Self>(offset);
1975 fidl::decode!(NetworkIdentifier, D, &mut self.id, decoder, offset + 0, _depth)?;
1977 Ok(())
1978 }
1979 }
1980
1981 impl fidl::encoding::ValueTypeMarker for ClientControllerConnectResponse {
1982 type Borrowed<'a> = &'a Self;
1983 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1984 value
1985 }
1986 }
1987
1988 unsafe impl fidl::encoding::TypeMarker for ClientControllerConnectResponse {
1989 type Owned = Self;
1990
1991 #[inline(always)]
1992 fn inline_align(_context: fidl::encoding::Context) -> usize {
1993 4
1994 }
1995
1996 #[inline(always)]
1997 fn inline_size(_context: fidl::encoding::Context) -> usize {
1998 4
1999 }
2000 }
2001
2002 unsafe impl<D: fidl::encoding::ResourceDialect>
2003 fidl::encoding::Encode<ClientControllerConnectResponse, D>
2004 for &ClientControllerConnectResponse
2005 {
2006 #[inline]
2007 unsafe fn encode(
2008 self,
2009 encoder: &mut fidl::encoding::Encoder<'_, D>,
2010 offset: usize,
2011 _depth: fidl::encoding::Depth,
2012 ) -> fidl::Result<()> {
2013 encoder.debug_check_bounds::<ClientControllerConnectResponse>(offset);
2014 fidl::encoding::Encode::<ClientControllerConnectResponse, D>::encode(
2016 (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2017 encoder,
2018 offset,
2019 _depth,
2020 )
2021 }
2022 }
2023 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2024 fidl::encoding::Encode<ClientControllerConnectResponse, D> for (T0,)
2025 {
2026 #[inline]
2027 unsafe fn encode(
2028 self,
2029 encoder: &mut fidl::encoding::Encoder<'_, D>,
2030 offset: usize,
2031 depth: fidl::encoding::Depth,
2032 ) -> fidl::Result<()> {
2033 encoder.debug_check_bounds::<ClientControllerConnectResponse>(offset);
2034 self.0.encode(encoder, offset + 0, depth)?;
2038 Ok(())
2039 }
2040 }
2041
2042 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2043 for ClientControllerConnectResponse
2044 {
2045 #[inline(always)]
2046 fn new_empty() -> Self {
2047 Self { status: fidl::new_empty!(RequestStatus, D) }
2048 }
2049
2050 #[inline]
2051 unsafe fn decode(
2052 &mut self,
2053 decoder: &mut fidl::encoding::Decoder<'_, D>,
2054 offset: usize,
2055 _depth: fidl::encoding::Depth,
2056 ) -> fidl::Result<()> {
2057 decoder.debug_check_bounds::<Self>(offset);
2058 fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2060 Ok(())
2061 }
2062 }
2063
2064 impl fidl::encoding::ValueTypeMarker for ClientControllerRemoveNetworkRequest {
2065 type Borrowed<'a> = &'a Self;
2066 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2067 value
2068 }
2069 }
2070
2071 unsafe impl fidl::encoding::TypeMarker for ClientControllerRemoveNetworkRequest {
2072 type Owned = Self;
2073
2074 #[inline(always)]
2075 fn inline_align(_context: fidl::encoding::Context) -> usize {
2076 8
2077 }
2078
2079 #[inline(always)]
2080 fn inline_size(_context: fidl::encoding::Context) -> usize {
2081 16
2082 }
2083 }
2084
2085 unsafe impl<D: fidl::encoding::ResourceDialect>
2086 fidl::encoding::Encode<ClientControllerRemoveNetworkRequest, D>
2087 for &ClientControllerRemoveNetworkRequest
2088 {
2089 #[inline]
2090 unsafe fn encode(
2091 self,
2092 encoder: &mut fidl::encoding::Encoder<'_, D>,
2093 offset: usize,
2094 _depth: fidl::encoding::Depth,
2095 ) -> fidl::Result<()> {
2096 encoder.debug_check_bounds::<ClientControllerRemoveNetworkRequest>(offset);
2097 fidl::encoding::Encode::<ClientControllerRemoveNetworkRequest, D>::encode(
2099 (<NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2100 encoder,
2101 offset,
2102 _depth,
2103 )
2104 }
2105 }
2106 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkConfig, D>>
2107 fidl::encoding::Encode<ClientControllerRemoveNetworkRequest, D> for (T0,)
2108 {
2109 #[inline]
2110 unsafe fn encode(
2111 self,
2112 encoder: &mut fidl::encoding::Encoder<'_, D>,
2113 offset: usize,
2114 depth: fidl::encoding::Depth,
2115 ) -> fidl::Result<()> {
2116 encoder.debug_check_bounds::<ClientControllerRemoveNetworkRequest>(offset);
2117 self.0.encode(encoder, offset + 0, depth)?;
2121 Ok(())
2122 }
2123 }
2124
2125 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2126 for ClientControllerRemoveNetworkRequest
2127 {
2128 #[inline(always)]
2129 fn new_empty() -> Self {
2130 Self { config: fidl::new_empty!(NetworkConfig, D) }
2131 }
2132
2133 #[inline]
2134 unsafe fn decode(
2135 &mut self,
2136 decoder: &mut fidl::encoding::Decoder<'_, D>,
2137 offset: usize,
2138 _depth: fidl::encoding::Depth,
2139 ) -> fidl::Result<()> {
2140 decoder.debug_check_bounds::<Self>(offset);
2141 fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
2143 Ok(())
2144 }
2145 }
2146
2147 impl fidl::encoding::ValueTypeMarker for ClientControllerSaveNetworkRequest {
2148 type Borrowed<'a> = &'a Self;
2149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2150 value
2151 }
2152 }
2153
2154 unsafe impl fidl::encoding::TypeMarker for ClientControllerSaveNetworkRequest {
2155 type Owned = Self;
2156
2157 #[inline(always)]
2158 fn inline_align(_context: fidl::encoding::Context) -> usize {
2159 8
2160 }
2161
2162 #[inline(always)]
2163 fn inline_size(_context: fidl::encoding::Context) -> usize {
2164 16
2165 }
2166 }
2167
2168 unsafe impl<D: fidl::encoding::ResourceDialect>
2169 fidl::encoding::Encode<ClientControllerSaveNetworkRequest, D>
2170 for &ClientControllerSaveNetworkRequest
2171 {
2172 #[inline]
2173 unsafe fn encode(
2174 self,
2175 encoder: &mut fidl::encoding::Encoder<'_, D>,
2176 offset: usize,
2177 _depth: fidl::encoding::Depth,
2178 ) -> fidl::Result<()> {
2179 encoder.debug_check_bounds::<ClientControllerSaveNetworkRequest>(offset);
2180 fidl::encoding::Encode::<ClientControllerSaveNetworkRequest, D>::encode(
2182 (<NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2183 encoder,
2184 offset,
2185 _depth,
2186 )
2187 }
2188 }
2189 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkConfig, D>>
2190 fidl::encoding::Encode<ClientControllerSaveNetworkRequest, D> for (T0,)
2191 {
2192 #[inline]
2193 unsafe fn encode(
2194 self,
2195 encoder: &mut fidl::encoding::Encoder<'_, D>,
2196 offset: usize,
2197 depth: fidl::encoding::Depth,
2198 ) -> fidl::Result<()> {
2199 encoder.debug_check_bounds::<ClientControllerSaveNetworkRequest>(offset);
2200 self.0.encode(encoder, offset + 0, depth)?;
2204 Ok(())
2205 }
2206 }
2207
2208 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2209 for ClientControllerSaveNetworkRequest
2210 {
2211 #[inline(always)]
2212 fn new_empty() -> Self {
2213 Self { config: fidl::new_empty!(NetworkConfig, D) }
2214 }
2215
2216 #[inline]
2217 unsafe fn decode(
2218 &mut self,
2219 decoder: &mut fidl::encoding::Decoder<'_, D>,
2220 offset: usize,
2221 _depth: fidl::encoding::Depth,
2222 ) -> fidl::Result<()> {
2223 decoder.debug_check_bounds::<Self>(offset);
2224 fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
2226 Ok(())
2227 }
2228 }
2229
2230 impl fidl::encoding::ValueTypeMarker for ClientControllerStartClientConnectionsResponse {
2231 type Borrowed<'a> = &'a Self;
2232 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2233 value
2234 }
2235 }
2236
2237 unsafe impl fidl::encoding::TypeMarker for ClientControllerStartClientConnectionsResponse {
2238 type Owned = Self;
2239
2240 #[inline(always)]
2241 fn inline_align(_context: fidl::encoding::Context) -> usize {
2242 4
2243 }
2244
2245 #[inline(always)]
2246 fn inline_size(_context: fidl::encoding::Context) -> usize {
2247 4
2248 }
2249 }
2250
2251 unsafe impl<D: fidl::encoding::ResourceDialect>
2252 fidl::encoding::Encode<ClientControllerStartClientConnectionsResponse, D>
2253 for &ClientControllerStartClientConnectionsResponse
2254 {
2255 #[inline]
2256 unsafe fn encode(
2257 self,
2258 encoder: &mut fidl::encoding::Encoder<'_, D>,
2259 offset: usize,
2260 _depth: fidl::encoding::Depth,
2261 ) -> fidl::Result<()> {
2262 encoder.debug_check_bounds::<ClientControllerStartClientConnectionsResponse>(offset);
2263 fidl::encoding::Encode::<ClientControllerStartClientConnectionsResponse, D>::encode(
2265 (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2266 encoder,
2267 offset,
2268 _depth,
2269 )
2270 }
2271 }
2272 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2273 fidl::encoding::Encode<ClientControllerStartClientConnectionsResponse, D> for (T0,)
2274 {
2275 #[inline]
2276 unsafe fn encode(
2277 self,
2278 encoder: &mut fidl::encoding::Encoder<'_, D>,
2279 offset: usize,
2280 depth: fidl::encoding::Depth,
2281 ) -> fidl::Result<()> {
2282 encoder.debug_check_bounds::<ClientControllerStartClientConnectionsResponse>(offset);
2283 self.0.encode(encoder, offset + 0, depth)?;
2287 Ok(())
2288 }
2289 }
2290
2291 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2292 for ClientControllerStartClientConnectionsResponse
2293 {
2294 #[inline(always)]
2295 fn new_empty() -> Self {
2296 Self { status: fidl::new_empty!(RequestStatus, D) }
2297 }
2298
2299 #[inline]
2300 unsafe fn decode(
2301 &mut self,
2302 decoder: &mut fidl::encoding::Decoder<'_, D>,
2303 offset: usize,
2304 _depth: fidl::encoding::Depth,
2305 ) -> fidl::Result<()> {
2306 decoder.debug_check_bounds::<Self>(offset);
2307 fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2309 Ok(())
2310 }
2311 }
2312
2313 impl fidl::encoding::ValueTypeMarker for ClientControllerStopClientConnectionsResponse {
2314 type Borrowed<'a> = &'a Self;
2315 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2316 value
2317 }
2318 }
2319
2320 unsafe impl fidl::encoding::TypeMarker for ClientControllerStopClientConnectionsResponse {
2321 type Owned = Self;
2322
2323 #[inline(always)]
2324 fn inline_align(_context: fidl::encoding::Context) -> usize {
2325 4
2326 }
2327
2328 #[inline(always)]
2329 fn inline_size(_context: fidl::encoding::Context) -> usize {
2330 4
2331 }
2332 }
2333
2334 unsafe impl<D: fidl::encoding::ResourceDialect>
2335 fidl::encoding::Encode<ClientControllerStopClientConnectionsResponse, D>
2336 for &ClientControllerStopClientConnectionsResponse
2337 {
2338 #[inline]
2339 unsafe fn encode(
2340 self,
2341 encoder: &mut fidl::encoding::Encoder<'_, D>,
2342 offset: usize,
2343 _depth: fidl::encoding::Depth,
2344 ) -> fidl::Result<()> {
2345 encoder.debug_check_bounds::<ClientControllerStopClientConnectionsResponse>(offset);
2346 fidl::encoding::Encode::<ClientControllerStopClientConnectionsResponse, D>::encode(
2348 (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2349 encoder,
2350 offset,
2351 _depth,
2352 )
2353 }
2354 }
2355 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2356 fidl::encoding::Encode<ClientControllerStopClientConnectionsResponse, D> for (T0,)
2357 {
2358 #[inline]
2359 unsafe fn encode(
2360 self,
2361 encoder: &mut fidl::encoding::Encoder<'_, D>,
2362 offset: usize,
2363 depth: fidl::encoding::Depth,
2364 ) -> fidl::Result<()> {
2365 encoder.debug_check_bounds::<ClientControllerStopClientConnectionsResponse>(offset);
2366 self.0.encode(encoder, offset + 0, depth)?;
2370 Ok(())
2371 }
2372 }
2373
2374 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2375 for ClientControllerStopClientConnectionsResponse
2376 {
2377 #[inline(always)]
2378 fn new_empty() -> Self {
2379 Self { status: fidl::new_empty!(RequestStatus, D) }
2380 }
2381
2382 #[inline]
2383 unsafe fn decode(
2384 &mut self,
2385 decoder: &mut fidl::encoding::Decoder<'_, D>,
2386 offset: usize,
2387 _depth: fidl::encoding::Depth,
2388 ) -> fidl::Result<()> {
2389 decoder.debug_check_bounds::<Self>(offset);
2390 fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2392 Ok(())
2393 }
2394 }
2395
2396 impl fidl::encoding::ValueTypeMarker for ClientStateUpdatesOnClientStateUpdateRequest {
2397 type Borrowed<'a> = &'a Self;
2398 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2399 value
2400 }
2401 }
2402
2403 unsafe impl fidl::encoding::TypeMarker for ClientStateUpdatesOnClientStateUpdateRequest {
2404 type Owned = Self;
2405
2406 #[inline(always)]
2407 fn inline_align(_context: fidl::encoding::Context) -> usize {
2408 8
2409 }
2410
2411 #[inline(always)]
2412 fn inline_size(_context: fidl::encoding::Context) -> usize {
2413 16
2414 }
2415 }
2416
2417 unsafe impl<D: fidl::encoding::ResourceDialect>
2418 fidl::encoding::Encode<ClientStateUpdatesOnClientStateUpdateRequest, D>
2419 for &ClientStateUpdatesOnClientStateUpdateRequest
2420 {
2421 #[inline]
2422 unsafe fn encode(
2423 self,
2424 encoder: &mut fidl::encoding::Encoder<'_, D>,
2425 offset: usize,
2426 _depth: fidl::encoding::Depth,
2427 ) -> fidl::Result<()> {
2428 encoder.debug_check_bounds::<ClientStateUpdatesOnClientStateUpdateRequest>(offset);
2429 fidl::encoding::Encode::<ClientStateUpdatesOnClientStateUpdateRequest, D>::encode(
2431 (<ClientStateSummary as fidl::encoding::ValueTypeMarker>::borrow(&self.summary),),
2432 encoder,
2433 offset,
2434 _depth,
2435 )
2436 }
2437 }
2438 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ClientStateSummary, D>>
2439 fidl::encoding::Encode<ClientStateUpdatesOnClientStateUpdateRequest, D> for (T0,)
2440 {
2441 #[inline]
2442 unsafe fn encode(
2443 self,
2444 encoder: &mut fidl::encoding::Encoder<'_, D>,
2445 offset: usize,
2446 depth: fidl::encoding::Depth,
2447 ) -> fidl::Result<()> {
2448 encoder.debug_check_bounds::<ClientStateUpdatesOnClientStateUpdateRequest>(offset);
2449 self.0.encode(encoder, offset + 0, depth)?;
2453 Ok(())
2454 }
2455 }
2456
2457 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2458 for ClientStateUpdatesOnClientStateUpdateRequest
2459 {
2460 #[inline(always)]
2461 fn new_empty() -> Self {
2462 Self { summary: fidl::new_empty!(ClientStateSummary, D) }
2463 }
2464
2465 #[inline]
2466 unsafe fn decode(
2467 &mut self,
2468 decoder: &mut fidl::encoding::Decoder<'_, D>,
2469 offset: usize,
2470 _depth: fidl::encoding::Depth,
2471 ) -> fidl::Result<()> {
2472 decoder.debug_check_bounds::<Self>(offset);
2473 fidl::decode!(ClientStateSummary, D, &mut self.summary, decoder, offset + 0, _depth)?;
2475 Ok(())
2476 }
2477 }
2478
2479 impl fidl::encoding::ValueTypeMarker for Empty {
2480 type Borrowed<'a> = &'a Self;
2481 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2482 value
2483 }
2484 }
2485
2486 unsafe impl fidl::encoding::TypeMarker for Empty {
2487 type Owned = Self;
2488
2489 #[inline(always)]
2490 fn inline_align(_context: fidl::encoding::Context) -> usize {
2491 1
2492 }
2493
2494 #[inline(always)]
2495 fn inline_size(_context: fidl::encoding::Context) -> usize {
2496 1
2497 }
2498 }
2499
2500 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
2501 #[inline]
2502 unsafe fn encode(
2503 self,
2504 encoder: &mut fidl::encoding::Encoder<'_, D>,
2505 offset: usize,
2506 _depth: fidl::encoding::Depth,
2507 ) -> fidl::Result<()> {
2508 encoder.debug_check_bounds::<Empty>(offset);
2509 encoder.write_num(0u8, offset);
2510 Ok(())
2511 }
2512 }
2513
2514 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
2515 #[inline(always)]
2516 fn new_empty() -> Self {
2517 Self
2518 }
2519
2520 #[inline]
2521 unsafe fn decode(
2522 &mut self,
2523 decoder: &mut fidl::encoding::Decoder<'_, D>,
2524 offset: usize,
2525 _depth: fidl::encoding::Depth,
2526 ) -> fidl::Result<()> {
2527 decoder.debug_check_bounds::<Self>(offset);
2528 match decoder.read_num::<u8>(offset) {
2529 0 => Ok(()),
2530 _ => Err(fidl::Error::Invalid),
2531 }
2532 }
2533 }
2534
2535 impl fidl::encoding::ValueTypeMarker for NetworkConfigIteratorGetNextResponse {
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 NetworkConfigIteratorGetNextResponse {
2543 type Owned = Self;
2544
2545 #[inline(always)]
2546 fn inline_align(_context: fidl::encoding::Context) -> usize {
2547 8
2548 }
2549
2550 #[inline(always)]
2551 fn inline_size(_context: fidl::encoding::Context) -> usize {
2552 16
2553 }
2554 }
2555
2556 unsafe impl<D: fidl::encoding::ResourceDialect>
2557 fidl::encoding::Encode<NetworkConfigIteratorGetNextResponse, D>
2558 for &NetworkConfigIteratorGetNextResponse
2559 {
2560 #[inline]
2561 unsafe fn encode(
2562 self,
2563 encoder: &mut fidl::encoding::Encoder<'_, D>,
2564 offset: usize,
2565 _depth: fidl::encoding::Depth,
2566 ) -> fidl::Result<()> {
2567 encoder.debug_check_bounds::<NetworkConfigIteratorGetNextResponse>(offset);
2568 fidl::encoding::Encode::<NetworkConfigIteratorGetNextResponse, D>::encode(
2570 (
2571 <fidl::encoding::UnboundedVector<NetworkConfig> as fidl::encoding::ValueTypeMarker>::borrow(&self.configs),
2572 ),
2573 encoder, offset, _depth
2574 )
2575 }
2576 }
2577 unsafe impl<
2578 D: fidl::encoding::ResourceDialect,
2579 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<NetworkConfig>, D>,
2580 > fidl::encoding::Encode<NetworkConfigIteratorGetNextResponse, D> for (T0,)
2581 {
2582 #[inline]
2583 unsafe fn encode(
2584 self,
2585 encoder: &mut fidl::encoding::Encoder<'_, D>,
2586 offset: usize,
2587 depth: fidl::encoding::Depth,
2588 ) -> fidl::Result<()> {
2589 encoder.debug_check_bounds::<NetworkConfigIteratorGetNextResponse>(offset);
2590 self.0.encode(encoder, offset + 0, depth)?;
2594 Ok(())
2595 }
2596 }
2597
2598 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2599 for NetworkConfigIteratorGetNextResponse
2600 {
2601 #[inline(always)]
2602 fn new_empty() -> Self {
2603 Self { configs: fidl::new_empty!(fidl::encoding::UnboundedVector<NetworkConfig>, D) }
2604 }
2605
2606 #[inline]
2607 unsafe fn decode(
2608 &mut self,
2609 decoder: &mut fidl::encoding::Decoder<'_, D>,
2610 offset: usize,
2611 _depth: fidl::encoding::Depth,
2612 ) -> fidl::Result<()> {
2613 decoder.debug_check_bounds::<Self>(offset);
2614 fidl::decode!(
2616 fidl::encoding::UnboundedVector<NetworkConfig>,
2617 D,
2618 &mut self.configs,
2619 decoder,
2620 offset + 0,
2621 _depth
2622 )?;
2623 Ok(())
2624 }
2625 }
2626
2627 impl fidl::encoding::ValueTypeMarker for NetworkIdentifier {
2628 type Borrowed<'a> = &'a Self;
2629 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2630 value
2631 }
2632 }
2633
2634 unsafe impl fidl::encoding::TypeMarker for NetworkIdentifier {
2635 type Owned = Self;
2636
2637 #[inline(always)]
2638 fn inline_align(_context: fidl::encoding::Context) -> usize {
2639 8
2640 }
2641
2642 #[inline(always)]
2643 fn inline_size(_context: fidl::encoding::Context) -> usize {
2644 24
2645 }
2646 }
2647
2648 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkIdentifier, D>
2649 for &NetworkIdentifier
2650 {
2651 #[inline]
2652 unsafe fn encode(
2653 self,
2654 encoder: &mut fidl::encoding::Encoder<'_, D>,
2655 offset: usize,
2656 _depth: fidl::encoding::Depth,
2657 ) -> fidl::Result<()> {
2658 encoder.debug_check_bounds::<NetworkIdentifier>(offset);
2659 fidl::encoding::Encode::<NetworkIdentifier, D>::encode(
2661 (
2662 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
2663 &self.ssid,
2664 ),
2665 <SecurityType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
2666 ),
2667 encoder,
2668 offset,
2669 _depth,
2670 )
2671 }
2672 }
2673 unsafe impl<
2674 D: fidl::encoding::ResourceDialect,
2675 T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
2676 T1: fidl::encoding::Encode<SecurityType, D>,
2677 > fidl::encoding::Encode<NetworkIdentifier, D> for (T0, T1)
2678 {
2679 #[inline]
2680 unsafe fn encode(
2681 self,
2682 encoder: &mut fidl::encoding::Encoder<'_, D>,
2683 offset: usize,
2684 depth: fidl::encoding::Depth,
2685 ) -> fidl::Result<()> {
2686 encoder.debug_check_bounds::<NetworkIdentifier>(offset);
2687 unsafe {
2690 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2691 (ptr as *mut u64).write_unaligned(0);
2692 }
2693 self.0.encode(encoder, offset + 0, depth)?;
2695 self.1.encode(encoder, offset + 16, depth)?;
2696 Ok(())
2697 }
2698 }
2699
2700 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkIdentifier {
2701 #[inline(always)]
2702 fn new_empty() -> Self {
2703 Self {
2704 ssid: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
2705 type_: fidl::new_empty!(SecurityType, D),
2706 }
2707 }
2708
2709 #[inline]
2710 unsafe fn decode(
2711 &mut self,
2712 decoder: &mut fidl::encoding::Decoder<'_, D>,
2713 offset: usize,
2714 _depth: fidl::encoding::Depth,
2715 ) -> fidl::Result<()> {
2716 decoder.debug_check_bounds::<Self>(offset);
2717 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2719 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2720 let mask = 0xffffffff00000000u64;
2721 let maskedval = padval & mask;
2722 if maskedval != 0 {
2723 return Err(fidl::Error::NonZeroPadding {
2724 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2725 });
2726 }
2727 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.ssid, decoder, offset + 0, _depth)?;
2728 fidl::decode!(SecurityType, D, &mut self.type_, decoder, offset + 16, _depth)?;
2729 Ok(())
2730 }
2731 }
2732
2733 impl fidl::encoding::ValueTypeMarker for ScanResultIteratorGetNextResponse {
2734 type Borrowed<'a> = &'a Self;
2735 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2736 value
2737 }
2738 }
2739
2740 unsafe impl fidl::encoding::TypeMarker for ScanResultIteratorGetNextResponse {
2741 type Owned = Self;
2742
2743 #[inline(always)]
2744 fn inline_align(_context: fidl::encoding::Context) -> usize {
2745 8
2746 }
2747
2748 #[inline(always)]
2749 fn inline_size(_context: fidl::encoding::Context) -> usize {
2750 16
2751 }
2752 }
2753
2754 unsafe impl<D: fidl::encoding::ResourceDialect>
2755 fidl::encoding::Encode<ScanResultIteratorGetNextResponse, D>
2756 for &ScanResultIteratorGetNextResponse
2757 {
2758 #[inline]
2759 unsafe fn encode(
2760 self,
2761 encoder: &mut fidl::encoding::Encoder<'_, D>,
2762 offset: usize,
2763 _depth: fidl::encoding::Depth,
2764 ) -> fidl::Result<()> {
2765 encoder.debug_check_bounds::<ScanResultIteratorGetNextResponse>(offset);
2766 fidl::encoding::Encode::<ScanResultIteratorGetNextResponse, D>::encode(
2768 (
2769 <fidl::encoding::UnboundedVector<ScanResult> as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_results),
2770 ),
2771 encoder, offset, _depth
2772 )
2773 }
2774 }
2775 unsafe impl<
2776 D: fidl::encoding::ResourceDialect,
2777 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ScanResult>, D>,
2778 > fidl::encoding::Encode<ScanResultIteratorGetNextResponse, D> for (T0,)
2779 {
2780 #[inline]
2781 unsafe fn encode(
2782 self,
2783 encoder: &mut fidl::encoding::Encoder<'_, D>,
2784 offset: usize,
2785 depth: fidl::encoding::Depth,
2786 ) -> fidl::Result<()> {
2787 encoder.debug_check_bounds::<ScanResultIteratorGetNextResponse>(offset);
2788 self.0.encode(encoder, offset + 0, depth)?;
2792 Ok(())
2793 }
2794 }
2795
2796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2797 for ScanResultIteratorGetNextResponse
2798 {
2799 #[inline(always)]
2800 fn new_empty() -> Self {
2801 Self { scan_results: fidl::new_empty!(fidl::encoding::UnboundedVector<ScanResult>, D) }
2802 }
2803
2804 #[inline]
2805 unsafe fn decode(
2806 &mut self,
2807 decoder: &mut fidl::encoding::Decoder<'_, D>,
2808 offset: usize,
2809 _depth: fidl::encoding::Depth,
2810 ) -> fidl::Result<()> {
2811 decoder.debug_check_bounds::<Self>(offset);
2812 fidl::decode!(
2814 fidl::encoding::UnboundedVector<ScanResult>,
2815 D,
2816 &mut self.scan_results,
2817 decoder,
2818 offset + 0,
2819 _depth
2820 )?;
2821 Ok(())
2822 }
2823 }
2824
2825 impl AccessPointState {
2826 #[inline(always)]
2827 fn max_ordinal_present(&self) -> u64 {
2828 if let Some(_) = self.id {
2829 return 6;
2830 }
2831 if let Some(_) = self.clients {
2832 return 5;
2833 }
2834 if let Some(_) = self.frequency {
2835 return 4;
2836 }
2837 if let Some(_) = self.band {
2838 return 3;
2839 }
2840 if let Some(_) = self.mode {
2841 return 2;
2842 }
2843 if let Some(_) = self.state {
2844 return 1;
2845 }
2846 0
2847 }
2848 }
2849
2850 impl fidl::encoding::ValueTypeMarker for AccessPointState {
2851 type Borrowed<'a> = &'a Self;
2852 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2853 value
2854 }
2855 }
2856
2857 unsafe impl fidl::encoding::TypeMarker for AccessPointState {
2858 type Owned = Self;
2859
2860 #[inline(always)]
2861 fn inline_align(_context: fidl::encoding::Context) -> usize {
2862 8
2863 }
2864
2865 #[inline(always)]
2866 fn inline_size(_context: fidl::encoding::Context) -> usize {
2867 16
2868 }
2869 }
2870
2871 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessPointState, D>
2872 for &AccessPointState
2873 {
2874 unsafe fn encode(
2875 self,
2876 encoder: &mut fidl::encoding::Encoder<'_, D>,
2877 offset: usize,
2878 mut depth: fidl::encoding::Depth,
2879 ) -> fidl::Result<()> {
2880 encoder.debug_check_bounds::<AccessPointState>(offset);
2881 let max_ordinal: u64 = self.max_ordinal_present();
2883 encoder.write_num(max_ordinal, offset);
2884 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2885 if max_ordinal == 0 {
2887 return Ok(());
2888 }
2889 depth.increment()?;
2890 let envelope_size = 8;
2891 let bytes_len = max_ordinal as usize * envelope_size;
2892 #[allow(unused_variables)]
2893 let offset = encoder.out_of_line_offset(bytes_len);
2894 let mut _prev_end_offset: usize = 0;
2895 if 1 > max_ordinal {
2896 return Ok(());
2897 }
2898
2899 let cur_offset: usize = (1 - 1) * envelope_size;
2902
2903 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2905
2906 fidl::encoding::encode_in_envelope_optional::<OperatingState, D>(
2911 self.state
2912 .as_ref()
2913 .map(<OperatingState as fidl::encoding::ValueTypeMarker>::borrow),
2914 encoder,
2915 offset + cur_offset,
2916 depth,
2917 )?;
2918
2919 _prev_end_offset = cur_offset + envelope_size;
2920 if 2 > max_ordinal {
2921 return Ok(());
2922 }
2923
2924 let cur_offset: usize = (2 - 1) * envelope_size;
2927
2928 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2930
2931 fidl::encoding::encode_in_envelope_optional::<ConnectivityMode, D>(
2936 self.mode
2937 .as_ref()
2938 .map(<ConnectivityMode as fidl::encoding::ValueTypeMarker>::borrow),
2939 encoder,
2940 offset + cur_offset,
2941 depth,
2942 )?;
2943
2944 _prev_end_offset = cur_offset + envelope_size;
2945 if 3 > max_ordinal {
2946 return Ok(());
2947 }
2948
2949 let cur_offset: usize = (3 - 1) * envelope_size;
2952
2953 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2955
2956 fidl::encoding::encode_in_envelope_optional::<OperatingBand, D>(
2961 self.band.as_ref().map(<OperatingBand as fidl::encoding::ValueTypeMarker>::borrow),
2962 encoder,
2963 offset + cur_offset,
2964 depth,
2965 )?;
2966
2967 _prev_end_offset = cur_offset + envelope_size;
2968 if 4 > max_ordinal {
2969 return Ok(());
2970 }
2971
2972 let cur_offset: usize = (4 - 1) * envelope_size;
2975
2976 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2978
2979 fidl::encoding::encode_in_envelope_optional::<u32, D>(
2984 self.frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2985 encoder,
2986 offset + cur_offset,
2987 depth,
2988 )?;
2989
2990 _prev_end_offset = cur_offset + envelope_size;
2991 if 5 > max_ordinal {
2992 return Ok(());
2993 }
2994
2995 let cur_offset: usize = (5 - 1) * envelope_size;
2998
2999 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3001
3002 fidl::encoding::encode_in_envelope_optional::<ConnectedClientInformation, D>(
3007 self.clients
3008 .as_ref()
3009 .map(<ConnectedClientInformation as fidl::encoding::ValueTypeMarker>::borrow),
3010 encoder,
3011 offset + cur_offset,
3012 depth,
3013 )?;
3014
3015 _prev_end_offset = cur_offset + envelope_size;
3016 if 6 > max_ordinal {
3017 return Ok(());
3018 }
3019
3020 let cur_offset: usize = (6 - 1) * envelope_size;
3023
3024 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3026
3027 fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
3032 self.id
3033 .as_ref()
3034 .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
3035 encoder,
3036 offset + cur_offset,
3037 depth,
3038 )?;
3039
3040 _prev_end_offset = cur_offset + envelope_size;
3041
3042 Ok(())
3043 }
3044 }
3045
3046 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessPointState {
3047 #[inline(always)]
3048 fn new_empty() -> Self {
3049 Self::default()
3050 }
3051
3052 unsafe fn decode(
3053 &mut self,
3054 decoder: &mut fidl::encoding::Decoder<'_, D>,
3055 offset: usize,
3056 mut depth: fidl::encoding::Depth,
3057 ) -> fidl::Result<()> {
3058 decoder.debug_check_bounds::<Self>(offset);
3059 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3060 None => return Err(fidl::Error::NotNullable),
3061 Some(len) => len,
3062 };
3063 if len == 0 {
3065 return Ok(());
3066 };
3067 depth.increment()?;
3068 let envelope_size = 8;
3069 let bytes_len = len * envelope_size;
3070 let offset = decoder.out_of_line_offset(bytes_len)?;
3071 let mut _next_ordinal_to_read = 0;
3073 let mut next_offset = offset;
3074 let end_offset = offset + bytes_len;
3075 _next_ordinal_to_read += 1;
3076 if next_offset >= end_offset {
3077 return Ok(());
3078 }
3079
3080 while _next_ordinal_to_read < 1 {
3082 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3083 _next_ordinal_to_read += 1;
3084 next_offset += envelope_size;
3085 }
3086
3087 let next_out_of_line = decoder.next_out_of_line();
3088 let handles_before = decoder.remaining_handles();
3089 if let Some((inlined, num_bytes, num_handles)) =
3090 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3091 {
3092 let member_inline_size =
3093 <OperatingState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3094 if inlined != (member_inline_size <= 4) {
3095 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3096 }
3097 let inner_offset;
3098 let mut inner_depth = depth.clone();
3099 if inlined {
3100 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3101 inner_offset = next_offset;
3102 } else {
3103 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3104 inner_depth.increment()?;
3105 }
3106 let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(OperatingState, D));
3107 fidl::decode!(OperatingState, D, val_ref, decoder, inner_offset, inner_depth)?;
3108 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3109 {
3110 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3111 }
3112 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3113 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3114 }
3115 }
3116
3117 next_offset += envelope_size;
3118 _next_ordinal_to_read += 1;
3119 if next_offset >= end_offset {
3120 return Ok(());
3121 }
3122
3123 while _next_ordinal_to_read < 2 {
3125 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3126 _next_ordinal_to_read += 1;
3127 next_offset += envelope_size;
3128 }
3129
3130 let next_out_of_line = decoder.next_out_of_line();
3131 let handles_before = decoder.remaining_handles();
3132 if let Some((inlined, num_bytes, num_handles)) =
3133 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3134 {
3135 let member_inline_size =
3136 <ConnectivityMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3137 if inlined != (member_inline_size <= 4) {
3138 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3139 }
3140 let inner_offset;
3141 let mut inner_depth = depth.clone();
3142 if inlined {
3143 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3144 inner_offset = next_offset;
3145 } else {
3146 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3147 inner_depth.increment()?;
3148 }
3149 let val_ref =
3150 self.mode.get_or_insert_with(|| fidl::new_empty!(ConnectivityMode, D));
3151 fidl::decode!(ConnectivityMode, D, val_ref, decoder, inner_offset, inner_depth)?;
3152 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3153 {
3154 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3155 }
3156 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3157 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3158 }
3159 }
3160
3161 next_offset += envelope_size;
3162 _next_ordinal_to_read += 1;
3163 if next_offset >= end_offset {
3164 return Ok(());
3165 }
3166
3167 while _next_ordinal_to_read < 3 {
3169 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3170 _next_ordinal_to_read += 1;
3171 next_offset += envelope_size;
3172 }
3173
3174 let next_out_of_line = decoder.next_out_of_line();
3175 let handles_before = decoder.remaining_handles();
3176 if let Some((inlined, num_bytes, num_handles)) =
3177 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3178 {
3179 let member_inline_size =
3180 <OperatingBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3181 if inlined != (member_inline_size <= 4) {
3182 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3183 }
3184 let inner_offset;
3185 let mut inner_depth = depth.clone();
3186 if inlined {
3187 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3188 inner_offset = next_offset;
3189 } else {
3190 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3191 inner_depth.increment()?;
3192 }
3193 let val_ref = self.band.get_or_insert_with(|| fidl::new_empty!(OperatingBand, D));
3194 fidl::decode!(OperatingBand, D, val_ref, decoder, inner_offset, inner_depth)?;
3195 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3196 {
3197 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3198 }
3199 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3200 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3201 }
3202 }
3203
3204 next_offset += envelope_size;
3205 _next_ordinal_to_read += 1;
3206 if next_offset >= end_offset {
3207 return Ok(());
3208 }
3209
3210 while _next_ordinal_to_read < 4 {
3212 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3213 _next_ordinal_to_read += 1;
3214 next_offset += envelope_size;
3215 }
3216
3217 let next_out_of_line = decoder.next_out_of_line();
3218 let handles_before = decoder.remaining_handles();
3219 if let Some((inlined, num_bytes, num_handles)) =
3220 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3221 {
3222 let member_inline_size =
3223 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3224 if inlined != (member_inline_size <= 4) {
3225 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3226 }
3227 let inner_offset;
3228 let mut inner_depth = depth.clone();
3229 if inlined {
3230 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3231 inner_offset = next_offset;
3232 } else {
3233 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3234 inner_depth.increment()?;
3235 }
3236 let val_ref = self.frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
3237 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3238 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3239 {
3240 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3241 }
3242 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3243 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3244 }
3245 }
3246
3247 next_offset += envelope_size;
3248 _next_ordinal_to_read += 1;
3249 if next_offset >= end_offset {
3250 return Ok(());
3251 }
3252
3253 while _next_ordinal_to_read < 5 {
3255 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3256 _next_ordinal_to_read += 1;
3257 next_offset += envelope_size;
3258 }
3259
3260 let next_out_of_line = decoder.next_out_of_line();
3261 let handles_before = decoder.remaining_handles();
3262 if let Some((inlined, num_bytes, num_handles)) =
3263 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3264 {
3265 let member_inline_size =
3266 <ConnectedClientInformation as fidl::encoding::TypeMarker>::inline_size(
3267 decoder.context,
3268 );
3269 if inlined != (member_inline_size <= 4) {
3270 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3271 }
3272 let inner_offset;
3273 let mut inner_depth = depth.clone();
3274 if inlined {
3275 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3276 inner_offset = next_offset;
3277 } else {
3278 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3279 inner_depth.increment()?;
3280 }
3281 let val_ref = self
3282 .clients
3283 .get_or_insert_with(|| fidl::new_empty!(ConnectedClientInformation, D));
3284 fidl::decode!(
3285 ConnectedClientInformation,
3286 D,
3287 val_ref,
3288 decoder,
3289 inner_offset,
3290 inner_depth
3291 )?;
3292 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3293 {
3294 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3295 }
3296 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3297 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3298 }
3299 }
3300
3301 next_offset += envelope_size;
3302 _next_ordinal_to_read += 1;
3303 if next_offset >= end_offset {
3304 return Ok(());
3305 }
3306
3307 while _next_ordinal_to_read < 6 {
3309 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3310 _next_ordinal_to_read += 1;
3311 next_offset += envelope_size;
3312 }
3313
3314 let next_out_of_line = decoder.next_out_of_line();
3315 let handles_before = decoder.remaining_handles();
3316 if let Some((inlined, num_bytes, num_handles)) =
3317 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3318 {
3319 let member_inline_size =
3320 <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3321 if inlined != (member_inline_size <= 4) {
3322 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3323 }
3324 let inner_offset;
3325 let mut inner_depth = depth.clone();
3326 if inlined {
3327 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3328 inner_offset = next_offset;
3329 } else {
3330 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3331 inner_depth.increment()?;
3332 }
3333 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
3334 fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
3335 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3336 {
3337 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3338 }
3339 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3340 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3341 }
3342 }
3343
3344 next_offset += envelope_size;
3345
3346 while next_offset < end_offset {
3348 _next_ordinal_to_read += 1;
3349 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3350 next_offset += envelope_size;
3351 }
3352
3353 Ok(())
3354 }
3355 }
3356
3357 impl Bss {
3358 #[inline(always)]
3359 fn max_ordinal_present(&self) -> u64 {
3360 if let Some(_) = self.timestamp_nanos {
3361 return 4;
3362 }
3363 if let Some(_) = self.frequency {
3364 return 3;
3365 }
3366 if let Some(_) = self.rssi {
3367 return 2;
3368 }
3369 if let Some(_) = self.bssid {
3370 return 1;
3371 }
3372 0
3373 }
3374 }
3375
3376 impl fidl::encoding::ValueTypeMarker for Bss {
3377 type Borrowed<'a> = &'a Self;
3378 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3379 value
3380 }
3381 }
3382
3383 unsafe impl fidl::encoding::TypeMarker for Bss {
3384 type Owned = Self;
3385
3386 #[inline(always)]
3387 fn inline_align(_context: fidl::encoding::Context) -> usize {
3388 8
3389 }
3390
3391 #[inline(always)]
3392 fn inline_size(_context: fidl::encoding::Context) -> usize {
3393 16
3394 }
3395 }
3396
3397 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Bss, D> for &Bss {
3398 unsafe fn encode(
3399 self,
3400 encoder: &mut fidl::encoding::Encoder<'_, D>,
3401 offset: usize,
3402 mut depth: fidl::encoding::Depth,
3403 ) -> fidl::Result<()> {
3404 encoder.debug_check_bounds::<Bss>(offset);
3405 let max_ordinal: u64 = self.max_ordinal_present();
3407 encoder.write_num(max_ordinal, offset);
3408 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3409 if max_ordinal == 0 {
3411 return Ok(());
3412 }
3413 depth.increment()?;
3414 let envelope_size = 8;
3415 let bytes_len = max_ordinal as usize * envelope_size;
3416 #[allow(unused_variables)]
3417 let offset = encoder.out_of_line_offset(bytes_len);
3418 let mut _prev_end_offset: usize = 0;
3419 if 1 > max_ordinal {
3420 return Ok(());
3421 }
3422
3423 let cur_offset: usize = (1 - 1) * envelope_size;
3426
3427 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3429
3430 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3435 self.bssid
3436 .as_ref()
3437 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3438 encoder,
3439 offset + cur_offset,
3440 depth,
3441 )?;
3442
3443 _prev_end_offset = cur_offset + envelope_size;
3444 if 2 > max_ordinal {
3445 return Ok(());
3446 }
3447
3448 let cur_offset: usize = (2 - 1) * envelope_size;
3451
3452 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3454
3455 fidl::encoding::encode_in_envelope_optional::<i8, D>(
3460 self.rssi.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
3461 encoder,
3462 offset + cur_offset,
3463 depth,
3464 )?;
3465
3466 _prev_end_offset = cur_offset + envelope_size;
3467 if 3 > max_ordinal {
3468 return Ok(());
3469 }
3470
3471 let cur_offset: usize = (3 - 1) * envelope_size;
3474
3475 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3477
3478 fidl::encoding::encode_in_envelope_optional::<u32, D>(
3483 self.frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3484 encoder,
3485 offset + cur_offset,
3486 depth,
3487 )?;
3488
3489 _prev_end_offset = cur_offset + envelope_size;
3490 if 4 > max_ordinal {
3491 return Ok(());
3492 }
3493
3494 let cur_offset: usize = (4 - 1) * envelope_size;
3497
3498 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3500
3501 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3506 self.timestamp_nanos.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3507 encoder,
3508 offset + cur_offset,
3509 depth,
3510 )?;
3511
3512 _prev_end_offset = cur_offset + envelope_size;
3513
3514 Ok(())
3515 }
3516 }
3517
3518 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Bss {
3519 #[inline(always)]
3520 fn new_empty() -> Self {
3521 Self::default()
3522 }
3523
3524 unsafe fn decode(
3525 &mut self,
3526 decoder: &mut fidl::encoding::Decoder<'_, D>,
3527 offset: usize,
3528 mut depth: fidl::encoding::Depth,
3529 ) -> fidl::Result<()> {
3530 decoder.debug_check_bounds::<Self>(offset);
3531 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3532 None => return Err(fidl::Error::NotNullable),
3533 Some(len) => len,
3534 };
3535 if len == 0 {
3537 return Ok(());
3538 };
3539 depth.increment()?;
3540 let envelope_size = 8;
3541 let bytes_len = len * envelope_size;
3542 let offset = decoder.out_of_line_offset(bytes_len)?;
3543 let mut _next_ordinal_to_read = 0;
3545 let mut next_offset = offset;
3546 let end_offset = offset + bytes_len;
3547 _next_ordinal_to_read += 1;
3548 if next_offset >= end_offset {
3549 return Ok(());
3550 }
3551
3552 while _next_ordinal_to_read < 1 {
3554 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3555 _next_ordinal_to_read += 1;
3556 next_offset += envelope_size;
3557 }
3558
3559 let next_out_of_line = decoder.next_out_of_line();
3560 let handles_before = decoder.remaining_handles();
3561 if let Some((inlined, num_bytes, num_handles)) =
3562 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3563 {
3564 let member_inline_size =
3565 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3566 decoder.context,
3567 );
3568 if inlined != (member_inline_size <= 4) {
3569 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3570 }
3571 let inner_offset;
3572 let mut inner_depth = depth.clone();
3573 if inlined {
3574 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3575 inner_offset = next_offset;
3576 } else {
3577 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3578 inner_depth.increment()?;
3579 }
3580 let val_ref = self
3581 .bssid
3582 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3583 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3584 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3585 {
3586 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3587 }
3588 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3589 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3590 }
3591 }
3592
3593 next_offset += envelope_size;
3594 _next_ordinal_to_read += 1;
3595 if next_offset >= end_offset {
3596 return Ok(());
3597 }
3598
3599 while _next_ordinal_to_read < 2 {
3601 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3602 _next_ordinal_to_read += 1;
3603 next_offset += envelope_size;
3604 }
3605
3606 let next_out_of_line = decoder.next_out_of_line();
3607 let handles_before = decoder.remaining_handles();
3608 if let Some((inlined, num_bytes, num_handles)) =
3609 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3610 {
3611 let member_inline_size =
3612 <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3613 if inlined != (member_inline_size <= 4) {
3614 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3615 }
3616 let inner_offset;
3617 let mut inner_depth = depth.clone();
3618 if inlined {
3619 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3620 inner_offset = next_offset;
3621 } else {
3622 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3623 inner_depth.increment()?;
3624 }
3625 let val_ref = self.rssi.get_or_insert_with(|| fidl::new_empty!(i8, D));
3626 fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
3627 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3628 {
3629 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3630 }
3631 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3632 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3633 }
3634 }
3635
3636 next_offset += envelope_size;
3637 _next_ordinal_to_read += 1;
3638 if next_offset >= end_offset {
3639 return Ok(());
3640 }
3641
3642 while _next_ordinal_to_read < 3 {
3644 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3645 _next_ordinal_to_read += 1;
3646 next_offset += envelope_size;
3647 }
3648
3649 let next_out_of_line = decoder.next_out_of_line();
3650 let handles_before = decoder.remaining_handles();
3651 if let Some((inlined, num_bytes, num_handles)) =
3652 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3653 {
3654 let member_inline_size =
3655 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3656 if inlined != (member_inline_size <= 4) {
3657 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3658 }
3659 let inner_offset;
3660 let mut inner_depth = depth.clone();
3661 if inlined {
3662 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3663 inner_offset = next_offset;
3664 } else {
3665 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3666 inner_depth.increment()?;
3667 }
3668 let val_ref = self.frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
3669 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3671 {
3672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3673 }
3674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3676 }
3677 }
3678
3679 next_offset += envelope_size;
3680 _next_ordinal_to_read += 1;
3681 if next_offset >= end_offset {
3682 return Ok(());
3683 }
3684
3685 while _next_ordinal_to_read < 4 {
3687 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3688 _next_ordinal_to_read += 1;
3689 next_offset += envelope_size;
3690 }
3691
3692 let next_out_of_line = decoder.next_out_of_line();
3693 let handles_before = decoder.remaining_handles();
3694 if let Some((inlined, num_bytes, num_handles)) =
3695 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3696 {
3697 let member_inline_size =
3698 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3699 if inlined != (member_inline_size <= 4) {
3700 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3701 }
3702 let inner_offset;
3703 let mut inner_depth = depth.clone();
3704 if inlined {
3705 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3706 inner_offset = next_offset;
3707 } else {
3708 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3709 inner_depth.increment()?;
3710 }
3711 let val_ref = self.timestamp_nanos.get_or_insert_with(|| fidl::new_empty!(i64, D));
3712 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3713 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3714 {
3715 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3716 }
3717 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3718 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3719 }
3720 }
3721
3722 next_offset += envelope_size;
3723
3724 while next_offset < end_offset {
3726 _next_ordinal_to_read += 1;
3727 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3728 next_offset += envelope_size;
3729 }
3730
3731 Ok(())
3732 }
3733 }
3734
3735 impl ClientStateSummary {
3736 #[inline(always)]
3737 fn max_ordinal_present(&self) -> u64 {
3738 if let Some(_) = self.networks {
3739 return 2;
3740 }
3741 if let Some(_) = self.state {
3742 return 1;
3743 }
3744 0
3745 }
3746 }
3747
3748 impl fidl::encoding::ValueTypeMarker for ClientStateSummary {
3749 type Borrowed<'a> = &'a Self;
3750 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3751 value
3752 }
3753 }
3754
3755 unsafe impl fidl::encoding::TypeMarker for ClientStateSummary {
3756 type Owned = Self;
3757
3758 #[inline(always)]
3759 fn inline_align(_context: fidl::encoding::Context) -> usize {
3760 8
3761 }
3762
3763 #[inline(always)]
3764 fn inline_size(_context: fidl::encoding::Context) -> usize {
3765 16
3766 }
3767 }
3768
3769 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClientStateSummary, D>
3770 for &ClientStateSummary
3771 {
3772 unsafe fn encode(
3773 self,
3774 encoder: &mut fidl::encoding::Encoder<'_, D>,
3775 offset: usize,
3776 mut depth: fidl::encoding::Depth,
3777 ) -> fidl::Result<()> {
3778 encoder.debug_check_bounds::<ClientStateSummary>(offset);
3779 let max_ordinal: u64 = self.max_ordinal_present();
3781 encoder.write_num(max_ordinal, offset);
3782 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3783 if max_ordinal == 0 {
3785 return Ok(());
3786 }
3787 depth.increment()?;
3788 let envelope_size = 8;
3789 let bytes_len = max_ordinal as usize * envelope_size;
3790 #[allow(unused_variables)]
3791 let offset = encoder.out_of_line_offset(bytes_len);
3792 let mut _prev_end_offset: usize = 0;
3793 if 1 > max_ordinal {
3794 return Ok(());
3795 }
3796
3797 let cur_offset: usize = (1 - 1) * envelope_size;
3800
3801 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3803
3804 fidl::encoding::encode_in_envelope_optional::<WlanClientState, D>(
3809 self.state
3810 .as_ref()
3811 .map(<WlanClientState as fidl::encoding::ValueTypeMarker>::borrow),
3812 encoder,
3813 offset + cur_offset,
3814 depth,
3815 )?;
3816
3817 _prev_end_offset = cur_offset + envelope_size;
3818 if 2 > max_ordinal {
3819 return Ok(());
3820 }
3821
3822 let cur_offset: usize = (2 - 1) * envelope_size;
3825
3826 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3828
3829 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<NetworkState>, D>(
3834 self.networks.as_ref().map(<fidl::encoding::UnboundedVector<NetworkState> as fidl::encoding::ValueTypeMarker>::borrow),
3835 encoder, offset + cur_offset, depth
3836 )?;
3837
3838 _prev_end_offset = cur_offset + envelope_size;
3839
3840 Ok(())
3841 }
3842 }
3843
3844 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClientStateSummary {
3845 #[inline(always)]
3846 fn new_empty() -> Self {
3847 Self::default()
3848 }
3849
3850 unsafe fn decode(
3851 &mut self,
3852 decoder: &mut fidl::encoding::Decoder<'_, D>,
3853 offset: usize,
3854 mut depth: fidl::encoding::Depth,
3855 ) -> fidl::Result<()> {
3856 decoder.debug_check_bounds::<Self>(offset);
3857 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3858 None => return Err(fidl::Error::NotNullable),
3859 Some(len) => len,
3860 };
3861 if len == 0 {
3863 return Ok(());
3864 };
3865 depth.increment()?;
3866 let envelope_size = 8;
3867 let bytes_len = len * envelope_size;
3868 let offset = decoder.out_of_line_offset(bytes_len)?;
3869 let mut _next_ordinal_to_read = 0;
3871 let mut next_offset = offset;
3872 let end_offset = offset + bytes_len;
3873 _next_ordinal_to_read += 1;
3874 if next_offset >= end_offset {
3875 return Ok(());
3876 }
3877
3878 while _next_ordinal_to_read < 1 {
3880 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3881 _next_ordinal_to_read += 1;
3882 next_offset += envelope_size;
3883 }
3884
3885 let next_out_of_line = decoder.next_out_of_line();
3886 let handles_before = decoder.remaining_handles();
3887 if let Some((inlined, num_bytes, num_handles)) =
3888 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3889 {
3890 let member_inline_size =
3891 <WlanClientState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3892 if inlined != (member_inline_size <= 4) {
3893 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3894 }
3895 let inner_offset;
3896 let mut inner_depth = depth.clone();
3897 if inlined {
3898 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3899 inner_offset = next_offset;
3900 } else {
3901 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3902 inner_depth.increment()?;
3903 }
3904 let val_ref =
3905 self.state.get_or_insert_with(|| fidl::new_empty!(WlanClientState, D));
3906 fidl::decode!(WlanClientState, D, val_ref, decoder, inner_offset, inner_depth)?;
3907 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3908 {
3909 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3910 }
3911 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3912 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3913 }
3914 }
3915
3916 next_offset += envelope_size;
3917 _next_ordinal_to_read += 1;
3918 if next_offset >= end_offset {
3919 return Ok(());
3920 }
3921
3922 while _next_ordinal_to_read < 2 {
3924 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3925 _next_ordinal_to_read += 1;
3926 next_offset += envelope_size;
3927 }
3928
3929 let next_out_of_line = decoder.next_out_of_line();
3930 let handles_before = decoder.remaining_handles();
3931 if let Some((inlined, num_bytes, num_handles)) =
3932 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3933 {
3934 let member_inline_size = <fidl::encoding::UnboundedVector<NetworkState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3935 if inlined != (member_inline_size <= 4) {
3936 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3937 }
3938 let inner_offset;
3939 let mut inner_depth = depth.clone();
3940 if inlined {
3941 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3942 inner_offset = next_offset;
3943 } else {
3944 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3945 inner_depth.increment()?;
3946 }
3947 let val_ref = self.networks.get_or_insert_with(|| {
3948 fidl::new_empty!(fidl::encoding::UnboundedVector<NetworkState>, D)
3949 });
3950 fidl::decode!(
3951 fidl::encoding::UnboundedVector<NetworkState>,
3952 D,
3953 val_ref,
3954 decoder,
3955 inner_offset,
3956 inner_depth
3957 )?;
3958 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3959 {
3960 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3961 }
3962 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3963 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3964 }
3965 }
3966
3967 next_offset += envelope_size;
3968
3969 while next_offset < end_offset {
3971 _next_ordinal_to_read += 1;
3972 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3973 next_offset += envelope_size;
3974 }
3975
3976 Ok(())
3977 }
3978 }
3979
3980 impl ConnectedClientInformation {
3981 #[inline(always)]
3982 fn max_ordinal_present(&self) -> u64 {
3983 if let Some(_) = self.count {
3984 return 1;
3985 }
3986 0
3987 }
3988 }
3989
3990 impl fidl::encoding::ValueTypeMarker for ConnectedClientInformation {
3991 type Borrowed<'a> = &'a Self;
3992 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3993 value
3994 }
3995 }
3996
3997 unsafe impl fidl::encoding::TypeMarker for ConnectedClientInformation {
3998 type Owned = Self;
3999
4000 #[inline(always)]
4001 fn inline_align(_context: fidl::encoding::Context) -> usize {
4002 8
4003 }
4004
4005 #[inline(always)]
4006 fn inline_size(_context: fidl::encoding::Context) -> usize {
4007 16
4008 }
4009 }
4010
4011 unsafe impl<D: fidl::encoding::ResourceDialect>
4012 fidl::encoding::Encode<ConnectedClientInformation, D> for &ConnectedClientInformation
4013 {
4014 unsafe fn encode(
4015 self,
4016 encoder: &mut fidl::encoding::Encoder<'_, D>,
4017 offset: usize,
4018 mut depth: fidl::encoding::Depth,
4019 ) -> fidl::Result<()> {
4020 encoder.debug_check_bounds::<ConnectedClientInformation>(offset);
4021 let max_ordinal: u64 = self.max_ordinal_present();
4023 encoder.write_num(max_ordinal, offset);
4024 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4025 if max_ordinal == 0 {
4027 return Ok(());
4028 }
4029 depth.increment()?;
4030 let envelope_size = 8;
4031 let bytes_len = max_ordinal as usize * envelope_size;
4032 #[allow(unused_variables)]
4033 let offset = encoder.out_of_line_offset(bytes_len);
4034 let mut _prev_end_offset: usize = 0;
4035 if 1 > max_ordinal {
4036 return Ok(());
4037 }
4038
4039 let cur_offset: usize = (1 - 1) * envelope_size;
4042
4043 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4045
4046 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4051 self.count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4052 encoder,
4053 offset + cur_offset,
4054 depth,
4055 )?;
4056
4057 _prev_end_offset = cur_offset + envelope_size;
4058
4059 Ok(())
4060 }
4061 }
4062
4063 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4064 for ConnectedClientInformation
4065 {
4066 #[inline(always)]
4067 fn new_empty() -> Self {
4068 Self::default()
4069 }
4070
4071 unsafe fn decode(
4072 &mut self,
4073 decoder: &mut fidl::encoding::Decoder<'_, D>,
4074 offset: usize,
4075 mut depth: fidl::encoding::Depth,
4076 ) -> fidl::Result<()> {
4077 decoder.debug_check_bounds::<Self>(offset);
4078 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4079 None => return Err(fidl::Error::NotNullable),
4080 Some(len) => len,
4081 };
4082 if len == 0 {
4084 return Ok(());
4085 };
4086 depth.increment()?;
4087 let envelope_size = 8;
4088 let bytes_len = len * envelope_size;
4089 let offset = decoder.out_of_line_offset(bytes_len)?;
4090 let mut _next_ordinal_to_read = 0;
4092 let mut next_offset = offset;
4093 let end_offset = offset + bytes_len;
4094 _next_ordinal_to_read += 1;
4095 if next_offset >= end_offset {
4096 return Ok(());
4097 }
4098
4099 while _next_ordinal_to_read < 1 {
4101 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4102 _next_ordinal_to_read += 1;
4103 next_offset += envelope_size;
4104 }
4105
4106 let next_out_of_line = decoder.next_out_of_line();
4107 let handles_before = decoder.remaining_handles();
4108 if let Some((inlined, num_bytes, num_handles)) =
4109 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4110 {
4111 let member_inline_size =
4112 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4113 if inlined != (member_inline_size <= 4) {
4114 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4115 }
4116 let inner_offset;
4117 let mut inner_depth = depth.clone();
4118 if inlined {
4119 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4120 inner_offset = next_offset;
4121 } else {
4122 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4123 inner_depth.increment()?;
4124 }
4125 let val_ref = self.count.get_or_insert_with(|| fidl::new_empty!(u8, D));
4126 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4127 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4128 {
4129 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4130 }
4131 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4132 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4133 }
4134 }
4135
4136 next_offset += envelope_size;
4137
4138 while next_offset < end_offset {
4140 _next_ordinal_to_read += 1;
4141 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4142 next_offset += envelope_size;
4143 }
4144
4145 Ok(())
4146 }
4147 }
4148
4149 impl NetworkConfig {
4150 #[inline(always)]
4151 fn max_ordinal_present(&self) -> u64 {
4152 if let Some(_) = self.credential {
4153 return 2;
4154 }
4155 if let Some(_) = self.id {
4156 return 1;
4157 }
4158 0
4159 }
4160 }
4161
4162 impl fidl::encoding::ValueTypeMarker for NetworkConfig {
4163 type Borrowed<'a> = &'a Self;
4164 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4165 value
4166 }
4167 }
4168
4169 unsafe impl fidl::encoding::TypeMarker for NetworkConfig {
4170 type Owned = Self;
4171
4172 #[inline(always)]
4173 fn inline_align(_context: fidl::encoding::Context) -> usize {
4174 8
4175 }
4176
4177 #[inline(always)]
4178 fn inline_size(_context: fidl::encoding::Context) -> usize {
4179 16
4180 }
4181 }
4182
4183 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkConfig, D>
4184 for &NetworkConfig
4185 {
4186 unsafe fn encode(
4187 self,
4188 encoder: &mut fidl::encoding::Encoder<'_, D>,
4189 offset: usize,
4190 mut depth: fidl::encoding::Depth,
4191 ) -> fidl::Result<()> {
4192 encoder.debug_check_bounds::<NetworkConfig>(offset);
4193 let max_ordinal: u64 = self.max_ordinal_present();
4195 encoder.write_num(max_ordinal, offset);
4196 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4197 if max_ordinal == 0 {
4199 return Ok(());
4200 }
4201 depth.increment()?;
4202 let envelope_size = 8;
4203 let bytes_len = max_ordinal as usize * envelope_size;
4204 #[allow(unused_variables)]
4205 let offset = encoder.out_of_line_offset(bytes_len);
4206 let mut _prev_end_offset: usize = 0;
4207 if 1 > max_ordinal {
4208 return Ok(());
4209 }
4210
4211 let cur_offset: usize = (1 - 1) * envelope_size;
4214
4215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4217
4218 fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4223 self.id
4224 .as_ref()
4225 .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4226 encoder,
4227 offset + cur_offset,
4228 depth,
4229 )?;
4230
4231 _prev_end_offset = cur_offset + envelope_size;
4232 if 2 > max_ordinal {
4233 return Ok(());
4234 }
4235
4236 let cur_offset: usize = (2 - 1) * envelope_size;
4239
4240 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4242
4243 fidl::encoding::encode_in_envelope_optional::<Credential, D>(
4248 self.credential
4249 .as_ref()
4250 .map(<Credential as fidl::encoding::ValueTypeMarker>::borrow),
4251 encoder,
4252 offset + cur_offset,
4253 depth,
4254 )?;
4255
4256 _prev_end_offset = cur_offset + envelope_size;
4257
4258 Ok(())
4259 }
4260 }
4261
4262 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkConfig {
4263 #[inline(always)]
4264 fn new_empty() -> Self {
4265 Self::default()
4266 }
4267
4268 unsafe fn decode(
4269 &mut self,
4270 decoder: &mut fidl::encoding::Decoder<'_, D>,
4271 offset: usize,
4272 mut depth: fidl::encoding::Depth,
4273 ) -> fidl::Result<()> {
4274 decoder.debug_check_bounds::<Self>(offset);
4275 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4276 None => return Err(fidl::Error::NotNullable),
4277 Some(len) => len,
4278 };
4279 if len == 0 {
4281 return Ok(());
4282 };
4283 depth.increment()?;
4284 let envelope_size = 8;
4285 let bytes_len = len * envelope_size;
4286 let offset = decoder.out_of_line_offset(bytes_len)?;
4287 let mut _next_ordinal_to_read = 0;
4289 let mut next_offset = offset;
4290 let end_offset = offset + bytes_len;
4291 _next_ordinal_to_read += 1;
4292 if next_offset >= end_offset {
4293 return Ok(());
4294 }
4295
4296 while _next_ordinal_to_read < 1 {
4298 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4299 _next_ordinal_to_read += 1;
4300 next_offset += envelope_size;
4301 }
4302
4303 let next_out_of_line = decoder.next_out_of_line();
4304 let handles_before = decoder.remaining_handles();
4305 if let Some((inlined, num_bytes, num_handles)) =
4306 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4307 {
4308 let member_inline_size =
4309 <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4310 if inlined != (member_inline_size <= 4) {
4311 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4312 }
4313 let inner_offset;
4314 let mut inner_depth = depth.clone();
4315 if inlined {
4316 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4317 inner_offset = next_offset;
4318 } else {
4319 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4320 inner_depth.increment()?;
4321 }
4322 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4323 fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4324 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4325 {
4326 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4327 }
4328 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4329 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4330 }
4331 }
4332
4333 next_offset += envelope_size;
4334 _next_ordinal_to_read += 1;
4335 if next_offset >= end_offset {
4336 return Ok(());
4337 }
4338
4339 while _next_ordinal_to_read < 2 {
4341 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4342 _next_ordinal_to_read += 1;
4343 next_offset += envelope_size;
4344 }
4345
4346 let next_out_of_line = decoder.next_out_of_line();
4347 let handles_before = decoder.remaining_handles();
4348 if let Some((inlined, num_bytes, num_handles)) =
4349 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4350 {
4351 let member_inline_size =
4352 <Credential as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4353 if inlined != (member_inline_size <= 4) {
4354 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4355 }
4356 let inner_offset;
4357 let mut inner_depth = depth.clone();
4358 if inlined {
4359 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4360 inner_offset = next_offset;
4361 } else {
4362 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4363 inner_depth.increment()?;
4364 }
4365 let val_ref =
4366 self.credential.get_or_insert_with(|| fidl::new_empty!(Credential, D));
4367 fidl::decode!(Credential, D, val_ref, decoder, inner_offset, inner_depth)?;
4368 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4369 {
4370 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4371 }
4372 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4373 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4374 }
4375 }
4376
4377 next_offset += envelope_size;
4378
4379 while next_offset < end_offset {
4381 _next_ordinal_to_read += 1;
4382 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4383 next_offset += envelope_size;
4384 }
4385
4386 Ok(())
4387 }
4388 }
4389
4390 impl NetworkState {
4391 #[inline(always)]
4392 fn max_ordinal_present(&self) -> u64 {
4393 if let Some(_) = self.status {
4394 return 3;
4395 }
4396 if let Some(_) = self.state {
4397 return 2;
4398 }
4399 if let Some(_) = self.id {
4400 return 1;
4401 }
4402 0
4403 }
4404 }
4405
4406 impl fidl::encoding::ValueTypeMarker for NetworkState {
4407 type Borrowed<'a> = &'a Self;
4408 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4409 value
4410 }
4411 }
4412
4413 unsafe impl fidl::encoding::TypeMarker for NetworkState {
4414 type Owned = Self;
4415
4416 #[inline(always)]
4417 fn inline_align(_context: fidl::encoding::Context) -> usize {
4418 8
4419 }
4420
4421 #[inline(always)]
4422 fn inline_size(_context: fidl::encoding::Context) -> usize {
4423 16
4424 }
4425 }
4426
4427 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkState, D>
4428 for &NetworkState
4429 {
4430 unsafe fn encode(
4431 self,
4432 encoder: &mut fidl::encoding::Encoder<'_, D>,
4433 offset: usize,
4434 mut depth: fidl::encoding::Depth,
4435 ) -> fidl::Result<()> {
4436 encoder.debug_check_bounds::<NetworkState>(offset);
4437 let max_ordinal: u64 = self.max_ordinal_present();
4439 encoder.write_num(max_ordinal, offset);
4440 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4441 if max_ordinal == 0 {
4443 return Ok(());
4444 }
4445 depth.increment()?;
4446 let envelope_size = 8;
4447 let bytes_len = max_ordinal as usize * envelope_size;
4448 #[allow(unused_variables)]
4449 let offset = encoder.out_of_line_offset(bytes_len);
4450 let mut _prev_end_offset: usize = 0;
4451 if 1 > max_ordinal {
4452 return Ok(());
4453 }
4454
4455 let cur_offset: usize = (1 - 1) * envelope_size;
4458
4459 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4461
4462 fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4467 self.id
4468 .as_ref()
4469 .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4470 encoder,
4471 offset + cur_offset,
4472 depth,
4473 )?;
4474
4475 _prev_end_offset = cur_offset + envelope_size;
4476 if 2 > max_ordinal {
4477 return Ok(());
4478 }
4479
4480 let cur_offset: usize = (2 - 1) * envelope_size;
4483
4484 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4486
4487 fidl::encoding::encode_in_envelope_optional::<ConnectionState, D>(
4492 self.state
4493 .as_ref()
4494 .map(<ConnectionState as fidl::encoding::ValueTypeMarker>::borrow),
4495 encoder,
4496 offset + cur_offset,
4497 depth,
4498 )?;
4499
4500 _prev_end_offset = cur_offset + envelope_size;
4501 if 3 > max_ordinal {
4502 return Ok(());
4503 }
4504
4505 let cur_offset: usize = (3 - 1) * envelope_size;
4508
4509 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4511
4512 fidl::encoding::encode_in_envelope_optional::<DisconnectStatus, D>(
4517 self.status
4518 .as_ref()
4519 .map(<DisconnectStatus as fidl::encoding::ValueTypeMarker>::borrow),
4520 encoder,
4521 offset + cur_offset,
4522 depth,
4523 )?;
4524
4525 _prev_end_offset = cur_offset + envelope_size;
4526
4527 Ok(())
4528 }
4529 }
4530
4531 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkState {
4532 #[inline(always)]
4533 fn new_empty() -> Self {
4534 Self::default()
4535 }
4536
4537 unsafe fn decode(
4538 &mut self,
4539 decoder: &mut fidl::encoding::Decoder<'_, D>,
4540 offset: usize,
4541 mut depth: fidl::encoding::Depth,
4542 ) -> fidl::Result<()> {
4543 decoder.debug_check_bounds::<Self>(offset);
4544 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4545 None => return Err(fidl::Error::NotNullable),
4546 Some(len) => len,
4547 };
4548 if len == 0 {
4550 return Ok(());
4551 };
4552 depth.increment()?;
4553 let envelope_size = 8;
4554 let bytes_len = len * envelope_size;
4555 let offset = decoder.out_of_line_offset(bytes_len)?;
4556 let mut _next_ordinal_to_read = 0;
4558 let mut next_offset = offset;
4559 let end_offset = offset + bytes_len;
4560 _next_ordinal_to_read += 1;
4561 if next_offset >= end_offset {
4562 return Ok(());
4563 }
4564
4565 while _next_ordinal_to_read < 1 {
4567 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4568 _next_ordinal_to_read += 1;
4569 next_offset += envelope_size;
4570 }
4571
4572 let next_out_of_line = decoder.next_out_of_line();
4573 let handles_before = decoder.remaining_handles();
4574 if let Some((inlined, num_bytes, num_handles)) =
4575 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4576 {
4577 let member_inline_size =
4578 <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4579 if inlined != (member_inline_size <= 4) {
4580 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4581 }
4582 let inner_offset;
4583 let mut inner_depth = depth.clone();
4584 if inlined {
4585 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4586 inner_offset = next_offset;
4587 } else {
4588 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4589 inner_depth.increment()?;
4590 }
4591 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4592 fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4593 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4594 {
4595 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4596 }
4597 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4598 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4599 }
4600 }
4601
4602 next_offset += envelope_size;
4603 _next_ordinal_to_read += 1;
4604 if next_offset >= end_offset {
4605 return Ok(());
4606 }
4607
4608 while _next_ordinal_to_read < 2 {
4610 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4611 _next_ordinal_to_read += 1;
4612 next_offset += envelope_size;
4613 }
4614
4615 let next_out_of_line = decoder.next_out_of_line();
4616 let handles_before = decoder.remaining_handles();
4617 if let Some((inlined, num_bytes, num_handles)) =
4618 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4619 {
4620 let member_inline_size =
4621 <ConnectionState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4622 if inlined != (member_inline_size <= 4) {
4623 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4624 }
4625 let inner_offset;
4626 let mut inner_depth = depth.clone();
4627 if inlined {
4628 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4629 inner_offset = next_offset;
4630 } else {
4631 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4632 inner_depth.increment()?;
4633 }
4634 let val_ref =
4635 self.state.get_or_insert_with(|| fidl::new_empty!(ConnectionState, D));
4636 fidl::decode!(ConnectionState, D, val_ref, decoder, inner_offset, inner_depth)?;
4637 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4638 {
4639 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4640 }
4641 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4642 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4643 }
4644 }
4645
4646 next_offset += envelope_size;
4647 _next_ordinal_to_read += 1;
4648 if next_offset >= end_offset {
4649 return Ok(());
4650 }
4651
4652 while _next_ordinal_to_read < 3 {
4654 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4655 _next_ordinal_to_read += 1;
4656 next_offset += envelope_size;
4657 }
4658
4659 let next_out_of_line = decoder.next_out_of_line();
4660 let handles_before = decoder.remaining_handles();
4661 if let Some((inlined, num_bytes, num_handles)) =
4662 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4663 {
4664 let member_inline_size =
4665 <DisconnectStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4666 if inlined != (member_inline_size <= 4) {
4667 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4668 }
4669 let inner_offset;
4670 let mut inner_depth = depth.clone();
4671 if inlined {
4672 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4673 inner_offset = next_offset;
4674 } else {
4675 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4676 inner_depth.increment()?;
4677 }
4678 let val_ref =
4679 self.status.get_or_insert_with(|| fidl::new_empty!(DisconnectStatus, D));
4680 fidl::decode!(DisconnectStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
4681 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4682 {
4683 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4684 }
4685 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4686 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4687 }
4688 }
4689
4690 next_offset += envelope_size;
4691
4692 while next_offset < end_offset {
4694 _next_ordinal_to_read += 1;
4695 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4696 next_offset += envelope_size;
4697 }
4698
4699 Ok(())
4700 }
4701 }
4702
4703 impl ScanResult {
4704 #[inline(always)]
4705 fn max_ordinal_present(&self) -> u64 {
4706 if let Some(_) = self.compatibility {
4707 return 3;
4708 }
4709 if let Some(_) = self.entries {
4710 return 2;
4711 }
4712 if let Some(_) = self.id {
4713 return 1;
4714 }
4715 0
4716 }
4717 }
4718
4719 impl fidl::encoding::ValueTypeMarker for ScanResult {
4720 type Borrowed<'a> = &'a Self;
4721 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4722 value
4723 }
4724 }
4725
4726 unsafe impl fidl::encoding::TypeMarker for ScanResult {
4727 type Owned = Self;
4728
4729 #[inline(always)]
4730 fn inline_align(_context: fidl::encoding::Context) -> usize {
4731 8
4732 }
4733
4734 #[inline(always)]
4735 fn inline_size(_context: fidl::encoding::Context) -> usize {
4736 16
4737 }
4738 }
4739
4740 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanResult, D>
4741 for &ScanResult
4742 {
4743 unsafe fn encode(
4744 self,
4745 encoder: &mut fidl::encoding::Encoder<'_, D>,
4746 offset: usize,
4747 mut depth: fidl::encoding::Depth,
4748 ) -> fidl::Result<()> {
4749 encoder.debug_check_bounds::<ScanResult>(offset);
4750 let max_ordinal: u64 = self.max_ordinal_present();
4752 encoder.write_num(max_ordinal, offset);
4753 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4754 if max_ordinal == 0 {
4756 return Ok(());
4757 }
4758 depth.increment()?;
4759 let envelope_size = 8;
4760 let bytes_len = max_ordinal as usize * envelope_size;
4761 #[allow(unused_variables)]
4762 let offset = encoder.out_of_line_offset(bytes_len);
4763 let mut _prev_end_offset: usize = 0;
4764 if 1 > max_ordinal {
4765 return Ok(());
4766 }
4767
4768 let cur_offset: usize = (1 - 1) * envelope_size;
4771
4772 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4774
4775 fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4780 self.id
4781 .as_ref()
4782 .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4783 encoder,
4784 offset + cur_offset,
4785 depth,
4786 )?;
4787
4788 _prev_end_offset = cur_offset + envelope_size;
4789 if 2 > max_ordinal {
4790 return Ok(());
4791 }
4792
4793 let cur_offset: usize = (2 - 1) * envelope_size;
4796
4797 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4799
4800 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Bss>, D>(
4805 self.entries.as_ref().map(<fidl::encoding::UnboundedVector<Bss> as fidl::encoding::ValueTypeMarker>::borrow),
4806 encoder, offset + cur_offset, depth
4807 )?;
4808
4809 _prev_end_offset = cur_offset + envelope_size;
4810 if 3 > max_ordinal {
4811 return Ok(());
4812 }
4813
4814 let cur_offset: usize = (3 - 1) * envelope_size;
4817
4818 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4820
4821 fidl::encoding::encode_in_envelope_optional::<Compatibility, D>(
4826 self.compatibility
4827 .as_ref()
4828 .map(<Compatibility as fidl::encoding::ValueTypeMarker>::borrow),
4829 encoder,
4830 offset + cur_offset,
4831 depth,
4832 )?;
4833
4834 _prev_end_offset = cur_offset + envelope_size;
4835
4836 Ok(())
4837 }
4838 }
4839
4840 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanResult {
4841 #[inline(always)]
4842 fn new_empty() -> Self {
4843 Self::default()
4844 }
4845
4846 unsafe fn decode(
4847 &mut self,
4848 decoder: &mut fidl::encoding::Decoder<'_, D>,
4849 offset: usize,
4850 mut depth: fidl::encoding::Depth,
4851 ) -> fidl::Result<()> {
4852 decoder.debug_check_bounds::<Self>(offset);
4853 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4854 None => return Err(fidl::Error::NotNullable),
4855 Some(len) => len,
4856 };
4857 if len == 0 {
4859 return Ok(());
4860 };
4861 depth.increment()?;
4862 let envelope_size = 8;
4863 let bytes_len = len * envelope_size;
4864 let offset = decoder.out_of_line_offset(bytes_len)?;
4865 let mut _next_ordinal_to_read = 0;
4867 let mut next_offset = offset;
4868 let end_offset = offset + bytes_len;
4869 _next_ordinal_to_read += 1;
4870 if next_offset >= end_offset {
4871 return Ok(());
4872 }
4873
4874 while _next_ordinal_to_read < 1 {
4876 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4877 _next_ordinal_to_read += 1;
4878 next_offset += envelope_size;
4879 }
4880
4881 let next_out_of_line = decoder.next_out_of_line();
4882 let handles_before = decoder.remaining_handles();
4883 if let Some((inlined, num_bytes, num_handles)) =
4884 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4885 {
4886 let member_inline_size =
4887 <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4888 if inlined != (member_inline_size <= 4) {
4889 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4890 }
4891 let inner_offset;
4892 let mut inner_depth = depth.clone();
4893 if inlined {
4894 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4895 inner_offset = next_offset;
4896 } else {
4897 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4898 inner_depth.increment()?;
4899 }
4900 let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4901 fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4902 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4903 {
4904 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4905 }
4906 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4907 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4908 }
4909 }
4910
4911 next_offset += envelope_size;
4912 _next_ordinal_to_read += 1;
4913 if next_offset >= end_offset {
4914 return Ok(());
4915 }
4916
4917 while _next_ordinal_to_read < 2 {
4919 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4920 _next_ordinal_to_read += 1;
4921 next_offset += envelope_size;
4922 }
4923
4924 let next_out_of_line = decoder.next_out_of_line();
4925 let handles_before = decoder.remaining_handles();
4926 if let Some((inlined, num_bytes, num_handles)) =
4927 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4928 {
4929 let member_inline_size = <fidl::encoding::UnboundedVector<Bss> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4930 if inlined != (member_inline_size <= 4) {
4931 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4932 }
4933 let inner_offset;
4934 let mut inner_depth = depth.clone();
4935 if inlined {
4936 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4937 inner_offset = next_offset;
4938 } else {
4939 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4940 inner_depth.increment()?;
4941 }
4942 let val_ref = self.entries.get_or_insert_with(|| {
4943 fidl::new_empty!(fidl::encoding::UnboundedVector<Bss>, D)
4944 });
4945 fidl::decode!(
4946 fidl::encoding::UnboundedVector<Bss>,
4947 D,
4948 val_ref,
4949 decoder,
4950 inner_offset,
4951 inner_depth
4952 )?;
4953 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4954 {
4955 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4956 }
4957 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4958 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4959 }
4960 }
4961
4962 next_offset += envelope_size;
4963 _next_ordinal_to_read += 1;
4964 if next_offset >= end_offset {
4965 return Ok(());
4966 }
4967
4968 while _next_ordinal_to_read < 3 {
4970 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4971 _next_ordinal_to_read += 1;
4972 next_offset += envelope_size;
4973 }
4974
4975 let next_out_of_line = decoder.next_out_of_line();
4976 let handles_before = decoder.remaining_handles();
4977 if let Some((inlined, num_bytes, num_handles)) =
4978 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4979 {
4980 let member_inline_size =
4981 <Compatibility as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4982 if inlined != (member_inline_size <= 4) {
4983 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4984 }
4985 let inner_offset;
4986 let mut inner_depth = depth.clone();
4987 if inlined {
4988 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4989 inner_offset = next_offset;
4990 } else {
4991 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4992 inner_depth.increment()?;
4993 }
4994 let val_ref =
4995 self.compatibility.get_or_insert_with(|| fidl::new_empty!(Compatibility, D));
4996 fidl::decode!(Compatibility, D, val_ref, decoder, inner_offset, inner_depth)?;
4997 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4998 {
4999 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5000 }
5001 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5002 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5003 }
5004 }
5005
5006 next_offset += envelope_size;
5007
5008 while next_offset < end_offset {
5010 _next_ordinal_to_read += 1;
5011 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5012 next_offset += envelope_size;
5013 }
5014
5015 Ok(())
5016 }
5017 }
5018
5019 impl fidl::encoding::ValueTypeMarker for Credential {
5020 type Borrowed<'a> = &'a Self;
5021 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5022 value
5023 }
5024 }
5025
5026 unsafe impl fidl::encoding::TypeMarker for Credential {
5027 type Owned = Self;
5028
5029 #[inline(always)]
5030 fn inline_align(_context: fidl::encoding::Context) -> usize {
5031 8
5032 }
5033
5034 #[inline(always)]
5035 fn inline_size(_context: fidl::encoding::Context) -> usize {
5036 16
5037 }
5038 }
5039
5040 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Credential, D>
5041 for &Credential
5042 {
5043 #[inline]
5044 unsafe fn encode(
5045 self,
5046 encoder: &mut fidl::encoding::Encoder<'_, D>,
5047 offset: usize,
5048 _depth: fidl::encoding::Depth,
5049 ) -> fidl::Result<()> {
5050 encoder.debug_check_bounds::<Credential>(offset);
5051 encoder.write_num::<u64>(self.ordinal(), offset);
5052 match self {
5053 Credential::None(ref val) => {
5054 fidl::encoding::encode_in_envelope::<Empty, D>(
5055 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
5056 encoder, offset + 8, _depth
5057 )
5058 }
5059 Credential::Password(ref val) => {
5060 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5061 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5062 encoder, offset + 8, _depth
5063 )
5064 }
5065 Credential::Psk(ref val) => {
5066 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5067 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5068 encoder, offset + 8, _depth
5069 )
5070 }
5071 Credential::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5072 }
5073 }
5074 }
5075
5076 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Credential {
5077 #[inline(always)]
5078 fn new_empty() -> Self {
5079 Self::__SourceBreaking { unknown_ordinal: 0 }
5080 }
5081
5082 #[inline]
5083 unsafe fn decode(
5084 &mut self,
5085 decoder: &mut fidl::encoding::Decoder<'_, D>,
5086 offset: usize,
5087 mut depth: fidl::encoding::Depth,
5088 ) -> fidl::Result<()> {
5089 decoder.debug_check_bounds::<Self>(offset);
5090 #[allow(unused_variables)]
5091 let next_out_of_line = decoder.next_out_of_line();
5092 let handles_before = decoder.remaining_handles();
5093 let (ordinal, inlined, num_bytes, num_handles) =
5094 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5095
5096 let member_inline_size = match ordinal {
5097 1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5098 2 => {
5099 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5100 decoder.context,
5101 )
5102 }
5103 3 => {
5104 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5105 decoder.context,
5106 )
5107 }
5108 0 => return Err(fidl::Error::UnknownUnionTag),
5109 _ => num_bytes as usize,
5110 };
5111
5112 if inlined != (member_inline_size <= 4) {
5113 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5114 }
5115 let _inner_offset;
5116 if inlined {
5117 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5118 _inner_offset = offset + 8;
5119 } else {
5120 depth.increment()?;
5121 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5122 }
5123 match ordinal {
5124 1 => {
5125 #[allow(irrefutable_let_patterns)]
5126 if let Credential::None(_) = self {
5127 } else {
5129 *self = Credential::None(fidl::new_empty!(Empty, D));
5131 }
5132 #[allow(irrefutable_let_patterns)]
5133 if let Credential::None(ref mut val) = self {
5134 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
5135 } else {
5136 unreachable!()
5137 }
5138 }
5139 2 => {
5140 #[allow(irrefutable_let_patterns)]
5141 if let Credential::Password(_) = self {
5142 } else {
5144 *self = Credential::Password(fidl::new_empty!(
5146 fidl::encoding::UnboundedVector<u8>,
5147 D
5148 ));
5149 }
5150 #[allow(irrefutable_let_patterns)]
5151 if let Credential::Password(ref mut val) = self {
5152 fidl::decode!(
5153 fidl::encoding::UnboundedVector<u8>,
5154 D,
5155 val,
5156 decoder,
5157 _inner_offset,
5158 depth
5159 )?;
5160 } else {
5161 unreachable!()
5162 }
5163 }
5164 3 => {
5165 #[allow(irrefutable_let_patterns)]
5166 if let Credential::Psk(_) = self {
5167 } else {
5169 *self = Credential::Psk(fidl::new_empty!(
5171 fidl::encoding::UnboundedVector<u8>,
5172 D
5173 ));
5174 }
5175 #[allow(irrefutable_let_patterns)]
5176 if let Credential::Psk(ref mut val) = self {
5177 fidl::decode!(
5178 fidl::encoding::UnboundedVector<u8>,
5179 D,
5180 val,
5181 decoder,
5182 _inner_offset,
5183 depth
5184 )?;
5185 } else {
5186 unreachable!()
5187 }
5188 }
5189 #[allow(deprecated)]
5190 ordinal => {
5191 for _ in 0..num_handles {
5192 decoder.drop_next_handle()?;
5193 }
5194 *self = Credential::__SourceBreaking { unknown_ordinal: ordinal };
5195 }
5196 }
5197 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5198 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5199 }
5200 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5201 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5202 }
5203 Ok(())
5204 }
5205 }
5206}