1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type LocalKey = Key;
13
14pub const MAX_PEER_SERVICES: u16 = 65535;
17
18#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
21#[repr(u32)]
22pub enum BondableMode {
23 Bondable = 1,
25 NonBondable = 2,
27}
28
29impl BondableMode {
30 #[inline]
31 pub fn from_primitive(prim: u32) -> Option<Self> {
32 match prim {
33 1 => Some(Self::Bondable),
34 2 => Some(Self::NonBondable),
35 _ => None,
36 }
37 }
38
39 #[inline]
40 pub const fn into_primitive(self) -> u32 {
41 self as u32
42 }
43
44 #[deprecated = "Strict enums should not use `is_unknown`"]
45 #[inline]
46 pub fn is_unknown(&self) -> bool {
47 false
48 }
49}
50
51#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
52#[repr(u32)]
53pub enum BootstrapError {
54 InvalidHostIdentity = 1,
55 WriteFailure = 2,
56}
57
58impl BootstrapError {
59 #[inline]
60 pub fn from_primitive(prim: u32) -> Option<Self> {
61 match prim {
62 1 => Some(Self::InvalidHostIdentity),
63 2 => Some(Self::WriteFailure),
64 _ => None,
65 }
66 }
67
68 #[inline]
69 pub const fn into_primitive(self) -> u32 {
70 self as u32
71 }
72
73 #[deprecated = "Strict enums should not use `is_unknown`"]
74 #[inline]
75 pub fn is_unknown(&self) -> bool {
76 false
77 }
78}
79
80#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
85#[repr(u32)]
86pub enum BrEdrSecurityMode {
87 Mode4 = 1,
92 SecureConnectionsOnly = 2,
98}
99
100impl BrEdrSecurityMode {
101 #[inline]
102 pub fn from_primitive(prim: u32) -> Option<Self> {
103 match prim {
104 1 => Some(Self::Mode4),
105 2 => Some(Self::SecureConnectionsOnly),
106 _ => None,
107 }
108 }
109
110 #[inline]
111 pub const fn into_primitive(self) -> u32 {
112 self as u32
113 }
114
115 #[deprecated = "Strict enums should not use `is_unknown`"]
116 #[inline]
117 pub fn is_unknown(&self) -> bool {
118 false
119 }
120}
121
122#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
123#[repr(u32)]
124pub enum Error {
125 Failed = 1,
127 PeerNotFound = 2,
129 TimedOut = 3,
131 Canceled = 4,
133 InProgress = 5,
135 NotSupported = 6,
137 InvalidArguments = 7,
139}
140
141impl Error {
142 #[inline]
143 pub fn from_primitive(prim: u32) -> Option<Self> {
144 match prim {
145 1 => Some(Self::Failed),
146 2 => Some(Self::PeerNotFound),
147 3 => Some(Self::TimedOut),
148 4 => Some(Self::Canceled),
149 5 => Some(Self::InProgress),
150 6 => Some(Self::NotSupported),
151 7 => Some(Self::InvalidArguments),
152 _ => None,
153 }
154 }
155
156 #[inline]
157 pub const fn into_primitive(self) -> u32 {
158 self as u32
159 }
160
161 #[deprecated = "Strict enums should not use `is_unknown`"]
162 #[inline]
163 pub fn is_unknown(&self) -> bool {
164 false
165 }
166}
167
168#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
173#[repr(u32)]
174pub enum InputCapability {
175 None = 1,
180 Confirmation = 2,
182 Keyboard = 3,
185}
186
187impl InputCapability {
188 #[inline]
189 pub fn from_primitive(prim: u32) -> Option<Self> {
190 match prim {
191 1 => Some(Self::None),
192 2 => Some(Self::Confirmation),
193 3 => Some(Self::Keyboard),
194 _ => None,
195 }
196 }
197
198 #[inline]
199 pub const fn into_primitive(self) -> u32 {
200 self as u32
201 }
202
203 #[deprecated = "Strict enums should not use `is_unknown`"]
204 #[inline]
205 pub fn is_unknown(&self) -> bool {
206 false
207 }
208}
209
210#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
215#[repr(u32)]
216pub enum LeSecurityMode {
217 Mode1 = 1,
221 SecureConnectionsOnly = 2,
227}
228
229impl LeSecurityMode {
230 #[inline]
231 pub fn from_primitive(prim: u32) -> Option<Self> {
232 match prim {
233 1 => Some(Self::Mode1),
234 2 => Some(Self::SecureConnectionsOnly),
235 _ => None,
236 }
237 }
238
239 #[inline]
240 pub const fn into_primitive(self) -> u32 {
241 self as u32
242 }
243
244 #[deprecated = "Strict enums should not use `is_unknown`"]
245 #[inline]
246 pub fn is_unknown(&self) -> bool {
247 false
248 }
249}
250
251#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
256#[repr(u32)]
257pub enum OutputCapability {
258 None = 1,
260 Display = 2,
262}
263
264impl OutputCapability {
265 #[inline]
266 pub fn from_primitive(prim: u32) -> Option<Self> {
267 match prim {
268 1 => Some(Self::None),
269 2 => Some(Self::Display),
270 _ => None,
271 }
272 }
273
274 #[inline]
275 pub const fn into_primitive(self) -> u32 {
276 self as u32
277 }
278
279 #[deprecated = "Strict enums should not use `is_unknown`"]
280 #[inline]
281 pub fn is_unknown(&self) -> bool {
282 false
283 }
284}
285
286#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
290#[repr(u32)]
291pub enum PairingKeypress {
292 DigitEntered = 1,
294 DigitErased = 2,
296 PasskeyCleared = 3,
298 PasskeyEntered = 4,
300}
301
302impl PairingKeypress {
303 #[inline]
304 pub fn from_primitive(prim: u32) -> Option<Self> {
305 match prim {
306 1 => Some(Self::DigitEntered),
307 2 => Some(Self::DigitErased),
308 3 => Some(Self::PasskeyCleared),
309 4 => Some(Self::PasskeyEntered),
310 _ => None,
311 }
312 }
313
314 #[inline]
315 pub const fn into_primitive(self) -> u32 {
316 self as u32
317 }
318
319 #[deprecated = "Strict enums should not use `is_unknown`"]
320 #[inline]
321 pub fn is_unknown(&self) -> bool {
322 false
323 }
324}
325
326#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
329#[repr(u32)]
330pub enum PairingMethod {
331 Consent = 1,
336 PasskeyDisplay = 2,
339 PasskeyComparison = 3,
343 PasskeyEntry = 4,
346}
347
348impl PairingMethod {
349 #[inline]
350 pub fn from_primitive(prim: u32) -> Option<Self> {
351 match prim {
352 1 => Some(Self::Consent),
353 2 => Some(Self::PasskeyDisplay),
354 3 => Some(Self::PasskeyComparison),
355 4 => Some(Self::PasskeyEntry),
356 _ => None,
357 }
358 }
359
360 #[inline]
361 pub const fn into_primitive(self) -> u32 {
362 self as u32
363 }
364
365 #[deprecated = "Strict enums should not use `is_unknown`"]
366 #[inline]
367 pub fn is_unknown(&self) -> bool {
368 false
369 }
370}
371
372#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
375#[repr(u32)]
376pub enum PairingSecurityLevel {
377 Encrypted = 1,
379 Authenticated = 2,
382}
383
384impl PairingSecurityLevel {
385 #[inline]
386 pub fn from_primitive(prim: u32) -> Option<Self> {
387 match prim {
388 1 => Some(Self::Encrypted),
389 2 => Some(Self::Authenticated),
390 _ => None,
391 }
392 }
393
394 #[inline]
395 pub const fn into_primitive(self) -> u32 {
396 self as u32
397 }
398
399 #[deprecated = "Strict enums should not use `is_unknown`"]
400 #[inline]
401 pub fn is_unknown(&self) -> bool {
402 false
403 }
404}
405
406#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
407#[repr(u32)]
408pub enum TechnologyType {
409 LowEnergy = 1,
410 Classic = 2,
411 DualMode = 3,
412}
413
414impl TechnologyType {
415 #[inline]
416 pub fn from_primitive(prim: u32) -> Option<Self> {
417 match prim {
418 1 => Some(Self::LowEnergy),
419 2 => Some(Self::Classic),
420 3 => Some(Self::DualMode),
421 _ => None,
422 }
423 }
424
425 #[inline]
426 pub const fn into_primitive(self) -> u32 {
427 self as u32
428 }
429
430 #[deprecated = "Strict enums should not use `is_unknown`"]
431 #[inline]
432 pub fn is_unknown(&self) -> bool {
433 false
434 }
435}
436
437#[derive(Clone, Debug, PartialEq)]
438pub struct AccessConnectRequest {
439 pub id: fidl_fuchsia_bluetooth::PeerId,
440}
441
442impl fidl::Persistable for AccessConnectRequest {}
443
444#[derive(Clone, Debug, PartialEq)]
445pub struct AccessDisconnectRequest {
446 pub id: fidl_fuchsia_bluetooth::PeerId,
447}
448
449impl fidl::Persistable for AccessDisconnectRequest {}
450
451#[derive(Clone, Debug, PartialEq)]
452pub struct AccessForgetRequest {
453 pub id: fidl_fuchsia_bluetooth::PeerId,
454}
455
456impl fidl::Persistable for AccessForgetRequest {}
457
458#[derive(Clone, Debug, PartialEq)]
459pub struct AccessPairRequest {
460 pub id: fidl_fuchsia_bluetooth::PeerId,
461 pub options: PairingOptions,
462}
463
464impl fidl::Persistable for AccessPairRequest {}
465
466#[derive(Clone, Debug, PartialEq)]
467pub struct AccessSetDeviceClassRequest {
468 pub device_class: fidl_fuchsia_bluetooth::DeviceClass,
469}
470
471impl fidl::Persistable for AccessSetDeviceClassRequest {}
472
473#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
474pub struct AccessSetLocalNameRequest {
475 pub name: String,
476}
477
478impl fidl::Persistable for AccessSetLocalNameRequest {}
479
480#[derive(Clone, Debug, PartialEq)]
481pub struct AccessWatchPeersResponse {
482 pub updated: Vec<Peer>,
483 pub removed: Vec<fidl_fuchsia_bluetooth::PeerId>,
484}
485
486impl fidl::Persistable for AccessWatchPeersResponse {}
487
488#[derive(Clone, Debug, PartialEq)]
489pub struct BootstrapAddIdentitiesRequest {
490 pub identities: Vec<Identity>,
491}
492
493impl fidl::Persistable for BootstrapAddIdentitiesRequest {}
494
495#[derive(Clone, Debug, PartialEq)]
496pub struct ConfigurationUpdateRequest {
497 pub settings: Settings,
498}
499
500impl fidl::Persistable for ConfigurationUpdateRequest {}
501
502#[derive(Clone, Debug, PartialEq)]
503pub struct ConfigurationUpdateResponse {
504 pub result: Settings,
505}
506
507impl fidl::Persistable for ConfigurationUpdateResponse {}
508
509#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
510pub struct Consent;
511
512impl fidl::Persistable for Consent {}
513
514#[derive(Clone, Debug, PartialEq)]
515pub struct HostWatcherSetActiveRequest {
516 pub id: fidl_fuchsia_bluetooth::HostId,
517}
518
519impl fidl::Persistable for HostWatcherSetActiveRequest {}
520
521#[derive(Clone, Debug, PartialEq)]
522pub struct HostWatcherWatchResponse {
523 pub hosts: Vec<HostInfo>,
524}
525
526impl fidl::Persistable for HostWatcherWatchResponse {}
527
528#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
530#[repr(C)]
531pub struct Key {
532 pub value: [u8; 16],
533}
534
535impl fidl::Persistable for Key {}
536
537#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
539#[repr(C)]
540pub struct LeConnectionParameters {
541 pub connection_interval: u16,
542 pub connection_latency: u16,
543 pub supervision_timeout: u16,
544}
545
546impl fidl::Persistable for LeConnectionParameters {}
547
548#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
551pub struct Ltk {
552 pub key: PeerKey,
553 pub ediv: u16,
554 pub rand: u64,
555}
556
557impl fidl::Persistable for Ltk {}
558
559#[derive(Clone, Debug, PartialEq)]
560pub struct PairingDelegate2RequestCompleteRequest {
561 pub id: fidl_fuchsia_bluetooth::PeerId,
562 pub success: bool,
563}
564
565impl fidl::Persistable for PairingDelegate2RequestCompleteRequest {}
566
567#[derive(Clone, Debug, PartialEq)]
568pub struct PairingDelegateOnLocalKeypressRequest {
569 pub id: fidl_fuchsia_bluetooth::PeerId,
570 pub keypress: PairingKeypress,
571}
572
573impl fidl::Persistable for PairingDelegateOnLocalKeypressRequest {}
574
575#[derive(Clone, Debug, PartialEq)]
576pub struct PairingDelegateOnPairingCompleteRequest {
577 pub id: fidl_fuchsia_bluetooth::PeerId,
578 pub success: bool,
579}
580
581impl fidl::Persistable for PairingDelegateOnPairingCompleteRequest {}
582
583#[derive(Clone, Debug, PartialEq)]
584pub struct PairingDelegateOnPairingRequestRequest {
585 pub peer: Peer,
586 pub method: PairingMethod,
587 pub displayed_passkey: u32,
588}
589
590impl fidl::Persistable for PairingDelegateOnPairingRequestRequest {}
591
592#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
593pub struct PairingDelegateOnPairingRequestResponse {
594 pub accept: bool,
595 pub entered_passkey: u32,
596}
597
598impl fidl::Persistable for PairingDelegateOnPairingRequestResponse {}
599
600#[derive(Clone, Debug, PartialEq)]
601pub struct PairingDelegateOnRemoteKeypressRequest {
602 pub id: fidl_fuchsia_bluetooth::PeerId,
603 pub keypress: PairingKeypress,
604}
605
606impl fidl::Persistable for PairingDelegateOnRemoteKeypressRequest {}
607
608#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
609pub struct PairingRequestKeypressRequest {
610 pub keypress: PairingKeypress,
611}
612
613impl fidl::Persistable for PairingRequestKeypressRequest {}
614
615#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
616pub struct PairingRequestOnCompleteRequest {
617 pub success: bool,
618}
619
620impl fidl::Persistable for PairingRequestOnCompleteRequest {}
621
622#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
623pub struct PairingRequestOnKeypressRequest {
624 pub keypress: PairingKeypress,
625}
626
627impl fidl::Persistable for PairingRequestOnKeypressRequest {}
628
629#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
630pub struct PasskeyEntry;
631
632impl fidl::Persistable for PasskeyEntry {}
633
634#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
636pub struct PeerKey {
637 pub security: SecurityProperties,
639 pub data: Key,
641}
642
643impl fidl::Persistable for PeerKey {}
644
645#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
646pub struct SecurityProperties {
647 pub authenticated: bool,
648 pub secure_connections: bool,
649 pub encryption_key_size: u8,
650}
651
652impl fidl::Persistable for SecurityProperties {}
653
654#[derive(Clone, Debug, Default, PartialEq)]
656pub struct BondingData {
657 pub identifier: Option<fidl_fuchsia_bluetooth::PeerId>,
659 pub local_address: Option<fidl_fuchsia_bluetooth::Address>,
661 pub name: Option<String>,
663 pub address: Option<fidl_fuchsia_bluetooth::Address>,
665 pub le_bond: Option<LeBondData>,
667 pub bredr_bond: Option<BredrBondData>,
669 #[doc(hidden)]
670 pub __source_breaking: fidl::marker::SourceBreaking,
671}
672
673impl fidl::Persistable for BondingData {}
674
675#[derive(Clone, Debug, Default, PartialEq)]
676pub struct BredrBondData {
677 pub role_preference: Option<fidl_fuchsia_bluetooth::ConnectionRole>,
681 pub services: Option<Vec<fidl_fuchsia_bluetooth::Uuid>>,
683 pub link_key: Option<PeerKey>,
686 #[doc(hidden)]
687 pub __source_breaking: fidl::marker::SourceBreaking,
688}
689
690impl fidl::Persistable for BredrBondData {}
691
692#[derive(Clone, Debug, Default, PartialEq)]
694pub struct HostData {
695 pub irk: Option<Key>,
704 #[doc(hidden)]
705 pub __source_breaking: fidl::marker::SourceBreaking,
706}
707
708impl fidl::Persistable for HostData {}
709
710#[derive(Clone, Debug, Default, PartialEq)]
712pub struct HostInfo {
713 pub id: Option<fidl_fuchsia_bluetooth::HostId>,
717 pub technology: Option<TechnologyType>,
721 pub active: Option<bool>,
724 pub local_name: Option<String>,
727 pub discoverable: Option<bool>,
730 pub discovering: Option<bool>,
732 pub addresses: Option<Vec<fidl_fuchsia_bluetooth::Address>>,
738 #[doc(hidden)]
739 pub __source_breaking: fidl::marker::SourceBreaking,
740}
741
742impl fidl::Persistable for HostInfo {}
743
744#[derive(Clone, Debug, Default, PartialEq)]
754pub struct Identity {
755 pub host: Option<HostData>,
756 pub bonds: Option<Vec<BondingData>>,
758 #[doc(hidden)]
759 pub __source_breaking: fidl::marker::SourceBreaking,
760}
761
762impl fidl::Persistable for Identity {}
763
764#[derive(Clone, Debug, Default, PartialEq)]
765pub struct LeBondData {
766 pub connection_parameters: Option<LeConnectionParameters>,
768 pub services: Option<Vec<fidl_fuchsia_bluetooth::Uuid>>,
770 pub irk: Option<PeerKey>,
772 pub csrk: Option<PeerKey>,
774 pub peer_ltk: Option<Ltk>,
780 pub local_ltk: Option<Ltk>,
786 #[doc(hidden)]
787 pub __source_breaking: fidl::marker::SourceBreaking,
788}
789
790impl fidl::Persistable for LeBondData {}
791
792#[derive(Clone, Debug, Default, PartialEq)]
795pub struct PairingOptions {
796 pub le_security_level: Option<PairingSecurityLevel>,
799 pub bondable_mode: Option<BondableMode>,
805 pub transport: Option<TechnologyType>,
810 #[doc(hidden)]
811 pub __source_breaking: fidl::marker::SourceBreaking,
812}
813
814impl fidl::Persistable for PairingOptions {}
815
816#[derive(Clone, Debug, Default, PartialEq)]
817pub struct PairingRequestAcceptRequest {
818 pub entered_passkey: Option<u32>,
819 #[doc(hidden)]
820 pub __source_breaking: fidl::marker::SourceBreaking,
821}
822
823impl fidl::Persistable for PairingRequestAcceptRequest {}
824
825#[derive(Clone, Debug, Default, PartialEq)]
827pub struct Peer {
828 pub id: Option<fidl_fuchsia_bluetooth::PeerId>,
832 pub address: Option<fidl_fuchsia_bluetooth::Address>,
840 pub technology: Option<TechnologyType>,
844 pub connected: Option<bool>,
848 pub bonded: Option<bool>,
852 pub name: Option<String>,
854 pub appearance: Option<fidl_fuchsia_bluetooth::Appearance>,
857 pub device_class: Option<fidl_fuchsia_bluetooth::DeviceClass>,
859 pub rssi: Option<i8>,
861 pub tx_power: Option<i8>,
863 pub services: Option<Vec<fidl_fuchsia_bluetooth::Uuid>>,
867 pub le_services: Option<Vec<fidl_fuchsia_bluetooth::Uuid>>,
871 pub bredr_services: Option<Vec<fidl_fuchsia_bluetooth::Uuid>>,
878 #[doc(hidden)]
879 pub __source_breaking: fidl::marker::SourceBreaking,
880}
881
882impl fidl::Persistable for Peer {}
883
884#[derive(Clone, Debug, Default, PartialEq)]
888pub struct Settings {
889 pub le_privacy: Option<bool>,
897 pub le_background_scan: Option<bool>,
902 pub bredr_connectable_mode: Option<bool>,
906 pub le_security_mode: Option<LeSecurityMode>,
911 pub bredr_security_mode: Option<BrEdrSecurityMode>,
916 #[doc(hidden)]
917 pub __source_breaking: fidl::marker::SourceBreaking,
918}
919
920impl fidl::Persistable for Settings {}
921
922#[derive(Clone, Debug)]
923pub enum PairingProperties {
924 Consent(Consent),
929 PasskeyDisplay(u32),
933 PasskeyConfirmation(u32),
938 PasskeyEntry(PasskeyEntry),
941 #[doc(hidden)]
942 __SourceBreaking { unknown_ordinal: u64 },
943}
944
945#[macro_export]
947macro_rules! PairingPropertiesUnknown {
948 () => {
949 _
950 };
951}
952
953impl PartialEq for PairingProperties {
955 fn eq(&self, other: &Self) -> bool {
956 match (self, other) {
957 (Self::Consent(x), Self::Consent(y)) => *x == *y,
958 (Self::PasskeyDisplay(x), Self::PasskeyDisplay(y)) => *x == *y,
959 (Self::PasskeyConfirmation(x), Self::PasskeyConfirmation(y)) => *x == *y,
960 (Self::PasskeyEntry(x), Self::PasskeyEntry(y)) => *x == *y,
961 _ => false,
962 }
963 }
964}
965
966impl PairingProperties {
967 #[inline]
968 pub fn ordinal(&self) -> u64 {
969 match *self {
970 Self::Consent(_) => 1,
971 Self::PasskeyDisplay(_) => 2,
972 Self::PasskeyConfirmation(_) => 3,
973 Self::PasskeyEntry(_) => 4,
974 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
975 }
976 }
977
978 #[inline]
979 pub fn unknown_variant_for_testing() -> Self {
980 Self::__SourceBreaking { unknown_ordinal: 0 }
981 }
982
983 #[inline]
984 pub fn is_unknown(&self) -> bool {
985 match self {
986 Self::__SourceBreaking { .. } => true,
987 _ => false,
988 }
989 }
990}
991
992impl fidl::Persistable for PairingProperties {}
993
994mod internal {
995 use super::*;
996 unsafe impl fidl::encoding::TypeMarker for BondableMode {
997 type Owned = Self;
998
999 #[inline(always)]
1000 fn inline_align(_context: fidl::encoding::Context) -> usize {
1001 std::mem::align_of::<u32>()
1002 }
1003
1004 #[inline(always)]
1005 fn inline_size(_context: fidl::encoding::Context) -> usize {
1006 std::mem::size_of::<u32>()
1007 }
1008
1009 #[inline(always)]
1010 fn encode_is_copy() -> bool {
1011 true
1012 }
1013
1014 #[inline(always)]
1015 fn decode_is_copy() -> bool {
1016 false
1017 }
1018 }
1019
1020 impl fidl::encoding::ValueTypeMarker for BondableMode {
1021 type Borrowed<'a> = Self;
1022 #[inline(always)]
1023 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1024 *value
1025 }
1026 }
1027
1028 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BondableMode {
1029 #[inline]
1030 unsafe fn encode(
1031 self,
1032 encoder: &mut fidl::encoding::Encoder<'_, D>,
1033 offset: usize,
1034 _depth: fidl::encoding::Depth,
1035 ) -> fidl::Result<()> {
1036 encoder.debug_check_bounds::<Self>(offset);
1037 encoder.write_num(self.into_primitive(), offset);
1038 Ok(())
1039 }
1040 }
1041
1042 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BondableMode {
1043 #[inline(always)]
1044 fn new_empty() -> Self {
1045 Self::Bondable
1046 }
1047
1048 #[inline]
1049 unsafe fn decode(
1050 &mut self,
1051 decoder: &mut fidl::encoding::Decoder<'_, D>,
1052 offset: usize,
1053 _depth: fidl::encoding::Depth,
1054 ) -> fidl::Result<()> {
1055 decoder.debug_check_bounds::<Self>(offset);
1056 let prim = decoder.read_num::<u32>(offset);
1057
1058 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1059 Ok(())
1060 }
1061 }
1062 unsafe impl fidl::encoding::TypeMarker for BootstrapError {
1063 type Owned = Self;
1064
1065 #[inline(always)]
1066 fn inline_align(_context: fidl::encoding::Context) -> usize {
1067 std::mem::align_of::<u32>()
1068 }
1069
1070 #[inline(always)]
1071 fn inline_size(_context: fidl::encoding::Context) -> usize {
1072 std::mem::size_of::<u32>()
1073 }
1074
1075 #[inline(always)]
1076 fn encode_is_copy() -> bool {
1077 true
1078 }
1079
1080 #[inline(always)]
1081 fn decode_is_copy() -> bool {
1082 false
1083 }
1084 }
1085
1086 impl fidl::encoding::ValueTypeMarker for BootstrapError {
1087 type Borrowed<'a> = Self;
1088 #[inline(always)]
1089 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1090 *value
1091 }
1092 }
1093
1094 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BootstrapError {
1095 #[inline]
1096 unsafe fn encode(
1097 self,
1098 encoder: &mut fidl::encoding::Encoder<'_, D>,
1099 offset: usize,
1100 _depth: fidl::encoding::Depth,
1101 ) -> fidl::Result<()> {
1102 encoder.debug_check_bounds::<Self>(offset);
1103 encoder.write_num(self.into_primitive(), offset);
1104 Ok(())
1105 }
1106 }
1107
1108 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BootstrapError {
1109 #[inline(always)]
1110 fn new_empty() -> Self {
1111 Self::InvalidHostIdentity
1112 }
1113
1114 #[inline]
1115 unsafe fn decode(
1116 &mut self,
1117 decoder: &mut fidl::encoding::Decoder<'_, D>,
1118 offset: usize,
1119 _depth: fidl::encoding::Depth,
1120 ) -> fidl::Result<()> {
1121 decoder.debug_check_bounds::<Self>(offset);
1122 let prim = decoder.read_num::<u32>(offset);
1123
1124 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1125 Ok(())
1126 }
1127 }
1128 unsafe impl fidl::encoding::TypeMarker for BrEdrSecurityMode {
1129 type Owned = Self;
1130
1131 #[inline(always)]
1132 fn inline_align(_context: fidl::encoding::Context) -> usize {
1133 std::mem::align_of::<u32>()
1134 }
1135
1136 #[inline(always)]
1137 fn inline_size(_context: fidl::encoding::Context) -> usize {
1138 std::mem::size_of::<u32>()
1139 }
1140
1141 #[inline(always)]
1142 fn encode_is_copy() -> bool {
1143 true
1144 }
1145
1146 #[inline(always)]
1147 fn decode_is_copy() -> bool {
1148 false
1149 }
1150 }
1151
1152 impl fidl::encoding::ValueTypeMarker for BrEdrSecurityMode {
1153 type Borrowed<'a> = Self;
1154 #[inline(always)]
1155 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1156 *value
1157 }
1158 }
1159
1160 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1161 for BrEdrSecurityMode
1162 {
1163 #[inline]
1164 unsafe fn encode(
1165 self,
1166 encoder: &mut fidl::encoding::Encoder<'_, D>,
1167 offset: usize,
1168 _depth: fidl::encoding::Depth,
1169 ) -> fidl::Result<()> {
1170 encoder.debug_check_bounds::<Self>(offset);
1171 encoder.write_num(self.into_primitive(), offset);
1172 Ok(())
1173 }
1174 }
1175
1176 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrEdrSecurityMode {
1177 #[inline(always)]
1178 fn new_empty() -> Self {
1179 Self::Mode4
1180 }
1181
1182 #[inline]
1183 unsafe fn decode(
1184 &mut self,
1185 decoder: &mut fidl::encoding::Decoder<'_, D>,
1186 offset: usize,
1187 _depth: fidl::encoding::Depth,
1188 ) -> fidl::Result<()> {
1189 decoder.debug_check_bounds::<Self>(offset);
1190 let prim = decoder.read_num::<u32>(offset);
1191
1192 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1193 Ok(())
1194 }
1195 }
1196 unsafe impl fidl::encoding::TypeMarker for Error {
1197 type Owned = Self;
1198
1199 #[inline(always)]
1200 fn inline_align(_context: fidl::encoding::Context) -> usize {
1201 std::mem::align_of::<u32>()
1202 }
1203
1204 #[inline(always)]
1205 fn inline_size(_context: fidl::encoding::Context) -> usize {
1206 std::mem::size_of::<u32>()
1207 }
1208
1209 #[inline(always)]
1210 fn encode_is_copy() -> bool {
1211 true
1212 }
1213
1214 #[inline(always)]
1215 fn decode_is_copy() -> bool {
1216 false
1217 }
1218 }
1219
1220 impl fidl::encoding::ValueTypeMarker for Error {
1221 type Borrowed<'a> = Self;
1222 #[inline(always)]
1223 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1224 *value
1225 }
1226 }
1227
1228 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
1229 #[inline]
1230 unsafe fn encode(
1231 self,
1232 encoder: &mut fidl::encoding::Encoder<'_, D>,
1233 offset: usize,
1234 _depth: fidl::encoding::Depth,
1235 ) -> fidl::Result<()> {
1236 encoder.debug_check_bounds::<Self>(offset);
1237 encoder.write_num(self.into_primitive(), offset);
1238 Ok(())
1239 }
1240 }
1241
1242 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
1243 #[inline(always)]
1244 fn new_empty() -> Self {
1245 Self::Failed
1246 }
1247
1248 #[inline]
1249 unsafe fn decode(
1250 &mut self,
1251 decoder: &mut fidl::encoding::Decoder<'_, D>,
1252 offset: usize,
1253 _depth: fidl::encoding::Depth,
1254 ) -> fidl::Result<()> {
1255 decoder.debug_check_bounds::<Self>(offset);
1256 let prim = decoder.read_num::<u32>(offset);
1257
1258 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1259 Ok(())
1260 }
1261 }
1262 unsafe impl fidl::encoding::TypeMarker for InputCapability {
1263 type Owned = Self;
1264
1265 #[inline(always)]
1266 fn inline_align(_context: fidl::encoding::Context) -> usize {
1267 std::mem::align_of::<u32>()
1268 }
1269
1270 #[inline(always)]
1271 fn inline_size(_context: fidl::encoding::Context) -> usize {
1272 std::mem::size_of::<u32>()
1273 }
1274
1275 #[inline(always)]
1276 fn encode_is_copy() -> bool {
1277 true
1278 }
1279
1280 #[inline(always)]
1281 fn decode_is_copy() -> bool {
1282 false
1283 }
1284 }
1285
1286 impl fidl::encoding::ValueTypeMarker for InputCapability {
1287 type Borrowed<'a> = Self;
1288 #[inline(always)]
1289 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1290 *value
1291 }
1292 }
1293
1294 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1295 for InputCapability
1296 {
1297 #[inline]
1298 unsafe fn encode(
1299 self,
1300 encoder: &mut fidl::encoding::Encoder<'_, D>,
1301 offset: usize,
1302 _depth: fidl::encoding::Depth,
1303 ) -> fidl::Result<()> {
1304 encoder.debug_check_bounds::<Self>(offset);
1305 encoder.write_num(self.into_primitive(), offset);
1306 Ok(())
1307 }
1308 }
1309
1310 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputCapability {
1311 #[inline(always)]
1312 fn new_empty() -> Self {
1313 Self::None
1314 }
1315
1316 #[inline]
1317 unsafe fn decode(
1318 &mut self,
1319 decoder: &mut fidl::encoding::Decoder<'_, D>,
1320 offset: usize,
1321 _depth: fidl::encoding::Depth,
1322 ) -> fidl::Result<()> {
1323 decoder.debug_check_bounds::<Self>(offset);
1324 let prim = decoder.read_num::<u32>(offset);
1325
1326 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1327 Ok(())
1328 }
1329 }
1330 unsafe impl fidl::encoding::TypeMarker for LeSecurityMode {
1331 type Owned = Self;
1332
1333 #[inline(always)]
1334 fn inline_align(_context: fidl::encoding::Context) -> usize {
1335 std::mem::align_of::<u32>()
1336 }
1337
1338 #[inline(always)]
1339 fn inline_size(_context: fidl::encoding::Context) -> usize {
1340 std::mem::size_of::<u32>()
1341 }
1342
1343 #[inline(always)]
1344 fn encode_is_copy() -> bool {
1345 true
1346 }
1347
1348 #[inline(always)]
1349 fn decode_is_copy() -> bool {
1350 false
1351 }
1352 }
1353
1354 impl fidl::encoding::ValueTypeMarker for LeSecurityMode {
1355 type Borrowed<'a> = Self;
1356 #[inline(always)]
1357 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1358 *value
1359 }
1360 }
1361
1362 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LeSecurityMode {
1363 #[inline]
1364 unsafe fn encode(
1365 self,
1366 encoder: &mut fidl::encoding::Encoder<'_, D>,
1367 offset: usize,
1368 _depth: fidl::encoding::Depth,
1369 ) -> fidl::Result<()> {
1370 encoder.debug_check_bounds::<Self>(offset);
1371 encoder.write_num(self.into_primitive(), offset);
1372 Ok(())
1373 }
1374 }
1375
1376 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LeSecurityMode {
1377 #[inline(always)]
1378 fn new_empty() -> Self {
1379 Self::Mode1
1380 }
1381
1382 #[inline]
1383 unsafe fn decode(
1384 &mut self,
1385 decoder: &mut fidl::encoding::Decoder<'_, D>,
1386 offset: usize,
1387 _depth: fidl::encoding::Depth,
1388 ) -> fidl::Result<()> {
1389 decoder.debug_check_bounds::<Self>(offset);
1390 let prim = decoder.read_num::<u32>(offset);
1391
1392 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1393 Ok(())
1394 }
1395 }
1396 unsafe impl fidl::encoding::TypeMarker for OutputCapability {
1397 type Owned = Self;
1398
1399 #[inline(always)]
1400 fn inline_align(_context: fidl::encoding::Context) -> usize {
1401 std::mem::align_of::<u32>()
1402 }
1403
1404 #[inline(always)]
1405 fn inline_size(_context: fidl::encoding::Context) -> usize {
1406 std::mem::size_of::<u32>()
1407 }
1408
1409 #[inline(always)]
1410 fn encode_is_copy() -> bool {
1411 true
1412 }
1413
1414 #[inline(always)]
1415 fn decode_is_copy() -> bool {
1416 false
1417 }
1418 }
1419
1420 impl fidl::encoding::ValueTypeMarker for OutputCapability {
1421 type Borrowed<'a> = Self;
1422 #[inline(always)]
1423 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1424 *value
1425 }
1426 }
1427
1428 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1429 for OutputCapability
1430 {
1431 #[inline]
1432 unsafe fn encode(
1433 self,
1434 encoder: &mut fidl::encoding::Encoder<'_, D>,
1435 offset: usize,
1436 _depth: fidl::encoding::Depth,
1437 ) -> fidl::Result<()> {
1438 encoder.debug_check_bounds::<Self>(offset);
1439 encoder.write_num(self.into_primitive(), offset);
1440 Ok(())
1441 }
1442 }
1443
1444 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OutputCapability {
1445 #[inline(always)]
1446 fn new_empty() -> Self {
1447 Self::None
1448 }
1449
1450 #[inline]
1451 unsafe fn decode(
1452 &mut self,
1453 decoder: &mut fidl::encoding::Decoder<'_, D>,
1454 offset: usize,
1455 _depth: fidl::encoding::Depth,
1456 ) -> fidl::Result<()> {
1457 decoder.debug_check_bounds::<Self>(offset);
1458 let prim = decoder.read_num::<u32>(offset);
1459
1460 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1461 Ok(())
1462 }
1463 }
1464 unsafe impl fidl::encoding::TypeMarker for PairingKeypress {
1465 type Owned = Self;
1466
1467 #[inline(always)]
1468 fn inline_align(_context: fidl::encoding::Context) -> usize {
1469 std::mem::align_of::<u32>()
1470 }
1471
1472 #[inline(always)]
1473 fn inline_size(_context: fidl::encoding::Context) -> usize {
1474 std::mem::size_of::<u32>()
1475 }
1476
1477 #[inline(always)]
1478 fn encode_is_copy() -> bool {
1479 true
1480 }
1481
1482 #[inline(always)]
1483 fn decode_is_copy() -> bool {
1484 false
1485 }
1486 }
1487
1488 impl fidl::encoding::ValueTypeMarker for PairingKeypress {
1489 type Borrowed<'a> = Self;
1490 #[inline(always)]
1491 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1492 *value
1493 }
1494 }
1495
1496 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1497 for PairingKeypress
1498 {
1499 #[inline]
1500 unsafe fn encode(
1501 self,
1502 encoder: &mut fidl::encoding::Encoder<'_, D>,
1503 offset: usize,
1504 _depth: fidl::encoding::Depth,
1505 ) -> fidl::Result<()> {
1506 encoder.debug_check_bounds::<Self>(offset);
1507 encoder.write_num(self.into_primitive(), offset);
1508 Ok(())
1509 }
1510 }
1511
1512 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PairingKeypress {
1513 #[inline(always)]
1514 fn new_empty() -> Self {
1515 Self::DigitEntered
1516 }
1517
1518 #[inline]
1519 unsafe fn decode(
1520 &mut self,
1521 decoder: &mut fidl::encoding::Decoder<'_, D>,
1522 offset: usize,
1523 _depth: fidl::encoding::Depth,
1524 ) -> fidl::Result<()> {
1525 decoder.debug_check_bounds::<Self>(offset);
1526 let prim = decoder.read_num::<u32>(offset);
1527
1528 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1529 Ok(())
1530 }
1531 }
1532 unsafe impl fidl::encoding::TypeMarker for PairingMethod {
1533 type Owned = Self;
1534
1535 #[inline(always)]
1536 fn inline_align(_context: fidl::encoding::Context) -> usize {
1537 std::mem::align_of::<u32>()
1538 }
1539
1540 #[inline(always)]
1541 fn inline_size(_context: fidl::encoding::Context) -> usize {
1542 std::mem::size_of::<u32>()
1543 }
1544
1545 #[inline(always)]
1546 fn encode_is_copy() -> bool {
1547 true
1548 }
1549
1550 #[inline(always)]
1551 fn decode_is_copy() -> bool {
1552 false
1553 }
1554 }
1555
1556 impl fidl::encoding::ValueTypeMarker for PairingMethod {
1557 type Borrowed<'a> = Self;
1558 #[inline(always)]
1559 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1560 *value
1561 }
1562 }
1563
1564 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PairingMethod {
1565 #[inline]
1566 unsafe fn encode(
1567 self,
1568 encoder: &mut fidl::encoding::Encoder<'_, D>,
1569 offset: usize,
1570 _depth: fidl::encoding::Depth,
1571 ) -> fidl::Result<()> {
1572 encoder.debug_check_bounds::<Self>(offset);
1573 encoder.write_num(self.into_primitive(), offset);
1574 Ok(())
1575 }
1576 }
1577
1578 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PairingMethod {
1579 #[inline(always)]
1580 fn new_empty() -> Self {
1581 Self::Consent
1582 }
1583
1584 #[inline]
1585 unsafe fn decode(
1586 &mut self,
1587 decoder: &mut fidl::encoding::Decoder<'_, D>,
1588 offset: usize,
1589 _depth: fidl::encoding::Depth,
1590 ) -> fidl::Result<()> {
1591 decoder.debug_check_bounds::<Self>(offset);
1592 let prim = decoder.read_num::<u32>(offset);
1593
1594 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1595 Ok(())
1596 }
1597 }
1598 unsafe impl fidl::encoding::TypeMarker for PairingSecurityLevel {
1599 type Owned = Self;
1600
1601 #[inline(always)]
1602 fn inline_align(_context: fidl::encoding::Context) -> usize {
1603 std::mem::align_of::<u32>()
1604 }
1605
1606 #[inline(always)]
1607 fn inline_size(_context: fidl::encoding::Context) -> usize {
1608 std::mem::size_of::<u32>()
1609 }
1610
1611 #[inline(always)]
1612 fn encode_is_copy() -> bool {
1613 true
1614 }
1615
1616 #[inline(always)]
1617 fn decode_is_copy() -> bool {
1618 false
1619 }
1620 }
1621
1622 impl fidl::encoding::ValueTypeMarker for PairingSecurityLevel {
1623 type Borrowed<'a> = Self;
1624 #[inline(always)]
1625 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1626 *value
1627 }
1628 }
1629
1630 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1631 for PairingSecurityLevel
1632 {
1633 #[inline]
1634 unsafe fn encode(
1635 self,
1636 encoder: &mut fidl::encoding::Encoder<'_, D>,
1637 offset: usize,
1638 _depth: fidl::encoding::Depth,
1639 ) -> fidl::Result<()> {
1640 encoder.debug_check_bounds::<Self>(offset);
1641 encoder.write_num(self.into_primitive(), offset);
1642 Ok(())
1643 }
1644 }
1645
1646 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PairingSecurityLevel {
1647 #[inline(always)]
1648 fn new_empty() -> Self {
1649 Self::Encrypted
1650 }
1651
1652 #[inline]
1653 unsafe fn decode(
1654 &mut self,
1655 decoder: &mut fidl::encoding::Decoder<'_, D>,
1656 offset: usize,
1657 _depth: fidl::encoding::Depth,
1658 ) -> fidl::Result<()> {
1659 decoder.debug_check_bounds::<Self>(offset);
1660 let prim = decoder.read_num::<u32>(offset);
1661
1662 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1663 Ok(())
1664 }
1665 }
1666 unsafe impl fidl::encoding::TypeMarker for TechnologyType {
1667 type Owned = Self;
1668
1669 #[inline(always)]
1670 fn inline_align(_context: fidl::encoding::Context) -> usize {
1671 std::mem::align_of::<u32>()
1672 }
1673
1674 #[inline(always)]
1675 fn inline_size(_context: fidl::encoding::Context) -> usize {
1676 std::mem::size_of::<u32>()
1677 }
1678
1679 #[inline(always)]
1680 fn encode_is_copy() -> bool {
1681 true
1682 }
1683
1684 #[inline(always)]
1685 fn decode_is_copy() -> bool {
1686 false
1687 }
1688 }
1689
1690 impl fidl::encoding::ValueTypeMarker for TechnologyType {
1691 type Borrowed<'a> = Self;
1692 #[inline(always)]
1693 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1694 *value
1695 }
1696 }
1697
1698 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TechnologyType {
1699 #[inline]
1700 unsafe fn encode(
1701 self,
1702 encoder: &mut fidl::encoding::Encoder<'_, D>,
1703 offset: usize,
1704 _depth: fidl::encoding::Depth,
1705 ) -> fidl::Result<()> {
1706 encoder.debug_check_bounds::<Self>(offset);
1707 encoder.write_num(self.into_primitive(), offset);
1708 Ok(())
1709 }
1710 }
1711
1712 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TechnologyType {
1713 #[inline(always)]
1714 fn new_empty() -> Self {
1715 Self::LowEnergy
1716 }
1717
1718 #[inline]
1719 unsafe fn decode(
1720 &mut self,
1721 decoder: &mut fidl::encoding::Decoder<'_, D>,
1722 offset: usize,
1723 _depth: fidl::encoding::Depth,
1724 ) -> fidl::Result<()> {
1725 decoder.debug_check_bounds::<Self>(offset);
1726 let prim = decoder.read_num::<u32>(offset);
1727
1728 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1729 Ok(())
1730 }
1731 }
1732
1733 impl fidl::encoding::ValueTypeMarker for AccessConnectRequest {
1734 type Borrowed<'a> = &'a Self;
1735 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1736 value
1737 }
1738 }
1739
1740 unsafe impl fidl::encoding::TypeMarker for AccessConnectRequest {
1741 type Owned = Self;
1742
1743 #[inline(always)]
1744 fn inline_align(_context: fidl::encoding::Context) -> usize {
1745 8
1746 }
1747
1748 #[inline(always)]
1749 fn inline_size(_context: fidl::encoding::Context) -> usize {
1750 8
1751 }
1752 }
1753
1754 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessConnectRequest, D>
1755 for &AccessConnectRequest
1756 {
1757 #[inline]
1758 unsafe fn encode(
1759 self,
1760 encoder: &mut fidl::encoding::Encoder<'_, D>,
1761 offset: usize,
1762 _depth: fidl::encoding::Depth,
1763 ) -> fidl::Result<()> {
1764 encoder.debug_check_bounds::<AccessConnectRequest>(offset);
1765 fidl::encoding::Encode::<AccessConnectRequest, D>::encode(
1767 (<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
1768 &self.id,
1769 ),),
1770 encoder,
1771 offset,
1772 _depth,
1773 )
1774 }
1775 }
1776 unsafe impl<
1777 D: fidl::encoding::ResourceDialect,
1778 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
1779 > fidl::encoding::Encode<AccessConnectRequest, D> for (T0,)
1780 {
1781 #[inline]
1782 unsafe fn encode(
1783 self,
1784 encoder: &mut fidl::encoding::Encoder<'_, D>,
1785 offset: usize,
1786 depth: fidl::encoding::Depth,
1787 ) -> fidl::Result<()> {
1788 encoder.debug_check_bounds::<AccessConnectRequest>(offset);
1789 self.0.encode(encoder, offset + 0, depth)?;
1793 Ok(())
1794 }
1795 }
1796
1797 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessConnectRequest {
1798 #[inline(always)]
1799 fn new_empty() -> Self {
1800 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D) }
1801 }
1802
1803 #[inline]
1804 unsafe fn decode(
1805 &mut self,
1806 decoder: &mut fidl::encoding::Decoder<'_, D>,
1807 offset: usize,
1808 _depth: fidl::encoding::Depth,
1809 ) -> fidl::Result<()> {
1810 decoder.debug_check_bounds::<Self>(offset);
1811 fidl::decode!(
1813 fidl_fuchsia_bluetooth::PeerId,
1814 D,
1815 &mut self.id,
1816 decoder,
1817 offset + 0,
1818 _depth
1819 )?;
1820 Ok(())
1821 }
1822 }
1823
1824 impl fidl::encoding::ValueTypeMarker for AccessDisconnectRequest {
1825 type Borrowed<'a> = &'a Self;
1826 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1827 value
1828 }
1829 }
1830
1831 unsafe impl fidl::encoding::TypeMarker for AccessDisconnectRequest {
1832 type Owned = Self;
1833
1834 #[inline(always)]
1835 fn inline_align(_context: fidl::encoding::Context) -> usize {
1836 8
1837 }
1838
1839 #[inline(always)]
1840 fn inline_size(_context: fidl::encoding::Context) -> usize {
1841 8
1842 }
1843 }
1844
1845 unsafe impl<D: fidl::encoding::ResourceDialect>
1846 fidl::encoding::Encode<AccessDisconnectRequest, D> for &AccessDisconnectRequest
1847 {
1848 #[inline]
1849 unsafe fn encode(
1850 self,
1851 encoder: &mut fidl::encoding::Encoder<'_, D>,
1852 offset: usize,
1853 _depth: fidl::encoding::Depth,
1854 ) -> fidl::Result<()> {
1855 encoder.debug_check_bounds::<AccessDisconnectRequest>(offset);
1856 fidl::encoding::Encode::<AccessDisconnectRequest, D>::encode(
1858 (<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
1859 &self.id,
1860 ),),
1861 encoder,
1862 offset,
1863 _depth,
1864 )
1865 }
1866 }
1867 unsafe impl<
1868 D: fidl::encoding::ResourceDialect,
1869 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
1870 > fidl::encoding::Encode<AccessDisconnectRequest, D> for (T0,)
1871 {
1872 #[inline]
1873 unsafe fn encode(
1874 self,
1875 encoder: &mut fidl::encoding::Encoder<'_, D>,
1876 offset: usize,
1877 depth: fidl::encoding::Depth,
1878 ) -> fidl::Result<()> {
1879 encoder.debug_check_bounds::<AccessDisconnectRequest>(offset);
1880 self.0.encode(encoder, offset + 0, depth)?;
1884 Ok(())
1885 }
1886 }
1887
1888 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1889 for AccessDisconnectRequest
1890 {
1891 #[inline(always)]
1892 fn new_empty() -> Self {
1893 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D) }
1894 }
1895
1896 #[inline]
1897 unsafe fn decode(
1898 &mut self,
1899 decoder: &mut fidl::encoding::Decoder<'_, D>,
1900 offset: usize,
1901 _depth: fidl::encoding::Depth,
1902 ) -> fidl::Result<()> {
1903 decoder.debug_check_bounds::<Self>(offset);
1904 fidl::decode!(
1906 fidl_fuchsia_bluetooth::PeerId,
1907 D,
1908 &mut self.id,
1909 decoder,
1910 offset + 0,
1911 _depth
1912 )?;
1913 Ok(())
1914 }
1915 }
1916
1917 impl fidl::encoding::ValueTypeMarker for AccessForgetRequest {
1918 type Borrowed<'a> = &'a Self;
1919 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1920 value
1921 }
1922 }
1923
1924 unsafe impl fidl::encoding::TypeMarker for AccessForgetRequest {
1925 type Owned = Self;
1926
1927 #[inline(always)]
1928 fn inline_align(_context: fidl::encoding::Context) -> usize {
1929 8
1930 }
1931
1932 #[inline(always)]
1933 fn inline_size(_context: fidl::encoding::Context) -> usize {
1934 8
1935 }
1936 }
1937
1938 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessForgetRequest, D>
1939 for &AccessForgetRequest
1940 {
1941 #[inline]
1942 unsafe fn encode(
1943 self,
1944 encoder: &mut fidl::encoding::Encoder<'_, D>,
1945 offset: usize,
1946 _depth: fidl::encoding::Depth,
1947 ) -> fidl::Result<()> {
1948 encoder.debug_check_bounds::<AccessForgetRequest>(offset);
1949 fidl::encoding::Encode::<AccessForgetRequest, D>::encode(
1951 (<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
1952 &self.id,
1953 ),),
1954 encoder,
1955 offset,
1956 _depth,
1957 )
1958 }
1959 }
1960 unsafe impl<
1961 D: fidl::encoding::ResourceDialect,
1962 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
1963 > fidl::encoding::Encode<AccessForgetRequest, D> for (T0,)
1964 {
1965 #[inline]
1966 unsafe fn encode(
1967 self,
1968 encoder: &mut fidl::encoding::Encoder<'_, D>,
1969 offset: usize,
1970 depth: fidl::encoding::Depth,
1971 ) -> fidl::Result<()> {
1972 encoder.debug_check_bounds::<AccessForgetRequest>(offset);
1973 self.0.encode(encoder, offset + 0, depth)?;
1977 Ok(())
1978 }
1979 }
1980
1981 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessForgetRequest {
1982 #[inline(always)]
1983 fn new_empty() -> Self {
1984 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D) }
1985 }
1986
1987 #[inline]
1988 unsafe fn decode(
1989 &mut self,
1990 decoder: &mut fidl::encoding::Decoder<'_, D>,
1991 offset: usize,
1992 _depth: fidl::encoding::Depth,
1993 ) -> fidl::Result<()> {
1994 decoder.debug_check_bounds::<Self>(offset);
1995 fidl::decode!(
1997 fidl_fuchsia_bluetooth::PeerId,
1998 D,
1999 &mut self.id,
2000 decoder,
2001 offset + 0,
2002 _depth
2003 )?;
2004 Ok(())
2005 }
2006 }
2007
2008 impl fidl::encoding::ValueTypeMarker for AccessPairRequest {
2009 type Borrowed<'a> = &'a Self;
2010 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2011 value
2012 }
2013 }
2014
2015 unsafe impl fidl::encoding::TypeMarker for AccessPairRequest {
2016 type Owned = Self;
2017
2018 #[inline(always)]
2019 fn inline_align(_context: fidl::encoding::Context) -> usize {
2020 8
2021 }
2022
2023 #[inline(always)]
2024 fn inline_size(_context: fidl::encoding::Context) -> usize {
2025 24
2026 }
2027 }
2028
2029 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessPairRequest, D>
2030 for &AccessPairRequest
2031 {
2032 #[inline]
2033 unsafe fn encode(
2034 self,
2035 encoder: &mut fidl::encoding::Encoder<'_, D>,
2036 offset: usize,
2037 _depth: fidl::encoding::Depth,
2038 ) -> fidl::Result<()> {
2039 encoder.debug_check_bounds::<AccessPairRequest>(offset);
2040 fidl::encoding::Encode::<AccessPairRequest, D>::encode(
2042 (
2043 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
2044 &self.id,
2045 ),
2046 <PairingOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
2047 ),
2048 encoder,
2049 offset,
2050 _depth,
2051 )
2052 }
2053 }
2054 unsafe impl<
2055 D: fidl::encoding::ResourceDialect,
2056 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
2057 T1: fidl::encoding::Encode<PairingOptions, D>,
2058 > fidl::encoding::Encode<AccessPairRequest, D> for (T0, T1)
2059 {
2060 #[inline]
2061 unsafe fn encode(
2062 self,
2063 encoder: &mut fidl::encoding::Encoder<'_, D>,
2064 offset: usize,
2065 depth: fidl::encoding::Depth,
2066 ) -> fidl::Result<()> {
2067 encoder.debug_check_bounds::<AccessPairRequest>(offset);
2068 self.0.encode(encoder, offset + 0, depth)?;
2072 self.1.encode(encoder, offset + 8, depth)?;
2073 Ok(())
2074 }
2075 }
2076
2077 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessPairRequest {
2078 #[inline(always)]
2079 fn new_empty() -> Self {
2080 Self {
2081 id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D),
2082 options: fidl::new_empty!(PairingOptions, D),
2083 }
2084 }
2085
2086 #[inline]
2087 unsafe fn decode(
2088 &mut self,
2089 decoder: &mut fidl::encoding::Decoder<'_, D>,
2090 offset: usize,
2091 _depth: fidl::encoding::Depth,
2092 ) -> fidl::Result<()> {
2093 decoder.debug_check_bounds::<Self>(offset);
2094 fidl::decode!(
2096 fidl_fuchsia_bluetooth::PeerId,
2097 D,
2098 &mut self.id,
2099 decoder,
2100 offset + 0,
2101 _depth
2102 )?;
2103 fidl::decode!(PairingOptions, D, &mut self.options, decoder, offset + 8, _depth)?;
2104 Ok(())
2105 }
2106 }
2107
2108 impl fidl::encoding::ValueTypeMarker for AccessSetDeviceClassRequest {
2109 type Borrowed<'a> = &'a Self;
2110 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2111 value
2112 }
2113 }
2114
2115 unsafe impl fidl::encoding::TypeMarker for AccessSetDeviceClassRequest {
2116 type Owned = Self;
2117
2118 #[inline(always)]
2119 fn inline_align(_context: fidl::encoding::Context) -> usize {
2120 4
2121 }
2122
2123 #[inline(always)]
2124 fn inline_size(_context: fidl::encoding::Context) -> usize {
2125 4
2126 }
2127 }
2128
2129 unsafe impl<D: fidl::encoding::ResourceDialect>
2130 fidl::encoding::Encode<AccessSetDeviceClassRequest, D> for &AccessSetDeviceClassRequest
2131 {
2132 #[inline]
2133 unsafe fn encode(
2134 self,
2135 encoder: &mut fidl::encoding::Encoder<'_, D>,
2136 offset: usize,
2137 _depth: fidl::encoding::Depth,
2138 ) -> fidl::Result<()> {
2139 encoder.debug_check_bounds::<AccessSetDeviceClassRequest>(offset);
2140 fidl::encoding::Encode::<AccessSetDeviceClassRequest, D>::encode(
2142 (<fidl_fuchsia_bluetooth::DeviceClass as fidl::encoding::ValueTypeMarker>::borrow(
2143 &self.device_class,
2144 ),),
2145 encoder,
2146 offset,
2147 _depth,
2148 )
2149 }
2150 }
2151 unsafe impl<
2152 D: fidl::encoding::ResourceDialect,
2153 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::DeviceClass, D>,
2154 > fidl::encoding::Encode<AccessSetDeviceClassRequest, D> for (T0,)
2155 {
2156 #[inline]
2157 unsafe fn encode(
2158 self,
2159 encoder: &mut fidl::encoding::Encoder<'_, D>,
2160 offset: usize,
2161 depth: fidl::encoding::Depth,
2162 ) -> fidl::Result<()> {
2163 encoder.debug_check_bounds::<AccessSetDeviceClassRequest>(offset);
2164 self.0.encode(encoder, offset + 0, depth)?;
2168 Ok(())
2169 }
2170 }
2171
2172 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2173 for AccessSetDeviceClassRequest
2174 {
2175 #[inline(always)]
2176 fn new_empty() -> Self {
2177 Self { device_class: fidl::new_empty!(fidl_fuchsia_bluetooth::DeviceClass, D) }
2178 }
2179
2180 #[inline]
2181 unsafe fn decode(
2182 &mut self,
2183 decoder: &mut fidl::encoding::Decoder<'_, D>,
2184 offset: usize,
2185 _depth: fidl::encoding::Depth,
2186 ) -> fidl::Result<()> {
2187 decoder.debug_check_bounds::<Self>(offset);
2188 fidl::decode!(
2190 fidl_fuchsia_bluetooth::DeviceClass,
2191 D,
2192 &mut self.device_class,
2193 decoder,
2194 offset + 0,
2195 _depth
2196 )?;
2197 Ok(())
2198 }
2199 }
2200
2201 impl fidl::encoding::ValueTypeMarker for AccessSetLocalNameRequest {
2202 type Borrowed<'a> = &'a Self;
2203 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2204 value
2205 }
2206 }
2207
2208 unsafe impl fidl::encoding::TypeMarker for AccessSetLocalNameRequest {
2209 type Owned = Self;
2210
2211 #[inline(always)]
2212 fn inline_align(_context: fidl::encoding::Context) -> usize {
2213 8
2214 }
2215
2216 #[inline(always)]
2217 fn inline_size(_context: fidl::encoding::Context) -> usize {
2218 16
2219 }
2220 }
2221
2222 unsafe impl<D: fidl::encoding::ResourceDialect>
2223 fidl::encoding::Encode<AccessSetLocalNameRequest, D> for &AccessSetLocalNameRequest
2224 {
2225 #[inline]
2226 unsafe fn encode(
2227 self,
2228 encoder: &mut fidl::encoding::Encoder<'_, D>,
2229 offset: usize,
2230 _depth: fidl::encoding::Depth,
2231 ) -> fidl::Result<()> {
2232 encoder.debug_check_bounds::<AccessSetLocalNameRequest>(offset);
2233 fidl::encoding::Encode::<AccessSetLocalNameRequest, D>::encode(
2235 (<fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow(
2236 &self.name,
2237 ),),
2238 encoder,
2239 offset,
2240 _depth,
2241 )
2242 }
2243 }
2244 unsafe impl<
2245 D: fidl::encoding::ResourceDialect,
2246 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<248>, D>,
2247 > fidl::encoding::Encode<AccessSetLocalNameRequest, D> for (T0,)
2248 {
2249 #[inline]
2250 unsafe fn encode(
2251 self,
2252 encoder: &mut fidl::encoding::Encoder<'_, D>,
2253 offset: usize,
2254 depth: fidl::encoding::Depth,
2255 ) -> fidl::Result<()> {
2256 encoder.debug_check_bounds::<AccessSetLocalNameRequest>(offset);
2257 self.0.encode(encoder, offset + 0, depth)?;
2261 Ok(())
2262 }
2263 }
2264
2265 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2266 for AccessSetLocalNameRequest
2267 {
2268 #[inline(always)]
2269 fn new_empty() -> Self {
2270 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<248>, D) }
2271 }
2272
2273 #[inline]
2274 unsafe fn decode(
2275 &mut self,
2276 decoder: &mut fidl::encoding::Decoder<'_, D>,
2277 offset: usize,
2278 _depth: fidl::encoding::Depth,
2279 ) -> fidl::Result<()> {
2280 decoder.debug_check_bounds::<Self>(offset);
2281 fidl::decode!(
2283 fidl::encoding::BoundedString<248>,
2284 D,
2285 &mut self.name,
2286 decoder,
2287 offset + 0,
2288 _depth
2289 )?;
2290 Ok(())
2291 }
2292 }
2293
2294 impl fidl::encoding::ValueTypeMarker for AccessWatchPeersResponse {
2295 type Borrowed<'a> = &'a Self;
2296 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2297 value
2298 }
2299 }
2300
2301 unsafe impl fidl::encoding::TypeMarker for AccessWatchPeersResponse {
2302 type Owned = Self;
2303
2304 #[inline(always)]
2305 fn inline_align(_context: fidl::encoding::Context) -> usize {
2306 8
2307 }
2308
2309 #[inline(always)]
2310 fn inline_size(_context: fidl::encoding::Context) -> usize {
2311 32
2312 }
2313 }
2314
2315 unsafe impl<D: fidl::encoding::ResourceDialect>
2316 fidl::encoding::Encode<AccessWatchPeersResponse, D> for &AccessWatchPeersResponse
2317 {
2318 #[inline]
2319 unsafe fn encode(
2320 self,
2321 encoder: &mut fidl::encoding::Encoder<'_, D>,
2322 offset: usize,
2323 _depth: fidl::encoding::Depth,
2324 ) -> fidl::Result<()> {
2325 encoder.debug_check_bounds::<AccessWatchPeersResponse>(offset);
2326 fidl::encoding::Encode::<AccessWatchPeersResponse, D>::encode(
2328 (
2329 <fidl::encoding::UnboundedVector<Peer> as fidl::encoding::ValueTypeMarker>::borrow(&self.updated),
2330 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::PeerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
2331 ),
2332 encoder, offset, _depth
2333 )
2334 }
2335 }
2336 unsafe impl<
2337 D: fidl::encoding::ResourceDialect,
2338 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Peer>, D>,
2339 T1: fidl::encoding::Encode<
2340 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::PeerId>,
2341 D,
2342 >,
2343 > fidl::encoding::Encode<AccessWatchPeersResponse, D> for (T0, T1)
2344 {
2345 #[inline]
2346 unsafe fn encode(
2347 self,
2348 encoder: &mut fidl::encoding::Encoder<'_, D>,
2349 offset: usize,
2350 depth: fidl::encoding::Depth,
2351 ) -> fidl::Result<()> {
2352 encoder.debug_check_bounds::<AccessWatchPeersResponse>(offset);
2353 self.0.encode(encoder, offset + 0, depth)?;
2357 self.1.encode(encoder, offset + 16, depth)?;
2358 Ok(())
2359 }
2360 }
2361
2362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2363 for AccessWatchPeersResponse
2364 {
2365 #[inline(always)]
2366 fn new_empty() -> Self {
2367 Self {
2368 updated: fidl::new_empty!(fidl::encoding::UnboundedVector<Peer>, D),
2369 removed: fidl::new_empty!(
2370 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::PeerId>,
2371 D
2372 ),
2373 }
2374 }
2375
2376 #[inline]
2377 unsafe fn decode(
2378 &mut self,
2379 decoder: &mut fidl::encoding::Decoder<'_, D>,
2380 offset: usize,
2381 _depth: fidl::encoding::Depth,
2382 ) -> fidl::Result<()> {
2383 decoder.debug_check_bounds::<Self>(offset);
2384 fidl::decode!(
2386 fidl::encoding::UnboundedVector<Peer>,
2387 D,
2388 &mut self.updated,
2389 decoder,
2390 offset + 0,
2391 _depth
2392 )?;
2393 fidl::decode!(
2394 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::PeerId>,
2395 D,
2396 &mut self.removed,
2397 decoder,
2398 offset + 16,
2399 _depth
2400 )?;
2401 Ok(())
2402 }
2403 }
2404
2405 impl fidl::encoding::ValueTypeMarker for BootstrapAddIdentitiesRequest {
2406 type Borrowed<'a> = &'a Self;
2407 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2408 value
2409 }
2410 }
2411
2412 unsafe impl fidl::encoding::TypeMarker for BootstrapAddIdentitiesRequest {
2413 type Owned = Self;
2414
2415 #[inline(always)]
2416 fn inline_align(_context: fidl::encoding::Context) -> usize {
2417 8
2418 }
2419
2420 #[inline(always)]
2421 fn inline_size(_context: fidl::encoding::Context) -> usize {
2422 16
2423 }
2424 }
2425
2426 unsafe impl<D: fidl::encoding::ResourceDialect>
2427 fidl::encoding::Encode<BootstrapAddIdentitiesRequest, D>
2428 for &BootstrapAddIdentitiesRequest
2429 {
2430 #[inline]
2431 unsafe fn encode(
2432 self,
2433 encoder: &mut fidl::encoding::Encoder<'_, D>,
2434 offset: usize,
2435 _depth: fidl::encoding::Depth,
2436 ) -> fidl::Result<()> {
2437 encoder.debug_check_bounds::<BootstrapAddIdentitiesRequest>(offset);
2438 fidl::encoding::Encode::<BootstrapAddIdentitiesRequest, D>::encode(
2440 (
2441 <fidl::encoding::UnboundedVector<Identity> as fidl::encoding::ValueTypeMarker>::borrow(&self.identities),
2442 ),
2443 encoder, offset, _depth
2444 )
2445 }
2446 }
2447 unsafe impl<
2448 D: fidl::encoding::ResourceDialect,
2449 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Identity>, D>,
2450 > fidl::encoding::Encode<BootstrapAddIdentitiesRequest, D> for (T0,)
2451 {
2452 #[inline]
2453 unsafe fn encode(
2454 self,
2455 encoder: &mut fidl::encoding::Encoder<'_, D>,
2456 offset: usize,
2457 depth: fidl::encoding::Depth,
2458 ) -> fidl::Result<()> {
2459 encoder.debug_check_bounds::<BootstrapAddIdentitiesRequest>(offset);
2460 self.0.encode(encoder, offset + 0, depth)?;
2464 Ok(())
2465 }
2466 }
2467
2468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2469 for BootstrapAddIdentitiesRequest
2470 {
2471 #[inline(always)]
2472 fn new_empty() -> Self {
2473 Self { identities: fidl::new_empty!(fidl::encoding::UnboundedVector<Identity>, D) }
2474 }
2475
2476 #[inline]
2477 unsafe fn decode(
2478 &mut self,
2479 decoder: &mut fidl::encoding::Decoder<'_, D>,
2480 offset: usize,
2481 _depth: fidl::encoding::Depth,
2482 ) -> fidl::Result<()> {
2483 decoder.debug_check_bounds::<Self>(offset);
2484 fidl::decode!(
2486 fidl::encoding::UnboundedVector<Identity>,
2487 D,
2488 &mut self.identities,
2489 decoder,
2490 offset + 0,
2491 _depth
2492 )?;
2493 Ok(())
2494 }
2495 }
2496
2497 impl fidl::encoding::ValueTypeMarker for ConfigurationUpdateRequest {
2498 type Borrowed<'a> = &'a Self;
2499 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2500 value
2501 }
2502 }
2503
2504 unsafe impl fidl::encoding::TypeMarker for ConfigurationUpdateRequest {
2505 type Owned = Self;
2506
2507 #[inline(always)]
2508 fn inline_align(_context: fidl::encoding::Context) -> usize {
2509 8
2510 }
2511
2512 #[inline(always)]
2513 fn inline_size(_context: fidl::encoding::Context) -> usize {
2514 16
2515 }
2516 }
2517
2518 unsafe impl<D: fidl::encoding::ResourceDialect>
2519 fidl::encoding::Encode<ConfigurationUpdateRequest, D> for &ConfigurationUpdateRequest
2520 {
2521 #[inline]
2522 unsafe fn encode(
2523 self,
2524 encoder: &mut fidl::encoding::Encoder<'_, D>,
2525 offset: usize,
2526 _depth: fidl::encoding::Depth,
2527 ) -> fidl::Result<()> {
2528 encoder.debug_check_bounds::<ConfigurationUpdateRequest>(offset);
2529 fidl::encoding::Encode::<ConfigurationUpdateRequest, D>::encode(
2531 (<Settings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2532 encoder,
2533 offset,
2534 _depth,
2535 )
2536 }
2537 }
2538 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Settings, D>>
2539 fidl::encoding::Encode<ConfigurationUpdateRequest, D> for (T0,)
2540 {
2541 #[inline]
2542 unsafe fn encode(
2543 self,
2544 encoder: &mut fidl::encoding::Encoder<'_, D>,
2545 offset: usize,
2546 depth: fidl::encoding::Depth,
2547 ) -> fidl::Result<()> {
2548 encoder.debug_check_bounds::<ConfigurationUpdateRequest>(offset);
2549 self.0.encode(encoder, offset + 0, depth)?;
2553 Ok(())
2554 }
2555 }
2556
2557 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2558 for ConfigurationUpdateRequest
2559 {
2560 #[inline(always)]
2561 fn new_empty() -> Self {
2562 Self { settings: fidl::new_empty!(Settings, D) }
2563 }
2564
2565 #[inline]
2566 unsafe fn decode(
2567 &mut self,
2568 decoder: &mut fidl::encoding::Decoder<'_, D>,
2569 offset: usize,
2570 _depth: fidl::encoding::Depth,
2571 ) -> fidl::Result<()> {
2572 decoder.debug_check_bounds::<Self>(offset);
2573 fidl::decode!(Settings, D, &mut self.settings, decoder, offset + 0, _depth)?;
2575 Ok(())
2576 }
2577 }
2578
2579 impl fidl::encoding::ValueTypeMarker for ConfigurationUpdateResponse {
2580 type Borrowed<'a> = &'a Self;
2581 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2582 value
2583 }
2584 }
2585
2586 unsafe impl fidl::encoding::TypeMarker for ConfigurationUpdateResponse {
2587 type Owned = Self;
2588
2589 #[inline(always)]
2590 fn inline_align(_context: fidl::encoding::Context) -> usize {
2591 8
2592 }
2593
2594 #[inline(always)]
2595 fn inline_size(_context: fidl::encoding::Context) -> usize {
2596 16
2597 }
2598 }
2599
2600 unsafe impl<D: fidl::encoding::ResourceDialect>
2601 fidl::encoding::Encode<ConfigurationUpdateResponse, D> for &ConfigurationUpdateResponse
2602 {
2603 #[inline]
2604 unsafe fn encode(
2605 self,
2606 encoder: &mut fidl::encoding::Encoder<'_, D>,
2607 offset: usize,
2608 _depth: fidl::encoding::Depth,
2609 ) -> fidl::Result<()> {
2610 encoder.debug_check_bounds::<ConfigurationUpdateResponse>(offset);
2611 fidl::encoding::Encode::<ConfigurationUpdateResponse, D>::encode(
2613 (<Settings as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2614 encoder,
2615 offset,
2616 _depth,
2617 )
2618 }
2619 }
2620 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Settings, D>>
2621 fidl::encoding::Encode<ConfigurationUpdateResponse, D> for (T0,)
2622 {
2623 #[inline]
2624 unsafe fn encode(
2625 self,
2626 encoder: &mut fidl::encoding::Encoder<'_, D>,
2627 offset: usize,
2628 depth: fidl::encoding::Depth,
2629 ) -> fidl::Result<()> {
2630 encoder.debug_check_bounds::<ConfigurationUpdateResponse>(offset);
2631 self.0.encode(encoder, offset + 0, depth)?;
2635 Ok(())
2636 }
2637 }
2638
2639 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2640 for ConfigurationUpdateResponse
2641 {
2642 #[inline(always)]
2643 fn new_empty() -> Self {
2644 Self { result: fidl::new_empty!(Settings, D) }
2645 }
2646
2647 #[inline]
2648 unsafe fn decode(
2649 &mut self,
2650 decoder: &mut fidl::encoding::Decoder<'_, D>,
2651 offset: usize,
2652 _depth: fidl::encoding::Depth,
2653 ) -> fidl::Result<()> {
2654 decoder.debug_check_bounds::<Self>(offset);
2655 fidl::decode!(Settings, D, &mut self.result, decoder, offset + 0, _depth)?;
2657 Ok(())
2658 }
2659 }
2660
2661 impl fidl::encoding::ValueTypeMarker for Consent {
2662 type Borrowed<'a> = &'a Self;
2663 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2664 value
2665 }
2666 }
2667
2668 unsafe impl fidl::encoding::TypeMarker for Consent {
2669 type Owned = Self;
2670
2671 #[inline(always)]
2672 fn inline_align(_context: fidl::encoding::Context) -> usize {
2673 1
2674 }
2675
2676 #[inline(always)]
2677 fn inline_size(_context: fidl::encoding::Context) -> usize {
2678 1
2679 }
2680 }
2681
2682 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Consent, D> for &Consent {
2683 #[inline]
2684 unsafe fn encode(
2685 self,
2686 encoder: &mut fidl::encoding::Encoder<'_, D>,
2687 offset: usize,
2688 _depth: fidl::encoding::Depth,
2689 ) -> fidl::Result<()> {
2690 encoder.debug_check_bounds::<Consent>(offset);
2691 encoder.write_num(0u8, offset);
2692 Ok(())
2693 }
2694 }
2695
2696 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Consent {
2697 #[inline(always)]
2698 fn new_empty() -> Self {
2699 Self
2700 }
2701
2702 #[inline]
2703 unsafe fn decode(
2704 &mut self,
2705 decoder: &mut fidl::encoding::Decoder<'_, D>,
2706 offset: usize,
2707 _depth: fidl::encoding::Depth,
2708 ) -> fidl::Result<()> {
2709 decoder.debug_check_bounds::<Self>(offset);
2710 match decoder.read_num::<u8>(offset) {
2711 0 => Ok(()),
2712 _ => Err(fidl::Error::Invalid),
2713 }
2714 }
2715 }
2716
2717 impl fidl::encoding::ValueTypeMarker for HostWatcherSetActiveRequest {
2718 type Borrowed<'a> = &'a Self;
2719 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2720 value
2721 }
2722 }
2723
2724 unsafe impl fidl::encoding::TypeMarker for HostWatcherSetActiveRequest {
2725 type Owned = Self;
2726
2727 #[inline(always)]
2728 fn inline_align(_context: fidl::encoding::Context) -> usize {
2729 8
2730 }
2731
2732 #[inline(always)]
2733 fn inline_size(_context: fidl::encoding::Context) -> usize {
2734 8
2735 }
2736 }
2737
2738 unsafe impl<D: fidl::encoding::ResourceDialect>
2739 fidl::encoding::Encode<HostWatcherSetActiveRequest, D> for &HostWatcherSetActiveRequest
2740 {
2741 #[inline]
2742 unsafe fn encode(
2743 self,
2744 encoder: &mut fidl::encoding::Encoder<'_, D>,
2745 offset: usize,
2746 _depth: fidl::encoding::Depth,
2747 ) -> fidl::Result<()> {
2748 encoder.debug_check_bounds::<HostWatcherSetActiveRequest>(offset);
2749 fidl::encoding::Encode::<HostWatcherSetActiveRequest, D>::encode(
2751 (<fidl_fuchsia_bluetooth::HostId as fidl::encoding::ValueTypeMarker>::borrow(
2752 &self.id,
2753 ),),
2754 encoder,
2755 offset,
2756 _depth,
2757 )
2758 }
2759 }
2760 unsafe impl<
2761 D: fidl::encoding::ResourceDialect,
2762 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::HostId, D>,
2763 > fidl::encoding::Encode<HostWatcherSetActiveRequest, D> for (T0,)
2764 {
2765 #[inline]
2766 unsafe fn encode(
2767 self,
2768 encoder: &mut fidl::encoding::Encoder<'_, D>,
2769 offset: usize,
2770 depth: fidl::encoding::Depth,
2771 ) -> fidl::Result<()> {
2772 encoder.debug_check_bounds::<HostWatcherSetActiveRequest>(offset);
2773 self.0.encode(encoder, offset + 0, depth)?;
2777 Ok(())
2778 }
2779 }
2780
2781 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2782 for HostWatcherSetActiveRequest
2783 {
2784 #[inline(always)]
2785 fn new_empty() -> Self {
2786 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth::HostId, D) }
2787 }
2788
2789 #[inline]
2790 unsafe fn decode(
2791 &mut self,
2792 decoder: &mut fidl::encoding::Decoder<'_, D>,
2793 offset: usize,
2794 _depth: fidl::encoding::Depth,
2795 ) -> fidl::Result<()> {
2796 decoder.debug_check_bounds::<Self>(offset);
2797 fidl::decode!(
2799 fidl_fuchsia_bluetooth::HostId,
2800 D,
2801 &mut self.id,
2802 decoder,
2803 offset + 0,
2804 _depth
2805 )?;
2806 Ok(())
2807 }
2808 }
2809
2810 impl fidl::encoding::ValueTypeMarker for HostWatcherWatchResponse {
2811 type Borrowed<'a> = &'a Self;
2812 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2813 value
2814 }
2815 }
2816
2817 unsafe impl fidl::encoding::TypeMarker for HostWatcherWatchResponse {
2818 type Owned = Self;
2819
2820 #[inline(always)]
2821 fn inline_align(_context: fidl::encoding::Context) -> usize {
2822 8
2823 }
2824
2825 #[inline(always)]
2826 fn inline_size(_context: fidl::encoding::Context) -> usize {
2827 16
2828 }
2829 }
2830
2831 unsafe impl<D: fidl::encoding::ResourceDialect>
2832 fidl::encoding::Encode<HostWatcherWatchResponse, D> for &HostWatcherWatchResponse
2833 {
2834 #[inline]
2835 unsafe fn encode(
2836 self,
2837 encoder: &mut fidl::encoding::Encoder<'_, D>,
2838 offset: usize,
2839 _depth: fidl::encoding::Depth,
2840 ) -> fidl::Result<()> {
2841 encoder.debug_check_bounds::<HostWatcherWatchResponse>(offset);
2842 fidl::encoding::Encode::<HostWatcherWatchResponse, D>::encode(
2844 (
2845 <fidl::encoding::UnboundedVector<HostInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.hosts),
2846 ),
2847 encoder, offset, _depth
2848 )
2849 }
2850 }
2851 unsafe impl<
2852 D: fidl::encoding::ResourceDialect,
2853 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<HostInfo>, D>,
2854 > fidl::encoding::Encode<HostWatcherWatchResponse, D> for (T0,)
2855 {
2856 #[inline]
2857 unsafe fn encode(
2858 self,
2859 encoder: &mut fidl::encoding::Encoder<'_, D>,
2860 offset: usize,
2861 depth: fidl::encoding::Depth,
2862 ) -> fidl::Result<()> {
2863 encoder.debug_check_bounds::<HostWatcherWatchResponse>(offset);
2864 self.0.encode(encoder, offset + 0, depth)?;
2868 Ok(())
2869 }
2870 }
2871
2872 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2873 for HostWatcherWatchResponse
2874 {
2875 #[inline(always)]
2876 fn new_empty() -> Self {
2877 Self { hosts: fidl::new_empty!(fidl::encoding::UnboundedVector<HostInfo>, D) }
2878 }
2879
2880 #[inline]
2881 unsafe fn decode(
2882 &mut self,
2883 decoder: &mut fidl::encoding::Decoder<'_, D>,
2884 offset: usize,
2885 _depth: fidl::encoding::Depth,
2886 ) -> fidl::Result<()> {
2887 decoder.debug_check_bounds::<Self>(offset);
2888 fidl::decode!(
2890 fidl::encoding::UnboundedVector<HostInfo>,
2891 D,
2892 &mut self.hosts,
2893 decoder,
2894 offset + 0,
2895 _depth
2896 )?;
2897 Ok(())
2898 }
2899 }
2900
2901 impl fidl::encoding::ValueTypeMarker for Key {
2902 type Borrowed<'a> = &'a Self;
2903 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2904 value
2905 }
2906 }
2907
2908 unsafe impl fidl::encoding::TypeMarker for Key {
2909 type Owned = Self;
2910
2911 #[inline(always)]
2912 fn inline_align(_context: fidl::encoding::Context) -> usize {
2913 1
2914 }
2915
2916 #[inline(always)]
2917 fn inline_size(_context: fidl::encoding::Context) -> usize {
2918 16
2919 }
2920 #[inline(always)]
2921 fn encode_is_copy() -> bool {
2922 true
2923 }
2924
2925 #[inline(always)]
2926 fn decode_is_copy() -> bool {
2927 true
2928 }
2929 }
2930
2931 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Key, D> for &Key {
2932 #[inline]
2933 unsafe fn encode(
2934 self,
2935 encoder: &mut fidl::encoding::Encoder<'_, D>,
2936 offset: usize,
2937 _depth: fidl::encoding::Depth,
2938 ) -> fidl::Result<()> {
2939 encoder.debug_check_bounds::<Key>(offset);
2940 unsafe {
2941 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2943 (buf_ptr as *mut Key).write_unaligned((self as *const Key).read());
2944 }
2947 Ok(())
2948 }
2949 }
2950 unsafe impl<
2951 D: fidl::encoding::ResourceDialect,
2952 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 16>, D>,
2953 > fidl::encoding::Encode<Key, D> for (T0,)
2954 {
2955 #[inline]
2956 unsafe fn encode(
2957 self,
2958 encoder: &mut fidl::encoding::Encoder<'_, D>,
2959 offset: usize,
2960 depth: fidl::encoding::Depth,
2961 ) -> fidl::Result<()> {
2962 encoder.debug_check_bounds::<Key>(offset);
2963 self.0.encode(encoder, offset + 0, depth)?;
2967 Ok(())
2968 }
2969 }
2970
2971 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Key {
2972 #[inline(always)]
2973 fn new_empty() -> Self {
2974 Self { value: fidl::new_empty!(fidl::encoding::Array<u8, 16>, D) }
2975 }
2976
2977 #[inline]
2978 unsafe fn decode(
2979 &mut self,
2980 decoder: &mut fidl::encoding::Decoder<'_, D>,
2981 offset: usize,
2982 _depth: fidl::encoding::Depth,
2983 ) -> fidl::Result<()> {
2984 decoder.debug_check_bounds::<Self>(offset);
2985 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2986 unsafe {
2989 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2990 }
2991 Ok(())
2992 }
2993 }
2994
2995 impl fidl::encoding::ValueTypeMarker for LeConnectionParameters {
2996 type Borrowed<'a> = &'a Self;
2997 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2998 value
2999 }
3000 }
3001
3002 unsafe impl fidl::encoding::TypeMarker for LeConnectionParameters {
3003 type Owned = Self;
3004
3005 #[inline(always)]
3006 fn inline_align(_context: fidl::encoding::Context) -> usize {
3007 2
3008 }
3009
3010 #[inline(always)]
3011 fn inline_size(_context: fidl::encoding::Context) -> usize {
3012 6
3013 }
3014 #[inline(always)]
3015 fn encode_is_copy() -> bool {
3016 true
3017 }
3018
3019 #[inline(always)]
3020 fn decode_is_copy() -> bool {
3021 true
3022 }
3023 }
3024
3025 unsafe impl<D: fidl::encoding::ResourceDialect>
3026 fidl::encoding::Encode<LeConnectionParameters, D> for &LeConnectionParameters
3027 {
3028 #[inline]
3029 unsafe fn encode(
3030 self,
3031 encoder: &mut fidl::encoding::Encoder<'_, D>,
3032 offset: usize,
3033 _depth: fidl::encoding::Depth,
3034 ) -> fidl::Result<()> {
3035 encoder.debug_check_bounds::<LeConnectionParameters>(offset);
3036 unsafe {
3037 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3039 (buf_ptr as *mut LeConnectionParameters)
3040 .write_unaligned((self as *const LeConnectionParameters).read());
3041 }
3044 Ok(())
3045 }
3046 }
3047 unsafe impl<
3048 D: fidl::encoding::ResourceDialect,
3049 T0: fidl::encoding::Encode<u16, D>,
3050 T1: fidl::encoding::Encode<u16, D>,
3051 T2: fidl::encoding::Encode<u16, D>,
3052 > fidl::encoding::Encode<LeConnectionParameters, D> for (T0, T1, T2)
3053 {
3054 #[inline]
3055 unsafe fn encode(
3056 self,
3057 encoder: &mut fidl::encoding::Encoder<'_, D>,
3058 offset: usize,
3059 depth: fidl::encoding::Depth,
3060 ) -> fidl::Result<()> {
3061 encoder.debug_check_bounds::<LeConnectionParameters>(offset);
3062 self.0.encode(encoder, offset + 0, depth)?;
3066 self.1.encode(encoder, offset + 2, depth)?;
3067 self.2.encode(encoder, offset + 4, depth)?;
3068 Ok(())
3069 }
3070 }
3071
3072 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3073 for LeConnectionParameters
3074 {
3075 #[inline(always)]
3076 fn new_empty() -> Self {
3077 Self {
3078 connection_interval: fidl::new_empty!(u16, D),
3079 connection_latency: fidl::new_empty!(u16, D),
3080 supervision_timeout: fidl::new_empty!(u16, D),
3081 }
3082 }
3083
3084 #[inline]
3085 unsafe fn decode(
3086 &mut self,
3087 decoder: &mut fidl::encoding::Decoder<'_, D>,
3088 offset: usize,
3089 _depth: fidl::encoding::Depth,
3090 ) -> fidl::Result<()> {
3091 decoder.debug_check_bounds::<Self>(offset);
3092 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3093 unsafe {
3096 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
3097 }
3098 Ok(())
3099 }
3100 }
3101
3102 impl fidl::encoding::ValueTypeMarker for Ltk {
3103 type Borrowed<'a> = &'a Self;
3104 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3105 value
3106 }
3107 }
3108
3109 unsafe impl fidl::encoding::TypeMarker for Ltk {
3110 type Owned = Self;
3111
3112 #[inline(always)]
3113 fn inline_align(_context: fidl::encoding::Context) -> usize {
3114 8
3115 }
3116
3117 #[inline(always)]
3118 fn inline_size(_context: fidl::encoding::Context) -> usize {
3119 32
3120 }
3121 }
3122
3123 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ltk, D> for &Ltk {
3124 #[inline]
3125 unsafe fn encode(
3126 self,
3127 encoder: &mut fidl::encoding::Encoder<'_, D>,
3128 offset: usize,
3129 _depth: fidl::encoding::Depth,
3130 ) -> fidl::Result<()> {
3131 encoder.debug_check_bounds::<Ltk>(offset);
3132 fidl::encoding::Encode::<Ltk, D>::encode(
3134 (
3135 <PeerKey as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
3136 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.ediv),
3137 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.rand),
3138 ),
3139 encoder,
3140 offset,
3141 _depth,
3142 )
3143 }
3144 }
3145 unsafe impl<
3146 D: fidl::encoding::ResourceDialect,
3147 T0: fidl::encoding::Encode<PeerKey, D>,
3148 T1: fidl::encoding::Encode<u16, D>,
3149 T2: fidl::encoding::Encode<u64, D>,
3150 > fidl::encoding::Encode<Ltk, D> for (T0, T1, T2)
3151 {
3152 #[inline]
3153 unsafe fn encode(
3154 self,
3155 encoder: &mut fidl::encoding::Encoder<'_, D>,
3156 offset: usize,
3157 depth: fidl::encoding::Depth,
3158 ) -> fidl::Result<()> {
3159 encoder.debug_check_bounds::<Ltk>(offset);
3160 unsafe {
3163 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3164 (ptr as *mut u64).write_unaligned(0);
3165 }
3166 self.0.encode(encoder, offset + 0, depth)?;
3168 self.1.encode(encoder, offset + 20, depth)?;
3169 self.2.encode(encoder, offset + 24, depth)?;
3170 Ok(())
3171 }
3172 }
3173
3174 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ltk {
3175 #[inline(always)]
3176 fn new_empty() -> Self {
3177 Self {
3178 key: fidl::new_empty!(PeerKey, D),
3179 ediv: fidl::new_empty!(u16, D),
3180 rand: fidl::new_empty!(u64, D),
3181 }
3182 }
3183
3184 #[inline]
3185 unsafe fn decode(
3186 &mut self,
3187 decoder: &mut fidl::encoding::Decoder<'_, D>,
3188 offset: usize,
3189 _depth: fidl::encoding::Depth,
3190 ) -> fidl::Result<()> {
3191 decoder.debug_check_bounds::<Self>(offset);
3192 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3194 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3195 let mask = 0xffff0000ff000000u64;
3196 let maskedval = padval & mask;
3197 if maskedval != 0 {
3198 return Err(fidl::Error::NonZeroPadding {
3199 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3200 });
3201 }
3202 fidl::decode!(PeerKey, D, &mut self.key, decoder, offset + 0, _depth)?;
3203 fidl::decode!(u16, D, &mut self.ediv, decoder, offset + 20, _depth)?;
3204 fidl::decode!(u64, D, &mut self.rand, decoder, offset + 24, _depth)?;
3205 Ok(())
3206 }
3207 }
3208
3209 impl fidl::encoding::ValueTypeMarker for PairingDelegate2RequestCompleteRequest {
3210 type Borrowed<'a> = &'a Self;
3211 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3212 value
3213 }
3214 }
3215
3216 unsafe impl fidl::encoding::TypeMarker for PairingDelegate2RequestCompleteRequest {
3217 type Owned = Self;
3218
3219 #[inline(always)]
3220 fn inline_align(_context: fidl::encoding::Context) -> usize {
3221 8
3222 }
3223
3224 #[inline(always)]
3225 fn inline_size(_context: fidl::encoding::Context) -> usize {
3226 16
3227 }
3228 }
3229
3230 unsafe impl<D: fidl::encoding::ResourceDialect>
3231 fidl::encoding::Encode<PairingDelegate2RequestCompleteRequest, D>
3232 for &PairingDelegate2RequestCompleteRequest
3233 {
3234 #[inline]
3235 unsafe fn encode(
3236 self,
3237 encoder: &mut fidl::encoding::Encoder<'_, D>,
3238 offset: usize,
3239 _depth: fidl::encoding::Depth,
3240 ) -> fidl::Result<()> {
3241 encoder.debug_check_bounds::<PairingDelegate2RequestCompleteRequest>(offset);
3242 fidl::encoding::Encode::<PairingDelegate2RequestCompleteRequest, D>::encode(
3244 (
3245 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
3246 &self.id,
3247 ),
3248 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.success),
3249 ),
3250 encoder,
3251 offset,
3252 _depth,
3253 )
3254 }
3255 }
3256 unsafe impl<
3257 D: fidl::encoding::ResourceDialect,
3258 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
3259 T1: fidl::encoding::Encode<bool, D>,
3260 > fidl::encoding::Encode<PairingDelegate2RequestCompleteRequest, D> for (T0, T1)
3261 {
3262 #[inline]
3263 unsafe fn encode(
3264 self,
3265 encoder: &mut fidl::encoding::Encoder<'_, D>,
3266 offset: usize,
3267 depth: fidl::encoding::Depth,
3268 ) -> fidl::Result<()> {
3269 encoder.debug_check_bounds::<PairingDelegate2RequestCompleteRequest>(offset);
3270 unsafe {
3273 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3274 (ptr as *mut u64).write_unaligned(0);
3275 }
3276 self.0.encode(encoder, offset + 0, depth)?;
3278 self.1.encode(encoder, offset + 8, depth)?;
3279 Ok(())
3280 }
3281 }
3282
3283 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3284 for PairingDelegate2RequestCompleteRequest
3285 {
3286 #[inline(always)]
3287 fn new_empty() -> Self {
3288 Self {
3289 id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D),
3290 success: fidl::new_empty!(bool, D),
3291 }
3292 }
3293
3294 #[inline]
3295 unsafe fn decode(
3296 &mut self,
3297 decoder: &mut fidl::encoding::Decoder<'_, D>,
3298 offset: usize,
3299 _depth: fidl::encoding::Depth,
3300 ) -> fidl::Result<()> {
3301 decoder.debug_check_bounds::<Self>(offset);
3302 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3304 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3305 let mask = 0xffffffffffffff00u64;
3306 let maskedval = padval & mask;
3307 if maskedval != 0 {
3308 return Err(fidl::Error::NonZeroPadding {
3309 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3310 });
3311 }
3312 fidl::decode!(
3313 fidl_fuchsia_bluetooth::PeerId,
3314 D,
3315 &mut self.id,
3316 decoder,
3317 offset + 0,
3318 _depth
3319 )?;
3320 fidl::decode!(bool, D, &mut self.success, decoder, offset + 8, _depth)?;
3321 Ok(())
3322 }
3323 }
3324
3325 impl fidl::encoding::ValueTypeMarker for PairingDelegateOnLocalKeypressRequest {
3326 type Borrowed<'a> = &'a Self;
3327 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3328 value
3329 }
3330 }
3331
3332 unsafe impl fidl::encoding::TypeMarker for PairingDelegateOnLocalKeypressRequest {
3333 type Owned = Self;
3334
3335 #[inline(always)]
3336 fn inline_align(_context: fidl::encoding::Context) -> usize {
3337 8
3338 }
3339
3340 #[inline(always)]
3341 fn inline_size(_context: fidl::encoding::Context) -> usize {
3342 16
3343 }
3344 }
3345
3346 unsafe impl<D: fidl::encoding::ResourceDialect>
3347 fidl::encoding::Encode<PairingDelegateOnLocalKeypressRequest, D>
3348 for &PairingDelegateOnLocalKeypressRequest
3349 {
3350 #[inline]
3351 unsafe fn encode(
3352 self,
3353 encoder: &mut fidl::encoding::Encoder<'_, D>,
3354 offset: usize,
3355 _depth: fidl::encoding::Depth,
3356 ) -> fidl::Result<()> {
3357 encoder.debug_check_bounds::<PairingDelegateOnLocalKeypressRequest>(offset);
3358 fidl::encoding::Encode::<PairingDelegateOnLocalKeypressRequest, D>::encode(
3360 (
3361 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
3362 &self.id,
3363 ),
3364 <PairingKeypress as fidl::encoding::ValueTypeMarker>::borrow(&self.keypress),
3365 ),
3366 encoder,
3367 offset,
3368 _depth,
3369 )
3370 }
3371 }
3372 unsafe impl<
3373 D: fidl::encoding::ResourceDialect,
3374 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
3375 T1: fidl::encoding::Encode<PairingKeypress, D>,
3376 > fidl::encoding::Encode<PairingDelegateOnLocalKeypressRequest, D> for (T0, T1)
3377 {
3378 #[inline]
3379 unsafe fn encode(
3380 self,
3381 encoder: &mut fidl::encoding::Encoder<'_, D>,
3382 offset: usize,
3383 depth: fidl::encoding::Depth,
3384 ) -> fidl::Result<()> {
3385 encoder.debug_check_bounds::<PairingDelegateOnLocalKeypressRequest>(offset);
3386 unsafe {
3389 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3390 (ptr as *mut u64).write_unaligned(0);
3391 }
3392 self.0.encode(encoder, offset + 0, depth)?;
3394 self.1.encode(encoder, offset + 8, depth)?;
3395 Ok(())
3396 }
3397 }
3398
3399 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3400 for PairingDelegateOnLocalKeypressRequest
3401 {
3402 #[inline(always)]
3403 fn new_empty() -> Self {
3404 Self {
3405 id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D),
3406 keypress: fidl::new_empty!(PairingKeypress, D),
3407 }
3408 }
3409
3410 #[inline]
3411 unsafe fn decode(
3412 &mut self,
3413 decoder: &mut fidl::encoding::Decoder<'_, D>,
3414 offset: usize,
3415 _depth: fidl::encoding::Depth,
3416 ) -> fidl::Result<()> {
3417 decoder.debug_check_bounds::<Self>(offset);
3418 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3420 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3421 let mask = 0xffffffff00000000u64;
3422 let maskedval = padval & mask;
3423 if maskedval != 0 {
3424 return Err(fidl::Error::NonZeroPadding {
3425 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3426 });
3427 }
3428 fidl::decode!(
3429 fidl_fuchsia_bluetooth::PeerId,
3430 D,
3431 &mut self.id,
3432 decoder,
3433 offset + 0,
3434 _depth
3435 )?;
3436 fidl::decode!(PairingKeypress, D, &mut self.keypress, decoder, offset + 8, _depth)?;
3437 Ok(())
3438 }
3439 }
3440
3441 impl fidl::encoding::ValueTypeMarker for PairingDelegateOnPairingCompleteRequest {
3442 type Borrowed<'a> = &'a Self;
3443 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3444 value
3445 }
3446 }
3447
3448 unsafe impl fidl::encoding::TypeMarker for PairingDelegateOnPairingCompleteRequest {
3449 type Owned = Self;
3450
3451 #[inline(always)]
3452 fn inline_align(_context: fidl::encoding::Context) -> usize {
3453 8
3454 }
3455
3456 #[inline(always)]
3457 fn inline_size(_context: fidl::encoding::Context) -> usize {
3458 16
3459 }
3460 }
3461
3462 unsafe impl<D: fidl::encoding::ResourceDialect>
3463 fidl::encoding::Encode<PairingDelegateOnPairingCompleteRequest, D>
3464 for &PairingDelegateOnPairingCompleteRequest
3465 {
3466 #[inline]
3467 unsafe fn encode(
3468 self,
3469 encoder: &mut fidl::encoding::Encoder<'_, D>,
3470 offset: usize,
3471 _depth: fidl::encoding::Depth,
3472 ) -> fidl::Result<()> {
3473 encoder.debug_check_bounds::<PairingDelegateOnPairingCompleteRequest>(offset);
3474 fidl::encoding::Encode::<PairingDelegateOnPairingCompleteRequest, D>::encode(
3476 (
3477 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
3478 &self.id,
3479 ),
3480 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.success),
3481 ),
3482 encoder,
3483 offset,
3484 _depth,
3485 )
3486 }
3487 }
3488 unsafe impl<
3489 D: fidl::encoding::ResourceDialect,
3490 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
3491 T1: fidl::encoding::Encode<bool, D>,
3492 > fidl::encoding::Encode<PairingDelegateOnPairingCompleteRequest, D> for (T0, T1)
3493 {
3494 #[inline]
3495 unsafe fn encode(
3496 self,
3497 encoder: &mut fidl::encoding::Encoder<'_, D>,
3498 offset: usize,
3499 depth: fidl::encoding::Depth,
3500 ) -> fidl::Result<()> {
3501 encoder.debug_check_bounds::<PairingDelegateOnPairingCompleteRequest>(offset);
3502 unsafe {
3505 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3506 (ptr as *mut u64).write_unaligned(0);
3507 }
3508 self.0.encode(encoder, offset + 0, depth)?;
3510 self.1.encode(encoder, offset + 8, depth)?;
3511 Ok(())
3512 }
3513 }
3514
3515 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3516 for PairingDelegateOnPairingCompleteRequest
3517 {
3518 #[inline(always)]
3519 fn new_empty() -> Self {
3520 Self {
3521 id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D),
3522 success: fidl::new_empty!(bool, D),
3523 }
3524 }
3525
3526 #[inline]
3527 unsafe fn decode(
3528 &mut self,
3529 decoder: &mut fidl::encoding::Decoder<'_, D>,
3530 offset: usize,
3531 _depth: fidl::encoding::Depth,
3532 ) -> fidl::Result<()> {
3533 decoder.debug_check_bounds::<Self>(offset);
3534 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3536 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3537 let mask = 0xffffffffffffff00u64;
3538 let maskedval = padval & mask;
3539 if maskedval != 0 {
3540 return Err(fidl::Error::NonZeroPadding {
3541 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3542 });
3543 }
3544 fidl::decode!(
3545 fidl_fuchsia_bluetooth::PeerId,
3546 D,
3547 &mut self.id,
3548 decoder,
3549 offset + 0,
3550 _depth
3551 )?;
3552 fidl::decode!(bool, D, &mut self.success, decoder, offset + 8, _depth)?;
3553 Ok(())
3554 }
3555 }
3556
3557 impl fidl::encoding::ValueTypeMarker for PairingDelegateOnPairingRequestRequest {
3558 type Borrowed<'a> = &'a Self;
3559 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3560 value
3561 }
3562 }
3563
3564 unsafe impl fidl::encoding::TypeMarker for PairingDelegateOnPairingRequestRequest {
3565 type Owned = Self;
3566
3567 #[inline(always)]
3568 fn inline_align(_context: fidl::encoding::Context) -> usize {
3569 8
3570 }
3571
3572 #[inline(always)]
3573 fn inline_size(_context: fidl::encoding::Context) -> usize {
3574 24
3575 }
3576 }
3577
3578 unsafe impl<D: fidl::encoding::ResourceDialect>
3579 fidl::encoding::Encode<PairingDelegateOnPairingRequestRequest, D>
3580 for &PairingDelegateOnPairingRequestRequest
3581 {
3582 #[inline]
3583 unsafe fn encode(
3584 self,
3585 encoder: &mut fidl::encoding::Encoder<'_, D>,
3586 offset: usize,
3587 _depth: fidl::encoding::Depth,
3588 ) -> fidl::Result<()> {
3589 encoder.debug_check_bounds::<PairingDelegateOnPairingRequestRequest>(offset);
3590 fidl::encoding::Encode::<PairingDelegateOnPairingRequestRequest, D>::encode(
3592 (
3593 <Peer as fidl::encoding::ValueTypeMarker>::borrow(&self.peer),
3594 <PairingMethod as fidl::encoding::ValueTypeMarker>::borrow(&self.method),
3595 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.displayed_passkey),
3596 ),
3597 encoder,
3598 offset,
3599 _depth,
3600 )
3601 }
3602 }
3603 unsafe impl<
3604 D: fidl::encoding::ResourceDialect,
3605 T0: fidl::encoding::Encode<Peer, D>,
3606 T1: fidl::encoding::Encode<PairingMethod, D>,
3607 T2: fidl::encoding::Encode<u32, D>,
3608 > fidl::encoding::Encode<PairingDelegateOnPairingRequestRequest, D> for (T0, T1, T2)
3609 {
3610 #[inline]
3611 unsafe fn encode(
3612 self,
3613 encoder: &mut fidl::encoding::Encoder<'_, D>,
3614 offset: usize,
3615 depth: fidl::encoding::Depth,
3616 ) -> fidl::Result<()> {
3617 encoder.debug_check_bounds::<PairingDelegateOnPairingRequestRequest>(offset);
3618 self.0.encode(encoder, offset + 0, depth)?;
3622 self.1.encode(encoder, offset + 16, depth)?;
3623 self.2.encode(encoder, offset + 20, depth)?;
3624 Ok(())
3625 }
3626 }
3627
3628 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3629 for PairingDelegateOnPairingRequestRequest
3630 {
3631 #[inline(always)]
3632 fn new_empty() -> Self {
3633 Self {
3634 peer: fidl::new_empty!(Peer, D),
3635 method: fidl::new_empty!(PairingMethod, D),
3636 displayed_passkey: fidl::new_empty!(u32, D),
3637 }
3638 }
3639
3640 #[inline]
3641 unsafe fn decode(
3642 &mut self,
3643 decoder: &mut fidl::encoding::Decoder<'_, D>,
3644 offset: usize,
3645 _depth: fidl::encoding::Depth,
3646 ) -> fidl::Result<()> {
3647 decoder.debug_check_bounds::<Self>(offset);
3648 fidl::decode!(Peer, D, &mut self.peer, decoder, offset + 0, _depth)?;
3650 fidl::decode!(PairingMethod, D, &mut self.method, decoder, offset + 16, _depth)?;
3651 fidl::decode!(u32, D, &mut self.displayed_passkey, decoder, offset + 20, _depth)?;
3652 Ok(())
3653 }
3654 }
3655
3656 impl fidl::encoding::ValueTypeMarker for PairingDelegateOnPairingRequestResponse {
3657 type Borrowed<'a> = &'a Self;
3658 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3659 value
3660 }
3661 }
3662
3663 unsafe impl fidl::encoding::TypeMarker for PairingDelegateOnPairingRequestResponse {
3664 type Owned = Self;
3665
3666 #[inline(always)]
3667 fn inline_align(_context: fidl::encoding::Context) -> usize {
3668 4
3669 }
3670
3671 #[inline(always)]
3672 fn inline_size(_context: fidl::encoding::Context) -> usize {
3673 8
3674 }
3675 }
3676
3677 unsafe impl<D: fidl::encoding::ResourceDialect>
3678 fidl::encoding::Encode<PairingDelegateOnPairingRequestResponse, D>
3679 for &PairingDelegateOnPairingRequestResponse
3680 {
3681 #[inline]
3682 unsafe fn encode(
3683 self,
3684 encoder: &mut fidl::encoding::Encoder<'_, D>,
3685 offset: usize,
3686 _depth: fidl::encoding::Depth,
3687 ) -> fidl::Result<()> {
3688 encoder.debug_check_bounds::<PairingDelegateOnPairingRequestResponse>(offset);
3689 fidl::encoding::Encode::<PairingDelegateOnPairingRequestResponse, D>::encode(
3691 (
3692 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.accept),
3693 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.entered_passkey),
3694 ),
3695 encoder,
3696 offset,
3697 _depth,
3698 )
3699 }
3700 }
3701 unsafe impl<
3702 D: fidl::encoding::ResourceDialect,
3703 T0: fidl::encoding::Encode<bool, D>,
3704 T1: fidl::encoding::Encode<u32, D>,
3705 > fidl::encoding::Encode<PairingDelegateOnPairingRequestResponse, D> for (T0, T1)
3706 {
3707 #[inline]
3708 unsafe fn encode(
3709 self,
3710 encoder: &mut fidl::encoding::Encoder<'_, D>,
3711 offset: usize,
3712 depth: fidl::encoding::Depth,
3713 ) -> fidl::Result<()> {
3714 encoder.debug_check_bounds::<PairingDelegateOnPairingRequestResponse>(offset);
3715 unsafe {
3718 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3719 (ptr as *mut u32).write_unaligned(0);
3720 }
3721 self.0.encode(encoder, offset + 0, depth)?;
3723 self.1.encode(encoder, offset + 4, depth)?;
3724 Ok(())
3725 }
3726 }
3727
3728 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3729 for PairingDelegateOnPairingRequestResponse
3730 {
3731 #[inline(always)]
3732 fn new_empty() -> Self {
3733 Self { accept: fidl::new_empty!(bool, D), entered_passkey: fidl::new_empty!(u32, D) }
3734 }
3735
3736 #[inline]
3737 unsafe fn decode(
3738 &mut self,
3739 decoder: &mut fidl::encoding::Decoder<'_, D>,
3740 offset: usize,
3741 _depth: fidl::encoding::Depth,
3742 ) -> fidl::Result<()> {
3743 decoder.debug_check_bounds::<Self>(offset);
3744 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3746 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3747 let mask = 0xffffff00u32;
3748 let maskedval = padval & mask;
3749 if maskedval != 0 {
3750 return Err(fidl::Error::NonZeroPadding {
3751 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3752 });
3753 }
3754 fidl::decode!(bool, D, &mut self.accept, decoder, offset + 0, _depth)?;
3755 fidl::decode!(u32, D, &mut self.entered_passkey, decoder, offset + 4, _depth)?;
3756 Ok(())
3757 }
3758 }
3759
3760 impl fidl::encoding::ValueTypeMarker for PairingDelegateOnRemoteKeypressRequest {
3761 type Borrowed<'a> = &'a Self;
3762 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3763 value
3764 }
3765 }
3766
3767 unsafe impl fidl::encoding::TypeMarker for PairingDelegateOnRemoteKeypressRequest {
3768 type Owned = Self;
3769
3770 #[inline(always)]
3771 fn inline_align(_context: fidl::encoding::Context) -> usize {
3772 8
3773 }
3774
3775 #[inline(always)]
3776 fn inline_size(_context: fidl::encoding::Context) -> usize {
3777 16
3778 }
3779 }
3780
3781 unsafe impl<D: fidl::encoding::ResourceDialect>
3782 fidl::encoding::Encode<PairingDelegateOnRemoteKeypressRequest, D>
3783 for &PairingDelegateOnRemoteKeypressRequest
3784 {
3785 #[inline]
3786 unsafe fn encode(
3787 self,
3788 encoder: &mut fidl::encoding::Encoder<'_, D>,
3789 offset: usize,
3790 _depth: fidl::encoding::Depth,
3791 ) -> fidl::Result<()> {
3792 encoder.debug_check_bounds::<PairingDelegateOnRemoteKeypressRequest>(offset);
3793 fidl::encoding::Encode::<PairingDelegateOnRemoteKeypressRequest, D>::encode(
3795 (
3796 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(
3797 &self.id,
3798 ),
3799 <PairingKeypress as fidl::encoding::ValueTypeMarker>::borrow(&self.keypress),
3800 ),
3801 encoder,
3802 offset,
3803 _depth,
3804 )
3805 }
3806 }
3807 unsafe impl<
3808 D: fidl::encoding::ResourceDialect,
3809 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth::PeerId, D>,
3810 T1: fidl::encoding::Encode<PairingKeypress, D>,
3811 > fidl::encoding::Encode<PairingDelegateOnRemoteKeypressRequest, D> for (T0, T1)
3812 {
3813 #[inline]
3814 unsafe fn encode(
3815 self,
3816 encoder: &mut fidl::encoding::Encoder<'_, D>,
3817 offset: usize,
3818 depth: fidl::encoding::Depth,
3819 ) -> fidl::Result<()> {
3820 encoder.debug_check_bounds::<PairingDelegateOnRemoteKeypressRequest>(offset);
3821 unsafe {
3824 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3825 (ptr as *mut u64).write_unaligned(0);
3826 }
3827 self.0.encode(encoder, offset + 0, depth)?;
3829 self.1.encode(encoder, offset + 8, depth)?;
3830 Ok(())
3831 }
3832 }
3833
3834 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3835 for PairingDelegateOnRemoteKeypressRequest
3836 {
3837 #[inline(always)]
3838 fn new_empty() -> Self {
3839 Self {
3840 id: fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D),
3841 keypress: fidl::new_empty!(PairingKeypress, D),
3842 }
3843 }
3844
3845 #[inline]
3846 unsafe fn decode(
3847 &mut self,
3848 decoder: &mut fidl::encoding::Decoder<'_, D>,
3849 offset: usize,
3850 _depth: fidl::encoding::Depth,
3851 ) -> fidl::Result<()> {
3852 decoder.debug_check_bounds::<Self>(offset);
3853 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3855 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3856 let mask = 0xffffffff00000000u64;
3857 let maskedval = padval & mask;
3858 if maskedval != 0 {
3859 return Err(fidl::Error::NonZeroPadding {
3860 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3861 });
3862 }
3863 fidl::decode!(
3864 fidl_fuchsia_bluetooth::PeerId,
3865 D,
3866 &mut self.id,
3867 decoder,
3868 offset + 0,
3869 _depth
3870 )?;
3871 fidl::decode!(PairingKeypress, D, &mut self.keypress, decoder, offset + 8, _depth)?;
3872 Ok(())
3873 }
3874 }
3875
3876 impl fidl::encoding::ValueTypeMarker for PairingRequestKeypressRequest {
3877 type Borrowed<'a> = &'a Self;
3878 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3879 value
3880 }
3881 }
3882
3883 unsafe impl fidl::encoding::TypeMarker for PairingRequestKeypressRequest {
3884 type Owned = Self;
3885
3886 #[inline(always)]
3887 fn inline_align(_context: fidl::encoding::Context) -> usize {
3888 4
3889 }
3890
3891 #[inline(always)]
3892 fn inline_size(_context: fidl::encoding::Context) -> usize {
3893 4
3894 }
3895 }
3896
3897 unsafe impl<D: fidl::encoding::ResourceDialect>
3898 fidl::encoding::Encode<PairingRequestKeypressRequest, D>
3899 for &PairingRequestKeypressRequest
3900 {
3901 #[inline]
3902 unsafe fn encode(
3903 self,
3904 encoder: &mut fidl::encoding::Encoder<'_, D>,
3905 offset: usize,
3906 _depth: fidl::encoding::Depth,
3907 ) -> fidl::Result<()> {
3908 encoder.debug_check_bounds::<PairingRequestKeypressRequest>(offset);
3909 fidl::encoding::Encode::<PairingRequestKeypressRequest, D>::encode(
3911 (<PairingKeypress as fidl::encoding::ValueTypeMarker>::borrow(&self.keypress),),
3912 encoder,
3913 offset,
3914 _depth,
3915 )
3916 }
3917 }
3918 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PairingKeypress, D>>
3919 fidl::encoding::Encode<PairingRequestKeypressRequest, D> for (T0,)
3920 {
3921 #[inline]
3922 unsafe fn encode(
3923 self,
3924 encoder: &mut fidl::encoding::Encoder<'_, D>,
3925 offset: usize,
3926 depth: fidl::encoding::Depth,
3927 ) -> fidl::Result<()> {
3928 encoder.debug_check_bounds::<PairingRequestKeypressRequest>(offset);
3929 self.0.encode(encoder, offset + 0, depth)?;
3933 Ok(())
3934 }
3935 }
3936
3937 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3938 for PairingRequestKeypressRequest
3939 {
3940 #[inline(always)]
3941 fn new_empty() -> Self {
3942 Self { keypress: fidl::new_empty!(PairingKeypress, D) }
3943 }
3944
3945 #[inline]
3946 unsafe fn decode(
3947 &mut self,
3948 decoder: &mut fidl::encoding::Decoder<'_, D>,
3949 offset: usize,
3950 _depth: fidl::encoding::Depth,
3951 ) -> fidl::Result<()> {
3952 decoder.debug_check_bounds::<Self>(offset);
3953 fidl::decode!(PairingKeypress, D, &mut self.keypress, decoder, offset + 0, _depth)?;
3955 Ok(())
3956 }
3957 }
3958
3959 impl fidl::encoding::ValueTypeMarker for PairingRequestOnCompleteRequest {
3960 type Borrowed<'a> = &'a Self;
3961 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3962 value
3963 }
3964 }
3965
3966 unsafe impl fidl::encoding::TypeMarker for PairingRequestOnCompleteRequest {
3967 type Owned = Self;
3968
3969 #[inline(always)]
3970 fn inline_align(_context: fidl::encoding::Context) -> usize {
3971 1
3972 }
3973
3974 #[inline(always)]
3975 fn inline_size(_context: fidl::encoding::Context) -> usize {
3976 1
3977 }
3978 }
3979
3980 unsafe impl<D: fidl::encoding::ResourceDialect>
3981 fidl::encoding::Encode<PairingRequestOnCompleteRequest, D>
3982 for &PairingRequestOnCompleteRequest
3983 {
3984 #[inline]
3985 unsafe fn encode(
3986 self,
3987 encoder: &mut fidl::encoding::Encoder<'_, D>,
3988 offset: usize,
3989 _depth: fidl::encoding::Depth,
3990 ) -> fidl::Result<()> {
3991 encoder.debug_check_bounds::<PairingRequestOnCompleteRequest>(offset);
3992 fidl::encoding::Encode::<PairingRequestOnCompleteRequest, D>::encode(
3994 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.success),),
3995 encoder,
3996 offset,
3997 _depth,
3998 )
3999 }
4000 }
4001 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
4002 fidl::encoding::Encode<PairingRequestOnCompleteRequest, D> for (T0,)
4003 {
4004 #[inline]
4005 unsafe fn encode(
4006 self,
4007 encoder: &mut fidl::encoding::Encoder<'_, D>,
4008 offset: usize,
4009 depth: fidl::encoding::Depth,
4010 ) -> fidl::Result<()> {
4011 encoder.debug_check_bounds::<PairingRequestOnCompleteRequest>(offset);
4012 self.0.encode(encoder, offset + 0, depth)?;
4016 Ok(())
4017 }
4018 }
4019
4020 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4021 for PairingRequestOnCompleteRequest
4022 {
4023 #[inline(always)]
4024 fn new_empty() -> Self {
4025 Self { success: fidl::new_empty!(bool, D) }
4026 }
4027
4028 #[inline]
4029 unsafe fn decode(
4030 &mut self,
4031 decoder: &mut fidl::encoding::Decoder<'_, D>,
4032 offset: usize,
4033 _depth: fidl::encoding::Depth,
4034 ) -> fidl::Result<()> {
4035 decoder.debug_check_bounds::<Self>(offset);
4036 fidl::decode!(bool, D, &mut self.success, decoder, offset + 0, _depth)?;
4038 Ok(())
4039 }
4040 }
4041
4042 impl fidl::encoding::ValueTypeMarker for PairingRequestOnKeypressRequest {
4043 type Borrowed<'a> = &'a Self;
4044 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4045 value
4046 }
4047 }
4048
4049 unsafe impl fidl::encoding::TypeMarker for PairingRequestOnKeypressRequest {
4050 type Owned = Self;
4051
4052 #[inline(always)]
4053 fn inline_align(_context: fidl::encoding::Context) -> usize {
4054 4
4055 }
4056
4057 #[inline(always)]
4058 fn inline_size(_context: fidl::encoding::Context) -> usize {
4059 4
4060 }
4061 }
4062
4063 unsafe impl<D: fidl::encoding::ResourceDialect>
4064 fidl::encoding::Encode<PairingRequestOnKeypressRequest, D>
4065 for &PairingRequestOnKeypressRequest
4066 {
4067 #[inline]
4068 unsafe fn encode(
4069 self,
4070 encoder: &mut fidl::encoding::Encoder<'_, D>,
4071 offset: usize,
4072 _depth: fidl::encoding::Depth,
4073 ) -> fidl::Result<()> {
4074 encoder.debug_check_bounds::<PairingRequestOnKeypressRequest>(offset);
4075 fidl::encoding::Encode::<PairingRequestOnKeypressRequest, D>::encode(
4077 (<PairingKeypress as fidl::encoding::ValueTypeMarker>::borrow(&self.keypress),),
4078 encoder,
4079 offset,
4080 _depth,
4081 )
4082 }
4083 }
4084 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PairingKeypress, D>>
4085 fidl::encoding::Encode<PairingRequestOnKeypressRequest, D> for (T0,)
4086 {
4087 #[inline]
4088 unsafe fn encode(
4089 self,
4090 encoder: &mut fidl::encoding::Encoder<'_, D>,
4091 offset: usize,
4092 depth: fidl::encoding::Depth,
4093 ) -> fidl::Result<()> {
4094 encoder.debug_check_bounds::<PairingRequestOnKeypressRequest>(offset);
4095 self.0.encode(encoder, offset + 0, depth)?;
4099 Ok(())
4100 }
4101 }
4102
4103 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4104 for PairingRequestOnKeypressRequest
4105 {
4106 #[inline(always)]
4107 fn new_empty() -> Self {
4108 Self { keypress: fidl::new_empty!(PairingKeypress, D) }
4109 }
4110
4111 #[inline]
4112 unsafe fn decode(
4113 &mut self,
4114 decoder: &mut fidl::encoding::Decoder<'_, D>,
4115 offset: usize,
4116 _depth: fidl::encoding::Depth,
4117 ) -> fidl::Result<()> {
4118 decoder.debug_check_bounds::<Self>(offset);
4119 fidl::decode!(PairingKeypress, D, &mut self.keypress, decoder, offset + 0, _depth)?;
4121 Ok(())
4122 }
4123 }
4124
4125 impl fidl::encoding::ValueTypeMarker for PasskeyEntry {
4126 type Borrowed<'a> = &'a Self;
4127 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4128 value
4129 }
4130 }
4131
4132 unsafe impl fidl::encoding::TypeMarker for PasskeyEntry {
4133 type Owned = Self;
4134
4135 #[inline(always)]
4136 fn inline_align(_context: fidl::encoding::Context) -> usize {
4137 1
4138 }
4139
4140 #[inline(always)]
4141 fn inline_size(_context: fidl::encoding::Context) -> usize {
4142 1
4143 }
4144 }
4145
4146 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PasskeyEntry, D>
4147 for &PasskeyEntry
4148 {
4149 #[inline]
4150 unsafe fn encode(
4151 self,
4152 encoder: &mut fidl::encoding::Encoder<'_, D>,
4153 offset: usize,
4154 _depth: fidl::encoding::Depth,
4155 ) -> fidl::Result<()> {
4156 encoder.debug_check_bounds::<PasskeyEntry>(offset);
4157 encoder.write_num(0u8, offset);
4158 Ok(())
4159 }
4160 }
4161
4162 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PasskeyEntry {
4163 #[inline(always)]
4164 fn new_empty() -> Self {
4165 Self
4166 }
4167
4168 #[inline]
4169 unsafe fn decode(
4170 &mut self,
4171 decoder: &mut fidl::encoding::Decoder<'_, D>,
4172 offset: usize,
4173 _depth: fidl::encoding::Depth,
4174 ) -> fidl::Result<()> {
4175 decoder.debug_check_bounds::<Self>(offset);
4176 match decoder.read_num::<u8>(offset) {
4177 0 => Ok(()),
4178 _ => Err(fidl::Error::Invalid),
4179 }
4180 }
4181 }
4182
4183 impl fidl::encoding::ValueTypeMarker for PeerKey {
4184 type Borrowed<'a> = &'a Self;
4185 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4186 value
4187 }
4188 }
4189
4190 unsafe impl fidl::encoding::TypeMarker for PeerKey {
4191 type Owned = Self;
4192
4193 #[inline(always)]
4194 fn inline_align(_context: fidl::encoding::Context) -> usize {
4195 1
4196 }
4197
4198 #[inline(always)]
4199 fn inline_size(_context: fidl::encoding::Context) -> usize {
4200 19
4201 }
4202 }
4203
4204 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PeerKey, D> for &PeerKey {
4205 #[inline]
4206 unsafe fn encode(
4207 self,
4208 encoder: &mut fidl::encoding::Encoder<'_, D>,
4209 offset: usize,
4210 _depth: fidl::encoding::Depth,
4211 ) -> fidl::Result<()> {
4212 encoder.debug_check_bounds::<PeerKey>(offset);
4213 fidl::encoding::Encode::<PeerKey, D>::encode(
4215 (
4216 <SecurityProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.security),
4217 <Key as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
4218 ),
4219 encoder,
4220 offset,
4221 _depth,
4222 )
4223 }
4224 }
4225 unsafe impl<
4226 D: fidl::encoding::ResourceDialect,
4227 T0: fidl::encoding::Encode<SecurityProperties, D>,
4228 T1: fidl::encoding::Encode<Key, D>,
4229 > fidl::encoding::Encode<PeerKey, D> for (T0, T1)
4230 {
4231 #[inline]
4232 unsafe fn encode(
4233 self,
4234 encoder: &mut fidl::encoding::Encoder<'_, D>,
4235 offset: usize,
4236 depth: fidl::encoding::Depth,
4237 ) -> fidl::Result<()> {
4238 encoder.debug_check_bounds::<PeerKey>(offset);
4239 self.0.encode(encoder, offset + 0, depth)?;
4243 self.1.encode(encoder, offset + 3, depth)?;
4244 Ok(())
4245 }
4246 }
4247
4248 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PeerKey {
4249 #[inline(always)]
4250 fn new_empty() -> Self {
4251 Self {
4252 security: fidl::new_empty!(SecurityProperties, D),
4253 data: fidl::new_empty!(Key, D),
4254 }
4255 }
4256
4257 #[inline]
4258 unsafe fn decode(
4259 &mut self,
4260 decoder: &mut fidl::encoding::Decoder<'_, D>,
4261 offset: usize,
4262 _depth: fidl::encoding::Depth,
4263 ) -> fidl::Result<()> {
4264 decoder.debug_check_bounds::<Self>(offset);
4265 fidl::decode!(SecurityProperties, D, &mut self.security, decoder, offset + 0, _depth)?;
4267 fidl::decode!(Key, D, &mut self.data, decoder, offset + 3, _depth)?;
4268 Ok(())
4269 }
4270 }
4271
4272 impl fidl::encoding::ValueTypeMarker for SecurityProperties {
4273 type Borrowed<'a> = &'a Self;
4274 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4275 value
4276 }
4277 }
4278
4279 unsafe impl fidl::encoding::TypeMarker for SecurityProperties {
4280 type Owned = Self;
4281
4282 #[inline(always)]
4283 fn inline_align(_context: fidl::encoding::Context) -> usize {
4284 1
4285 }
4286
4287 #[inline(always)]
4288 fn inline_size(_context: fidl::encoding::Context) -> usize {
4289 3
4290 }
4291 }
4292
4293 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecurityProperties, D>
4294 for &SecurityProperties
4295 {
4296 #[inline]
4297 unsafe fn encode(
4298 self,
4299 encoder: &mut fidl::encoding::Encoder<'_, D>,
4300 offset: usize,
4301 _depth: fidl::encoding::Depth,
4302 ) -> fidl::Result<()> {
4303 encoder.debug_check_bounds::<SecurityProperties>(offset);
4304 fidl::encoding::Encode::<SecurityProperties, D>::encode(
4306 (
4307 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.authenticated),
4308 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.secure_connections),
4309 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.encryption_key_size),
4310 ),
4311 encoder,
4312 offset,
4313 _depth,
4314 )
4315 }
4316 }
4317 unsafe impl<
4318 D: fidl::encoding::ResourceDialect,
4319 T0: fidl::encoding::Encode<bool, D>,
4320 T1: fidl::encoding::Encode<bool, D>,
4321 T2: fidl::encoding::Encode<u8, D>,
4322 > fidl::encoding::Encode<SecurityProperties, D> for (T0, T1, T2)
4323 {
4324 #[inline]
4325 unsafe fn encode(
4326 self,
4327 encoder: &mut fidl::encoding::Encoder<'_, D>,
4328 offset: usize,
4329 depth: fidl::encoding::Depth,
4330 ) -> fidl::Result<()> {
4331 encoder.debug_check_bounds::<SecurityProperties>(offset);
4332 self.0.encode(encoder, offset + 0, depth)?;
4336 self.1.encode(encoder, offset + 1, depth)?;
4337 self.2.encode(encoder, offset + 2, depth)?;
4338 Ok(())
4339 }
4340 }
4341
4342 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecurityProperties {
4343 #[inline(always)]
4344 fn new_empty() -> Self {
4345 Self {
4346 authenticated: fidl::new_empty!(bool, D),
4347 secure_connections: fidl::new_empty!(bool, D),
4348 encryption_key_size: fidl::new_empty!(u8, D),
4349 }
4350 }
4351
4352 #[inline]
4353 unsafe fn decode(
4354 &mut self,
4355 decoder: &mut fidl::encoding::Decoder<'_, D>,
4356 offset: usize,
4357 _depth: fidl::encoding::Depth,
4358 ) -> fidl::Result<()> {
4359 decoder.debug_check_bounds::<Self>(offset);
4360 fidl::decode!(bool, D, &mut self.authenticated, decoder, offset + 0, _depth)?;
4362 fidl::decode!(bool, D, &mut self.secure_connections, decoder, offset + 1, _depth)?;
4363 fidl::decode!(u8, D, &mut self.encryption_key_size, decoder, offset + 2, _depth)?;
4364 Ok(())
4365 }
4366 }
4367
4368 impl BondingData {
4369 #[inline(always)]
4370 fn max_ordinal_present(&self) -> u64 {
4371 if let Some(_) = self.bredr_bond {
4372 return 8;
4373 }
4374 if let Some(_) = self.le_bond {
4375 return 7;
4376 }
4377 if let Some(_) = self.address {
4378 return 6;
4379 }
4380 if let Some(_) = self.name {
4381 return 3;
4382 }
4383 if let Some(_) = self.local_address {
4384 return 2;
4385 }
4386 if let Some(_) = self.identifier {
4387 return 1;
4388 }
4389 0
4390 }
4391 }
4392
4393 impl fidl::encoding::ValueTypeMarker for BondingData {
4394 type Borrowed<'a> = &'a Self;
4395 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4396 value
4397 }
4398 }
4399
4400 unsafe impl fidl::encoding::TypeMarker for BondingData {
4401 type Owned = Self;
4402
4403 #[inline(always)]
4404 fn inline_align(_context: fidl::encoding::Context) -> usize {
4405 8
4406 }
4407
4408 #[inline(always)]
4409 fn inline_size(_context: fidl::encoding::Context) -> usize {
4410 16
4411 }
4412 }
4413
4414 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BondingData, D>
4415 for &BondingData
4416 {
4417 unsafe fn encode(
4418 self,
4419 encoder: &mut fidl::encoding::Encoder<'_, D>,
4420 offset: usize,
4421 mut depth: fidl::encoding::Depth,
4422 ) -> fidl::Result<()> {
4423 encoder.debug_check_bounds::<BondingData>(offset);
4424 let max_ordinal: u64 = self.max_ordinal_present();
4426 encoder.write_num(max_ordinal, offset);
4427 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4428 if max_ordinal == 0 {
4430 return Ok(());
4431 }
4432 depth.increment()?;
4433 let envelope_size = 8;
4434 let bytes_len = max_ordinal as usize * envelope_size;
4435 #[allow(unused_variables)]
4436 let offset = encoder.out_of_line_offset(bytes_len);
4437 let mut _prev_end_offset: usize = 0;
4438 if 1 > max_ordinal {
4439 return Ok(());
4440 }
4441
4442 let cur_offset: usize = (1 - 1) * envelope_size;
4445
4446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4448
4449 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::PeerId, D>(
4454 self.identifier.as_ref().map(
4455 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow,
4456 ),
4457 encoder,
4458 offset + cur_offset,
4459 depth,
4460 )?;
4461
4462 _prev_end_offset = cur_offset + envelope_size;
4463 if 2 > max_ordinal {
4464 return Ok(());
4465 }
4466
4467 let cur_offset: usize = (2 - 1) * envelope_size;
4470
4471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4473
4474 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::Address, D>(
4479 self.local_address.as_ref().map(
4480 <fidl_fuchsia_bluetooth::Address as fidl::encoding::ValueTypeMarker>::borrow,
4481 ),
4482 encoder,
4483 offset + cur_offset,
4484 depth,
4485 )?;
4486
4487 _prev_end_offset = cur_offset + envelope_size;
4488 if 3 > max_ordinal {
4489 return Ok(());
4490 }
4491
4492 let cur_offset: usize = (3 - 1) * envelope_size;
4495
4496 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4498
4499 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<248>, D>(
4504 self.name.as_ref().map(
4505 <fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow,
4506 ),
4507 encoder,
4508 offset + cur_offset,
4509 depth,
4510 )?;
4511
4512 _prev_end_offset = cur_offset + envelope_size;
4513 if 6 > max_ordinal {
4514 return Ok(());
4515 }
4516
4517 let cur_offset: usize = (6 - 1) * envelope_size;
4520
4521 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4523
4524 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::Address, D>(
4529 self.address.as_ref().map(
4530 <fidl_fuchsia_bluetooth::Address as fidl::encoding::ValueTypeMarker>::borrow,
4531 ),
4532 encoder,
4533 offset + cur_offset,
4534 depth,
4535 )?;
4536
4537 _prev_end_offset = cur_offset + envelope_size;
4538 if 7 > max_ordinal {
4539 return Ok(());
4540 }
4541
4542 let cur_offset: usize = (7 - 1) * envelope_size;
4545
4546 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4548
4549 fidl::encoding::encode_in_envelope_optional::<LeBondData, D>(
4554 self.le_bond.as_ref().map(<LeBondData as fidl::encoding::ValueTypeMarker>::borrow),
4555 encoder,
4556 offset + cur_offset,
4557 depth,
4558 )?;
4559
4560 _prev_end_offset = cur_offset + envelope_size;
4561 if 8 > max_ordinal {
4562 return Ok(());
4563 }
4564
4565 let cur_offset: usize = (8 - 1) * envelope_size;
4568
4569 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4571
4572 fidl::encoding::encode_in_envelope_optional::<BredrBondData, D>(
4577 self.bredr_bond
4578 .as_ref()
4579 .map(<BredrBondData as fidl::encoding::ValueTypeMarker>::borrow),
4580 encoder,
4581 offset + cur_offset,
4582 depth,
4583 )?;
4584
4585 _prev_end_offset = cur_offset + envelope_size;
4586
4587 Ok(())
4588 }
4589 }
4590
4591 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BondingData {
4592 #[inline(always)]
4593 fn new_empty() -> Self {
4594 Self::default()
4595 }
4596
4597 unsafe fn decode(
4598 &mut self,
4599 decoder: &mut fidl::encoding::Decoder<'_, D>,
4600 offset: usize,
4601 mut depth: fidl::encoding::Depth,
4602 ) -> fidl::Result<()> {
4603 decoder.debug_check_bounds::<Self>(offset);
4604 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4605 None => return Err(fidl::Error::NotNullable),
4606 Some(len) => len,
4607 };
4608 if len == 0 {
4610 return Ok(());
4611 };
4612 depth.increment()?;
4613 let envelope_size = 8;
4614 let bytes_len = len * envelope_size;
4615 let offset = decoder.out_of_line_offset(bytes_len)?;
4616 let mut _next_ordinal_to_read = 0;
4618 let mut next_offset = offset;
4619 let end_offset = offset + bytes_len;
4620 _next_ordinal_to_read += 1;
4621 if next_offset >= end_offset {
4622 return Ok(());
4623 }
4624
4625 while _next_ordinal_to_read < 1 {
4627 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4628 _next_ordinal_to_read += 1;
4629 next_offset += envelope_size;
4630 }
4631
4632 let next_out_of_line = decoder.next_out_of_line();
4633 let handles_before = decoder.remaining_handles();
4634 if let Some((inlined, num_bytes, num_handles)) =
4635 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4636 {
4637 let member_inline_size =
4638 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::TypeMarker>::inline_size(
4639 decoder.context,
4640 );
4641 if inlined != (member_inline_size <= 4) {
4642 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4643 }
4644 let inner_offset;
4645 let mut inner_depth = depth.clone();
4646 if inlined {
4647 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4648 inner_offset = next_offset;
4649 } else {
4650 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4651 inner_depth.increment()?;
4652 }
4653 let val_ref = self
4654 .identifier
4655 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D));
4656 fidl::decode!(
4657 fidl_fuchsia_bluetooth::PeerId,
4658 D,
4659 val_ref,
4660 decoder,
4661 inner_offset,
4662 inner_depth
4663 )?;
4664 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4665 {
4666 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4667 }
4668 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4669 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4670 }
4671 }
4672
4673 next_offset += envelope_size;
4674 _next_ordinal_to_read += 1;
4675 if next_offset >= end_offset {
4676 return Ok(());
4677 }
4678
4679 while _next_ordinal_to_read < 2 {
4681 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4682 _next_ordinal_to_read += 1;
4683 next_offset += envelope_size;
4684 }
4685
4686 let next_out_of_line = decoder.next_out_of_line();
4687 let handles_before = decoder.remaining_handles();
4688 if let Some((inlined, num_bytes, num_handles)) =
4689 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4690 {
4691 let member_inline_size =
4692 <fidl_fuchsia_bluetooth::Address as fidl::encoding::TypeMarker>::inline_size(
4693 decoder.context,
4694 );
4695 if inlined != (member_inline_size <= 4) {
4696 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4697 }
4698 let inner_offset;
4699 let mut inner_depth = depth.clone();
4700 if inlined {
4701 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4702 inner_offset = next_offset;
4703 } else {
4704 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4705 inner_depth.increment()?;
4706 }
4707 let val_ref = self
4708 .local_address
4709 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::Address, D));
4710 fidl::decode!(
4711 fidl_fuchsia_bluetooth::Address,
4712 D,
4713 val_ref,
4714 decoder,
4715 inner_offset,
4716 inner_depth
4717 )?;
4718 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4719 {
4720 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4721 }
4722 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4723 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4724 }
4725 }
4726
4727 next_offset += envelope_size;
4728 _next_ordinal_to_read += 1;
4729 if next_offset >= end_offset {
4730 return Ok(());
4731 }
4732
4733 while _next_ordinal_to_read < 3 {
4735 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4736 _next_ordinal_to_read += 1;
4737 next_offset += envelope_size;
4738 }
4739
4740 let next_out_of_line = decoder.next_out_of_line();
4741 let handles_before = decoder.remaining_handles();
4742 if let Some((inlined, num_bytes, num_handles)) =
4743 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4744 {
4745 let member_inline_size =
4746 <fidl::encoding::BoundedString<248> as fidl::encoding::TypeMarker>::inline_size(
4747 decoder.context,
4748 );
4749 if inlined != (member_inline_size <= 4) {
4750 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4751 }
4752 let inner_offset;
4753 let mut inner_depth = depth.clone();
4754 if inlined {
4755 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4756 inner_offset = next_offset;
4757 } else {
4758 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4759 inner_depth.increment()?;
4760 }
4761 let val_ref = self
4762 .name
4763 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<248>, D));
4764 fidl::decode!(
4765 fidl::encoding::BoundedString<248>,
4766 D,
4767 val_ref,
4768 decoder,
4769 inner_offset,
4770 inner_depth
4771 )?;
4772 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4773 {
4774 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4775 }
4776 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4777 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4778 }
4779 }
4780
4781 next_offset += envelope_size;
4782 _next_ordinal_to_read += 1;
4783 if next_offset >= end_offset {
4784 return Ok(());
4785 }
4786
4787 while _next_ordinal_to_read < 6 {
4789 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4790 _next_ordinal_to_read += 1;
4791 next_offset += envelope_size;
4792 }
4793
4794 let next_out_of_line = decoder.next_out_of_line();
4795 let handles_before = decoder.remaining_handles();
4796 if let Some((inlined, num_bytes, num_handles)) =
4797 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4798 {
4799 let member_inline_size =
4800 <fidl_fuchsia_bluetooth::Address as fidl::encoding::TypeMarker>::inline_size(
4801 decoder.context,
4802 );
4803 if inlined != (member_inline_size <= 4) {
4804 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4805 }
4806 let inner_offset;
4807 let mut inner_depth = depth.clone();
4808 if inlined {
4809 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4810 inner_offset = next_offset;
4811 } else {
4812 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4813 inner_depth.increment()?;
4814 }
4815 let val_ref = self
4816 .address
4817 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::Address, D));
4818 fidl::decode!(
4819 fidl_fuchsia_bluetooth::Address,
4820 D,
4821 val_ref,
4822 decoder,
4823 inner_offset,
4824 inner_depth
4825 )?;
4826 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4827 {
4828 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4829 }
4830 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4831 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4832 }
4833 }
4834
4835 next_offset += envelope_size;
4836 _next_ordinal_to_read += 1;
4837 if next_offset >= end_offset {
4838 return Ok(());
4839 }
4840
4841 while _next_ordinal_to_read < 7 {
4843 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4844 _next_ordinal_to_read += 1;
4845 next_offset += envelope_size;
4846 }
4847
4848 let next_out_of_line = decoder.next_out_of_line();
4849 let handles_before = decoder.remaining_handles();
4850 if let Some((inlined, num_bytes, num_handles)) =
4851 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4852 {
4853 let member_inline_size =
4854 <LeBondData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4855 if inlined != (member_inline_size <= 4) {
4856 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4857 }
4858 let inner_offset;
4859 let mut inner_depth = depth.clone();
4860 if inlined {
4861 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4862 inner_offset = next_offset;
4863 } else {
4864 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4865 inner_depth.increment()?;
4866 }
4867 let val_ref = self.le_bond.get_or_insert_with(|| fidl::new_empty!(LeBondData, D));
4868 fidl::decode!(LeBondData, D, val_ref, decoder, inner_offset, inner_depth)?;
4869 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4870 {
4871 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4872 }
4873 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4874 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4875 }
4876 }
4877
4878 next_offset += envelope_size;
4879 _next_ordinal_to_read += 1;
4880 if next_offset >= end_offset {
4881 return Ok(());
4882 }
4883
4884 while _next_ordinal_to_read < 8 {
4886 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4887 _next_ordinal_to_read += 1;
4888 next_offset += envelope_size;
4889 }
4890
4891 let next_out_of_line = decoder.next_out_of_line();
4892 let handles_before = decoder.remaining_handles();
4893 if let Some((inlined, num_bytes, num_handles)) =
4894 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4895 {
4896 let member_inline_size =
4897 <BredrBondData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4898 if inlined != (member_inline_size <= 4) {
4899 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4900 }
4901 let inner_offset;
4902 let mut inner_depth = depth.clone();
4903 if inlined {
4904 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4905 inner_offset = next_offset;
4906 } else {
4907 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4908 inner_depth.increment()?;
4909 }
4910 let val_ref =
4911 self.bredr_bond.get_or_insert_with(|| fidl::new_empty!(BredrBondData, D));
4912 fidl::decode!(BredrBondData, D, val_ref, decoder, inner_offset, inner_depth)?;
4913 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4914 {
4915 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4916 }
4917 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4918 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4919 }
4920 }
4921
4922 next_offset += envelope_size;
4923
4924 while next_offset < end_offset {
4926 _next_ordinal_to_read += 1;
4927 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4928 next_offset += envelope_size;
4929 }
4930
4931 Ok(())
4932 }
4933 }
4934
4935 impl BredrBondData {
4936 #[inline(always)]
4937 fn max_ordinal_present(&self) -> u64 {
4938 if let Some(_) = self.link_key {
4939 return 3;
4940 }
4941 if let Some(_) = self.services {
4942 return 2;
4943 }
4944 if let Some(_) = self.role_preference {
4945 return 1;
4946 }
4947 0
4948 }
4949 }
4950
4951 impl fidl::encoding::ValueTypeMarker for BredrBondData {
4952 type Borrowed<'a> = &'a Self;
4953 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4954 value
4955 }
4956 }
4957
4958 unsafe impl fidl::encoding::TypeMarker for BredrBondData {
4959 type Owned = Self;
4960
4961 #[inline(always)]
4962 fn inline_align(_context: fidl::encoding::Context) -> usize {
4963 8
4964 }
4965
4966 #[inline(always)]
4967 fn inline_size(_context: fidl::encoding::Context) -> usize {
4968 16
4969 }
4970 }
4971
4972 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BredrBondData, D>
4973 for &BredrBondData
4974 {
4975 unsafe fn encode(
4976 self,
4977 encoder: &mut fidl::encoding::Encoder<'_, D>,
4978 offset: usize,
4979 mut depth: fidl::encoding::Depth,
4980 ) -> fidl::Result<()> {
4981 encoder.debug_check_bounds::<BredrBondData>(offset);
4982 let max_ordinal: u64 = self.max_ordinal_present();
4984 encoder.write_num(max_ordinal, offset);
4985 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4986 if max_ordinal == 0 {
4988 return Ok(());
4989 }
4990 depth.increment()?;
4991 let envelope_size = 8;
4992 let bytes_len = max_ordinal as usize * envelope_size;
4993 #[allow(unused_variables)]
4994 let offset = encoder.out_of_line_offset(bytes_len);
4995 let mut _prev_end_offset: usize = 0;
4996 if 1 > max_ordinal {
4997 return Ok(());
4998 }
4999
5000 let cur_offset: usize = (1 - 1) * envelope_size;
5003
5004 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5006
5007 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::ConnectionRole, D>(
5012 self.role_preference.as_ref().map(<fidl_fuchsia_bluetooth::ConnectionRole as fidl::encoding::ValueTypeMarker>::borrow),
5013 encoder, offset + cur_offset, depth
5014 )?;
5015
5016 _prev_end_offset = cur_offset + envelope_size;
5017 if 2 > max_ordinal {
5018 return Ok(());
5019 }
5020
5021 let cur_offset: usize = (2 - 1) * envelope_size;
5024
5025 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5027
5028 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D>(
5033 self.services.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535> as fidl::encoding::ValueTypeMarker>::borrow),
5034 encoder, offset + cur_offset, depth
5035 )?;
5036
5037 _prev_end_offset = cur_offset + envelope_size;
5038 if 3 > max_ordinal {
5039 return Ok(());
5040 }
5041
5042 let cur_offset: usize = (3 - 1) * envelope_size;
5045
5046 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5048
5049 fidl::encoding::encode_in_envelope_optional::<PeerKey, D>(
5054 self.link_key.as_ref().map(<PeerKey as fidl::encoding::ValueTypeMarker>::borrow),
5055 encoder,
5056 offset + cur_offset,
5057 depth,
5058 )?;
5059
5060 _prev_end_offset = cur_offset + envelope_size;
5061
5062 Ok(())
5063 }
5064 }
5065
5066 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BredrBondData {
5067 #[inline(always)]
5068 fn new_empty() -> Self {
5069 Self::default()
5070 }
5071
5072 unsafe fn decode(
5073 &mut self,
5074 decoder: &mut fidl::encoding::Decoder<'_, D>,
5075 offset: usize,
5076 mut depth: fidl::encoding::Depth,
5077 ) -> fidl::Result<()> {
5078 decoder.debug_check_bounds::<Self>(offset);
5079 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5080 None => return Err(fidl::Error::NotNullable),
5081 Some(len) => len,
5082 };
5083 if len == 0 {
5085 return Ok(());
5086 };
5087 depth.increment()?;
5088 let envelope_size = 8;
5089 let bytes_len = len * envelope_size;
5090 let offset = decoder.out_of_line_offset(bytes_len)?;
5091 let mut _next_ordinal_to_read = 0;
5093 let mut next_offset = offset;
5094 let end_offset = offset + bytes_len;
5095 _next_ordinal_to_read += 1;
5096 if next_offset >= end_offset {
5097 return Ok(());
5098 }
5099
5100 while _next_ordinal_to_read < 1 {
5102 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5103 _next_ordinal_to_read += 1;
5104 next_offset += envelope_size;
5105 }
5106
5107 let next_out_of_line = decoder.next_out_of_line();
5108 let handles_before = decoder.remaining_handles();
5109 if let Some((inlined, num_bytes, num_handles)) =
5110 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5111 {
5112 let member_inline_size = <fidl_fuchsia_bluetooth::ConnectionRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5113 if inlined != (member_inline_size <= 4) {
5114 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5115 }
5116 let inner_offset;
5117 let mut inner_depth = depth.clone();
5118 if inlined {
5119 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5120 inner_offset = next_offset;
5121 } else {
5122 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5123 inner_depth.increment()?;
5124 }
5125 let val_ref = self.role_preference.get_or_insert_with(|| {
5126 fidl::new_empty!(fidl_fuchsia_bluetooth::ConnectionRole, D)
5127 });
5128 fidl::decode!(
5129 fidl_fuchsia_bluetooth::ConnectionRole,
5130 D,
5131 val_ref,
5132 decoder,
5133 inner_offset,
5134 inner_depth
5135 )?;
5136 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5137 {
5138 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5139 }
5140 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5141 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5142 }
5143 }
5144
5145 next_offset += envelope_size;
5146 _next_ordinal_to_read += 1;
5147 if next_offset >= end_offset {
5148 return Ok(());
5149 }
5150
5151 while _next_ordinal_to_read < 2 {
5153 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5154 _next_ordinal_to_read += 1;
5155 next_offset += envelope_size;
5156 }
5157
5158 let next_out_of_line = decoder.next_out_of_line();
5159 let handles_before = decoder.remaining_handles();
5160 if let Some((inlined, num_bytes, num_handles)) =
5161 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5162 {
5163 let member_inline_size = <fidl::encoding::Vector<
5164 fidl_fuchsia_bluetooth::Uuid,
5165 65535,
5166 > as fidl::encoding::TypeMarker>::inline_size(
5167 decoder.context
5168 );
5169 if inlined != (member_inline_size <= 4) {
5170 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5171 }
5172 let inner_offset;
5173 let mut inner_depth = depth.clone();
5174 if inlined {
5175 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5176 inner_offset = next_offset;
5177 } else {
5178 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5179 inner_depth.increment()?;
5180 }
5181 let val_ref =
5182 self.services.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D));
5183 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D, val_ref, decoder, inner_offset, inner_depth)?;
5184 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5185 {
5186 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5187 }
5188 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5189 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5190 }
5191 }
5192
5193 next_offset += envelope_size;
5194 _next_ordinal_to_read += 1;
5195 if next_offset >= end_offset {
5196 return Ok(());
5197 }
5198
5199 while _next_ordinal_to_read < 3 {
5201 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5202 _next_ordinal_to_read += 1;
5203 next_offset += envelope_size;
5204 }
5205
5206 let next_out_of_line = decoder.next_out_of_line();
5207 let handles_before = decoder.remaining_handles();
5208 if let Some((inlined, num_bytes, num_handles)) =
5209 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5210 {
5211 let member_inline_size =
5212 <PeerKey as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5213 if inlined != (member_inline_size <= 4) {
5214 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5215 }
5216 let inner_offset;
5217 let mut inner_depth = depth.clone();
5218 if inlined {
5219 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5220 inner_offset = next_offset;
5221 } else {
5222 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5223 inner_depth.increment()?;
5224 }
5225 let val_ref = self.link_key.get_or_insert_with(|| fidl::new_empty!(PeerKey, D));
5226 fidl::decode!(PeerKey, D, val_ref, decoder, inner_offset, inner_depth)?;
5227 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5228 {
5229 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5230 }
5231 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5232 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5233 }
5234 }
5235
5236 next_offset += envelope_size;
5237
5238 while next_offset < end_offset {
5240 _next_ordinal_to_read += 1;
5241 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5242 next_offset += envelope_size;
5243 }
5244
5245 Ok(())
5246 }
5247 }
5248
5249 impl HostData {
5250 #[inline(always)]
5251 fn max_ordinal_present(&self) -> u64 {
5252 if let Some(_) = self.irk {
5253 return 1;
5254 }
5255 0
5256 }
5257 }
5258
5259 impl fidl::encoding::ValueTypeMarker for HostData {
5260 type Borrowed<'a> = &'a Self;
5261 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5262 value
5263 }
5264 }
5265
5266 unsafe impl fidl::encoding::TypeMarker for HostData {
5267 type Owned = Self;
5268
5269 #[inline(always)]
5270 fn inline_align(_context: fidl::encoding::Context) -> usize {
5271 8
5272 }
5273
5274 #[inline(always)]
5275 fn inline_size(_context: fidl::encoding::Context) -> usize {
5276 16
5277 }
5278 }
5279
5280 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostData, D> for &HostData {
5281 unsafe fn encode(
5282 self,
5283 encoder: &mut fidl::encoding::Encoder<'_, D>,
5284 offset: usize,
5285 mut depth: fidl::encoding::Depth,
5286 ) -> fidl::Result<()> {
5287 encoder.debug_check_bounds::<HostData>(offset);
5288 let max_ordinal: u64 = self.max_ordinal_present();
5290 encoder.write_num(max_ordinal, offset);
5291 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5292 if max_ordinal == 0 {
5294 return Ok(());
5295 }
5296 depth.increment()?;
5297 let envelope_size = 8;
5298 let bytes_len = max_ordinal as usize * envelope_size;
5299 #[allow(unused_variables)]
5300 let offset = encoder.out_of_line_offset(bytes_len);
5301 let mut _prev_end_offset: usize = 0;
5302 if 1 > max_ordinal {
5303 return Ok(());
5304 }
5305
5306 let cur_offset: usize = (1 - 1) * envelope_size;
5309
5310 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5312
5313 fidl::encoding::encode_in_envelope_optional::<Key, D>(
5318 self.irk.as_ref().map(<Key as fidl::encoding::ValueTypeMarker>::borrow),
5319 encoder,
5320 offset + cur_offset,
5321 depth,
5322 )?;
5323
5324 _prev_end_offset = cur_offset + envelope_size;
5325
5326 Ok(())
5327 }
5328 }
5329
5330 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostData {
5331 #[inline(always)]
5332 fn new_empty() -> Self {
5333 Self::default()
5334 }
5335
5336 unsafe fn decode(
5337 &mut self,
5338 decoder: &mut fidl::encoding::Decoder<'_, D>,
5339 offset: usize,
5340 mut depth: fidl::encoding::Depth,
5341 ) -> fidl::Result<()> {
5342 decoder.debug_check_bounds::<Self>(offset);
5343 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5344 None => return Err(fidl::Error::NotNullable),
5345 Some(len) => len,
5346 };
5347 if len == 0 {
5349 return Ok(());
5350 };
5351 depth.increment()?;
5352 let envelope_size = 8;
5353 let bytes_len = len * envelope_size;
5354 let offset = decoder.out_of_line_offset(bytes_len)?;
5355 let mut _next_ordinal_to_read = 0;
5357 let mut next_offset = offset;
5358 let end_offset = offset + bytes_len;
5359 _next_ordinal_to_read += 1;
5360 if next_offset >= end_offset {
5361 return Ok(());
5362 }
5363
5364 while _next_ordinal_to_read < 1 {
5366 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5367 _next_ordinal_to_read += 1;
5368 next_offset += envelope_size;
5369 }
5370
5371 let next_out_of_line = decoder.next_out_of_line();
5372 let handles_before = decoder.remaining_handles();
5373 if let Some((inlined, num_bytes, num_handles)) =
5374 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5375 {
5376 let member_inline_size =
5377 <Key as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5378 if inlined != (member_inline_size <= 4) {
5379 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5380 }
5381 let inner_offset;
5382 let mut inner_depth = depth.clone();
5383 if inlined {
5384 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5385 inner_offset = next_offset;
5386 } else {
5387 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5388 inner_depth.increment()?;
5389 }
5390 let val_ref = self.irk.get_or_insert_with(|| fidl::new_empty!(Key, D));
5391 fidl::decode!(Key, D, val_ref, decoder, inner_offset, inner_depth)?;
5392 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5393 {
5394 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5395 }
5396 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5397 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5398 }
5399 }
5400
5401 next_offset += envelope_size;
5402
5403 while next_offset < end_offset {
5405 _next_ordinal_to_read += 1;
5406 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5407 next_offset += envelope_size;
5408 }
5409
5410 Ok(())
5411 }
5412 }
5413
5414 impl HostInfo {
5415 #[inline(always)]
5416 fn max_ordinal_present(&self) -> u64 {
5417 if let Some(_) = self.addresses {
5418 return 8;
5419 }
5420 if let Some(_) = self.discovering {
5421 return 7;
5422 }
5423 if let Some(_) = self.discoverable {
5424 return 6;
5425 }
5426 if let Some(_) = self.local_name {
5427 return 5;
5428 }
5429 if let Some(_) = self.active {
5430 return 4;
5431 }
5432 if let Some(_) = self.technology {
5433 return 2;
5434 }
5435 if let Some(_) = self.id {
5436 return 1;
5437 }
5438 0
5439 }
5440 }
5441
5442 impl fidl::encoding::ValueTypeMarker for HostInfo {
5443 type Borrowed<'a> = &'a Self;
5444 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5445 value
5446 }
5447 }
5448
5449 unsafe impl fidl::encoding::TypeMarker for HostInfo {
5450 type Owned = Self;
5451
5452 #[inline(always)]
5453 fn inline_align(_context: fidl::encoding::Context) -> usize {
5454 8
5455 }
5456
5457 #[inline(always)]
5458 fn inline_size(_context: fidl::encoding::Context) -> usize {
5459 16
5460 }
5461 }
5462
5463 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostInfo, D> for &HostInfo {
5464 unsafe fn encode(
5465 self,
5466 encoder: &mut fidl::encoding::Encoder<'_, D>,
5467 offset: usize,
5468 mut depth: fidl::encoding::Depth,
5469 ) -> fidl::Result<()> {
5470 encoder.debug_check_bounds::<HostInfo>(offset);
5471 let max_ordinal: u64 = self.max_ordinal_present();
5473 encoder.write_num(max_ordinal, offset);
5474 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5475 if max_ordinal == 0 {
5477 return Ok(());
5478 }
5479 depth.increment()?;
5480 let envelope_size = 8;
5481 let bytes_len = max_ordinal as usize * envelope_size;
5482 #[allow(unused_variables)]
5483 let offset = encoder.out_of_line_offset(bytes_len);
5484 let mut _prev_end_offset: usize = 0;
5485 if 1 > max_ordinal {
5486 return Ok(());
5487 }
5488
5489 let cur_offset: usize = (1 - 1) * envelope_size;
5492
5493 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5495
5496 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::HostId, D>(
5501 self.id.as_ref().map(
5502 <fidl_fuchsia_bluetooth::HostId as fidl::encoding::ValueTypeMarker>::borrow,
5503 ),
5504 encoder,
5505 offset + cur_offset,
5506 depth,
5507 )?;
5508
5509 _prev_end_offset = cur_offset + envelope_size;
5510 if 2 > max_ordinal {
5511 return Ok(());
5512 }
5513
5514 let cur_offset: usize = (2 - 1) * envelope_size;
5517
5518 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5520
5521 fidl::encoding::encode_in_envelope_optional::<TechnologyType, D>(
5526 self.technology
5527 .as_ref()
5528 .map(<TechnologyType as fidl::encoding::ValueTypeMarker>::borrow),
5529 encoder,
5530 offset + cur_offset,
5531 depth,
5532 )?;
5533
5534 _prev_end_offset = cur_offset + envelope_size;
5535 if 4 > max_ordinal {
5536 return Ok(());
5537 }
5538
5539 let cur_offset: usize = (4 - 1) * envelope_size;
5542
5543 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5545
5546 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5551 self.active.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5552 encoder,
5553 offset + cur_offset,
5554 depth,
5555 )?;
5556
5557 _prev_end_offset = cur_offset + envelope_size;
5558 if 5 > max_ordinal {
5559 return Ok(());
5560 }
5561
5562 let cur_offset: usize = (5 - 1) * envelope_size;
5565
5566 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5568
5569 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<248>, D>(
5574 self.local_name.as_ref().map(
5575 <fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow,
5576 ),
5577 encoder,
5578 offset + cur_offset,
5579 depth,
5580 )?;
5581
5582 _prev_end_offset = cur_offset + envelope_size;
5583 if 6 > max_ordinal {
5584 return Ok(());
5585 }
5586
5587 let cur_offset: usize = (6 - 1) * envelope_size;
5590
5591 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5593
5594 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5599 self.discoverable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5600 encoder,
5601 offset + cur_offset,
5602 depth,
5603 )?;
5604
5605 _prev_end_offset = cur_offset + envelope_size;
5606 if 7 > max_ordinal {
5607 return Ok(());
5608 }
5609
5610 let cur_offset: usize = (7 - 1) * envelope_size;
5613
5614 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5616
5617 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5622 self.discovering.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5623 encoder,
5624 offset + cur_offset,
5625 depth,
5626 )?;
5627
5628 _prev_end_offset = cur_offset + envelope_size;
5629 if 8 > max_ordinal {
5630 return Ok(());
5631 }
5632
5633 let cur_offset: usize = (8 - 1) * envelope_size;
5636
5637 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5639
5640 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::Address>, D>(
5645 self.addresses.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::Address> as fidl::encoding::ValueTypeMarker>::borrow),
5646 encoder, offset + cur_offset, depth
5647 )?;
5648
5649 _prev_end_offset = cur_offset + envelope_size;
5650
5651 Ok(())
5652 }
5653 }
5654
5655 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostInfo {
5656 #[inline(always)]
5657 fn new_empty() -> Self {
5658 Self::default()
5659 }
5660
5661 unsafe fn decode(
5662 &mut self,
5663 decoder: &mut fidl::encoding::Decoder<'_, D>,
5664 offset: usize,
5665 mut depth: fidl::encoding::Depth,
5666 ) -> fidl::Result<()> {
5667 decoder.debug_check_bounds::<Self>(offset);
5668 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5669 None => return Err(fidl::Error::NotNullable),
5670 Some(len) => len,
5671 };
5672 if len == 0 {
5674 return Ok(());
5675 };
5676 depth.increment()?;
5677 let envelope_size = 8;
5678 let bytes_len = len * envelope_size;
5679 let offset = decoder.out_of_line_offset(bytes_len)?;
5680 let mut _next_ordinal_to_read = 0;
5682 let mut next_offset = offset;
5683 let end_offset = offset + bytes_len;
5684 _next_ordinal_to_read += 1;
5685 if next_offset >= end_offset {
5686 return Ok(());
5687 }
5688
5689 while _next_ordinal_to_read < 1 {
5691 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5692 _next_ordinal_to_read += 1;
5693 next_offset += envelope_size;
5694 }
5695
5696 let next_out_of_line = decoder.next_out_of_line();
5697 let handles_before = decoder.remaining_handles();
5698 if let Some((inlined, num_bytes, num_handles)) =
5699 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5700 {
5701 let member_inline_size =
5702 <fidl_fuchsia_bluetooth::HostId as fidl::encoding::TypeMarker>::inline_size(
5703 decoder.context,
5704 );
5705 if inlined != (member_inline_size <= 4) {
5706 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5707 }
5708 let inner_offset;
5709 let mut inner_depth = depth.clone();
5710 if inlined {
5711 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5712 inner_offset = next_offset;
5713 } else {
5714 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5715 inner_depth.increment()?;
5716 }
5717 let val_ref = self
5718 .id
5719 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::HostId, D));
5720 fidl::decode!(
5721 fidl_fuchsia_bluetooth::HostId,
5722 D,
5723 val_ref,
5724 decoder,
5725 inner_offset,
5726 inner_depth
5727 )?;
5728 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5729 {
5730 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5731 }
5732 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5733 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5734 }
5735 }
5736
5737 next_offset += envelope_size;
5738 _next_ordinal_to_read += 1;
5739 if next_offset >= end_offset {
5740 return Ok(());
5741 }
5742
5743 while _next_ordinal_to_read < 2 {
5745 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5746 _next_ordinal_to_read += 1;
5747 next_offset += envelope_size;
5748 }
5749
5750 let next_out_of_line = decoder.next_out_of_line();
5751 let handles_before = decoder.remaining_handles();
5752 if let Some((inlined, num_bytes, num_handles)) =
5753 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5754 {
5755 let member_inline_size =
5756 <TechnologyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5757 if inlined != (member_inline_size <= 4) {
5758 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5759 }
5760 let inner_offset;
5761 let mut inner_depth = depth.clone();
5762 if inlined {
5763 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5764 inner_offset = next_offset;
5765 } else {
5766 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5767 inner_depth.increment()?;
5768 }
5769 let val_ref =
5770 self.technology.get_or_insert_with(|| fidl::new_empty!(TechnologyType, D));
5771 fidl::decode!(TechnologyType, D, val_ref, decoder, inner_offset, inner_depth)?;
5772 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5773 {
5774 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5775 }
5776 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5777 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5778 }
5779 }
5780
5781 next_offset += envelope_size;
5782 _next_ordinal_to_read += 1;
5783 if next_offset >= end_offset {
5784 return Ok(());
5785 }
5786
5787 while _next_ordinal_to_read < 4 {
5789 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5790 _next_ordinal_to_read += 1;
5791 next_offset += envelope_size;
5792 }
5793
5794 let next_out_of_line = decoder.next_out_of_line();
5795 let handles_before = decoder.remaining_handles();
5796 if let Some((inlined, num_bytes, num_handles)) =
5797 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5798 {
5799 let member_inline_size =
5800 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5801 if inlined != (member_inline_size <= 4) {
5802 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5803 }
5804 let inner_offset;
5805 let mut inner_depth = depth.clone();
5806 if inlined {
5807 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5808 inner_offset = next_offset;
5809 } else {
5810 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5811 inner_depth.increment()?;
5812 }
5813 let val_ref = self.active.get_or_insert_with(|| fidl::new_empty!(bool, D));
5814 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5815 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5816 {
5817 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5818 }
5819 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5820 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5821 }
5822 }
5823
5824 next_offset += envelope_size;
5825 _next_ordinal_to_read += 1;
5826 if next_offset >= end_offset {
5827 return Ok(());
5828 }
5829
5830 while _next_ordinal_to_read < 5 {
5832 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5833 _next_ordinal_to_read += 1;
5834 next_offset += envelope_size;
5835 }
5836
5837 let next_out_of_line = decoder.next_out_of_line();
5838 let handles_before = decoder.remaining_handles();
5839 if let Some((inlined, num_bytes, num_handles)) =
5840 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5841 {
5842 let member_inline_size =
5843 <fidl::encoding::BoundedString<248> as fidl::encoding::TypeMarker>::inline_size(
5844 decoder.context,
5845 );
5846 if inlined != (member_inline_size <= 4) {
5847 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5848 }
5849 let inner_offset;
5850 let mut inner_depth = depth.clone();
5851 if inlined {
5852 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5853 inner_offset = next_offset;
5854 } else {
5855 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5856 inner_depth.increment()?;
5857 }
5858 let val_ref = self
5859 .local_name
5860 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<248>, D));
5861 fidl::decode!(
5862 fidl::encoding::BoundedString<248>,
5863 D,
5864 val_ref,
5865 decoder,
5866 inner_offset,
5867 inner_depth
5868 )?;
5869 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5870 {
5871 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5872 }
5873 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5874 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5875 }
5876 }
5877
5878 next_offset += envelope_size;
5879 _next_ordinal_to_read += 1;
5880 if next_offset >= end_offset {
5881 return Ok(());
5882 }
5883
5884 while _next_ordinal_to_read < 6 {
5886 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5887 _next_ordinal_to_read += 1;
5888 next_offset += envelope_size;
5889 }
5890
5891 let next_out_of_line = decoder.next_out_of_line();
5892 let handles_before = decoder.remaining_handles();
5893 if let Some((inlined, num_bytes, num_handles)) =
5894 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5895 {
5896 let member_inline_size =
5897 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5898 if inlined != (member_inline_size <= 4) {
5899 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5900 }
5901 let inner_offset;
5902 let mut inner_depth = depth.clone();
5903 if inlined {
5904 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5905 inner_offset = next_offset;
5906 } else {
5907 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5908 inner_depth.increment()?;
5909 }
5910 let val_ref = self.discoverable.get_or_insert_with(|| fidl::new_empty!(bool, D));
5911 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5912 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5913 {
5914 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5915 }
5916 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5917 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5918 }
5919 }
5920
5921 next_offset += envelope_size;
5922 _next_ordinal_to_read += 1;
5923 if next_offset >= end_offset {
5924 return Ok(());
5925 }
5926
5927 while _next_ordinal_to_read < 7 {
5929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5930 _next_ordinal_to_read += 1;
5931 next_offset += envelope_size;
5932 }
5933
5934 let next_out_of_line = decoder.next_out_of_line();
5935 let handles_before = decoder.remaining_handles();
5936 if let Some((inlined, num_bytes, num_handles)) =
5937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5938 {
5939 let member_inline_size =
5940 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5941 if inlined != (member_inline_size <= 4) {
5942 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5943 }
5944 let inner_offset;
5945 let mut inner_depth = depth.clone();
5946 if inlined {
5947 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5948 inner_offset = next_offset;
5949 } else {
5950 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5951 inner_depth.increment()?;
5952 }
5953 let val_ref = self.discovering.get_or_insert_with(|| fidl::new_empty!(bool, D));
5954 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5955 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5956 {
5957 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5958 }
5959 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5960 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5961 }
5962 }
5963
5964 next_offset += envelope_size;
5965 _next_ordinal_to_read += 1;
5966 if next_offset >= end_offset {
5967 return Ok(());
5968 }
5969
5970 while _next_ordinal_to_read < 8 {
5972 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5973 _next_ordinal_to_read += 1;
5974 next_offset += envelope_size;
5975 }
5976
5977 let next_out_of_line = decoder.next_out_of_line();
5978 let handles_before = decoder.remaining_handles();
5979 if let Some((inlined, num_bytes, num_handles)) =
5980 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5981 {
5982 let member_inline_size = <fidl::encoding::UnboundedVector<
5983 fidl_fuchsia_bluetooth::Address,
5984 > as fidl::encoding::TypeMarker>::inline_size(
5985 decoder.context
5986 );
5987 if inlined != (member_inline_size <= 4) {
5988 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5989 }
5990 let inner_offset;
5991 let mut inner_depth = depth.clone();
5992 if inlined {
5993 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5994 inner_offset = next_offset;
5995 } else {
5996 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5997 inner_depth.increment()?;
5998 }
5999 let val_ref = self.addresses.get_or_insert_with(|| {
6000 fidl::new_empty!(
6001 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::Address>,
6002 D
6003 )
6004 });
6005 fidl::decode!(
6006 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth::Address>,
6007 D,
6008 val_ref,
6009 decoder,
6010 inner_offset,
6011 inner_depth
6012 )?;
6013 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6014 {
6015 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6016 }
6017 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6018 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6019 }
6020 }
6021
6022 next_offset += envelope_size;
6023
6024 while next_offset < end_offset {
6026 _next_ordinal_to_read += 1;
6027 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6028 next_offset += envelope_size;
6029 }
6030
6031 Ok(())
6032 }
6033 }
6034
6035 impl Identity {
6036 #[inline(always)]
6037 fn max_ordinal_present(&self) -> u64 {
6038 if let Some(_) = self.bonds {
6039 return 2;
6040 }
6041 if let Some(_) = self.host {
6042 return 1;
6043 }
6044 0
6045 }
6046 }
6047
6048 impl fidl::encoding::ValueTypeMarker for Identity {
6049 type Borrowed<'a> = &'a Self;
6050 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6051 value
6052 }
6053 }
6054
6055 unsafe impl fidl::encoding::TypeMarker for Identity {
6056 type Owned = Self;
6057
6058 #[inline(always)]
6059 fn inline_align(_context: fidl::encoding::Context) -> usize {
6060 8
6061 }
6062
6063 #[inline(always)]
6064 fn inline_size(_context: fidl::encoding::Context) -> usize {
6065 16
6066 }
6067 }
6068
6069 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Identity, D> for &Identity {
6070 unsafe fn encode(
6071 self,
6072 encoder: &mut fidl::encoding::Encoder<'_, D>,
6073 offset: usize,
6074 mut depth: fidl::encoding::Depth,
6075 ) -> fidl::Result<()> {
6076 encoder.debug_check_bounds::<Identity>(offset);
6077 let max_ordinal: u64 = self.max_ordinal_present();
6079 encoder.write_num(max_ordinal, offset);
6080 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6081 if max_ordinal == 0 {
6083 return Ok(());
6084 }
6085 depth.increment()?;
6086 let envelope_size = 8;
6087 let bytes_len = max_ordinal as usize * envelope_size;
6088 #[allow(unused_variables)]
6089 let offset = encoder.out_of_line_offset(bytes_len);
6090 let mut _prev_end_offset: usize = 0;
6091 if 1 > max_ordinal {
6092 return Ok(());
6093 }
6094
6095 let cur_offset: usize = (1 - 1) * envelope_size;
6098
6099 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6101
6102 fidl::encoding::encode_in_envelope_optional::<HostData, D>(
6107 self.host.as_ref().map(<HostData as fidl::encoding::ValueTypeMarker>::borrow),
6108 encoder,
6109 offset + cur_offset,
6110 depth,
6111 )?;
6112
6113 _prev_end_offset = cur_offset + envelope_size;
6114 if 2 > max_ordinal {
6115 return Ok(());
6116 }
6117
6118 let cur_offset: usize = (2 - 1) * envelope_size;
6121
6122 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6124
6125 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<BondingData>, D>(
6130 self.bonds.as_ref().map(<fidl::encoding::UnboundedVector<BondingData> as fidl::encoding::ValueTypeMarker>::borrow),
6131 encoder, offset + cur_offset, depth
6132 )?;
6133
6134 _prev_end_offset = cur_offset + envelope_size;
6135
6136 Ok(())
6137 }
6138 }
6139
6140 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Identity {
6141 #[inline(always)]
6142 fn new_empty() -> Self {
6143 Self::default()
6144 }
6145
6146 unsafe fn decode(
6147 &mut self,
6148 decoder: &mut fidl::encoding::Decoder<'_, D>,
6149 offset: usize,
6150 mut depth: fidl::encoding::Depth,
6151 ) -> fidl::Result<()> {
6152 decoder.debug_check_bounds::<Self>(offset);
6153 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6154 None => return Err(fidl::Error::NotNullable),
6155 Some(len) => len,
6156 };
6157 if len == 0 {
6159 return Ok(());
6160 };
6161 depth.increment()?;
6162 let envelope_size = 8;
6163 let bytes_len = len * envelope_size;
6164 let offset = decoder.out_of_line_offset(bytes_len)?;
6165 let mut _next_ordinal_to_read = 0;
6167 let mut next_offset = offset;
6168 let end_offset = offset + bytes_len;
6169 _next_ordinal_to_read += 1;
6170 if next_offset >= end_offset {
6171 return Ok(());
6172 }
6173
6174 while _next_ordinal_to_read < 1 {
6176 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6177 _next_ordinal_to_read += 1;
6178 next_offset += envelope_size;
6179 }
6180
6181 let next_out_of_line = decoder.next_out_of_line();
6182 let handles_before = decoder.remaining_handles();
6183 if let Some((inlined, num_bytes, num_handles)) =
6184 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6185 {
6186 let member_inline_size =
6187 <HostData as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6188 if inlined != (member_inline_size <= 4) {
6189 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6190 }
6191 let inner_offset;
6192 let mut inner_depth = depth.clone();
6193 if inlined {
6194 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6195 inner_offset = next_offset;
6196 } else {
6197 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6198 inner_depth.increment()?;
6199 }
6200 let val_ref = self.host.get_or_insert_with(|| fidl::new_empty!(HostData, D));
6201 fidl::decode!(HostData, D, val_ref, decoder, inner_offset, inner_depth)?;
6202 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6203 {
6204 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6205 }
6206 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6207 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6208 }
6209 }
6210
6211 next_offset += envelope_size;
6212 _next_ordinal_to_read += 1;
6213 if next_offset >= end_offset {
6214 return Ok(());
6215 }
6216
6217 while _next_ordinal_to_read < 2 {
6219 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6220 _next_ordinal_to_read += 1;
6221 next_offset += envelope_size;
6222 }
6223
6224 let next_out_of_line = decoder.next_out_of_line();
6225 let handles_before = decoder.remaining_handles();
6226 if let Some((inlined, num_bytes, num_handles)) =
6227 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6228 {
6229 let member_inline_size = <fidl::encoding::UnboundedVector<BondingData> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6230 if inlined != (member_inline_size <= 4) {
6231 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6232 }
6233 let inner_offset;
6234 let mut inner_depth = depth.clone();
6235 if inlined {
6236 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6237 inner_offset = next_offset;
6238 } else {
6239 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6240 inner_depth.increment()?;
6241 }
6242 let val_ref = self.bonds.get_or_insert_with(|| {
6243 fidl::new_empty!(fidl::encoding::UnboundedVector<BondingData>, D)
6244 });
6245 fidl::decode!(
6246 fidl::encoding::UnboundedVector<BondingData>,
6247 D,
6248 val_ref,
6249 decoder,
6250 inner_offset,
6251 inner_depth
6252 )?;
6253 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6254 {
6255 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6256 }
6257 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6258 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6259 }
6260 }
6261
6262 next_offset += envelope_size;
6263
6264 while next_offset < end_offset {
6266 _next_ordinal_to_read += 1;
6267 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6268 next_offset += envelope_size;
6269 }
6270
6271 Ok(())
6272 }
6273 }
6274
6275 impl LeBondData {
6276 #[inline(always)]
6277 fn max_ordinal_present(&self) -> u64 {
6278 if let Some(_) = self.local_ltk {
6279 return 6;
6280 }
6281 if let Some(_) = self.peer_ltk {
6282 return 5;
6283 }
6284 if let Some(_) = self.csrk {
6285 return 4;
6286 }
6287 if let Some(_) = self.irk {
6288 return 3;
6289 }
6290 if let Some(_) = self.services {
6291 return 2;
6292 }
6293 if let Some(_) = self.connection_parameters {
6294 return 1;
6295 }
6296 0
6297 }
6298 }
6299
6300 impl fidl::encoding::ValueTypeMarker for LeBondData {
6301 type Borrowed<'a> = &'a Self;
6302 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6303 value
6304 }
6305 }
6306
6307 unsafe impl fidl::encoding::TypeMarker for LeBondData {
6308 type Owned = Self;
6309
6310 #[inline(always)]
6311 fn inline_align(_context: fidl::encoding::Context) -> usize {
6312 8
6313 }
6314
6315 #[inline(always)]
6316 fn inline_size(_context: fidl::encoding::Context) -> usize {
6317 16
6318 }
6319 }
6320
6321 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LeBondData, D>
6322 for &LeBondData
6323 {
6324 unsafe fn encode(
6325 self,
6326 encoder: &mut fidl::encoding::Encoder<'_, D>,
6327 offset: usize,
6328 mut depth: fidl::encoding::Depth,
6329 ) -> fidl::Result<()> {
6330 encoder.debug_check_bounds::<LeBondData>(offset);
6331 let max_ordinal: u64 = self.max_ordinal_present();
6333 encoder.write_num(max_ordinal, offset);
6334 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6335 if max_ordinal == 0 {
6337 return Ok(());
6338 }
6339 depth.increment()?;
6340 let envelope_size = 8;
6341 let bytes_len = max_ordinal as usize * envelope_size;
6342 #[allow(unused_variables)]
6343 let offset = encoder.out_of_line_offset(bytes_len);
6344 let mut _prev_end_offset: usize = 0;
6345 if 1 > max_ordinal {
6346 return Ok(());
6347 }
6348
6349 let cur_offset: usize = (1 - 1) * envelope_size;
6352
6353 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6355
6356 fidl::encoding::encode_in_envelope_optional::<LeConnectionParameters, D>(
6361 self.connection_parameters
6362 .as_ref()
6363 .map(<LeConnectionParameters as fidl::encoding::ValueTypeMarker>::borrow),
6364 encoder,
6365 offset + cur_offset,
6366 depth,
6367 )?;
6368
6369 _prev_end_offset = cur_offset + envelope_size;
6370 if 2 > max_ordinal {
6371 return Ok(());
6372 }
6373
6374 let cur_offset: usize = (2 - 1) * envelope_size;
6377
6378 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6380
6381 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D>(
6386 self.services.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535> as fidl::encoding::ValueTypeMarker>::borrow),
6387 encoder, offset + cur_offset, depth
6388 )?;
6389
6390 _prev_end_offset = cur_offset + envelope_size;
6391 if 3 > max_ordinal {
6392 return Ok(());
6393 }
6394
6395 let cur_offset: usize = (3 - 1) * envelope_size;
6398
6399 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6401
6402 fidl::encoding::encode_in_envelope_optional::<PeerKey, D>(
6407 self.irk.as_ref().map(<PeerKey as fidl::encoding::ValueTypeMarker>::borrow),
6408 encoder,
6409 offset + cur_offset,
6410 depth,
6411 )?;
6412
6413 _prev_end_offset = cur_offset + envelope_size;
6414 if 4 > max_ordinal {
6415 return Ok(());
6416 }
6417
6418 let cur_offset: usize = (4 - 1) * envelope_size;
6421
6422 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6424
6425 fidl::encoding::encode_in_envelope_optional::<PeerKey, D>(
6430 self.csrk.as_ref().map(<PeerKey as fidl::encoding::ValueTypeMarker>::borrow),
6431 encoder,
6432 offset + cur_offset,
6433 depth,
6434 )?;
6435
6436 _prev_end_offset = cur_offset + envelope_size;
6437 if 5 > max_ordinal {
6438 return Ok(());
6439 }
6440
6441 let cur_offset: usize = (5 - 1) * envelope_size;
6444
6445 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6447
6448 fidl::encoding::encode_in_envelope_optional::<Ltk, D>(
6453 self.peer_ltk.as_ref().map(<Ltk as fidl::encoding::ValueTypeMarker>::borrow),
6454 encoder,
6455 offset + cur_offset,
6456 depth,
6457 )?;
6458
6459 _prev_end_offset = cur_offset + envelope_size;
6460 if 6 > max_ordinal {
6461 return Ok(());
6462 }
6463
6464 let cur_offset: usize = (6 - 1) * envelope_size;
6467
6468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6470
6471 fidl::encoding::encode_in_envelope_optional::<Ltk, D>(
6476 self.local_ltk.as_ref().map(<Ltk as fidl::encoding::ValueTypeMarker>::borrow),
6477 encoder,
6478 offset + cur_offset,
6479 depth,
6480 )?;
6481
6482 _prev_end_offset = cur_offset + envelope_size;
6483
6484 Ok(())
6485 }
6486 }
6487
6488 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LeBondData {
6489 #[inline(always)]
6490 fn new_empty() -> Self {
6491 Self::default()
6492 }
6493
6494 unsafe fn decode(
6495 &mut self,
6496 decoder: &mut fidl::encoding::Decoder<'_, D>,
6497 offset: usize,
6498 mut depth: fidl::encoding::Depth,
6499 ) -> fidl::Result<()> {
6500 decoder.debug_check_bounds::<Self>(offset);
6501 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6502 None => return Err(fidl::Error::NotNullable),
6503 Some(len) => len,
6504 };
6505 if len == 0 {
6507 return Ok(());
6508 };
6509 depth.increment()?;
6510 let envelope_size = 8;
6511 let bytes_len = len * envelope_size;
6512 let offset = decoder.out_of_line_offset(bytes_len)?;
6513 let mut _next_ordinal_to_read = 0;
6515 let mut next_offset = offset;
6516 let end_offset = offset + bytes_len;
6517 _next_ordinal_to_read += 1;
6518 if next_offset >= end_offset {
6519 return Ok(());
6520 }
6521
6522 while _next_ordinal_to_read < 1 {
6524 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6525 _next_ordinal_to_read += 1;
6526 next_offset += envelope_size;
6527 }
6528
6529 let next_out_of_line = decoder.next_out_of_line();
6530 let handles_before = decoder.remaining_handles();
6531 if let Some((inlined, num_bytes, num_handles)) =
6532 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6533 {
6534 let member_inline_size =
6535 <LeConnectionParameters as fidl::encoding::TypeMarker>::inline_size(
6536 decoder.context,
6537 );
6538 if inlined != (member_inline_size <= 4) {
6539 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6540 }
6541 let inner_offset;
6542 let mut inner_depth = depth.clone();
6543 if inlined {
6544 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6545 inner_offset = next_offset;
6546 } else {
6547 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6548 inner_depth.increment()?;
6549 }
6550 let val_ref = self
6551 .connection_parameters
6552 .get_or_insert_with(|| fidl::new_empty!(LeConnectionParameters, D));
6553 fidl::decode!(
6554 LeConnectionParameters,
6555 D,
6556 val_ref,
6557 decoder,
6558 inner_offset,
6559 inner_depth
6560 )?;
6561 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6562 {
6563 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6564 }
6565 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6566 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6567 }
6568 }
6569
6570 next_offset += envelope_size;
6571 _next_ordinal_to_read += 1;
6572 if next_offset >= end_offset {
6573 return Ok(());
6574 }
6575
6576 while _next_ordinal_to_read < 2 {
6578 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6579 _next_ordinal_to_read += 1;
6580 next_offset += envelope_size;
6581 }
6582
6583 let next_out_of_line = decoder.next_out_of_line();
6584 let handles_before = decoder.remaining_handles();
6585 if let Some((inlined, num_bytes, num_handles)) =
6586 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6587 {
6588 let member_inline_size = <fidl::encoding::Vector<
6589 fidl_fuchsia_bluetooth::Uuid,
6590 65535,
6591 > as fidl::encoding::TypeMarker>::inline_size(
6592 decoder.context
6593 );
6594 if inlined != (member_inline_size <= 4) {
6595 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6596 }
6597 let inner_offset;
6598 let mut inner_depth = depth.clone();
6599 if inlined {
6600 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6601 inner_offset = next_offset;
6602 } else {
6603 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6604 inner_depth.increment()?;
6605 }
6606 let val_ref =
6607 self.services.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D));
6608 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D, val_ref, decoder, inner_offset, inner_depth)?;
6609 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6610 {
6611 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6612 }
6613 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6614 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6615 }
6616 }
6617
6618 next_offset += envelope_size;
6619 _next_ordinal_to_read += 1;
6620 if next_offset >= end_offset {
6621 return Ok(());
6622 }
6623
6624 while _next_ordinal_to_read < 3 {
6626 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6627 _next_ordinal_to_read += 1;
6628 next_offset += envelope_size;
6629 }
6630
6631 let next_out_of_line = decoder.next_out_of_line();
6632 let handles_before = decoder.remaining_handles();
6633 if let Some((inlined, num_bytes, num_handles)) =
6634 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6635 {
6636 let member_inline_size =
6637 <PeerKey as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6638 if inlined != (member_inline_size <= 4) {
6639 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6640 }
6641 let inner_offset;
6642 let mut inner_depth = depth.clone();
6643 if inlined {
6644 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6645 inner_offset = next_offset;
6646 } else {
6647 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6648 inner_depth.increment()?;
6649 }
6650 let val_ref = self.irk.get_or_insert_with(|| fidl::new_empty!(PeerKey, D));
6651 fidl::decode!(PeerKey, D, val_ref, decoder, inner_offset, inner_depth)?;
6652 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6653 {
6654 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6655 }
6656 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6657 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6658 }
6659 }
6660
6661 next_offset += envelope_size;
6662 _next_ordinal_to_read += 1;
6663 if next_offset >= end_offset {
6664 return Ok(());
6665 }
6666
6667 while _next_ordinal_to_read < 4 {
6669 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6670 _next_ordinal_to_read += 1;
6671 next_offset += envelope_size;
6672 }
6673
6674 let next_out_of_line = decoder.next_out_of_line();
6675 let handles_before = decoder.remaining_handles();
6676 if let Some((inlined, num_bytes, num_handles)) =
6677 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6678 {
6679 let member_inline_size =
6680 <PeerKey as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6681 if inlined != (member_inline_size <= 4) {
6682 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6683 }
6684 let inner_offset;
6685 let mut inner_depth = depth.clone();
6686 if inlined {
6687 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6688 inner_offset = next_offset;
6689 } else {
6690 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6691 inner_depth.increment()?;
6692 }
6693 let val_ref = self.csrk.get_or_insert_with(|| fidl::new_empty!(PeerKey, D));
6694 fidl::decode!(PeerKey, D, val_ref, decoder, inner_offset, inner_depth)?;
6695 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6696 {
6697 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6698 }
6699 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6700 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6701 }
6702 }
6703
6704 next_offset += envelope_size;
6705 _next_ordinal_to_read += 1;
6706 if next_offset >= end_offset {
6707 return Ok(());
6708 }
6709
6710 while _next_ordinal_to_read < 5 {
6712 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6713 _next_ordinal_to_read += 1;
6714 next_offset += envelope_size;
6715 }
6716
6717 let next_out_of_line = decoder.next_out_of_line();
6718 let handles_before = decoder.remaining_handles();
6719 if let Some((inlined, num_bytes, num_handles)) =
6720 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6721 {
6722 let member_inline_size =
6723 <Ltk as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6724 if inlined != (member_inline_size <= 4) {
6725 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6726 }
6727 let inner_offset;
6728 let mut inner_depth = depth.clone();
6729 if inlined {
6730 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6731 inner_offset = next_offset;
6732 } else {
6733 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6734 inner_depth.increment()?;
6735 }
6736 let val_ref = self.peer_ltk.get_or_insert_with(|| fidl::new_empty!(Ltk, D));
6737 fidl::decode!(Ltk, D, val_ref, decoder, inner_offset, inner_depth)?;
6738 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6739 {
6740 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6741 }
6742 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6743 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6744 }
6745 }
6746
6747 next_offset += envelope_size;
6748 _next_ordinal_to_read += 1;
6749 if next_offset >= end_offset {
6750 return Ok(());
6751 }
6752
6753 while _next_ordinal_to_read < 6 {
6755 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6756 _next_ordinal_to_read += 1;
6757 next_offset += envelope_size;
6758 }
6759
6760 let next_out_of_line = decoder.next_out_of_line();
6761 let handles_before = decoder.remaining_handles();
6762 if let Some((inlined, num_bytes, num_handles)) =
6763 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6764 {
6765 let member_inline_size =
6766 <Ltk as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6767 if inlined != (member_inline_size <= 4) {
6768 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6769 }
6770 let inner_offset;
6771 let mut inner_depth = depth.clone();
6772 if inlined {
6773 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6774 inner_offset = next_offset;
6775 } else {
6776 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6777 inner_depth.increment()?;
6778 }
6779 let val_ref = self.local_ltk.get_or_insert_with(|| fidl::new_empty!(Ltk, D));
6780 fidl::decode!(Ltk, D, val_ref, decoder, inner_offset, inner_depth)?;
6781 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6782 {
6783 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6784 }
6785 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6786 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6787 }
6788 }
6789
6790 next_offset += envelope_size;
6791
6792 while next_offset < end_offset {
6794 _next_ordinal_to_read += 1;
6795 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6796 next_offset += envelope_size;
6797 }
6798
6799 Ok(())
6800 }
6801 }
6802
6803 impl PairingOptions {
6804 #[inline(always)]
6805 fn max_ordinal_present(&self) -> u64 {
6806 if let Some(_) = self.transport {
6807 return 3;
6808 }
6809 if let Some(_) = self.bondable_mode {
6810 return 2;
6811 }
6812 if let Some(_) = self.le_security_level {
6813 return 1;
6814 }
6815 0
6816 }
6817 }
6818
6819 impl fidl::encoding::ValueTypeMarker for PairingOptions {
6820 type Borrowed<'a> = &'a Self;
6821 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6822 value
6823 }
6824 }
6825
6826 unsafe impl fidl::encoding::TypeMarker for PairingOptions {
6827 type Owned = Self;
6828
6829 #[inline(always)]
6830 fn inline_align(_context: fidl::encoding::Context) -> usize {
6831 8
6832 }
6833
6834 #[inline(always)]
6835 fn inline_size(_context: fidl::encoding::Context) -> usize {
6836 16
6837 }
6838 }
6839
6840 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PairingOptions, D>
6841 for &PairingOptions
6842 {
6843 unsafe fn encode(
6844 self,
6845 encoder: &mut fidl::encoding::Encoder<'_, D>,
6846 offset: usize,
6847 mut depth: fidl::encoding::Depth,
6848 ) -> fidl::Result<()> {
6849 encoder.debug_check_bounds::<PairingOptions>(offset);
6850 let max_ordinal: u64 = self.max_ordinal_present();
6852 encoder.write_num(max_ordinal, offset);
6853 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6854 if max_ordinal == 0 {
6856 return Ok(());
6857 }
6858 depth.increment()?;
6859 let envelope_size = 8;
6860 let bytes_len = max_ordinal as usize * envelope_size;
6861 #[allow(unused_variables)]
6862 let offset = encoder.out_of_line_offset(bytes_len);
6863 let mut _prev_end_offset: usize = 0;
6864 if 1 > max_ordinal {
6865 return Ok(());
6866 }
6867
6868 let cur_offset: usize = (1 - 1) * envelope_size;
6871
6872 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6874
6875 fidl::encoding::encode_in_envelope_optional::<PairingSecurityLevel, D>(
6880 self.le_security_level
6881 .as_ref()
6882 .map(<PairingSecurityLevel as fidl::encoding::ValueTypeMarker>::borrow),
6883 encoder,
6884 offset + cur_offset,
6885 depth,
6886 )?;
6887
6888 _prev_end_offset = cur_offset + envelope_size;
6889 if 2 > max_ordinal {
6890 return Ok(());
6891 }
6892
6893 let cur_offset: usize = (2 - 1) * envelope_size;
6896
6897 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6899
6900 fidl::encoding::encode_in_envelope_optional::<BondableMode, D>(
6905 self.bondable_mode
6906 .as_ref()
6907 .map(<BondableMode as fidl::encoding::ValueTypeMarker>::borrow),
6908 encoder,
6909 offset + cur_offset,
6910 depth,
6911 )?;
6912
6913 _prev_end_offset = cur_offset + envelope_size;
6914 if 3 > max_ordinal {
6915 return Ok(());
6916 }
6917
6918 let cur_offset: usize = (3 - 1) * envelope_size;
6921
6922 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6924
6925 fidl::encoding::encode_in_envelope_optional::<TechnologyType, D>(
6930 self.transport
6931 .as_ref()
6932 .map(<TechnologyType as fidl::encoding::ValueTypeMarker>::borrow),
6933 encoder,
6934 offset + cur_offset,
6935 depth,
6936 )?;
6937
6938 _prev_end_offset = cur_offset + envelope_size;
6939
6940 Ok(())
6941 }
6942 }
6943
6944 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PairingOptions {
6945 #[inline(always)]
6946 fn new_empty() -> Self {
6947 Self::default()
6948 }
6949
6950 unsafe fn decode(
6951 &mut self,
6952 decoder: &mut fidl::encoding::Decoder<'_, D>,
6953 offset: usize,
6954 mut depth: fidl::encoding::Depth,
6955 ) -> fidl::Result<()> {
6956 decoder.debug_check_bounds::<Self>(offset);
6957 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6958 None => return Err(fidl::Error::NotNullable),
6959 Some(len) => len,
6960 };
6961 if len == 0 {
6963 return Ok(());
6964 };
6965 depth.increment()?;
6966 let envelope_size = 8;
6967 let bytes_len = len * envelope_size;
6968 let offset = decoder.out_of_line_offset(bytes_len)?;
6969 let mut _next_ordinal_to_read = 0;
6971 let mut next_offset = offset;
6972 let end_offset = offset + bytes_len;
6973 _next_ordinal_to_read += 1;
6974 if next_offset >= end_offset {
6975 return Ok(());
6976 }
6977
6978 while _next_ordinal_to_read < 1 {
6980 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6981 _next_ordinal_to_read += 1;
6982 next_offset += envelope_size;
6983 }
6984
6985 let next_out_of_line = decoder.next_out_of_line();
6986 let handles_before = decoder.remaining_handles();
6987 if let Some((inlined, num_bytes, num_handles)) =
6988 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6989 {
6990 let member_inline_size =
6991 <PairingSecurityLevel as fidl::encoding::TypeMarker>::inline_size(
6992 decoder.context,
6993 );
6994 if inlined != (member_inline_size <= 4) {
6995 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6996 }
6997 let inner_offset;
6998 let mut inner_depth = depth.clone();
6999 if inlined {
7000 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7001 inner_offset = next_offset;
7002 } else {
7003 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7004 inner_depth.increment()?;
7005 }
7006 let val_ref = self
7007 .le_security_level
7008 .get_or_insert_with(|| fidl::new_empty!(PairingSecurityLevel, D));
7009 fidl::decode!(
7010 PairingSecurityLevel,
7011 D,
7012 val_ref,
7013 decoder,
7014 inner_offset,
7015 inner_depth
7016 )?;
7017 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7018 {
7019 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7020 }
7021 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7022 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7023 }
7024 }
7025
7026 next_offset += envelope_size;
7027 _next_ordinal_to_read += 1;
7028 if next_offset >= end_offset {
7029 return Ok(());
7030 }
7031
7032 while _next_ordinal_to_read < 2 {
7034 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7035 _next_ordinal_to_read += 1;
7036 next_offset += envelope_size;
7037 }
7038
7039 let next_out_of_line = decoder.next_out_of_line();
7040 let handles_before = decoder.remaining_handles();
7041 if let Some((inlined, num_bytes, num_handles)) =
7042 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7043 {
7044 let member_inline_size =
7045 <BondableMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7046 if inlined != (member_inline_size <= 4) {
7047 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7048 }
7049 let inner_offset;
7050 let mut inner_depth = depth.clone();
7051 if inlined {
7052 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7053 inner_offset = next_offset;
7054 } else {
7055 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7056 inner_depth.increment()?;
7057 }
7058 let val_ref =
7059 self.bondable_mode.get_or_insert_with(|| fidl::new_empty!(BondableMode, D));
7060 fidl::decode!(BondableMode, D, val_ref, decoder, inner_offset, inner_depth)?;
7061 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7062 {
7063 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7064 }
7065 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7066 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7067 }
7068 }
7069
7070 next_offset += envelope_size;
7071 _next_ordinal_to_read += 1;
7072 if next_offset >= end_offset {
7073 return Ok(());
7074 }
7075
7076 while _next_ordinal_to_read < 3 {
7078 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7079 _next_ordinal_to_read += 1;
7080 next_offset += envelope_size;
7081 }
7082
7083 let next_out_of_line = decoder.next_out_of_line();
7084 let handles_before = decoder.remaining_handles();
7085 if let Some((inlined, num_bytes, num_handles)) =
7086 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7087 {
7088 let member_inline_size =
7089 <TechnologyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7090 if inlined != (member_inline_size <= 4) {
7091 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7092 }
7093 let inner_offset;
7094 let mut inner_depth = depth.clone();
7095 if inlined {
7096 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7097 inner_offset = next_offset;
7098 } else {
7099 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7100 inner_depth.increment()?;
7101 }
7102 let val_ref =
7103 self.transport.get_or_insert_with(|| fidl::new_empty!(TechnologyType, D));
7104 fidl::decode!(TechnologyType, D, val_ref, decoder, inner_offset, inner_depth)?;
7105 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7106 {
7107 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7108 }
7109 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7110 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7111 }
7112 }
7113
7114 next_offset += envelope_size;
7115
7116 while next_offset < end_offset {
7118 _next_ordinal_to_read += 1;
7119 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7120 next_offset += envelope_size;
7121 }
7122
7123 Ok(())
7124 }
7125 }
7126
7127 impl PairingRequestAcceptRequest {
7128 #[inline(always)]
7129 fn max_ordinal_present(&self) -> u64 {
7130 if let Some(_) = self.entered_passkey {
7131 return 1;
7132 }
7133 0
7134 }
7135 }
7136
7137 impl fidl::encoding::ValueTypeMarker for PairingRequestAcceptRequest {
7138 type Borrowed<'a> = &'a Self;
7139 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7140 value
7141 }
7142 }
7143
7144 unsafe impl fidl::encoding::TypeMarker for PairingRequestAcceptRequest {
7145 type Owned = Self;
7146
7147 #[inline(always)]
7148 fn inline_align(_context: fidl::encoding::Context) -> usize {
7149 8
7150 }
7151
7152 #[inline(always)]
7153 fn inline_size(_context: fidl::encoding::Context) -> usize {
7154 16
7155 }
7156 }
7157
7158 unsafe impl<D: fidl::encoding::ResourceDialect>
7159 fidl::encoding::Encode<PairingRequestAcceptRequest, D> for &PairingRequestAcceptRequest
7160 {
7161 unsafe fn encode(
7162 self,
7163 encoder: &mut fidl::encoding::Encoder<'_, D>,
7164 offset: usize,
7165 mut depth: fidl::encoding::Depth,
7166 ) -> fidl::Result<()> {
7167 encoder.debug_check_bounds::<PairingRequestAcceptRequest>(offset);
7168 let max_ordinal: u64 = self.max_ordinal_present();
7170 encoder.write_num(max_ordinal, offset);
7171 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7172 if max_ordinal == 0 {
7174 return Ok(());
7175 }
7176 depth.increment()?;
7177 let envelope_size = 8;
7178 let bytes_len = max_ordinal as usize * envelope_size;
7179 #[allow(unused_variables)]
7180 let offset = encoder.out_of_line_offset(bytes_len);
7181 let mut _prev_end_offset: usize = 0;
7182 if 1 > max_ordinal {
7183 return Ok(());
7184 }
7185
7186 let cur_offset: usize = (1 - 1) * envelope_size;
7189
7190 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7192
7193 fidl::encoding::encode_in_envelope_optional::<u32, D>(
7198 self.entered_passkey.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
7199 encoder,
7200 offset + cur_offset,
7201 depth,
7202 )?;
7203
7204 _prev_end_offset = cur_offset + envelope_size;
7205
7206 Ok(())
7207 }
7208 }
7209
7210 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7211 for PairingRequestAcceptRequest
7212 {
7213 #[inline(always)]
7214 fn new_empty() -> Self {
7215 Self::default()
7216 }
7217
7218 unsafe fn decode(
7219 &mut self,
7220 decoder: &mut fidl::encoding::Decoder<'_, D>,
7221 offset: usize,
7222 mut depth: fidl::encoding::Depth,
7223 ) -> fidl::Result<()> {
7224 decoder.debug_check_bounds::<Self>(offset);
7225 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7226 None => return Err(fidl::Error::NotNullable),
7227 Some(len) => len,
7228 };
7229 if len == 0 {
7231 return Ok(());
7232 };
7233 depth.increment()?;
7234 let envelope_size = 8;
7235 let bytes_len = len * envelope_size;
7236 let offset = decoder.out_of_line_offset(bytes_len)?;
7237 let mut _next_ordinal_to_read = 0;
7239 let mut next_offset = offset;
7240 let end_offset = offset + bytes_len;
7241 _next_ordinal_to_read += 1;
7242 if next_offset >= end_offset {
7243 return Ok(());
7244 }
7245
7246 while _next_ordinal_to_read < 1 {
7248 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7249 _next_ordinal_to_read += 1;
7250 next_offset += envelope_size;
7251 }
7252
7253 let next_out_of_line = decoder.next_out_of_line();
7254 let handles_before = decoder.remaining_handles();
7255 if let Some((inlined, num_bytes, num_handles)) =
7256 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7257 {
7258 let member_inline_size =
7259 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7260 if inlined != (member_inline_size <= 4) {
7261 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7262 }
7263 let inner_offset;
7264 let mut inner_depth = depth.clone();
7265 if inlined {
7266 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7267 inner_offset = next_offset;
7268 } else {
7269 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7270 inner_depth.increment()?;
7271 }
7272 let val_ref = self.entered_passkey.get_or_insert_with(|| fidl::new_empty!(u32, D));
7273 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
7274 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7275 {
7276 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7277 }
7278 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7279 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7280 }
7281 }
7282
7283 next_offset += envelope_size;
7284
7285 while next_offset < end_offset {
7287 _next_ordinal_to_read += 1;
7288 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7289 next_offset += envelope_size;
7290 }
7291
7292 Ok(())
7293 }
7294 }
7295
7296 impl Peer {
7297 #[inline(always)]
7298 fn max_ordinal_present(&self) -> u64 {
7299 if let Some(_) = self.bredr_services {
7300 return 13;
7301 }
7302 if let Some(_) = self.le_services {
7303 return 12;
7304 }
7305 if let Some(_) = self.services {
7306 return 11;
7307 }
7308 if let Some(_) = self.tx_power {
7309 return 10;
7310 }
7311 if let Some(_) = self.rssi {
7312 return 9;
7313 }
7314 if let Some(_) = self.device_class {
7315 return 8;
7316 }
7317 if let Some(_) = self.appearance {
7318 return 7;
7319 }
7320 if let Some(_) = self.name {
7321 return 6;
7322 }
7323 if let Some(_) = self.bonded {
7324 return 5;
7325 }
7326 if let Some(_) = self.connected {
7327 return 4;
7328 }
7329 if let Some(_) = self.technology {
7330 return 3;
7331 }
7332 if let Some(_) = self.address {
7333 return 2;
7334 }
7335 if let Some(_) = self.id {
7336 return 1;
7337 }
7338 0
7339 }
7340 }
7341
7342 impl fidl::encoding::ValueTypeMarker for Peer {
7343 type Borrowed<'a> = &'a Self;
7344 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7345 value
7346 }
7347 }
7348
7349 unsafe impl fidl::encoding::TypeMarker for Peer {
7350 type Owned = Self;
7351
7352 #[inline(always)]
7353 fn inline_align(_context: fidl::encoding::Context) -> usize {
7354 8
7355 }
7356
7357 #[inline(always)]
7358 fn inline_size(_context: fidl::encoding::Context) -> usize {
7359 16
7360 }
7361 }
7362
7363 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Peer, D> for &Peer {
7364 unsafe fn encode(
7365 self,
7366 encoder: &mut fidl::encoding::Encoder<'_, D>,
7367 offset: usize,
7368 mut depth: fidl::encoding::Depth,
7369 ) -> fidl::Result<()> {
7370 encoder.debug_check_bounds::<Peer>(offset);
7371 let max_ordinal: u64 = self.max_ordinal_present();
7373 encoder.write_num(max_ordinal, offset);
7374 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7375 if max_ordinal == 0 {
7377 return Ok(());
7378 }
7379 depth.increment()?;
7380 let envelope_size = 8;
7381 let bytes_len = max_ordinal as usize * envelope_size;
7382 #[allow(unused_variables)]
7383 let offset = encoder.out_of_line_offset(bytes_len);
7384 let mut _prev_end_offset: usize = 0;
7385 if 1 > max_ordinal {
7386 return Ok(());
7387 }
7388
7389 let cur_offset: usize = (1 - 1) * envelope_size;
7392
7393 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7395
7396 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::PeerId, D>(
7401 self.id.as_ref().map(
7402 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow,
7403 ),
7404 encoder,
7405 offset + cur_offset,
7406 depth,
7407 )?;
7408
7409 _prev_end_offset = cur_offset + envelope_size;
7410 if 2 > max_ordinal {
7411 return Ok(());
7412 }
7413
7414 let cur_offset: usize = (2 - 1) * envelope_size;
7417
7418 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7420
7421 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::Address, D>(
7426 self.address.as_ref().map(
7427 <fidl_fuchsia_bluetooth::Address as fidl::encoding::ValueTypeMarker>::borrow,
7428 ),
7429 encoder,
7430 offset + cur_offset,
7431 depth,
7432 )?;
7433
7434 _prev_end_offset = cur_offset + envelope_size;
7435 if 3 > max_ordinal {
7436 return Ok(());
7437 }
7438
7439 let cur_offset: usize = (3 - 1) * envelope_size;
7442
7443 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7445
7446 fidl::encoding::encode_in_envelope_optional::<TechnologyType, D>(
7451 self.technology
7452 .as_ref()
7453 .map(<TechnologyType as fidl::encoding::ValueTypeMarker>::borrow),
7454 encoder,
7455 offset + cur_offset,
7456 depth,
7457 )?;
7458
7459 _prev_end_offset = cur_offset + envelope_size;
7460 if 4 > max_ordinal {
7461 return Ok(());
7462 }
7463
7464 let cur_offset: usize = (4 - 1) * envelope_size;
7467
7468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7470
7471 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7476 self.connected.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7477 encoder,
7478 offset + cur_offset,
7479 depth,
7480 )?;
7481
7482 _prev_end_offset = cur_offset + envelope_size;
7483 if 5 > max_ordinal {
7484 return Ok(());
7485 }
7486
7487 let cur_offset: usize = (5 - 1) * envelope_size;
7490
7491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7493
7494 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7499 self.bonded.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7500 encoder,
7501 offset + cur_offset,
7502 depth,
7503 )?;
7504
7505 _prev_end_offset = cur_offset + envelope_size;
7506 if 6 > max_ordinal {
7507 return Ok(());
7508 }
7509
7510 let cur_offset: usize = (6 - 1) * envelope_size;
7513
7514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7516
7517 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<248>, D>(
7522 self.name.as_ref().map(
7523 <fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow,
7524 ),
7525 encoder,
7526 offset + cur_offset,
7527 depth,
7528 )?;
7529
7530 _prev_end_offset = cur_offset + envelope_size;
7531 if 7 > max_ordinal {
7532 return Ok(());
7533 }
7534
7535 let cur_offset: usize = (7 - 1) * envelope_size;
7538
7539 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7541
7542 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::Appearance, D>(
7547 self.appearance.as_ref().map(
7548 <fidl_fuchsia_bluetooth::Appearance as fidl::encoding::ValueTypeMarker>::borrow,
7549 ),
7550 encoder,
7551 offset + cur_offset,
7552 depth,
7553 )?;
7554
7555 _prev_end_offset = cur_offset + envelope_size;
7556 if 8 > max_ordinal {
7557 return Ok(());
7558 }
7559
7560 let cur_offset: usize = (8 - 1) * envelope_size;
7563
7564 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7566
7567 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_bluetooth::DeviceClass, D>(
7572 self.device_class.as_ref().map(<fidl_fuchsia_bluetooth::DeviceClass as fidl::encoding::ValueTypeMarker>::borrow),
7573 encoder, offset + cur_offset, depth
7574 )?;
7575
7576 _prev_end_offset = cur_offset + envelope_size;
7577 if 9 > max_ordinal {
7578 return Ok(());
7579 }
7580
7581 let cur_offset: usize = (9 - 1) * envelope_size;
7584
7585 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7587
7588 fidl::encoding::encode_in_envelope_optional::<i8, D>(
7593 self.rssi.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
7594 encoder,
7595 offset + cur_offset,
7596 depth,
7597 )?;
7598
7599 _prev_end_offset = cur_offset + envelope_size;
7600 if 10 > max_ordinal {
7601 return Ok(());
7602 }
7603
7604 let cur_offset: usize = (10 - 1) * envelope_size;
7607
7608 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7610
7611 fidl::encoding::encode_in_envelope_optional::<i8, D>(
7616 self.tx_power.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
7617 encoder,
7618 offset + cur_offset,
7619 depth,
7620 )?;
7621
7622 _prev_end_offset = cur_offset + envelope_size;
7623 if 11 > max_ordinal {
7624 return Ok(());
7625 }
7626
7627 let cur_offset: usize = (11 - 1) * envelope_size;
7630
7631 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7633
7634 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D>(
7639 self.services.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535> as fidl::encoding::ValueTypeMarker>::borrow),
7640 encoder, offset + cur_offset, depth
7641 )?;
7642
7643 _prev_end_offset = cur_offset + envelope_size;
7644 if 12 > max_ordinal {
7645 return Ok(());
7646 }
7647
7648 let cur_offset: usize = (12 - 1) * envelope_size;
7651
7652 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7654
7655 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D>(
7660 self.le_services.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535> as fidl::encoding::ValueTypeMarker>::borrow),
7661 encoder, offset + cur_offset, depth
7662 )?;
7663
7664 _prev_end_offset = cur_offset + envelope_size;
7665 if 13 > max_ordinal {
7666 return Ok(());
7667 }
7668
7669 let cur_offset: usize = (13 - 1) * envelope_size;
7672
7673 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7675
7676 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D>(
7681 self.bredr_services.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535> as fidl::encoding::ValueTypeMarker>::borrow),
7682 encoder, offset + cur_offset, depth
7683 )?;
7684
7685 _prev_end_offset = cur_offset + envelope_size;
7686
7687 Ok(())
7688 }
7689 }
7690
7691 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Peer {
7692 #[inline(always)]
7693 fn new_empty() -> Self {
7694 Self::default()
7695 }
7696
7697 unsafe fn decode(
7698 &mut self,
7699 decoder: &mut fidl::encoding::Decoder<'_, D>,
7700 offset: usize,
7701 mut depth: fidl::encoding::Depth,
7702 ) -> fidl::Result<()> {
7703 decoder.debug_check_bounds::<Self>(offset);
7704 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7705 None => return Err(fidl::Error::NotNullable),
7706 Some(len) => len,
7707 };
7708 if len == 0 {
7710 return Ok(());
7711 };
7712 depth.increment()?;
7713 let envelope_size = 8;
7714 let bytes_len = len * envelope_size;
7715 let offset = decoder.out_of_line_offset(bytes_len)?;
7716 let mut _next_ordinal_to_read = 0;
7718 let mut next_offset = offset;
7719 let end_offset = offset + bytes_len;
7720 _next_ordinal_to_read += 1;
7721 if next_offset >= end_offset {
7722 return Ok(());
7723 }
7724
7725 while _next_ordinal_to_read < 1 {
7727 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7728 _next_ordinal_to_read += 1;
7729 next_offset += envelope_size;
7730 }
7731
7732 let next_out_of_line = decoder.next_out_of_line();
7733 let handles_before = decoder.remaining_handles();
7734 if let Some((inlined, num_bytes, num_handles)) =
7735 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7736 {
7737 let member_inline_size =
7738 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::TypeMarker>::inline_size(
7739 decoder.context,
7740 );
7741 if inlined != (member_inline_size <= 4) {
7742 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7743 }
7744 let inner_offset;
7745 let mut inner_depth = depth.clone();
7746 if inlined {
7747 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7748 inner_offset = next_offset;
7749 } else {
7750 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7751 inner_depth.increment()?;
7752 }
7753 let val_ref = self
7754 .id
7755 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::PeerId, D));
7756 fidl::decode!(
7757 fidl_fuchsia_bluetooth::PeerId,
7758 D,
7759 val_ref,
7760 decoder,
7761 inner_offset,
7762 inner_depth
7763 )?;
7764 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7765 {
7766 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7767 }
7768 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7769 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7770 }
7771 }
7772
7773 next_offset += envelope_size;
7774 _next_ordinal_to_read += 1;
7775 if next_offset >= end_offset {
7776 return Ok(());
7777 }
7778
7779 while _next_ordinal_to_read < 2 {
7781 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7782 _next_ordinal_to_read += 1;
7783 next_offset += envelope_size;
7784 }
7785
7786 let next_out_of_line = decoder.next_out_of_line();
7787 let handles_before = decoder.remaining_handles();
7788 if let Some((inlined, num_bytes, num_handles)) =
7789 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7790 {
7791 let member_inline_size =
7792 <fidl_fuchsia_bluetooth::Address as fidl::encoding::TypeMarker>::inline_size(
7793 decoder.context,
7794 );
7795 if inlined != (member_inline_size <= 4) {
7796 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7797 }
7798 let inner_offset;
7799 let mut inner_depth = depth.clone();
7800 if inlined {
7801 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7802 inner_offset = next_offset;
7803 } else {
7804 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7805 inner_depth.increment()?;
7806 }
7807 let val_ref = self
7808 .address
7809 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::Address, D));
7810 fidl::decode!(
7811 fidl_fuchsia_bluetooth::Address,
7812 D,
7813 val_ref,
7814 decoder,
7815 inner_offset,
7816 inner_depth
7817 )?;
7818 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7819 {
7820 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7821 }
7822 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7823 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7824 }
7825 }
7826
7827 next_offset += envelope_size;
7828 _next_ordinal_to_read += 1;
7829 if next_offset >= end_offset {
7830 return Ok(());
7831 }
7832
7833 while _next_ordinal_to_read < 3 {
7835 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7836 _next_ordinal_to_read += 1;
7837 next_offset += envelope_size;
7838 }
7839
7840 let next_out_of_line = decoder.next_out_of_line();
7841 let handles_before = decoder.remaining_handles();
7842 if let Some((inlined, num_bytes, num_handles)) =
7843 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7844 {
7845 let member_inline_size =
7846 <TechnologyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7847 if inlined != (member_inline_size <= 4) {
7848 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7849 }
7850 let inner_offset;
7851 let mut inner_depth = depth.clone();
7852 if inlined {
7853 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7854 inner_offset = next_offset;
7855 } else {
7856 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7857 inner_depth.increment()?;
7858 }
7859 let val_ref =
7860 self.technology.get_or_insert_with(|| fidl::new_empty!(TechnologyType, D));
7861 fidl::decode!(TechnologyType, D, val_ref, decoder, inner_offset, inner_depth)?;
7862 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7863 {
7864 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7865 }
7866 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7867 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7868 }
7869 }
7870
7871 next_offset += envelope_size;
7872 _next_ordinal_to_read += 1;
7873 if next_offset >= end_offset {
7874 return Ok(());
7875 }
7876
7877 while _next_ordinal_to_read < 4 {
7879 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7880 _next_ordinal_to_read += 1;
7881 next_offset += envelope_size;
7882 }
7883
7884 let next_out_of_line = decoder.next_out_of_line();
7885 let handles_before = decoder.remaining_handles();
7886 if let Some((inlined, num_bytes, num_handles)) =
7887 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7888 {
7889 let member_inline_size =
7890 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7891 if inlined != (member_inline_size <= 4) {
7892 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7893 }
7894 let inner_offset;
7895 let mut inner_depth = depth.clone();
7896 if inlined {
7897 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7898 inner_offset = next_offset;
7899 } else {
7900 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7901 inner_depth.increment()?;
7902 }
7903 let val_ref = self.connected.get_or_insert_with(|| fidl::new_empty!(bool, D));
7904 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7905 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7906 {
7907 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7908 }
7909 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7910 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7911 }
7912 }
7913
7914 next_offset += envelope_size;
7915 _next_ordinal_to_read += 1;
7916 if next_offset >= end_offset {
7917 return Ok(());
7918 }
7919
7920 while _next_ordinal_to_read < 5 {
7922 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7923 _next_ordinal_to_read += 1;
7924 next_offset += envelope_size;
7925 }
7926
7927 let next_out_of_line = decoder.next_out_of_line();
7928 let handles_before = decoder.remaining_handles();
7929 if let Some((inlined, num_bytes, num_handles)) =
7930 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7931 {
7932 let member_inline_size =
7933 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7934 if inlined != (member_inline_size <= 4) {
7935 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7936 }
7937 let inner_offset;
7938 let mut inner_depth = depth.clone();
7939 if inlined {
7940 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7941 inner_offset = next_offset;
7942 } else {
7943 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7944 inner_depth.increment()?;
7945 }
7946 let val_ref = self.bonded.get_or_insert_with(|| fidl::new_empty!(bool, D));
7947 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7948 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7949 {
7950 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7951 }
7952 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7953 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7954 }
7955 }
7956
7957 next_offset += envelope_size;
7958 _next_ordinal_to_read += 1;
7959 if next_offset >= end_offset {
7960 return Ok(());
7961 }
7962
7963 while _next_ordinal_to_read < 6 {
7965 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7966 _next_ordinal_to_read += 1;
7967 next_offset += envelope_size;
7968 }
7969
7970 let next_out_of_line = decoder.next_out_of_line();
7971 let handles_before = decoder.remaining_handles();
7972 if let Some((inlined, num_bytes, num_handles)) =
7973 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7974 {
7975 let member_inline_size =
7976 <fidl::encoding::BoundedString<248> as fidl::encoding::TypeMarker>::inline_size(
7977 decoder.context,
7978 );
7979 if inlined != (member_inline_size <= 4) {
7980 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7981 }
7982 let inner_offset;
7983 let mut inner_depth = depth.clone();
7984 if inlined {
7985 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7986 inner_offset = next_offset;
7987 } else {
7988 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7989 inner_depth.increment()?;
7990 }
7991 let val_ref = self
7992 .name
7993 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<248>, D));
7994 fidl::decode!(
7995 fidl::encoding::BoundedString<248>,
7996 D,
7997 val_ref,
7998 decoder,
7999 inner_offset,
8000 inner_depth
8001 )?;
8002 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8003 {
8004 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8005 }
8006 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8007 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8008 }
8009 }
8010
8011 next_offset += envelope_size;
8012 _next_ordinal_to_read += 1;
8013 if next_offset >= end_offset {
8014 return Ok(());
8015 }
8016
8017 while _next_ordinal_to_read < 7 {
8019 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8020 _next_ordinal_to_read += 1;
8021 next_offset += envelope_size;
8022 }
8023
8024 let next_out_of_line = decoder.next_out_of_line();
8025 let handles_before = decoder.remaining_handles();
8026 if let Some((inlined, num_bytes, num_handles)) =
8027 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8028 {
8029 let member_inline_size =
8030 <fidl_fuchsia_bluetooth::Appearance as fidl::encoding::TypeMarker>::inline_size(
8031 decoder.context,
8032 );
8033 if inlined != (member_inline_size <= 4) {
8034 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8035 }
8036 let inner_offset;
8037 let mut inner_depth = depth.clone();
8038 if inlined {
8039 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8040 inner_offset = next_offset;
8041 } else {
8042 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8043 inner_depth.increment()?;
8044 }
8045 let val_ref = self
8046 .appearance
8047 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_bluetooth::Appearance, D));
8048 fidl::decode!(
8049 fidl_fuchsia_bluetooth::Appearance,
8050 D,
8051 val_ref,
8052 decoder,
8053 inner_offset,
8054 inner_depth
8055 )?;
8056 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8057 {
8058 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8059 }
8060 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8061 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8062 }
8063 }
8064
8065 next_offset += envelope_size;
8066 _next_ordinal_to_read += 1;
8067 if next_offset >= end_offset {
8068 return Ok(());
8069 }
8070
8071 while _next_ordinal_to_read < 8 {
8073 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8074 _next_ordinal_to_read += 1;
8075 next_offset += envelope_size;
8076 }
8077
8078 let next_out_of_line = decoder.next_out_of_line();
8079 let handles_before = decoder.remaining_handles();
8080 if let Some((inlined, num_bytes, num_handles)) =
8081 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8082 {
8083 let member_inline_size = <fidl_fuchsia_bluetooth::DeviceClass as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8084 if inlined != (member_inline_size <= 4) {
8085 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8086 }
8087 let inner_offset;
8088 let mut inner_depth = depth.clone();
8089 if inlined {
8090 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8091 inner_offset = next_offset;
8092 } else {
8093 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8094 inner_depth.increment()?;
8095 }
8096 let val_ref = self.device_class.get_or_insert_with(|| {
8097 fidl::new_empty!(fidl_fuchsia_bluetooth::DeviceClass, D)
8098 });
8099 fidl::decode!(
8100 fidl_fuchsia_bluetooth::DeviceClass,
8101 D,
8102 val_ref,
8103 decoder,
8104 inner_offset,
8105 inner_depth
8106 )?;
8107 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8108 {
8109 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8110 }
8111 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8112 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8113 }
8114 }
8115
8116 next_offset += envelope_size;
8117 _next_ordinal_to_read += 1;
8118 if next_offset >= end_offset {
8119 return Ok(());
8120 }
8121
8122 while _next_ordinal_to_read < 9 {
8124 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8125 _next_ordinal_to_read += 1;
8126 next_offset += envelope_size;
8127 }
8128
8129 let next_out_of_line = decoder.next_out_of_line();
8130 let handles_before = decoder.remaining_handles();
8131 if let Some((inlined, num_bytes, num_handles)) =
8132 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8133 {
8134 let member_inline_size =
8135 <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8136 if inlined != (member_inline_size <= 4) {
8137 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8138 }
8139 let inner_offset;
8140 let mut inner_depth = depth.clone();
8141 if inlined {
8142 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8143 inner_offset = next_offset;
8144 } else {
8145 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8146 inner_depth.increment()?;
8147 }
8148 let val_ref = self.rssi.get_or_insert_with(|| fidl::new_empty!(i8, D));
8149 fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
8150 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8151 {
8152 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8153 }
8154 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8155 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8156 }
8157 }
8158
8159 next_offset += envelope_size;
8160 _next_ordinal_to_read += 1;
8161 if next_offset >= end_offset {
8162 return Ok(());
8163 }
8164
8165 while _next_ordinal_to_read < 10 {
8167 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8168 _next_ordinal_to_read += 1;
8169 next_offset += envelope_size;
8170 }
8171
8172 let next_out_of_line = decoder.next_out_of_line();
8173 let handles_before = decoder.remaining_handles();
8174 if let Some((inlined, num_bytes, num_handles)) =
8175 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8176 {
8177 let member_inline_size =
8178 <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8179 if inlined != (member_inline_size <= 4) {
8180 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8181 }
8182 let inner_offset;
8183 let mut inner_depth = depth.clone();
8184 if inlined {
8185 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8186 inner_offset = next_offset;
8187 } else {
8188 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8189 inner_depth.increment()?;
8190 }
8191 let val_ref = self.tx_power.get_or_insert_with(|| fidl::new_empty!(i8, D));
8192 fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
8193 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8194 {
8195 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8196 }
8197 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8198 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8199 }
8200 }
8201
8202 next_offset += envelope_size;
8203 _next_ordinal_to_read += 1;
8204 if next_offset >= end_offset {
8205 return Ok(());
8206 }
8207
8208 while _next_ordinal_to_read < 11 {
8210 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8211 _next_ordinal_to_read += 1;
8212 next_offset += envelope_size;
8213 }
8214
8215 let next_out_of_line = decoder.next_out_of_line();
8216 let handles_before = decoder.remaining_handles();
8217 if let Some((inlined, num_bytes, num_handles)) =
8218 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8219 {
8220 let member_inline_size = <fidl::encoding::Vector<
8221 fidl_fuchsia_bluetooth::Uuid,
8222 65535,
8223 > as fidl::encoding::TypeMarker>::inline_size(
8224 decoder.context
8225 );
8226 if inlined != (member_inline_size <= 4) {
8227 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8228 }
8229 let inner_offset;
8230 let mut inner_depth = depth.clone();
8231 if inlined {
8232 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8233 inner_offset = next_offset;
8234 } else {
8235 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8236 inner_depth.increment()?;
8237 }
8238 let val_ref =
8239 self.services.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D));
8240 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D, val_ref, decoder, inner_offset, inner_depth)?;
8241 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8242 {
8243 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8244 }
8245 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8246 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8247 }
8248 }
8249
8250 next_offset += envelope_size;
8251 _next_ordinal_to_read += 1;
8252 if next_offset >= end_offset {
8253 return Ok(());
8254 }
8255
8256 while _next_ordinal_to_read < 12 {
8258 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8259 _next_ordinal_to_read += 1;
8260 next_offset += envelope_size;
8261 }
8262
8263 let next_out_of_line = decoder.next_out_of_line();
8264 let handles_before = decoder.remaining_handles();
8265 if let Some((inlined, num_bytes, num_handles)) =
8266 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8267 {
8268 let member_inline_size = <fidl::encoding::Vector<
8269 fidl_fuchsia_bluetooth::Uuid,
8270 65535,
8271 > as fidl::encoding::TypeMarker>::inline_size(
8272 decoder.context
8273 );
8274 if inlined != (member_inline_size <= 4) {
8275 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8276 }
8277 let inner_offset;
8278 let mut inner_depth = depth.clone();
8279 if inlined {
8280 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8281 inner_offset = next_offset;
8282 } else {
8283 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8284 inner_depth.increment()?;
8285 }
8286 let val_ref =
8287 self.le_services.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D));
8288 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D, val_ref, decoder, inner_offset, inner_depth)?;
8289 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8290 {
8291 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8292 }
8293 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8294 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8295 }
8296 }
8297
8298 next_offset += envelope_size;
8299 _next_ordinal_to_read += 1;
8300 if next_offset >= end_offset {
8301 return Ok(());
8302 }
8303
8304 while _next_ordinal_to_read < 13 {
8306 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8307 _next_ordinal_to_read += 1;
8308 next_offset += envelope_size;
8309 }
8310
8311 let next_out_of_line = decoder.next_out_of_line();
8312 let handles_before = decoder.remaining_handles();
8313 if let Some((inlined, num_bytes, num_handles)) =
8314 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8315 {
8316 let member_inline_size = <fidl::encoding::Vector<
8317 fidl_fuchsia_bluetooth::Uuid,
8318 65535,
8319 > as fidl::encoding::TypeMarker>::inline_size(
8320 decoder.context
8321 );
8322 if inlined != (member_inline_size <= 4) {
8323 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8324 }
8325 let inner_offset;
8326 let mut inner_depth = depth.clone();
8327 if inlined {
8328 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8329 inner_offset = next_offset;
8330 } else {
8331 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8332 inner_depth.increment()?;
8333 }
8334 let val_ref =
8335 self.bredr_services.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D));
8336 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_bluetooth::Uuid, 65535>, D, val_ref, decoder, inner_offset, inner_depth)?;
8337 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8338 {
8339 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8340 }
8341 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8342 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8343 }
8344 }
8345
8346 next_offset += envelope_size;
8347
8348 while next_offset < end_offset {
8350 _next_ordinal_to_read += 1;
8351 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8352 next_offset += envelope_size;
8353 }
8354
8355 Ok(())
8356 }
8357 }
8358
8359 impl Settings {
8360 #[inline(always)]
8361 fn max_ordinal_present(&self) -> u64 {
8362 if let Some(_) = self.bredr_security_mode {
8363 return 5;
8364 }
8365 if let Some(_) = self.le_security_mode {
8366 return 4;
8367 }
8368 if let Some(_) = self.bredr_connectable_mode {
8369 return 3;
8370 }
8371 if let Some(_) = self.le_background_scan {
8372 return 2;
8373 }
8374 if let Some(_) = self.le_privacy {
8375 return 1;
8376 }
8377 0
8378 }
8379 }
8380
8381 impl fidl::encoding::ValueTypeMarker for Settings {
8382 type Borrowed<'a> = &'a Self;
8383 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8384 value
8385 }
8386 }
8387
8388 unsafe impl fidl::encoding::TypeMarker for Settings {
8389 type Owned = Self;
8390
8391 #[inline(always)]
8392 fn inline_align(_context: fidl::encoding::Context) -> usize {
8393 8
8394 }
8395
8396 #[inline(always)]
8397 fn inline_size(_context: fidl::encoding::Context) -> usize {
8398 16
8399 }
8400 }
8401
8402 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Settings, D> for &Settings {
8403 unsafe fn encode(
8404 self,
8405 encoder: &mut fidl::encoding::Encoder<'_, D>,
8406 offset: usize,
8407 mut depth: fidl::encoding::Depth,
8408 ) -> fidl::Result<()> {
8409 encoder.debug_check_bounds::<Settings>(offset);
8410 let max_ordinal: u64 = self.max_ordinal_present();
8412 encoder.write_num(max_ordinal, offset);
8413 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8414 if max_ordinal == 0 {
8416 return Ok(());
8417 }
8418 depth.increment()?;
8419 let envelope_size = 8;
8420 let bytes_len = max_ordinal as usize * envelope_size;
8421 #[allow(unused_variables)]
8422 let offset = encoder.out_of_line_offset(bytes_len);
8423 let mut _prev_end_offset: usize = 0;
8424 if 1 > max_ordinal {
8425 return Ok(());
8426 }
8427
8428 let cur_offset: usize = (1 - 1) * envelope_size;
8431
8432 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8434
8435 fidl::encoding::encode_in_envelope_optional::<bool, D>(
8440 self.le_privacy.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8441 encoder,
8442 offset + cur_offset,
8443 depth,
8444 )?;
8445
8446 _prev_end_offset = cur_offset + envelope_size;
8447 if 2 > max_ordinal {
8448 return Ok(());
8449 }
8450
8451 let cur_offset: usize = (2 - 1) * envelope_size;
8454
8455 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8457
8458 fidl::encoding::encode_in_envelope_optional::<bool, D>(
8463 self.le_background_scan
8464 .as_ref()
8465 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8466 encoder,
8467 offset + cur_offset,
8468 depth,
8469 )?;
8470
8471 _prev_end_offset = cur_offset + envelope_size;
8472 if 3 > max_ordinal {
8473 return Ok(());
8474 }
8475
8476 let cur_offset: usize = (3 - 1) * envelope_size;
8479
8480 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8482
8483 fidl::encoding::encode_in_envelope_optional::<bool, D>(
8488 self.bredr_connectable_mode
8489 .as_ref()
8490 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8491 encoder,
8492 offset + cur_offset,
8493 depth,
8494 )?;
8495
8496 _prev_end_offset = cur_offset + envelope_size;
8497 if 4 > max_ordinal {
8498 return Ok(());
8499 }
8500
8501 let cur_offset: usize = (4 - 1) * envelope_size;
8504
8505 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8507
8508 fidl::encoding::encode_in_envelope_optional::<LeSecurityMode, D>(
8513 self.le_security_mode
8514 .as_ref()
8515 .map(<LeSecurityMode as fidl::encoding::ValueTypeMarker>::borrow),
8516 encoder,
8517 offset + cur_offset,
8518 depth,
8519 )?;
8520
8521 _prev_end_offset = cur_offset + envelope_size;
8522 if 5 > max_ordinal {
8523 return Ok(());
8524 }
8525
8526 let cur_offset: usize = (5 - 1) * envelope_size;
8529
8530 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8532
8533 fidl::encoding::encode_in_envelope_optional::<BrEdrSecurityMode, D>(
8538 self.bredr_security_mode
8539 .as_ref()
8540 .map(<BrEdrSecurityMode as fidl::encoding::ValueTypeMarker>::borrow),
8541 encoder,
8542 offset + cur_offset,
8543 depth,
8544 )?;
8545
8546 _prev_end_offset = cur_offset + envelope_size;
8547
8548 Ok(())
8549 }
8550 }
8551
8552 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Settings {
8553 #[inline(always)]
8554 fn new_empty() -> Self {
8555 Self::default()
8556 }
8557
8558 unsafe fn decode(
8559 &mut self,
8560 decoder: &mut fidl::encoding::Decoder<'_, D>,
8561 offset: usize,
8562 mut depth: fidl::encoding::Depth,
8563 ) -> fidl::Result<()> {
8564 decoder.debug_check_bounds::<Self>(offset);
8565 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8566 None => return Err(fidl::Error::NotNullable),
8567 Some(len) => len,
8568 };
8569 if len == 0 {
8571 return Ok(());
8572 };
8573 depth.increment()?;
8574 let envelope_size = 8;
8575 let bytes_len = len * envelope_size;
8576 let offset = decoder.out_of_line_offset(bytes_len)?;
8577 let mut _next_ordinal_to_read = 0;
8579 let mut next_offset = offset;
8580 let end_offset = offset + bytes_len;
8581 _next_ordinal_to_read += 1;
8582 if next_offset >= end_offset {
8583 return Ok(());
8584 }
8585
8586 while _next_ordinal_to_read < 1 {
8588 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8589 _next_ordinal_to_read += 1;
8590 next_offset += envelope_size;
8591 }
8592
8593 let next_out_of_line = decoder.next_out_of_line();
8594 let handles_before = decoder.remaining_handles();
8595 if let Some((inlined, num_bytes, num_handles)) =
8596 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8597 {
8598 let member_inline_size =
8599 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8600 if inlined != (member_inline_size <= 4) {
8601 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8602 }
8603 let inner_offset;
8604 let mut inner_depth = depth.clone();
8605 if inlined {
8606 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8607 inner_offset = next_offset;
8608 } else {
8609 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8610 inner_depth.increment()?;
8611 }
8612 let val_ref = self.le_privacy.get_or_insert_with(|| fidl::new_empty!(bool, D));
8613 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8614 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8615 {
8616 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8617 }
8618 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8619 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8620 }
8621 }
8622
8623 next_offset += envelope_size;
8624 _next_ordinal_to_read += 1;
8625 if next_offset >= end_offset {
8626 return Ok(());
8627 }
8628
8629 while _next_ordinal_to_read < 2 {
8631 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8632 _next_ordinal_to_read += 1;
8633 next_offset += envelope_size;
8634 }
8635
8636 let next_out_of_line = decoder.next_out_of_line();
8637 let handles_before = decoder.remaining_handles();
8638 if let Some((inlined, num_bytes, num_handles)) =
8639 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8640 {
8641 let member_inline_size =
8642 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8643 if inlined != (member_inline_size <= 4) {
8644 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8645 }
8646 let inner_offset;
8647 let mut inner_depth = depth.clone();
8648 if inlined {
8649 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8650 inner_offset = next_offset;
8651 } else {
8652 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8653 inner_depth.increment()?;
8654 }
8655 let val_ref =
8656 self.le_background_scan.get_or_insert_with(|| fidl::new_empty!(bool, D));
8657 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8658 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8659 {
8660 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8661 }
8662 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8663 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8664 }
8665 }
8666
8667 next_offset += envelope_size;
8668 _next_ordinal_to_read += 1;
8669 if next_offset >= end_offset {
8670 return Ok(());
8671 }
8672
8673 while _next_ordinal_to_read < 3 {
8675 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8676 _next_ordinal_to_read += 1;
8677 next_offset += envelope_size;
8678 }
8679
8680 let next_out_of_line = decoder.next_out_of_line();
8681 let handles_before = decoder.remaining_handles();
8682 if let Some((inlined, num_bytes, num_handles)) =
8683 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8684 {
8685 let member_inline_size =
8686 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8687 if inlined != (member_inline_size <= 4) {
8688 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8689 }
8690 let inner_offset;
8691 let mut inner_depth = depth.clone();
8692 if inlined {
8693 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8694 inner_offset = next_offset;
8695 } else {
8696 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8697 inner_depth.increment()?;
8698 }
8699 let val_ref =
8700 self.bredr_connectable_mode.get_or_insert_with(|| fidl::new_empty!(bool, D));
8701 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8702 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8703 {
8704 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8705 }
8706 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8707 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8708 }
8709 }
8710
8711 next_offset += envelope_size;
8712 _next_ordinal_to_read += 1;
8713 if next_offset >= end_offset {
8714 return Ok(());
8715 }
8716
8717 while _next_ordinal_to_read < 4 {
8719 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8720 _next_ordinal_to_read += 1;
8721 next_offset += envelope_size;
8722 }
8723
8724 let next_out_of_line = decoder.next_out_of_line();
8725 let handles_before = decoder.remaining_handles();
8726 if let Some((inlined, num_bytes, num_handles)) =
8727 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8728 {
8729 let member_inline_size =
8730 <LeSecurityMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8731 if inlined != (member_inline_size <= 4) {
8732 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8733 }
8734 let inner_offset;
8735 let mut inner_depth = depth.clone();
8736 if inlined {
8737 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8738 inner_offset = next_offset;
8739 } else {
8740 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8741 inner_depth.increment()?;
8742 }
8743 let val_ref = self
8744 .le_security_mode
8745 .get_or_insert_with(|| fidl::new_empty!(LeSecurityMode, D));
8746 fidl::decode!(LeSecurityMode, D, val_ref, decoder, inner_offset, inner_depth)?;
8747 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8748 {
8749 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8750 }
8751 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8752 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8753 }
8754 }
8755
8756 next_offset += envelope_size;
8757 _next_ordinal_to_read += 1;
8758 if next_offset >= end_offset {
8759 return Ok(());
8760 }
8761
8762 while _next_ordinal_to_read < 5 {
8764 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8765 _next_ordinal_to_read += 1;
8766 next_offset += envelope_size;
8767 }
8768
8769 let next_out_of_line = decoder.next_out_of_line();
8770 let handles_before = decoder.remaining_handles();
8771 if let Some((inlined, num_bytes, num_handles)) =
8772 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8773 {
8774 let member_inline_size =
8775 <BrEdrSecurityMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8776 if inlined != (member_inline_size <= 4) {
8777 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8778 }
8779 let inner_offset;
8780 let mut inner_depth = depth.clone();
8781 if inlined {
8782 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8783 inner_offset = next_offset;
8784 } else {
8785 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8786 inner_depth.increment()?;
8787 }
8788 let val_ref = self
8789 .bredr_security_mode
8790 .get_or_insert_with(|| fidl::new_empty!(BrEdrSecurityMode, D));
8791 fidl::decode!(BrEdrSecurityMode, D, val_ref, decoder, inner_offset, inner_depth)?;
8792 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8793 {
8794 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8795 }
8796 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8797 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8798 }
8799 }
8800
8801 next_offset += envelope_size;
8802
8803 while next_offset < end_offset {
8805 _next_ordinal_to_read += 1;
8806 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8807 next_offset += envelope_size;
8808 }
8809
8810 Ok(())
8811 }
8812 }
8813
8814 impl fidl::encoding::ValueTypeMarker for PairingProperties {
8815 type Borrowed<'a> = &'a Self;
8816 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8817 value
8818 }
8819 }
8820
8821 unsafe impl fidl::encoding::TypeMarker for PairingProperties {
8822 type Owned = Self;
8823
8824 #[inline(always)]
8825 fn inline_align(_context: fidl::encoding::Context) -> usize {
8826 8
8827 }
8828
8829 #[inline(always)]
8830 fn inline_size(_context: fidl::encoding::Context) -> usize {
8831 16
8832 }
8833 }
8834
8835 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PairingProperties, D>
8836 for &PairingProperties
8837 {
8838 #[inline]
8839 unsafe fn encode(
8840 self,
8841 encoder: &mut fidl::encoding::Encoder<'_, D>,
8842 offset: usize,
8843 _depth: fidl::encoding::Depth,
8844 ) -> fidl::Result<()> {
8845 encoder.debug_check_bounds::<PairingProperties>(offset);
8846 encoder.write_num::<u64>(self.ordinal(), offset);
8847 match self {
8848 PairingProperties::Consent(ref val) => {
8849 fidl::encoding::encode_in_envelope::<Consent, D>(
8850 <Consent as fidl::encoding::ValueTypeMarker>::borrow(val),
8851 encoder,
8852 offset + 8,
8853 _depth,
8854 )
8855 }
8856 PairingProperties::PasskeyDisplay(ref val) => {
8857 fidl::encoding::encode_in_envelope::<u32, D>(
8858 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
8859 encoder,
8860 offset + 8,
8861 _depth,
8862 )
8863 }
8864 PairingProperties::PasskeyConfirmation(ref val) => {
8865 fidl::encoding::encode_in_envelope::<u32, D>(
8866 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
8867 encoder,
8868 offset + 8,
8869 _depth,
8870 )
8871 }
8872 PairingProperties::PasskeyEntry(ref val) => {
8873 fidl::encoding::encode_in_envelope::<PasskeyEntry, D>(
8874 <PasskeyEntry as fidl::encoding::ValueTypeMarker>::borrow(val),
8875 encoder,
8876 offset + 8,
8877 _depth,
8878 )
8879 }
8880 PairingProperties::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8881 }
8882 }
8883 }
8884
8885 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PairingProperties {
8886 #[inline(always)]
8887 fn new_empty() -> Self {
8888 Self::__SourceBreaking { unknown_ordinal: 0 }
8889 }
8890
8891 #[inline]
8892 unsafe fn decode(
8893 &mut self,
8894 decoder: &mut fidl::encoding::Decoder<'_, D>,
8895 offset: usize,
8896 mut depth: fidl::encoding::Depth,
8897 ) -> fidl::Result<()> {
8898 decoder.debug_check_bounds::<Self>(offset);
8899 #[allow(unused_variables)]
8900 let next_out_of_line = decoder.next_out_of_line();
8901 let handles_before = decoder.remaining_handles();
8902 let (ordinal, inlined, num_bytes, num_handles) =
8903 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8904
8905 let member_inline_size = match ordinal {
8906 1 => <Consent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8907 2 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8908 3 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8909 4 => <PasskeyEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8910 0 => return Err(fidl::Error::UnknownUnionTag),
8911 _ => num_bytes as usize,
8912 };
8913
8914 if inlined != (member_inline_size <= 4) {
8915 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8916 }
8917 let _inner_offset;
8918 if inlined {
8919 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8920 _inner_offset = offset + 8;
8921 } else {
8922 depth.increment()?;
8923 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8924 }
8925 match ordinal {
8926 1 => {
8927 #[allow(irrefutable_let_patterns)]
8928 if let PairingProperties::Consent(_) = self {
8929 } else {
8931 *self = PairingProperties::Consent(fidl::new_empty!(Consent, D));
8933 }
8934 #[allow(irrefutable_let_patterns)]
8935 if let PairingProperties::Consent(ref mut val) = self {
8936 fidl::decode!(Consent, D, val, decoder, _inner_offset, depth)?;
8937 } else {
8938 unreachable!()
8939 }
8940 }
8941 2 => {
8942 #[allow(irrefutable_let_patterns)]
8943 if let PairingProperties::PasskeyDisplay(_) = self {
8944 } else {
8946 *self = PairingProperties::PasskeyDisplay(fidl::new_empty!(u32, D));
8948 }
8949 #[allow(irrefutable_let_patterns)]
8950 if let PairingProperties::PasskeyDisplay(ref mut val) = self {
8951 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
8952 } else {
8953 unreachable!()
8954 }
8955 }
8956 3 => {
8957 #[allow(irrefutable_let_patterns)]
8958 if let PairingProperties::PasskeyConfirmation(_) = self {
8959 } else {
8961 *self = PairingProperties::PasskeyConfirmation(fidl::new_empty!(u32, D));
8963 }
8964 #[allow(irrefutable_let_patterns)]
8965 if let PairingProperties::PasskeyConfirmation(ref mut val) = self {
8966 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
8967 } else {
8968 unreachable!()
8969 }
8970 }
8971 4 => {
8972 #[allow(irrefutable_let_patterns)]
8973 if let PairingProperties::PasskeyEntry(_) = self {
8974 } else {
8976 *self = PairingProperties::PasskeyEntry(fidl::new_empty!(PasskeyEntry, D));
8978 }
8979 #[allow(irrefutable_let_patterns)]
8980 if let PairingProperties::PasskeyEntry(ref mut val) = self {
8981 fidl::decode!(PasskeyEntry, D, val, decoder, _inner_offset, depth)?;
8982 } else {
8983 unreachable!()
8984 }
8985 }
8986 #[allow(deprecated)]
8987 ordinal => {
8988 for _ in 0..num_handles {
8989 decoder.drop_next_handle()?;
8990 }
8991 *self = PairingProperties::__SourceBreaking { unknown_ordinal: ordinal };
8992 }
8993 }
8994 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8995 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8996 }
8997 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8998 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8999 }
9000 Ok(())
9001 }
9002 }
9003}