1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Debug, PartialEq)]
12pub struct BondingDelegateRestoreBondsRequest {
13 pub bonds: Vec<fidl_fuchsia_bluetooth_sys__common::BondingData>,
14}
15
16impl fidl::Persistable for BondingDelegateRestoreBondsRequest {}
17
18#[derive(Clone, Debug, PartialEq)]
19pub struct BondingDelegateRestoreBondsResponse {
20 pub errors: Vec<fidl_fuchsia_bluetooth_sys__common::BondingData>,
21}
22
23impl fidl::Persistable for BondingDelegateRestoreBondsResponse {}
24
25#[derive(Clone, Debug, PartialEq)]
26pub struct HostConnectRequest {
27 pub id: fidl_fuchsia_bluetooth__common::PeerId,
28}
29
30impl fidl::Persistable for HostConnectRequest {}
31
32#[derive(Clone, Debug, PartialEq)]
33pub struct HostDisconnectRequest {
34 pub id: fidl_fuchsia_bluetooth__common::PeerId,
35}
36
37impl fidl::Persistable for HostDisconnectRequest {}
38
39#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
40pub struct HostEnableBackgroundScanRequest {
41 pub enabled: bool,
42}
43
44impl fidl::Persistable for HostEnableBackgroundScanRequest {}
45
46#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47pub struct HostEnablePrivacyRequest {
48 pub enabled: bool,
49}
50
51impl fidl::Persistable for HostEnablePrivacyRequest {}
52
53#[derive(Clone, Debug, PartialEq)]
54pub struct HostForgetRequest {
55 pub id: fidl_fuchsia_bluetooth__common::PeerId,
56}
57
58impl fidl::Persistable for HostForgetRequest {}
59
60#[derive(Clone, Debug, PartialEq)]
61pub struct HostPairRequest {
62 pub id: fidl_fuchsia_bluetooth__common::PeerId,
63 pub options: fidl_fuchsia_bluetooth_sys__common::PairingOptions,
64}
65
66impl fidl::Persistable for HostPairRequest {}
67
68#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
69pub struct HostSetBrEdrSecurityModeRequest {
70 pub bredr_security_mode: fidl_fuchsia_bluetooth_sys__common::BrEdrSecurityMode,
71}
72
73impl fidl::Persistable for HostSetBrEdrSecurityModeRequest {}
74
75#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
76pub struct HostSetConnectableRequest {
77 pub enabled: bool,
78}
79
80impl fidl::Persistable for HostSetConnectableRequest {}
81
82#[derive(Clone, Debug, PartialEq)]
83pub struct HostSetDeviceClassRequest {
84 pub device_class: fidl_fuchsia_bluetooth__common::DeviceClass,
85}
86
87impl fidl::Persistable for HostSetDeviceClassRequest {}
88
89#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct HostSetDiscoverableRequest {
91 pub enabled: bool,
92}
93
94impl fidl::Persistable for HostSetDiscoverableRequest {}
95
96#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97pub struct HostSetLeSecurityModeRequest {
98 pub le_security_mode: fidl_fuchsia_bluetooth_sys__common::LeSecurityMode,
99}
100
101impl fidl::Persistable for HostSetLeSecurityModeRequest {}
102
103#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
104pub struct HostSetLocalNameRequest {
105 pub local_name: String,
106}
107
108impl fidl::Persistable for HostSetLocalNameRequest {}
109
110#[derive(Clone, Debug, PartialEq)]
111pub struct HostWatchStateResponse {
112 pub info: fidl_fuchsia_bluetooth_sys__common::HostInfo,
113}
114
115impl fidl::Persistable for HostWatchStateResponse {}
116
117#[derive(Clone, Debug)]
118pub enum BondingDelegateWatchBondsResponse {
119 Updated(fidl_fuchsia_bluetooth_sys__common::BondingData),
121 Removed(fidl_fuchsia_bluetooth__common::PeerId),
123 #[doc(hidden)]
124 __SourceBreaking { unknown_ordinal: u64 },
125}
126
127#[macro_export]
129macro_rules! BondingDelegateWatchBondsResponseUnknown {
130 () => {
131 _
132 };
133}
134
135impl PartialEq for BondingDelegateWatchBondsResponse {
137 fn eq(&self, other: &Self) -> bool {
138 match (self, other) {
139 (Self::Updated(x), Self::Updated(y)) => *x == *y,
140 (Self::Removed(x), Self::Removed(y)) => *x == *y,
141 _ => false,
142 }
143 }
144}
145
146impl BondingDelegateWatchBondsResponse {
147 #[inline]
148 pub fn ordinal(&self) -> u64 {
149 match *self {
150 Self::Updated(_) => 1,
151 Self::Removed(_) => 2,
152 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
153 }
154 }
155
156 #[inline]
157 pub fn unknown_variant_for_testing() -> Self {
158 Self::__SourceBreaking { unknown_ordinal: 0 }
159 }
160
161 #[inline]
162 pub fn is_unknown(&self) -> bool {
163 match self {
164 Self::__SourceBreaking { .. } => true,
165 _ => false,
166 }
167 }
168}
169
170impl fidl::Persistable for BondingDelegateWatchBondsResponse {}
171
172#[derive(Clone, Debug)]
173pub enum PeerWatcherGetNextResponse {
174 Updated(Vec<fidl_fuchsia_bluetooth_sys__common::Peer>),
177 Removed(Vec<fidl_fuchsia_bluetooth__common::PeerId>),
181 #[doc(hidden)]
182 __SourceBreaking { unknown_ordinal: u64 },
183}
184
185#[macro_export]
187macro_rules! PeerWatcherGetNextResponseUnknown {
188 () => {
189 _
190 };
191}
192
193impl PartialEq for PeerWatcherGetNextResponse {
195 fn eq(&self, other: &Self) -> bool {
196 match (self, other) {
197 (Self::Updated(x), Self::Updated(y)) => *x == *y,
198 (Self::Removed(x), Self::Removed(y)) => *x == *y,
199 _ => false,
200 }
201 }
202}
203
204impl PeerWatcherGetNextResponse {
205 #[inline]
206 pub fn ordinal(&self) -> u64 {
207 match *self {
208 Self::Updated(_) => 1,
209 Self::Removed(_) => 2,
210 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
211 }
212 }
213
214 #[inline]
215 pub fn unknown_variant_for_testing() -> Self {
216 Self::__SourceBreaking { unknown_ordinal: 0 }
217 }
218
219 #[inline]
220 pub fn is_unknown(&self) -> bool {
221 match self {
222 Self::__SourceBreaking { .. } => true,
223 _ => false,
224 }
225 }
226}
227
228impl fidl::Persistable for PeerWatcherGetNextResponse {}
229
230pub mod bonding_delegate_ordinals {
231 pub const RESTORE_BONDS: u64 = 0x2f17e533f2475e96;
232 pub const WATCH_BONDS: u64 = 0x48313cadc60cd07a;
233}
234
235pub mod discovery_session_ordinals {
236 pub const STOP: u64 = 0x3cbbd11b42632198;
237}
238
239pub mod host_ordinals {
240 pub const REQUEST_PROTOCOL: u64 = 0x45cb5bf9834016b4;
241 pub const SHUTDOWN: u64 = 0x18747459244591c9;
242 pub const WATCH_STATE: u64 = 0x19157554e2a3db52;
243 pub const SET_LOCAL_DATA: u64 = 0x57b70f72bb0a9187;
244 pub const SET_PEER_WATCHER: u64 = 0x3dec6b3c99c0a437;
245 pub const SET_LOCAL_NAME: u64 = 0x85e98b56b98f123;
246 pub const SET_DEVICE_CLASS: u64 = 0x4caef8f835950de2;
247 pub const START_DISCOVERY: u64 = 0x3f40a85341413e4;
248 pub const SET_CONNECTABLE: u64 = 0x187a6a82e811fa92;
249 pub const SET_DISCOVERABLE: u64 = 0x89f8c7da63e36de;
250 pub const CONNECT: u64 = 0x5a56139c993e7240;
251 pub const DISCONNECT: u64 = 0x33211717491121b1;
252 pub const PAIR: u64 = 0x2efaec6dc5d62ca2;
253 pub const FORGET: u64 = 0x904f58dbdd4490a;
254 pub const ENABLE_BACKGROUND_SCAN: u64 = 0x51f038a8cf498946;
255 pub const ENABLE_PRIVACY: u64 = 0x370a76e1d2b5034b;
256 pub const SET_BR_EDR_SECURITY_MODE: u64 = 0x1d94d20717459281;
257 pub const SET_LE_SECURITY_MODE: u64 = 0x6ef0a424a336a81;
258 pub const SET_PAIRING_DELEGATE: u64 = 0x21a5bba5ffc9773e;
259 pub const SET_BONDING_DELEGATE: u64 = 0x651d446a05b664d4;
260}
261
262pub mod peer_watcher_ordinals {
263 pub const GET_NEXT: u64 = 0x31b4855de7565b77;
264}
265
266pub mod receiver_ordinals {
267 pub const ADD_HOST: u64 = 0x2089233075765e8c;
268}
269
270mod internal {
271 use super::*;
272
273 impl fidl::encoding::ValueTypeMarker for BondingDelegateRestoreBondsRequest {
274 type Borrowed<'a> = &'a Self;
275 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
276 value
277 }
278 }
279
280 unsafe impl fidl::encoding::TypeMarker for BondingDelegateRestoreBondsRequest {
281 type Owned = Self;
282
283 #[inline(always)]
284 fn inline_align(_context: fidl::encoding::Context) -> usize {
285 8
286 }
287
288 #[inline(always)]
289 fn inline_size(_context: fidl::encoding::Context) -> usize {
290 16
291 }
292 }
293
294 unsafe impl<D: fidl::encoding::ResourceDialect>
295 fidl::encoding::Encode<BondingDelegateRestoreBondsRequest, D>
296 for &BondingDelegateRestoreBondsRequest
297 {
298 #[inline]
299 unsafe fn encode(
300 self,
301 encoder: &mut fidl::encoding::Encoder<'_, D>,
302 offset: usize,
303 _depth: fidl::encoding::Depth,
304 ) -> fidl::Result<()> {
305 encoder.debug_check_bounds::<BondingDelegateRestoreBondsRequest>(offset);
306 fidl::encoding::Encode::<BondingDelegateRestoreBondsRequest, D>::encode(
308 (
309 <fidl::encoding::UnboundedVector<
310 fidl_fuchsia_bluetooth_sys__common::BondingData,
311 > as fidl::encoding::ValueTypeMarker>::borrow(&self.bonds),
312 ),
313 encoder,
314 offset,
315 _depth,
316 )
317 }
318 }
319 unsafe impl<
320 D: fidl::encoding::ResourceDialect,
321 T0: fidl::encoding::Encode<
322 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::BondingData>,
323 D,
324 >,
325 > fidl::encoding::Encode<BondingDelegateRestoreBondsRequest, D> for (T0,)
326 {
327 #[inline]
328 unsafe fn encode(
329 self,
330 encoder: &mut fidl::encoding::Encoder<'_, D>,
331 offset: usize,
332 depth: fidl::encoding::Depth,
333 ) -> fidl::Result<()> {
334 encoder.debug_check_bounds::<BondingDelegateRestoreBondsRequest>(offset);
335 self.0.encode(encoder, offset + 0, depth)?;
339 Ok(())
340 }
341 }
342
343 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
344 for BondingDelegateRestoreBondsRequest
345 {
346 #[inline(always)]
347 fn new_empty() -> Self {
348 Self {
349 bonds: fidl::new_empty!(
350 fidl::encoding::UnboundedVector<
351 fidl_fuchsia_bluetooth_sys__common::BondingData,
352 >,
353 D
354 ),
355 }
356 }
357
358 #[inline]
359 unsafe fn decode(
360 &mut self,
361 decoder: &mut fidl::encoding::Decoder<'_, D>,
362 offset: usize,
363 _depth: fidl::encoding::Depth,
364 ) -> fidl::Result<()> {
365 decoder.debug_check_bounds::<Self>(offset);
366 fidl::decode!(
368 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::BondingData>,
369 D,
370 &mut self.bonds,
371 decoder,
372 offset + 0,
373 _depth
374 )?;
375 Ok(())
376 }
377 }
378
379 impl fidl::encoding::ValueTypeMarker for BondingDelegateRestoreBondsResponse {
380 type Borrowed<'a> = &'a Self;
381 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
382 value
383 }
384 }
385
386 unsafe impl fidl::encoding::TypeMarker for BondingDelegateRestoreBondsResponse {
387 type Owned = Self;
388
389 #[inline(always)]
390 fn inline_align(_context: fidl::encoding::Context) -> usize {
391 8
392 }
393
394 #[inline(always)]
395 fn inline_size(_context: fidl::encoding::Context) -> usize {
396 16
397 }
398 }
399
400 unsafe impl<D: fidl::encoding::ResourceDialect>
401 fidl::encoding::Encode<BondingDelegateRestoreBondsResponse, D>
402 for &BondingDelegateRestoreBondsResponse
403 {
404 #[inline]
405 unsafe fn encode(
406 self,
407 encoder: &mut fidl::encoding::Encoder<'_, D>,
408 offset: usize,
409 _depth: fidl::encoding::Depth,
410 ) -> fidl::Result<()> {
411 encoder.debug_check_bounds::<BondingDelegateRestoreBondsResponse>(offset);
412 fidl::encoding::Encode::<BondingDelegateRestoreBondsResponse, D>::encode(
414 (
415 <fidl::encoding::UnboundedVector<
416 fidl_fuchsia_bluetooth_sys__common::BondingData,
417 > as fidl::encoding::ValueTypeMarker>::borrow(&self.errors),
418 ),
419 encoder,
420 offset,
421 _depth,
422 )
423 }
424 }
425 unsafe impl<
426 D: fidl::encoding::ResourceDialect,
427 T0: fidl::encoding::Encode<
428 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::BondingData>,
429 D,
430 >,
431 > fidl::encoding::Encode<BondingDelegateRestoreBondsResponse, D> for (T0,)
432 {
433 #[inline]
434 unsafe fn encode(
435 self,
436 encoder: &mut fidl::encoding::Encoder<'_, D>,
437 offset: usize,
438 depth: fidl::encoding::Depth,
439 ) -> fidl::Result<()> {
440 encoder.debug_check_bounds::<BondingDelegateRestoreBondsResponse>(offset);
441 self.0.encode(encoder, offset + 0, depth)?;
445 Ok(())
446 }
447 }
448
449 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
450 for BondingDelegateRestoreBondsResponse
451 {
452 #[inline(always)]
453 fn new_empty() -> Self {
454 Self {
455 errors: fidl::new_empty!(
456 fidl::encoding::UnboundedVector<
457 fidl_fuchsia_bluetooth_sys__common::BondingData,
458 >,
459 D
460 ),
461 }
462 }
463
464 #[inline]
465 unsafe fn decode(
466 &mut self,
467 decoder: &mut fidl::encoding::Decoder<'_, D>,
468 offset: usize,
469 _depth: fidl::encoding::Depth,
470 ) -> fidl::Result<()> {
471 decoder.debug_check_bounds::<Self>(offset);
472 fidl::decode!(
474 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::BondingData>,
475 D,
476 &mut self.errors,
477 decoder,
478 offset + 0,
479 _depth
480 )?;
481 Ok(())
482 }
483 }
484
485 impl fidl::encoding::ValueTypeMarker for HostConnectRequest {
486 type Borrowed<'a> = &'a Self;
487 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
488 value
489 }
490 }
491
492 unsafe impl fidl::encoding::TypeMarker for HostConnectRequest {
493 type Owned = Self;
494
495 #[inline(always)]
496 fn inline_align(_context: fidl::encoding::Context) -> usize {
497 8
498 }
499
500 #[inline(always)]
501 fn inline_size(_context: fidl::encoding::Context) -> usize {
502 8
503 }
504 }
505
506 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostConnectRequest, D>
507 for &HostConnectRequest
508 {
509 #[inline]
510 unsafe fn encode(
511 self,
512 encoder: &mut fidl::encoding::Encoder<'_, D>,
513 offset: usize,
514 _depth: fidl::encoding::Depth,
515 ) -> fidl::Result<()> {
516 encoder.debug_check_bounds::<HostConnectRequest>(offset);
517 fidl::encoding::Encode::<HostConnectRequest, D>::encode(
519 (
520 <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
521 ),
522 encoder, offset, _depth
523 )
524 }
525 }
526 unsafe impl<
527 D: fidl::encoding::ResourceDialect,
528 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::PeerId, D>,
529 > fidl::encoding::Encode<HostConnectRequest, D> for (T0,)
530 {
531 #[inline]
532 unsafe fn encode(
533 self,
534 encoder: &mut fidl::encoding::Encoder<'_, D>,
535 offset: usize,
536 depth: fidl::encoding::Depth,
537 ) -> fidl::Result<()> {
538 encoder.debug_check_bounds::<HostConnectRequest>(offset);
539 self.0.encode(encoder, offset + 0, depth)?;
543 Ok(())
544 }
545 }
546
547 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostConnectRequest {
548 #[inline(always)]
549 fn new_empty() -> Self {
550 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth__common::PeerId, D) }
551 }
552
553 #[inline]
554 unsafe fn decode(
555 &mut self,
556 decoder: &mut fidl::encoding::Decoder<'_, D>,
557 offset: usize,
558 _depth: fidl::encoding::Depth,
559 ) -> fidl::Result<()> {
560 decoder.debug_check_bounds::<Self>(offset);
561 fidl::decode!(
563 fidl_fuchsia_bluetooth__common::PeerId,
564 D,
565 &mut self.id,
566 decoder,
567 offset + 0,
568 _depth
569 )?;
570 Ok(())
571 }
572 }
573
574 impl fidl::encoding::ValueTypeMarker for HostDisconnectRequest {
575 type Borrowed<'a> = &'a Self;
576 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
577 value
578 }
579 }
580
581 unsafe impl fidl::encoding::TypeMarker for HostDisconnectRequest {
582 type Owned = Self;
583
584 #[inline(always)]
585 fn inline_align(_context: fidl::encoding::Context) -> usize {
586 8
587 }
588
589 #[inline(always)]
590 fn inline_size(_context: fidl::encoding::Context) -> usize {
591 8
592 }
593 }
594
595 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostDisconnectRequest, D>
596 for &HostDisconnectRequest
597 {
598 #[inline]
599 unsafe fn encode(
600 self,
601 encoder: &mut fidl::encoding::Encoder<'_, D>,
602 offset: usize,
603 _depth: fidl::encoding::Depth,
604 ) -> fidl::Result<()> {
605 encoder.debug_check_bounds::<HostDisconnectRequest>(offset);
606 fidl::encoding::Encode::<HostDisconnectRequest, D>::encode(
608 (
609 <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
610 ),
611 encoder, offset, _depth
612 )
613 }
614 }
615 unsafe impl<
616 D: fidl::encoding::ResourceDialect,
617 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::PeerId, D>,
618 > fidl::encoding::Encode<HostDisconnectRequest, D> for (T0,)
619 {
620 #[inline]
621 unsafe fn encode(
622 self,
623 encoder: &mut fidl::encoding::Encoder<'_, D>,
624 offset: usize,
625 depth: fidl::encoding::Depth,
626 ) -> fidl::Result<()> {
627 encoder.debug_check_bounds::<HostDisconnectRequest>(offset);
628 self.0.encode(encoder, offset + 0, depth)?;
632 Ok(())
633 }
634 }
635
636 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostDisconnectRequest {
637 #[inline(always)]
638 fn new_empty() -> Self {
639 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth__common::PeerId, D) }
640 }
641
642 #[inline]
643 unsafe fn decode(
644 &mut self,
645 decoder: &mut fidl::encoding::Decoder<'_, D>,
646 offset: usize,
647 _depth: fidl::encoding::Depth,
648 ) -> fidl::Result<()> {
649 decoder.debug_check_bounds::<Self>(offset);
650 fidl::decode!(
652 fidl_fuchsia_bluetooth__common::PeerId,
653 D,
654 &mut self.id,
655 decoder,
656 offset + 0,
657 _depth
658 )?;
659 Ok(())
660 }
661 }
662
663 impl fidl::encoding::ValueTypeMarker for HostEnableBackgroundScanRequest {
664 type Borrowed<'a> = &'a Self;
665 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
666 value
667 }
668 }
669
670 unsafe impl fidl::encoding::TypeMarker for HostEnableBackgroundScanRequest {
671 type Owned = Self;
672
673 #[inline(always)]
674 fn inline_align(_context: fidl::encoding::Context) -> usize {
675 1
676 }
677
678 #[inline(always)]
679 fn inline_size(_context: fidl::encoding::Context) -> usize {
680 1
681 }
682 }
683
684 unsafe impl<D: fidl::encoding::ResourceDialect>
685 fidl::encoding::Encode<HostEnableBackgroundScanRequest, D>
686 for &HostEnableBackgroundScanRequest
687 {
688 #[inline]
689 unsafe fn encode(
690 self,
691 encoder: &mut fidl::encoding::Encoder<'_, D>,
692 offset: usize,
693 _depth: fidl::encoding::Depth,
694 ) -> fidl::Result<()> {
695 encoder.debug_check_bounds::<HostEnableBackgroundScanRequest>(offset);
696 fidl::encoding::Encode::<HostEnableBackgroundScanRequest, D>::encode(
698 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
699 encoder,
700 offset,
701 _depth,
702 )
703 }
704 }
705 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
706 fidl::encoding::Encode<HostEnableBackgroundScanRequest, D> for (T0,)
707 {
708 #[inline]
709 unsafe fn encode(
710 self,
711 encoder: &mut fidl::encoding::Encoder<'_, D>,
712 offset: usize,
713 depth: fidl::encoding::Depth,
714 ) -> fidl::Result<()> {
715 encoder.debug_check_bounds::<HostEnableBackgroundScanRequest>(offset);
716 self.0.encode(encoder, offset + 0, depth)?;
720 Ok(())
721 }
722 }
723
724 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
725 for HostEnableBackgroundScanRequest
726 {
727 #[inline(always)]
728 fn new_empty() -> Self {
729 Self { enabled: fidl::new_empty!(bool, D) }
730 }
731
732 #[inline]
733 unsafe fn decode(
734 &mut self,
735 decoder: &mut fidl::encoding::Decoder<'_, D>,
736 offset: usize,
737 _depth: fidl::encoding::Depth,
738 ) -> fidl::Result<()> {
739 decoder.debug_check_bounds::<Self>(offset);
740 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
742 Ok(())
743 }
744 }
745
746 impl fidl::encoding::ValueTypeMarker for HostEnablePrivacyRequest {
747 type Borrowed<'a> = &'a Self;
748 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
749 value
750 }
751 }
752
753 unsafe impl fidl::encoding::TypeMarker for HostEnablePrivacyRequest {
754 type Owned = Self;
755
756 #[inline(always)]
757 fn inline_align(_context: fidl::encoding::Context) -> usize {
758 1
759 }
760
761 #[inline(always)]
762 fn inline_size(_context: fidl::encoding::Context) -> usize {
763 1
764 }
765 }
766
767 unsafe impl<D: fidl::encoding::ResourceDialect>
768 fidl::encoding::Encode<HostEnablePrivacyRequest, D> for &HostEnablePrivacyRequest
769 {
770 #[inline]
771 unsafe fn encode(
772 self,
773 encoder: &mut fidl::encoding::Encoder<'_, D>,
774 offset: usize,
775 _depth: fidl::encoding::Depth,
776 ) -> fidl::Result<()> {
777 encoder.debug_check_bounds::<HostEnablePrivacyRequest>(offset);
778 fidl::encoding::Encode::<HostEnablePrivacyRequest, D>::encode(
780 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
781 encoder,
782 offset,
783 _depth,
784 )
785 }
786 }
787 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
788 fidl::encoding::Encode<HostEnablePrivacyRequest, D> for (T0,)
789 {
790 #[inline]
791 unsafe fn encode(
792 self,
793 encoder: &mut fidl::encoding::Encoder<'_, D>,
794 offset: usize,
795 depth: fidl::encoding::Depth,
796 ) -> fidl::Result<()> {
797 encoder.debug_check_bounds::<HostEnablePrivacyRequest>(offset);
798 self.0.encode(encoder, offset + 0, depth)?;
802 Ok(())
803 }
804 }
805
806 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
807 for HostEnablePrivacyRequest
808 {
809 #[inline(always)]
810 fn new_empty() -> Self {
811 Self { enabled: fidl::new_empty!(bool, D) }
812 }
813
814 #[inline]
815 unsafe fn decode(
816 &mut self,
817 decoder: &mut fidl::encoding::Decoder<'_, D>,
818 offset: usize,
819 _depth: fidl::encoding::Depth,
820 ) -> fidl::Result<()> {
821 decoder.debug_check_bounds::<Self>(offset);
822 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
824 Ok(())
825 }
826 }
827
828 impl fidl::encoding::ValueTypeMarker for HostForgetRequest {
829 type Borrowed<'a> = &'a Self;
830 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
831 value
832 }
833 }
834
835 unsafe impl fidl::encoding::TypeMarker for HostForgetRequest {
836 type Owned = Self;
837
838 #[inline(always)]
839 fn inline_align(_context: fidl::encoding::Context) -> usize {
840 8
841 }
842
843 #[inline(always)]
844 fn inline_size(_context: fidl::encoding::Context) -> usize {
845 8
846 }
847 }
848
849 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostForgetRequest, D>
850 for &HostForgetRequest
851 {
852 #[inline]
853 unsafe fn encode(
854 self,
855 encoder: &mut fidl::encoding::Encoder<'_, D>,
856 offset: usize,
857 _depth: fidl::encoding::Depth,
858 ) -> fidl::Result<()> {
859 encoder.debug_check_bounds::<HostForgetRequest>(offset);
860 fidl::encoding::Encode::<HostForgetRequest, D>::encode(
862 (
863 <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
864 ),
865 encoder, offset, _depth
866 )
867 }
868 }
869 unsafe impl<
870 D: fidl::encoding::ResourceDialect,
871 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::PeerId, D>,
872 > fidl::encoding::Encode<HostForgetRequest, D> for (T0,)
873 {
874 #[inline]
875 unsafe fn encode(
876 self,
877 encoder: &mut fidl::encoding::Encoder<'_, D>,
878 offset: usize,
879 depth: fidl::encoding::Depth,
880 ) -> fidl::Result<()> {
881 encoder.debug_check_bounds::<HostForgetRequest>(offset);
882 self.0.encode(encoder, offset + 0, depth)?;
886 Ok(())
887 }
888 }
889
890 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostForgetRequest {
891 #[inline(always)]
892 fn new_empty() -> Self {
893 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth__common::PeerId, D) }
894 }
895
896 #[inline]
897 unsafe fn decode(
898 &mut self,
899 decoder: &mut fidl::encoding::Decoder<'_, D>,
900 offset: usize,
901 _depth: fidl::encoding::Depth,
902 ) -> fidl::Result<()> {
903 decoder.debug_check_bounds::<Self>(offset);
904 fidl::decode!(
906 fidl_fuchsia_bluetooth__common::PeerId,
907 D,
908 &mut self.id,
909 decoder,
910 offset + 0,
911 _depth
912 )?;
913 Ok(())
914 }
915 }
916
917 impl fidl::encoding::ValueTypeMarker for HostPairRequest {
918 type Borrowed<'a> = &'a Self;
919 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
920 value
921 }
922 }
923
924 unsafe impl fidl::encoding::TypeMarker for HostPairRequest {
925 type Owned = Self;
926
927 #[inline(always)]
928 fn inline_align(_context: fidl::encoding::Context) -> usize {
929 8
930 }
931
932 #[inline(always)]
933 fn inline_size(_context: fidl::encoding::Context) -> usize {
934 24
935 }
936 }
937
938 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostPairRequest, D>
939 for &HostPairRequest
940 {
941 #[inline]
942 unsafe fn encode(
943 self,
944 encoder: &mut fidl::encoding::Encoder<'_, D>,
945 offset: usize,
946 _depth: fidl::encoding::Depth,
947 ) -> fidl::Result<()> {
948 encoder.debug_check_bounds::<HostPairRequest>(offset);
949 fidl::encoding::Encode::<HostPairRequest, D>::encode(
951 (
952 <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
953 <fidl_fuchsia_bluetooth_sys__common::PairingOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
954 ),
955 encoder, offset, _depth
956 )
957 }
958 }
959 unsafe impl<
960 D: fidl::encoding::ResourceDialect,
961 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::PeerId, D>,
962 T1: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys__common::PairingOptions, D>,
963 > fidl::encoding::Encode<HostPairRequest, D> for (T0, T1)
964 {
965 #[inline]
966 unsafe fn encode(
967 self,
968 encoder: &mut fidl::encoding::Encoder<'_, D>,
969 offset: usize,
970 depth: fidl::encoding::Depth,
971 ) -> fidl::Result<()> {
972 encoder.debug_check_bounds::<HostPairRequest>(offset);
973 self.0.encode(encoder, offset + 0, depth)?;
977 self.1.encode(encoder, offset + 8, depth)?;
978 Ok(())
979 }
980 }
981
982 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostPairRequest {
983 #[inline(always)]
984 fn new_empty() -> Self {
985 Self {
986 id: fidl::new_empty!(fidl_fuchsia_bluetooth__common::PeerId, D),
987 options: fidl::new_empty!(fidl_fuchsia_bluetooth_sys__common::PairingOptions, D),
988 }
989 }
990
991 #[inline]
992 unsafe fn decode(
993 &mut self,
994 decoder: &mut fidl::encoding::Decoder<'_, D>,
995 offset: usize,
996 _depth: fidl::encoding::Depth,
997 ) -> fidl::Result<()> {
998 decoder.debug_check_bounds::<Self>(offset);
999 fidl::decode!(
1001 fidl_fuchsia_bluetooth__common::PeerId,
1002 D,
1003 &mut self.id,
1004 decoder,
1005 offset + 0,
1006 _depth
1007 )?;
1008 fidl::decode!(
1009 fidl_fuchsia_bluetooth_sys__common::PairingOptions,
1010 D,
1011 &mut self.options,
1012 decoder,
1013 offset + 8,
1014 _depth
1015 )?;
1016 Ok(())
1017 }
1018 }
1019
1020 impl fidl::encoding::ValueTypeMarker for HostSetBrEdrSecurityModeRequest {
1021 type Borrowed<'a> = &'a Self;
1022 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1023 value
1024 }
1025 }
1026
1027 unsafe impl fidl::encoding::TypeMarker for HostSetBrEdrSecurityModeRequest {
1028 type Owned = Self;
1029
1030 #[inline(always)]
1031 fn inline_align(_context: fidl::encoding::Context) -> usize {
1032 4
1033 }
1034
1035 #[inline(always)]
1036 fn inline_size(_context: fidl::encoding::Context) -> usize {
1037 4
1038 }
1039 }
1040
1041 unsafe impl<D: fidl::encoding::ResourceDialect>
1042 fidl::encoding::Encode<HostSetBrEdrSecurityModeRequest, D>
1043 for &HostSetBrEdrSecurityModeRequest
1044 {
1045 #[inline]
1046 unsafe fn encode(
1047 self,
1048 encoder: &mut fidl::encoding::Encoder<'_, D>,
1049 offset: usize,
1050 _depth: fidl::encoding::Depth,
1051 ) -> fidl::Result<()> {
1052 encoder.debug_check_bounds::<HostSetBrEdrSecurityModeRequest>(offset);
1053 fidl::encoding::Encode::<HostSetBrEdrSecurityModeRequest, D>::encode(
1055 (
1056 <fidl_fuchsia_bluetooth_sys__common::BrEdrSecurityMode as fidl::encoding::ValueTypeMarker>::borrow(&self.bredr_security_mode),
1057 ),
1058 encoder, offset, _depth
1059 )
1060 }
1061 }
1062 unsafe impl<
1063 D: fidl::encoding::ResourceDialect,
1064 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys__common::BrEdrSecurityMode, D>,
1065 > fidl::encoding::Encode<HostSetBrEdrSecurityModeRequest, D> for (T0,)
1066 {
1067 #[inline]
1068 unsafe fn encode(
1069 self,
1070 encoder: &mut fidl::encoding::Encoder<'_, D>,
1071 offset: usize,
1072 depth: fidl::encoding::Depth,
1073 ) -> fidl::Result<()> {
1074 encoder.debug_check_bounds::<HostSetBrEdrSecurityModeRequest>(offset);
1075 self.0.encode(encoder, offset + 0, depth)?;
1079 Ok(())
1080 }
1081 }
1082
1083 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1084 for HostSetBrEdrSecurityModeRequest
1085 {
1086 #[inline(always)]
1087 fn new_empty() -> Self {
1088 Self {
1089 bredr_security_mode: fidl::new_empty!(
1090 fidl_fuchsia_bluetooth_sys__common::BrEdrSecurityMode,
1091 D
1092 ),
1093 }
1094 }
1095
1096 #[inline]
1097 unsafe fn decode(
1098 &mut self,
1099 decoder: &mut fidl::encoding::Decoder<'_, D>,
1100 offset: usize,
1101 _depth: fidl::encoding::Depth,
1102 ) -> fidl::Result<()> {
1103 decoder.debug_check_bounds::<Self>(offset);
1104 fidl::decode!(
1106 fidl_fuchsia_bluetooth_sys__common::BrEdrSecurityMode,
1107 D,
1108 &mut self.bredr_security_mode,
1109 decoder,
1110 offset + 0,
1111 _depth
1112 )?;
1113 Ok(())
1114 }
1115 }
1116
1117 impl fidl::encoding::ValueTypeMarker for HostSetConnectableRequest {
1118 type Borrowed<'a> = &'a Self;
1119 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1120 value
1121 }
1122 }
1123
1124 unsafe impl fidl::encoding::TypeMarker for HostSetConnectableRequest {
1125 type Owned = Self;
1126
1127 #[inline(always)]
1128 fn inline_align(_context: fidl::encoding::Context) -> usize {
1129 1
1130 }
1131
1132 #[inline(always)]
1133 fn inline_size(_context: fidl::encoding::Context) -> usize {
1134 1
1135 }
1136 }
1137
1138 unsafe impl<D: fidl::encoding::ResourceDialect>
1139 fidl::encoding::Encode<HostSetConnectableRequest, D> for &HostSetConnectableRequest
1140 {
1141 #[inline]
1142 unsafe fn encode(
1143 self,
1144 encoder: &mut fidl::encoding::Encoder<'_, D>,
1145 offset: usize,
1146 _depth: fidl::encoding::Depth,
1147 ) -> fidl::Result<()> {
1148 encoder.debug_check_bounds::<HostSetConnectableRequest>(offset);
1149 fidl::encoding::Encode::<HostSetConnectableRequest, D>::encode(
1151 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1152 encoder,
1153 offset,
1154 _depth,
1155 )
1156 }
1157 }
1158 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1159 fidl::encoding::Encode<HostSetConnectableRequest, D> for (T0,)
1160 {
1161 #[inline]
1162 unsafe fn encode(
1163 self,
1164 encoder: &mut fidl::encoding::Encoder<'_, D>,
1165 offset: usize,
1166 depth: fidl::encoding::Depth,
1167 ) -> fidl::Result<()> {
1168 encoder.debug_check_bounds::<HostSetConnectableRequest>(offset);
1169 self.0.encode(encoder, offset + 0, depth)?;
1173 Ok(())
1174 }
1175 }
1176
1177 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1178 for HostSetConnectableRequest
1179 {
1180 #[inline(always)]
1181 fn new_empty() -> Self {
1182 Self { enabled: fidl::new_empty!(bool, D) }
1183 }
1184
1185 #[inline]
1186 unsafe fn decode(
1187 &mut self,
1188 decoder: &mut fidl::encoding::Decoder<'_, D>,
1189 offset: usize,
1190 _depth: fidl::encoding::Depth,
1191 ) -> fidl::Result<()> {
1192 decoder.debug_check_bounds::<Self>(offset);
1193 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1195 Ok(())
1196 }
1197 }
1198
1199 impl fidl::encoding::ValueTypeMarker for HostSetDeviceClassRequest {
1200 type Borrowed<'a> = &'a Self;
1201 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1202 value
1203 }
1204 }
1205
1206 unsafe impl fidl::encoding::TypeMarker for HostSetDeviceClassRequest {
1207 type Owned = Self;
1208
1209 #[inline(always)]
1210 fn inline_align(_context: fidl::encoding::Context) -> usize {
1211 4
1212 }
1213
1214 #[inline(always)]
1215 fn inline_size(_context: fidl::encoding::Context) -> usize {
1216 4
1217 }
1218 }
1219
1220 unsafe impl<D: fidl::encoding::ResourceDialect>
1221 fidl::encoding::Encode<HostSetDeviceClassRequest, D> for &HostSetDeviceClassRequest
1222 {
1223 #[inline]
1224 unsafe fn encode(
1225 self,
1226 encoder: &mut fidl::encoding::Encoder<'_, D>,
1227 offset: usize,
1228 _depth: fidl::encoding::Depth,
1229 ) -> fidl::Result<()> {
1230 encoder.debug_check_bounds::<HostSetDeviceClassRequest>(offset);
1231 fidl::encoding::Encode::<HostSetDeviceClassRequest, D>::encode(
1233 (
1234 <fidl_fuchsia_bluetooth__common::DeviceClass as fidl::encoding::ValueTypeMarker>::borrow(&self.device_class),
1235 ),
1236 encoder, offset, _depth
1237 )
1238 }
1239 }
1240 unsafe impl<
1241 D: fidl::encoding::ResourceDialect,
1242 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::DeviceClass, D>,
1243 > fidl::encoding::Encode<HostSetDeviceClassRequest, D> for (T0,)
1244 {
1245 #[inline]
1246 unsafe fn encode(
1247 self,
1248 encoder: &mut fidl::encoding::Encoder<'_, D>,
1249 offset: usize,
1250 depth: fidl::encoding::Depth,
1251 ) -> fidl::Result<()> {
1252 encoder.debug_check_bounds::<HostSetDeviceClassRequest>(offset);
1253 self.0.encode(encoder, offset + 0, depth)?;
1257 Ok(())
1258 }
1259 }
1260
1261 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1262 for HostSetDeviceClassRequest
1263 {
1264 #[inline(always)]
1265 fn new_empty() -> Self {
1266 Self { device_class: fidl::new_empty!(fidl_fuchsia_bluetooth__common::DeviceClass, D) }
1267 }
1268
1269 #[inline]
1270 unsafe fn decode(
1271 &mut self,
1272 decoder: &mut fidl::encoding::Decoder<'_, D>,
1273 offset: usize,
1274 _depth: fidl::encoding::Depth,
1275 ) -> fidl::Result<()> {
1276 decoder.debug_check_bounds::<Self>(offset);
1277 fidl::decode!(
1279 fidl_fuchsia_bluetooth__common::DeviceClass,
1280 D,
1281 &mut self.device_class,
1282 decoder,
1283 offset + 0,
1284 _depth
1285 )?;
1286 Ok(())
1287 }
1288 }
1289
1290 impl fidl::encoding::ValueTypeMarker for HostSetDiscoverableRequest {
1291 type Borrowed<'a> = &'a Self;
1292 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1293 value
1294 }
1295 }
1296
1297 unsafe impl fidl::encoding::TypeMarker for HostSetDiscoverableRequest {
1298 type Owned = Self;
1299
1300 #[inline(always)]
1301 fn inline_align(_context: fidl::encoding::Context) -> usize {
1302 1
1303 }
1304
1305 #[inline(always)]
1306 fn inline_size(_context: fidl::encoding::Context) -> usize {
1307 1
1308 }
1309 }
1310
1311 unsafe impl<D: fidl::encoding::ResourceDialect>
1312 fidl::encoding::Encode<HostSetDiscoverableRequest, D> for &HostSetDiscoverableRequest
1313 {
1314 #[inline]
1315 unsafe fn encode(
1316 self,
1317 encoder: &mut fidl::encoding::Encoder<'_, D>,
1318 offset: usize,
1319 _depth: fidl::encoding::Depth,
1320 ) -> fidl::Result<()> {
1321 encoder.debug_check_bounds::<HostSetDiscoverableRequest>(offset);
1322 fidl::encoding::Encode::<HostSetDiscoverableRequest, D>::encode(
1324 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1325 encoder,
1326 offset,
1327 _depth,
1328 )
1329 }
1330 }
1331 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1332 fidl::encoding::Encode<HostSetDiscoverableRequest, D> for (T0,)
1333 {
1334 #[inline]
1335 unsafe fn encode(
1336 self,
1337 encoder: &mut fidl::encoding::Encoder<'_, D>,
1338 offset: usize,
1339 depth: fidl::encoding::Depth,
1340 ) -> fidl::Result<()> {
1341 encoder.debug_check_bounds::<HostSetDiscoverableRequest>(offset);
1342 self.0.encode(encoder, offset + 0, depth)?;
1346 Ok(())
1347 }
1348 }
1349
1350 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1351 for HostSetDiscoverableRequest
1352 {
1353 #[inline(always)]
1354 fn new_empty() -> Self {
1355 Self { enabled: fidl::new_empty!(bool, D) }
1356 }
1357
1358 #[inline]
1359 unsafe fn decode(
1360 &mut self,
1361 decoder: &mut fidl::encoding::Decoder<'_, D>,
1362 offset: usize,
1363 _depth: fidl::encoding::Depth,
1364 ) -> fidl::Result<()> {
1365 decoder.debug_check_bounds::<Self>(offset);
1366 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1368 Ok(())
1369 }
1370 }
1371
1372 impl fidl::encoding::ValueTypeMarker for HostSetLeSecurityModeRequest {
1373 type Borrowed<'a> = &'a Self;
1374 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1375 value
1376 }
1377 }
1378
1379 unsafe impl fidl::encoding::TypeMarker for HostSetLeSecurityModeRequest {
1380 type Owned = Self;
1381
1382 #[inline(always)]
1383 fn inline_align(_context: fidl::encoding::Context) -> usize {
1384 4
1385 }
1386
1387 #[inline(always)]
1388 fn inline_size(_context: fidl::encoding::Context) -> usize {
1389 4
1390 }
1391 }
1392
1393 unsafe impl<D: fidl::encoding::ResourceDialect>
1394 fidl::encoding::Encode<HostSetLeSecurityModeRequest, D> for &HostSetLeSecurityModeRequest
1395 {
1396 #[inline]
1397 unsafe fn encode(
1398 self,
1399 encoder: &mut fidl::encoding::Encoder<'_, D>,
1400 offset: usize,
1401 _depth: fidl::encoding::Depth,
1402 ) -> fidl::Result<()> {
1403 encoder.debug_check_bounds::<HostSetLeSecurityModeRequest>(offset);
1404 fidl::encoding::Encode::<HostSetLeSecurityModeRequest, D>::encode(
1406 (
1407 <fidl_fuchsia_bluetooth_sys__common::LeSecurityMode as fidl::encoding::ValueTypeMarker>::borrow(&self.le_security_mode),
1408 ),
1409 encoder, offset, _depth
1410 )
1411 }
1412 }
1413 unsafe impl<
1414 D: fidl::encoding::ResourceDialect,
1415 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys__common::LeSecurityMode, D>,
1416 > fidl::encoding::Encode<HostSetLeSecurityModeRequest, D> for (T0,)
1417 {
1418 #[inline]
1419 unsafe fn encode(
1420 self,
1421 encoder: &mut fidl::encoding::Encoder<'_, D>,
1422 offset: usize,
1423 depth: fidl::encoding::Depth,
1424 ) -> fidl::Result<()> {
1425 encoder.debug_check_bounds::<HostSetLeSecurityModeRequest>(offset);
1426 self.0.encode(encoder, offset + 0, depth)?;
1430 Ok(())
1431 }
1432 }
1433
1434 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1435 for HostSetLeSecurityModeRequest
1436 {
1437 #[inline(always)]
1438 fn new_empty() -> Self {
1439 Self {
1440 le_security_mode: fidl::new_empty!(
1441 fidl_fuchsia_bluetooth_sys__common::LeSecurityMode,
1442 D
1443 ),
1444 }
1445 }
1446
1447 #[inline]
1448 unsafe fn decode(
1449 &mut self,
1450 decoder: &mut fidl::encoding::Decoder<'_, D>,
1451 offset: usize,
1452 _depth: fidl::encoding::Depth,
1453 ) -> fidl::Result<()> {
1454 decoder.debug_check_bounds::<Self>(offset);
1455 fidl::decode!(
1457 fidl_fuchsia_bluetooth_sys__common::LeSecurityMode,
1458 D,
1459 &mut self.le_security_mode,
1460 decoder,
1461 offset + 0,
1462 _depth
1463 )?;
1464 Ok(())
1465 }
1466 }
1467
1468 impl fidl::encoding::ValueTypeMarker for HostSetLocalNameRequest {
1469 type Borrowed<'a> = &'a Self;
1470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1471 value
1472 }
1473 }
1474
1475 unsafe impl fidl::encoding::TypeMarker for HostSetLocalNameRequest {
1476 type Owned = Self;
1477
1478 #[inline(always)]
1479 fn inline_align(_context: fidl::encoding::Context) -> usize {
1480 8
1481 }
1482
1483 #[inline(always)]
1484 fn inline_size(_context: fidl::encoding::Context) -> usize {
1485 16
1486 }
1487 }
1488
1489 unsafe impl<D: fidl::encoding::ResourceDialect>
1490 fidl::encoding::Encode<HostSetLocalNameRequest, D> for &HostSetLocalNameRequest
1491 {
1492 #[inline]
1493 unsafe fn encode(
1494 self,
1495 encoder: &mut fidl::encoding::Encoder<'_, D>,
1496 offset: usize,
1497 _depth: fidl::encoding::Depth,
1498 ) -> fidl::Result<()> {
1499 encoder.debug_check_bounds::<HostSetLocalNameRequest>(offset);
1500 fidl::encoding::Encode::<HostSetLocalNameRequest, D>::encode(
1502 (<fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow(
1503 &self.local_name,
1504 ),),
1505 encoder,
1506 offset,
1507 _depth,
1508 )
1509 }
1510 }
1511 unsafe impl<
1512 D: fidl::encoding::ResourceDialect,
1513 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<248>, D>,
1514 > fidl::encoding::Encode<HostSetLocalNameRequest, D> for (T0,)
1515 {
1516 #[inline]
1517 unsafe fn encode(
1518 self,
1519 encoder: &mut fidl::encoding::Encoder<'_, D>,
1520 offset: usize,
1521 depth: fidl::encoding::Depth,
1522 ) -> fidl::Result<()> {
1523 encoder.debug_check_bounds::<HostSetLocalNameRequest>(offset);
1524 self.0.encode(encoder, offset + 0, depth)?;
1528 Ok(())
1529 }
1530 }
1531
1532 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1533 for HostSetLocalNameRequest
1534 {
1535 #[inline(always)]
1536 fn new_empty() -> Self {
1537 Self { local_name: fidl::new_empty!(fidl::encoding::BoundedString<248>, D) }
1538 }
1539
1540 #[inline]
1541 unsafe fn decode(
1542 &mut self,
1543 decoder: &mut fidl::encoding::Decoder<'_, D>,
1544 offset: usize,
1545 _depth: fidl::encoding::Depth,
1546 ) -> fidl::Result<()> {
1547 decoder.debug_check_bounds::<Self>(offset);
1548 fidl::decode!(
1550 fidl::encoding::BoundedString<248>,
1551 D,
1552 &mut self.local_name,
1553 decoder,
1554 offset + 0,
1555 _depth
1556 )?;
1557 Ok(())
1558 }
1559 }
1560
1561 impl fidl::encoding::ValueTypeMarker for HostWatchStateResponse {
1562 type Borrowed<'a> = &'a Self;
1563 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1564 value
1565 }
1566 }
1567
1568 unsafe impl fidl::encoding::TypeMarker for HostWatchStateResponse {
1569 type Owned = Self;
1570
1571 #[inline(always)]
1572 fn inline_align(_context: fidl::encoding::Context) -> usize {
1573 8
1574 }
1575
1576 #[inline(always)]
1577 fn inline_size(_context: fidl::encoding::Context) -> usize {
1578 16
1579 }
1580 }
1581
1582 unsafe impl<D: fidl::encoding::ResourceDialect>
1583 fidl::encoding::Encode<HostWatchStateResponse, D> for &HostWatchStateResponse
1584 {
1585 #[inline]
1586 unsafe fn encode(
1587 self,
1588 encoder: &mut fidl::encoding::Encoder<'_, D>,
1589 offset: usize,
1590 _depth: fidl::encoding::Depth,
1591 ) -> fidl::Result<()> {
1592 encoder.debug_check_bounds::<HostWatchStateResponse>(offset);
1593 fidl::encoding::Encode::<HostWatchStateResponse, D>::encode(
1595 (
1596 <fidl_fuchsia_bluetooth_sys__common::HostInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1597 ),
1598 encoder, offset, _depth
1599 )
1600 }
1601 }
1602 unsafe impl<
1603 D: fidl::encoding::ResourceDialect,
1604 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys__common::HostInfo, D>,
1605 > fidl::encoding::Encode<HostWatchStateResponse, D> for (T0,)
1606 {
1607 #[inline]
1608 unsafe fn encode(
1609 self,
1610 encoder: &mut fidl::encoding::Encoder<'_, D>,
1611 offset: usize,
1612 depth: fidl::encoding::Depth,
1613 ) -> fidl::Result<()> {
1614 encoder.debug_check_bounds::<HostWatchStateResponse>(offset);
1615 self.0.encode(encoder, offset + 0, depth)?;
1619 Ok(())
1620 }
1621 }
1622
1623 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1624 for HostWatchStateResponse
1625 {
1626 #[inline(always)]
1627 fn new_empty() -> Self {
1628 Self { info: fidl::new_empty!(fidl_fuchsia_bluetooth_sys__common::HostInfo, D) }
1629 }
1630
1631 #[inline]
1632 unsafe fn decode(
1633 &mut self,
1634 decoder: &mut fidl::encoding::Decoder<'_, D>,
1635 offset: usize,
1636 _depth: fidl::encoding::Depth,
1637 ) -> fidl::Result<()> {
1638 decoder.debug_check_bounds::<Self>(offset);
1639 fidl::decode!(
1641 fidl_fuchsia_bluetooth_sys__common::HostInfo,
1642 D,
1643 &mut self.info,
1644 decoder,
1645 offset + 0,
1646 _depth
1647 )?;
1648 Ok(())
1649 }
1650 }
1651
1652 impl fidl::encoding::ValueTypeMarker for BondingDelegateWatchBondsResponse {
1653 type Borrowed<'a> = &'a Self;
1654 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1655 value
1656 }
1657 }
1658
1659 unsafe impl fidl::encoding::TypeMarker for BondingDelegateWatchBondsResponse {
1660 type Owned = Self;
1661
1662 #[inline(always)]
1663 fn inline_align(_context: fidl::encoding::Context) -> usize {
1664 8
1665 }
1666
1667 #[inline(always)]
1668 fn inline_size(_context: fidl::encoding::Context) -> usize {
1669 16
1670 }
1671 }
1672
1673 unsafe impl<D: fidl::encoding::ResourceDialect>
1674 fidl::encoding::Encode<BondingDelegateWatchBondsResponse, D>
1675 for &BondingDelegateWatchBondsResponse
1676 {
1677 #[inline]
1678 unsafe fn encode(
1679 self,
1680 encoder: &mut fidl::encoding::Encoder<'_, D>,
1681 offset: usize,
1682 _depth: fidl::encoding::Depth,
1683 ) -> fidl::Result<()> {
1684 encoder.debug_check_bounds::<BondingDelegateWatchBondsResponse>(offset);
1685 encoder.write_num::<u64>(self.ordinal(), offset);
1686 match self {
1687 BondingDelegateWatchBondsResponse::Updated(ref val) => {
1688 fidl::encoding::encode_in_envelope::<fidl_fuchsia_bluetooth_sys__common::BondingData, D>(
1689 <fidl_fuchsia_bluetooth_sys__common::BondingData as fidl::encoding::ValueTypeMarker>::borrow(val),
1690 encoder, offset + 8, _depth
1691 )
1692 }
1693 BondingDelegateWatchBondsResponse::Removed(ref val) => {
1694 fidl::encoding::encode_in_envelope::<fidl_fuchsia_bluetooth__common::PeerId, D>(
1695 <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(val),
1696 encoder, offset + 8, _depth
1697 )
1698 }
1699 BondingDelegateWatchBondsResponse::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1700 }
1701 }
1702 }
1703
1704 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1705 for BondingDelegateWatchBondsResponse
1706 {
1707 #[inline(always)]
1708 fn new_empty() -> Self {
1709 Self::__SourceBreaking { unknown_ordinal: 0 }
1710 }
1711
1712 #[inline]
1713 unsafe fn decode(
1714 &mut self,
1715 decoder: &mut fidl::encoding::Decoder<'_, D>,
1716 offset: usize,
1717 mut depth: fidl::encoding::Depth,
1718 ) -> fidl::Result<()> {
1719 decoder.debug_check_bounds::<Self>(offset);
1720 #[allow(unused_variables)]
1721 let next_out_of_line = decoder.next_out_of_line();
1722 let handles_before = decoder.remaining_handles();
1723 let (ordinal, inlined, num_bytes, num_handles) =
1724 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1725
1726 let member_inline_size = match ordinal {
1727 1 => <fidl_fuchsia_bluetooth_sys__common::BondingData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1728 2 => <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1729 0 => return Err(fidl::Error::UnknownUnionTag),
1730 _ => num_bytes as usize,
1731 };
1732
1733 if inlined != (member_inline_size <= 4) {
1734 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1735 }
1736 let _inner_offset;
1737 if inlined {
1738 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1739 _inner_offset = offset + 8;
1740 } else {
1741 depth.increment()?;
1742 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1743 }
1744 match ordinal {
1745 1 => {
1746 #[allow(irrefutable_let_patterns)]
1747 if let BondingDelegateWatchBondsResponse::Updated(_) = self {
1748 } else {
1750 *self = BondingDelegateWatchBondsResponse::Updated(fidl::new_empty!(
1752 fidl_fuchsia_bluetooth_sys__common::BondingData,
1753 D
1754 ));
1755 }
1756 #[allow(irrefutable_let_patterns)]
1757 if let BondingDelegateWatchBondsResponse::Updated(ref mut val) = self {
1758 fidl::decode!(
1759 fidl_fuchsia_bluetooth_sys__common::BondingData,
1760 D,
1761 val,
1762 decoder,
1763 _inner_offset,
1764 depth
1765 )?;
1766 } else {
1767 unreachable!()
1768 }
1769 }
1770 2 => {
1771 #[allow(irrefutable_let_patterns)]
1772 if let BondingDelegateWatchBondsResponse::Removed(_) = self {
1773 } else {
1775 *self = BondingDelegateWatchBondsResponse::Removed(fidl::new_empty!(
1777 fidl_fuchsia_bluetooth__common::PeerId,
1778 D
1779 ));
1780 }
1781 #[allow(irrefutable_let_patterns)]
1782 if let BondingDelegateWatchBondsResponse::Removed(ref mut val) = self {
1783 fidl::decode!(
1784 fidl_fuchsia_bluetooth__common::PeerId,
1785 D,
1786 val,
1787 decoder,
1788 _inner_offset,
1789 depth
1790 )?;
1791 } else {
1792 unreachable!()
1793 }
1794 }
1795 #[allow(deprecated)]
1796 ordinal => {
1797 for _ in 0..num_handles {
1798 decoder.drop_next_handle()?;
1799 }
1800 *self = BondingDelegateWatchBondsResponse::__SourceBreaking {
1801 unknown_ordinal: ordinal,
1802 };
1803 }
1804 }
1805 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1806 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1807 }
1808 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1809 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1810 }
1811 Ok(())
1812 }
1813 }
1814
1815 impl fidl::encoding::ValueTypeMarker for PeerWatcherGetNextResponse {
1816 type Borrowed<'a> = &'a Self;
1817 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1818 value
1819 }
1820 }
1821
1822 unsafe impl fidl::encoding::TypeMarker for PeerWatcherGetNextResponse {
1823 type Owned = Self;
1824
1825 #[inline(always)]
1826 fn inline_align(_context: fidl::encoding::Context) -> usize {
1827 8
1828 }
1829
1830 #[inline(always)]
1831 fn inline_size(_context: fidl::encoding::Context) -> usize {
1832 16
1833 }
1834 }
1835
1836 unsafe impl<D: fidl::encoding::ResourceDialect>
1837 fidl::encoding::Encode<PeerWatcherGetNextResponse, D> for &PeerWatcherGetNextResponse
1838 {
1839 #[inline]
1840 unsafe fn encode(
1841 self,
1842 encoder: &mut fidl::encoding::Encoder<'_, D>,
1843 offset: usize,
1844 _depth: fidl::encoding::Depth,
1845 ) -> fidl::Result<()> {
1846 encoder.debug_check_bounds::<PeerWatcherGetNextResponse>(offset);
1847 encoder.write_num::<u64>(self.ordinal(), offset);
1848 match self {
1849 PeerWatcherGetNextResponse::Updated(ref val) => {
1850 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::Peer>, D>(
1851 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::Peer> as fidl::encoding::ValueTypeMarker>::borrow(val),
1852 encoder, offset + 8, _depth
1853 )
1854 }
1855 PeerWatcherGetNextResponse::Removed(ref val) => {
1856 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth__common::PeerId>, D>(
1857 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth__common::PeerId> as fidl::encoding::ValueTypeMarker>::borrow(val),
1858 encoder, offset + 8, _depth
1859 )
1860 }
1861 PeerWatcherGetNextResponse::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1862 }
1863 }
1864 }
1865
1866 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1867 for PeerWatcherGetNextResponse
1868 {
1869 #[inline(always)]
1870 fn new_empty() -> Self {
1871 Self::__SourceBreaking { unknown_ordinal: 0 }
1872 }
1873
1874 #[inline]
1875 unsafe fn decode(
1876 &mut self,
1877 decoder: &mut fidl::encoding::Decoder<'_, D>,
1878 offset: usize,
1879 mut depth: fidl::encoding::Depth,
1880 ) -> fidl::Result<()> {
1881 decoder.debug_check_bounds::<Self>(offset);
1882 #[allow(unused_variables)]
1883 let next_out_of_line = decoder.next_out_of_line();
1884 let handles_before = decoder.remaining_handles();
1885 let (ordinal, inlined, num_bytes, num_handles) =
1886 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1887
1888 let member_inline_size = match ordinal {
1889 1 => <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys__common::Peer> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1890 2 => <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth__common::PeerId> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1891 0 => return Err(fidl::Error::UnknownUnionTag),
1892 _ => num_bytes as usize,
1893 };
1894
1895 if inlined != (member_inline_size <= 4) {
1896 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1897 }
1898 let _inner_offset;
1899 if inlined {
1900 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1901 _inner_offset = offset + 8;
1902 } else {
1903 depth.increment()?;
1904 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1905 }
1906 match ordinal {
1907 1 => {
1908 #[allow(irrefutable_let_patterns)]
1909 if let PeerWatcherGetNextResponse::Updated(_) = self {
1910 } else {
1912 *self = PeerWatcherGetNextResponse::Updated(fidl::new_empty!(
1914 fidl::encoding::UnboundedVector<
1915 fidl_fuchsia_bluetooth_sys__common::Peer,
1916 >,
1917 D
1918 ));
1919 }
1920 #[allow(irrefutable_let_patterns)]
1921 if let PeerWatcherGetNextResponse::Updated(ref mut val) = self {
1922 fidl::decode!(
1923 fidl::encoding::UnboundedVector<
1924 fidl_fuchsia_bluetooth_sys__common::Peer,
1925 >,
1926 D,
1927 val,
1928 decoder,
1929 _inner_offset,
1930 depth
1931 )?;
1932 } else {
1933 unreachable!()
1934 }
1935 }
1936 2 => {
1937 #[allow(irrefutable_let_patterns)]
1938 if let PeerWatcherGetNextResponse::Removed(_) = self {
1939 } else {
1941 *self = PeerWatcherGetNextResponse::Removed(fidl::new_empty!(
1943 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth__common::PeerId>,
1944 D
1945 ));
1946 }
1947 #[allow(irrefutable_let_patterns)]
1948 if let PeerWatcherGetNextResponse::Removed(ref mut val) = self {
1949 fidl::decode!(
1950 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth__common::PeerId>,
1951 D,
1952 val,
1953 decoder,
1954 _inner_offset,
1955 depth
1956 )?;
1957 } else {
1958 unreachable!()
1959 }
1960 }
1961 #[allow(deprecated)]
1962 ordinal => {
1963 for _ in 0..num_handles {
1964 decoder.drop_next_handle()?;
1965 }
1966 *self =
1967 PeerWatcherGetNextResponse::__SourceBreaking { unknown_ordinal: ordinal };
1968 }
1969 }
1970 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1971 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1972 }
1973 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1974 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1975 }
1976 Ok(())
1977 }
1978 }
1979}