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<fidl_fuchsia_bluetooth_sys_common::BondingData> as fidl::encoding::ValueTypeMarker>::borrow(&self.bonds),
310 ),
311 encoder, offset, _depth
312 )
313 }
314 }
315 unsafe impl<
316 D: fidl::encoding::ResourceDialect,
317 T0: fidl::encoding::Encode<
318 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
319 D,
320 >,
321 > fidl::encoding::Encode<BondingDelegateRestoreBondsRequest, D> for (T0,)
322 {
323 #[inline]
324 unsafe fn encode(
325 self,
326 encoder: &mut fidl::encoding::Encoder<'_, D>,
327 offset: usize,
328 depth: fidl::encoding::Depth,
329 ) -> fidl::Result<()> {
330 encoder.debug_check_bounds::<BondingDelegateRestoreBondsRequest>(offset);
331 self.0.encode(encoder, offset + 0, depth)?;
335 Ok(())
336 }
337 }
338
339 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
340 for BondingDelegateRestoreBondsRequest
341 {
342 #[inline(always)]
343 fn new_empty() -> Self {
344 Self {
345 bonds: fidl::new_empty!(
346 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
347 D
348 ),
349 }
350 }
351
352 #[inline]
353 unsafe fn decode(
354 &mut self,
355 decoder: &mut fidl::encoding::Decoder<'_, D>,
356 offset: usize,
357 _depth: fidl::encoding::Depth,
358 ) -> fidl::Result<()> {
359 decoder.debug_check_bounds::<Self>(offset);
360 fidl::decode!(
362 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
363 D,
364 &mut self.bonds,
365 decoder,
366 offset + 0,
367 _depth
368 )?;
369 Ok(())
370 }
371 }
372
373 impl fidl::encoding::ValueTypeMarker for BondingDelegateRestoreBondsResponse {
374 type Borrowed<'a> = &'a Self;
375 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
376 value
377 }
378 }
379
380 unsafe impl fidl::encoding::TypeMarker for BondingDelegateRestoreBondsResponse {
381 type Owned = Self;
382
383 #[inline(always)]
384 fn inline_align(_context: fidl::encoding::Context) -> usize {
385 8
386 }
387
388 #[inline(always)]
389 fn inline_size(_context: fidl::encoding::Context) -> usize {
390 16
391 }
392 }
393
394 unsafe impl<D: fidl::encoding::ResourceDialect>
395 fidl::encoding::Encode<BondingDelegateRestoreBondsResponse, D>
396 for &BondingDelegateRestoreBondsResponse
397 {
398 #[inline]
399 unsafe fn encode(
400 self,
401 encoder: &mut fidl::encoding::Encoder<'_, D>,
402 offset: usize,
403 _depth: fidl::encoding::Depth,
404 ) -> fidl::Result<()> {
405 encoder.debug_check_bounds::<BondingDelegateRestoreBondsResponse>(offset);
406 fidl::encoding::Encode::<BondingDelegateRestoreBondsResponse, D>::encode(
408 (
409 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData> as fidl::encoding::ValueTypeMarker>::borrow(&self.errors),
410 ),
411 encoder, offset, _depth
412 )
413 }
414 }
415 unsafe impl<
416 D: fidl::encoding::ResourceDialect,
417 T0: fidl::encoding::Encode<
418 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
419 D,
420 >,
421 > fidl::encoding::Encode<BondingDelegateRestoreBondsResponse, D> for (T0,)
422 {
423 #[inline]
424 unsafe fn encode(
425 self,
426 encoder: &mut fidl::encoding::Encoder<'_, D>,
427 offset: usize,
428 depth: fidl::encoding::Depth,
429 ) -> fidl::Result<()> {
430 encoder.debug_check_bounds::<BondingDelegateRestoreBondsResponse>(offset);
431 self.0.encode(encoder, offset + 0, depth)?;
435 Ok(())
436 }
437 }
438
439 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
440 for BondingDelegateRestoreBondsResponse
441 {
442 #[inline(always)]
443 fn new_empty() -> Self {
444 Self {
445 errors: fidl::new_empty!(
446 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
447 D
448 ),
449 }
450 }
451
452 #[inline]
453 unsafe fn decode(
454 &mut self,
455 decoder: &mut fidl::encoding::Decoder<'_, D>,
456 offset: usize,
457 _depth: fidl::encoding::Depth,
458 ) -> fidl::Result<()> {
459 decoder.debug_check_bounds::<Self>(offset);
460 fidl::decode!(
462 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::BondingData>,
463 D,
464 &mut self.errors,
465 decoder,
466 offset + 0,
467 _depth
468 )?;
469 Ok(())
470 }
471 }
472
473 impl fidl::encoding::ValueTypeMarker for HostConnectRequest {
474 type Borrowed<'a> = &'a Self;
475 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
476 value
477 }
478 }
479
480 unsafe impl fidl::encoding::TypeMarker for HostConnectRequest {
481 type Owned = Self;
482
483 #[inline(always)]
484 fn inline_align(_context: fidl::encoding::Context) -> usize {
485 8
486 }
487
488 #[inline(always)]
489 fn inline_size(_context: fidl::encoding::Context) -> usize {
490 8
491 }
492 }
493
494 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostConnectRequest, D>
495 for &HostConnectRequest
496 {
497 #[inline]
498 unsafe fn encode(
499 self,
500 encoder: &mut fidl::encoding::Encoder<'_, D>,
501 offset: usize,
502 _depth: fidl::encoding::Depth,
503 ) -> fidl::Result<()> {
504 encoder.debug_check_bounds::<HostConnectRequest>(offset);
505 fidl::encoding::Encode::<HostConnectRequest, D>::encode(
507 (
508 <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
509 ),
510 encoder, offset, _depth
511 )
512 }
513 }
514 unsafe impl<
515 D: fidl::encoding::ResourceDialect,
516 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_common::PeerId, D>,
517 > fidl::encoding::Encode<HostConnectRequest, D> for (T0,)
518 {
519 #[inline]
520 unsafe fn encode(
521 self,
522 encoder: &mut fidl::encoding::Encoder<'_, D>,
523 offset: usize,
524 depth: fidl::encoding::Depth,
525 ) -> fidl::Result<()> {
526 encoder.debug_check_bounds::<HostConnectRequest>(offset);
527 self.0.encode(encoder, offset + 0, depth)?;
531 Ok(())
532 }
533 }
534
535 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostConnectRequest {
536 #[inline(always)]
537 fn new_empty() -> Self {
538 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth_common::PeerId, D) }
539 }
540
541 #[inline]
542 unsafe fn decode(
543 &mut self,
544 decoder: &mut fidl::encoding::Decoder<'_, D>,
545 offset: usize,
546 _depth: fidl::encoding::Depth,
547 ) -> fidl::Result<()> {
548 decoder.debug_check_bounds::<Self>(offset);
549 fidl::decode!(
551 fidl_fuchsia_bluetooth_common::PeerId,
552 D,
553 &mut self.id,
554 decoder,
555 offset + 0,
556 _depth
557 )?;
558 Ok(())
559 }
560 }
561
562 impl fidl::encoding::ValueTypeMarker for HostDisconnectRequest {
563 type Borrowed<'a> = &'a Self;
564 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
565 value
566 }
567 }
568
569 unsafe impl fidl::encoding::TypeMarker for HostDisconnectRequest {
570 type Owned = Self;
571
572 #[inline(always)]
573 fn inline_align(_context: fidl::encoding::Context) -> usize {
574 8
575 }
576
577 #[inline(always)]
578 fn inline_size(_context: fidl::encoding::Context) -> usize {
579 8
580 }
581 }
582
583 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostDisconnectRequest, D>
584 for &HostDisconnectRequest
585 {
586 #[inline]
587 unsafe fn encode(
588 self,
589 encoder: &mut fidl::encoding::Encoder<'_, D>,
590 offset: usize,
591 _depth: fidl::encoding::Depth,
592 ) -> fidl::Result<()> {
593 encoder.debug_check_bounds::<HostDisconnectRequest>(offset);
594 fidl::encoding::Encode::<HostDisconnectRequest, D>::encode(
596 (
597 <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
598 ),
599 encoder, offset, _depth
600 )
601 }
602 }
603 unsafe impl<
604 D: fidl::encoding::ResourceDialect,
605 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_common::PeerId, D>,
606 > fidl::encoding::Encode<HostDisconnectRequest, D> for (T0,)
607 {
608 #[inline]
609 unsafe fn encode(
610 self,
611 encoder: &mut fidl::encoding::Encoder<'_, D>,
612 offset: usize,
613 depth: fidl::encoding::Depth,
614 ) -> fidl::Result<()> {
615 encoder.debug_check_bounds::<HostDisconnectRequest>(offset);
616 self.0.encode(encoder, offset + 0, depth)?;
620 Ok(())
621 }
622 }
623
624 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostDisconnectRequest {
625 #[inline(always)]
626 fn new_empty() -> Self {
627 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth_common::PeerId, D) }
628 }
629
630 #[inline]
631 unsafe fn decode(
632 &mut self,
633 decoder: &mut fidl::encoding::Decoder<'_, D>,
634 offset: usize,
635 _depth: fidl::encoding::Depth,
636 ) -> fidl::Result<()> {
637 decoder.debug_check_bounds::<Self>(offset);
638 fidl::decode!(
640 fidl_fuchsia_bluetooth_common::PeerId,
641 D,
642 &mut self.id,
643 decoder,
644 offset + 0,
645 _depth
646 )?;
647 Ok(())
648 }
649 }
650
651 impl fidl::encoding::ValueTypeMarker for HostEnableBackgroundScanRequest {
652 type Borrowed<'a> = &'a Self;
653 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
654 value
655 }
656 }
657
658 unsafe impl fidl::encoding::TypeMarker for HostEnableBackgroundScanRequest {
659 type Owned = Self;
660
661 #[inline(always)]
662 fn inline_align(_context: fidl::encoding::Context) -> usize {
663 1
664 }
665
666 #[inline(always)]
667 fn inline_size(_context: fidl::encoding::Context) -> usize {
668 1
669 }
670 }
671
672 unsafe impl<D: fidl::encoding::ResourceDialect>
673 fidl::encoding::Encode<HostEnableBackgroundScanRequest, D>
674 for &HostEnableBackgroundScanRequest
675 {
676 #[inline]
677 unsafe fn encode(
678 self,
679 encoder: &mut fidl::encoding::Encoder<'_, D>,
680 offset: usize,
681 _depth: fidl::encoding::Depth,
682 ) -> fidl::Result<()> {
683 encoder.debug_check_bounds::<HostEnableBackgroundScanRequest>(offset);
684 fidl::encoding::Encode::<HostEnableBackgroundScanRequest, D>::encode(
686 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
687 encoder,
688 offset,
689 _depth,
690 )
691 }
692 }
693 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
694 fidl::encoding::Encode<HostEnableBackgroundScanRequest, D> for (T0,)
695 {
696 #[inline]
697 unsafe fn encode(
698 self,
699 encoder: &mut fidl::encoding::Encoder<'_, D>,
700 offset: usize,
701 depth: fidl::encoding::Depth,
702 ) -> fidl::Result<()> {
703 encoder.debug_check_bounds::<HostEnableBackgroundScanRequest>(offset);
704 self.0.encode(encoder, offset + 0, depth)?;
708 Ok(())
709 }
710 }
711
712 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
713 for HostEnableBackgroundScanRequest
714 {
715 #[inline(always)]
716 fn new_empty() -> Self {
717 Self { enabled: fidl::new_empty!(bool, D) }
718 }
719
720 #[inline]
721 unsafe fn decode(
722 &mut self,
723 decoder: &mut fidl::encoding::Decoder<'_, D>,
724 offset: usize,
725 _depth: fidl::encoding::Depth,
726 ) -> fidl::Result<()> {
727 decoder.debug_check_bounds::<Self>(offset);
728 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
730 Ok(())
731 }
732 }
733
734 impl fidl::encoding::ValueTypeMarker for HostEnablePrivacyRequest {
735 type Borrowed<'a> = &'a Self;
736 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
737 value
738 }
739 }
740
741 unsafe impl fidl::encoding::TypeMarker for HostEnablePrivacyRequest {
742 type Owned = Self;
743
744 #[inline(always)]
745 fn inline_align(_context: fidl::encoding::Context) -> usize {
746 1
747 }
748
749 #[inline(always)]
750 fn inline_size(_context: fidl::encoding::Context) -> usize {
751 1
752 }
753 }
754
755 unsafe impl<D: fidl::encoding::ResourceDialect>
756 fidl::encoding::Encode<HostEnablePrivacyRequest, D> for &HostEnablePrivacyRequest
757 {
758 #[inline]
759 unsafe fn encode(
760 self,
761 encoder: &mut fidl::encoding::Encoder<'_, D>,
762 offset: usize,
763 _depth: fidl::encoding::Depth,
764 ) -> fidl::Result<()> {
765 encoder.debug_check_bounds::<HostEnablePrivacyRequest>(offset);
766 fidl::encoding::Encode::<HostEnablePrivacyRequest, D>::encode(
768 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
769 encoder,
770 offset,
771 _depth,
772 )
773 }
774 }
775 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
776 fidl::encoding::Encode<HostEnablePrivacyRequest, D> for (T0,)
777 {
778 #[inline]
779 unsafe fn encode(
780 self,
781 encoder: &mut fidl::encoding::Encoder<'_, D>,
782 offset: usize,
783 depth: fidl::encoding::Depth,
784 ) -> fidl::Result<()> {
785 encoder.debug_check_bounds::<HostEnablePrivacyRequest>(offset);
786 self.0.encode(encoder, offset + 0, depth)?;
790 Ok(())
791 }
792 }
793
794 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
795 for HostEnablePrivacyRequest
796 {
797 #[inline(always)]
798 fn new_empty() -> Self {
799 Self { enabled: fidl::new_empty!(bool, D) }
800 }
801
802 #[inline]
803 unsafe fn decode(
804 &mut self,
805 decoder: &mut fidl::encoding::Decoder<'_, D>,
806 offset: usize,
807 _depth: fidl::encoding::Depth,
808 ) -> fidl::Result<()> {
809 decoder.debug_check_bounds::<Self>(offset);
810 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
812 Ok(())
813 }
814 }
815
816 impl fidl::encoding::ValueTypeMarker for HostForgetRequest {
817 type Borrowed<'a> = &'a Self;
818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
819 value
820 }
821 }
822
823 unsafe impl fidl::encoding::TypeMarker for HostForgetRequest {
824 type Owned = Self;
825
826 #[inline(always)]
827 fn inline_align(_context: fidl::encoding::Context) -> usize {
828 8
829 }
830
831 #[inline(always)]
832 fn inline_size(_context: fidl::encoding::Context) -> usize {
833 8
834 }
835 }
836
837 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostForgetRequest, D>
838 for &HostForgetRequest
839 {
840 #[inline]
841 unsafe fn encode(
842 self,
843 encoder: &mut fidl::encoding::Encoder<'_, D>,
844 offset: usize,
845 _depth: fidl::encoding::Depth,
846 ) -> fidl::Result<()> {
847 encoder.debug_check_bounds::<HostForgetRequest>(offset);
848 fidl::encoding::Encode::<HostForgetRequest, D>::encode(
850 (
851 <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
852 ),
853 encoder, offset, _depth
854 )
855 }
856 }
857 unsafe impl<
858 D: fidl::encoding::ResourceDialect,
859 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_common::PeerId, D>,
860 > fidl::encoding::Encode<HostForgetRequest, D> for (T0,)
861 {
862 #[inline]
863 unsafe fn encode(
864 self,
865 encoder: &mut fidl::encoding::Encoder<'_, D>,
866 offset: usize,
867 depth: fidl::encoding::Depth,
868 ) -> fidl::Result<()> {
869 encoder.debug_check_bounds::<HostForgetRequest>(offset);
870 self.0.encode(encoder, offset + 0, depth)?;
874 Ok(())
875 }
876 }
877
878 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostForgetRequest {
879 #[inline(always)]
880 fn new_empty() -> Self {
881 Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth_common::PeerId, D) }
882 }
883
884 #[inline]
885 unsafe fn decode(
886 &mut self,
887 decoder: &mut fidl::encoding::Decoder<'_, D>,
888 offset: usize,
889 _depth: fidl::encoding::Depth,
890 ) -> fidl::Result<()> {
891 decoder.debug_check_bounds::<Self>(offset);
892 fidl::decode!(
894 fidl_fuchsia_bluetooth_common::PeerId,
895 D,
896 &mut self.id,
897 decoder,
898 offset + 0,
899 _depth
900 )?;
901 Ok(())
902 }
903 }
904
905 impl fidl::encoding::ValueTypeMarker for HostPairRequest {
906 type Borrowed<'a> = &'a Self;
907 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
908 value
909 }
910 }
911
912 unsafe impl fidl::encoding::TypeMarker for HostPairRequest {
913 type Owned = Self;
914
915 #[inline(always)]
916 fn inline_align(_context: fidl::encoding::Context) -> usize {
917 8
918 }
919
920 #[inline(always)]
921 fn inline_size(_context: fidl::encoding::Context) -> usize {
922 24
923 }
924 }
925
926 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HostPairRequest, D>
927 for &HostPairRequest
928 {
929 #[inline]
930 unsafe fn encode(
931 self,
932 encoder: &mut fidl::encoding::Encoder<'_, D>,
933 offset: usize,
934 _depth: fidl::encoding::Depth,
935 ) -> fidl::Result<()> {
936 encoder.debug_check_bounds::<HostPairRequest>(offset);
937 fidl::encoding::Encode::<HostPairRequest, D>::encode(
939 (
940 <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
941 <fidl_fuchsia_bluetooth_sys_common::PairingOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
942 ),
943 encoder, offset, _depth
944 )
945 }
946 }
947 unsafe impl<
948 D: fidl::encoding::ResourceDialect,
949 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_common::PeerId, D>,
950 T1: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys_common::PairingOptions, D>,
951 > fidl::encoding::Encode<HostPairRequest, D> for (T0, T1)
952 {
953 #[inline]
954 unsafe fn encode(
955 self,
956 encoder: &mut fidl::encoding::Encoder<'_, D>,
957 offset: usize,
958 depth: fidl::encoding::Depth,
959 ) -> fidl::Result<()> {
960 encoder.debug_check_bounds::<HostPairRequest>(offset);
961 self.0.encode(encoder, offset + 0, depth)?;
965 self.1.encode(encoder, offset + 8, depth)?;
966 Ok(())
967 }
968 }
969
970 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HostPairRequest {
971 #[inline(always)]
972 fn new_empty() -> Self {
973 Self {
974 id: fidl::new_empty!(fidl_fuchsia_bluetooth_common::PeerId, D),
975 options: fidl::new_empty!(fidl_fuchsia_bluetooth_sys_common::PairingOptions, D),
976 }
977 }
978
979 #[inline]
980 unsafe fn decode(
981 &mut self,
982 decoder: &mut fidl::encoding::Decoder<'_, D>,
983 offset: usize,
984 _depth: fidl::encoding::Depth,
985 ) -> fidl::Result<()> {
986 decoder.debug_check_bounds::<Self>(offset);
987 fidl::decode!(
989 fidl_fuchsia_bluetooth_common::PeerId,
990 D,
991 &mut self.id,
992 decoder,
993 offset + 0,
994 _depth
995 )?;
996 fidl::decode!(
997 fidl_fuchsia_bluetooth_sys_common::PairingOptions,
998 D,
999 &mut self.options,
1000 decoder,
1001 offset + 8,
1002 _depth
1003 )?;
1004 Ok(())
1005 }
1006 }
1007
1008 impl fidl::encoding::ValueTypeMarker for HostSetBrEdrSecurityModeRequest {
1009 type Borrowed<'a> = &'a Self;
1010 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1011 value
1012 }
1013 }
1014
1015 unsafe impl fidl::encoding::TypeMarker for HostSetBrEdrSecurityModeRequest {
1016 type Owned = Self;
1017
1018 #[inline(always)]
1019 fn inline_align(_context: fidl::encoding::Context) -> usize {
1020 4
1021 }
1022
1023 #[inline(always)]
1024 fn inline_size(_context: fidl::encoding::Context) -> usize {
1025 4
1026 }
1027 }
1028
1029 unsafe impl<D: fidl::encoding::ResourceDialect>
1030 fidl::encoding::Encode<HostSetBrEdrSecurityModeRequest, D>
1031 for &HostSetBrEdrSecurityModeRequest
1032 {
1033 #[inline]
1034 unsafe fn encode(
1035 self,
1036 encoder: &mut fidl::encoding::Encoder<'_, D>,
1037 offset: usize,
1038 _depth: fidl::encoding::Depth,
1039 ) -> fidl::Result<()> {
1040 encoder.debug_check_bounds::<HostSetBrEdrSecurityModeRequest>(offset);
1041 fidl::encoding::Encode::<HostSetBrEdrSecurityModeRequest, D>::encode(
1043 (
1044 <fidl_fuchsia_bluetooth_sys_common::BrEdrSecurityMode as fidl::encoding::ValueTypeMarker>::borrow(&self.bredr_security_mode),
1045 ),
1046 encoder, offset, _depth
1047 )
1048 }
1049 }
1050 unsafe impl<
1051 D: fidl::encoding::ResourceDialect,
1052 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys_common::BrEdrSecurityMode, D>,
1053 > fidl::encoding::Encode<HostSetBrEdrSecurityModeRequest, D> for (T0,)
1054 {
1055 #[inline]
1056 unsafe fn encode(
1057 self,
1058 encoder: &mut fidl::encoding::Encoder<'_, D>,
1059 offset: usize,
1060 depth: fidl::encoding::Depth,
1061 ) -> fidl::Result<()> {
1062 encoder.debug_check_bounds::<HostSetBrEdrSecurityModeRequest>(offset);
1063 self.0.encode(encoder, offset + 0, depth)?;
1067 Ok(())
1068 }
1069 }
1070
1071 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1072 for HostSetBrEdrSecurityModeRequest
1073 {
1074 #[inline(always)]
1075 fn new_empty() -> Self {
1076 Self {
1077 bredr_security_mode: fidl::new_empty!(
1078 fidl_fuchsia_bluetooth_sys_common::BrEdrSecurityMode,
1079 D
1080 ),
1081 }
1082 }
1083
1084 #[inline]
1085 unsafe fn decode(
1086 &mut self,
1087 decoder: &mut fidl::encoding::Decoder<'_, D>,
1088 offset: usize,
1089 _depth: fidl::encoding::Depth,
1090 ) -> fidl::Result<()> {
1091 decoder.debug_check_bounds::<Self>(offset);
1092 fidl::decode!(
1094 fidl_fuchsia_bluetooth_sys_common::BrEdrSecurityMode,
1095 D,
1096 &mut self.bredr_security_mode,
1097 decoder,
1098 offset + 0,
1099 _depth
1100 )?;
1101 Ok(())
1102 }
1103 }
1104
1105 impl fidl::encoding::ValueTypeMarker for HostSetConnectableRequest {
1106 type Borrowed<'a> = &'a Self;
1107 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1108 value
1109 }
1110 }
1111
1112 unsafe impl fidl::encoding::TypeMarker for HostSetConnectableRequest {
1113 type Owned = Self;
1114
1115 #[inline(always)]
1116 fn inline_align(_context: fidl::encoding::Context) -> usize {
1117 1
1118 }
1119
1120 #[inline(always)]
1121 fn inline_size(_context: fidl::encoding::Context) -> usize {
1122 1
1123 }
1124 }
1125
1126 unsafe impl<D: fidl::encoding::ResourceDialect>
1127 fidl::encoding::Encode<HostSetConnectableRequest, D> for &HostSetConnectableRequest
1128 {
1129 #[inline]
1130 unsafe fn encode(
1131 self,
1132 encoder: &mut fidl::encoding::Encoder<'_, D>,
1133 offset: usize,
1134 _depth: fidl::encoding::Depth,
1135 ) -> fidl::Result<()> {
1136 encoder.debug_check_bounds::<HostSetConnectableRequest>(offset);
1137 fidl::encoding::Encode::<HostSetConnectableRequest, D>::encode(
1139 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1140 encoder,
1141 offset,
1142 _depth,
1143 )
1144 }
1145 }
1146 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1147 fidl::encoding::Encode<HostSetConnectableRequest, D> for (T0,)
1148 {
1149 #[inline]
1150 unsafe fn encode(
1151 self,
1152 encoder: &mut fidl::encoding::Encoder<'_, D>,
1153 offset: usize,
1154 depth: fidl::encoding::Depth,
1155 ) -> fidl::Result<()> {
1156 encoder.debug_check_bounds::<HostSetConnectableRequest>(offset);
1157 self.0.encode(encoder, offset + 0, depth)?;
1161 Ok(())
1162 }
1163 }
1164
1165 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1166 for HostSetConnectableRequest
1167 {
1168 #[inline(always)]
1169 fn new_empty() -> Self {
1170 Self { enabled: fidl::new_empty!(bool, D) }
1171 }
1172
1173 #[inline]
1174 unsafe fn decode(
1175 &mut self,
1176 decoder: &mut fidl::encoding::Decoder<'_, D>,
1177 offset: usize,
1178 _depth: fidl::encoding::Depth,
1179 ) -> fidl::Result<()> {
1180 decoder.debug_check_bounds::<Self>(offset);
1181 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1183 Ok(())
1184 }
1185 }
1186
1187 impl fidl::encoding::ValueTypeMarker for HostSetDeviceClassRequest {
1188 type Borrowed<'a> = &'a Self;
1189 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1190 value
1191 }
1192 }
1193
1194 unsafe impl fidl::encoding::TypeMarker for HostSetDeviceClassRequest {
1195 type Owned = Self;
1196
1197 #[inline(always)]
1198 fn inline_align(_context: fidl::encoding::Context) -> usize {
1199 4
1200 }
1201
1202 #[inline(always)]
1203 fn inline_size(_context: fidl::encoding::Context) -> usize {
1204 4
1205 }
1206 }
1207
1208 unsafe impl<D: fidl::encoding::ResourceDialect>
1209 fidl::encoding::Encode<HostSetDeviceClassRequest, D> for &HostSetDeviceClassRequest
1210 {
1211 #[inline]
1212 unsafe fn encode(
1213 self,
1214 encoder: &mut fidl::encoding::Encoder<'_, D>,
1215 offset: usize,
1216 _depth: fidl::encoding::Depth,
1217 ) -> fidl::Result<()> {
1218 encoder.debug_check_bounds::<HostSetDeviceClassRequest>(offset);
1219 fidl::encoding::Encode::<HostSetDeviceClassRequest, D>::encode(
1221 (
1222 <fidl_fuchsia_bluetooth_common::DeviceClass as fidl::encoding::ValueTypeMarker>::borrow(&self.device_class),
1223 ),
1224 encoder, offset, _depth
1225 )
1226 }
1227 }
1228 unsafe impl<
1229 D: fidl::encoding::ResourceDialect,
1230 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_common::DeviceClass, D>,
1231 > fidl::encoding::Encode<HostSetDeviceClassRequest, D> for (T0,)
1232 {
1233 #[inline]
1234 unsafe fn encode(
1235 self,
1236 encoder: &mut fidl::encoding::Encoder<'_, D>,
1237 offset: usize,
1238 depth: fidl::encoding::Depth,
1239 ) -> fidl::Result<()> {
1240 encoder.debug_check_bounds::<HostSetDeviceClassRequest>(offset);
1241 self.0.encode(encoder, offset + 0, depth)?;
1245 Ok(())
1246 }
1247 }
1248
1249 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1250 for HostSetDeviceClassRequest
1251 {
1252 #[inline(always)]
1253 fn new_empty() -> Self {
1254 Self { device_class: fidl::new_empty!(fidl_fuchsia_bluetooth_common::DeviceClass, D) }
1255 }
1256
1257 #[inline]
1258 unsafe fn decode(
1259 &mut self,
1260 decoder: &mut fidl::encoding::Decoder<'_, D>,
1261 offset: usize,
1262 _depth: fidl::encoding::Depth,
1263 ) -> fidl::Result<()> {
1264 decoder.debug_check_bounds::<Self>(offset);
1265 fidl::decode!(
1267 fidl_fuchsia_bluetooth_common::DeviceClass,
1268 D,
1269 &mut self.device_class,
1270 decoder,
1271 offset + 0,
1272 _depth
1273 )?;
1274 Ok(())
1275 }
1276 }
1277
1278 impl fidl::encoding::ValueTypeMarker for HostSetDiscoverableRequest {
1279 type Borrowed<'a> = &'a Self;
1280 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1281 value
1282 }
1283 }
1284
1285 unsafe impl fidl::encoding::TypeMarker for HostSetDiscoverableRequest {
1286 type Owned = Self;
1287
1288 #[inline(always)]
1289 fn inline_align(_context: fidl::encoding::Context) -> usize {
1290 1
1291 }
1292
1293 #[inline(always)]
1294 fn inline_size(_context: fidl::encoding::Context) -> usize {
1295 1
1296 }
1297 }
1298
1299 unsafe impl<D: fidl::encoding::ResourceDialect>
1300 fidl::encoding::Encode<HostSetDiscoverableRequest, D> for &HostSetDiscoverableRequest
1301 {
1302 #[inline]
1303 unsafe fn encode(
1304 self,
1305 encoder: &mut fidl::encoding::Encoder<'_, D>,
1306 offset: usize,
1307 _depth: fidl::encoding::Depth,
1308 ) -> fidl::Result<()> {
1309 encoder.debug_check_bounds::<HostSetDiscoverableRequest>(offset);
1310 fidl::encoding::Encode::<HostSetDiscoverableRequest, D>::encode(
1312 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
1313 encoder,
1314 offset,
1315 _depth,
1316 )
1317 }
1318 }
1319 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1320 fidl::encoding::Encode<HostSetDiscoverableRequest, D> for (T0,)
1321 {
1322 #[inline]
1323 unsafe fn encode(
1324 self,
1325 encoder: &mut fidl::encoding::Encoder<'_, D>,
1326 offset: usize,
1327 depth: fidl::encoding::Depth,
1328 ) -> fidl::Result<()> {
1329 encoder.debug_check_bounds::<HostSetDiscoverableRequest>(offset);
1330 self.0.encode(encoder, offset + 0, depth)?;
1334 Ok(())
1335 }
1336 }
1337
1338 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1339 for HostSetDiscoverableRequest
1340 {
1341 #[inline(always)]
1342 fn new_empty() -> Self {
1343 Self { enabled: fidl::new_empty!(bool, D) }
1344 }
1345
1346 #[inline]
1347 unsafe fn decode(
1348 &mut self,
1349 decoder: &mut fidl::encoding::Decoder<'_, D>,
1350 offset: usize,
1351 _depth: fidl::encoding::Depth,
1352 ) -> fidl::Result<()> {
1353 decoder.debug_check_bounds::<Self>(offset);
1354 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
1356 Ok(())
1357 }
1358 }
1359
1360 impl fidl::encoding::ValueTypeMarker for HostSetLeSecurityModeRequest {
1361 type Borrowed<'a> = &'a Self;
1362 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1363 value
1364 }
1365 }
1366
1367 unsafe impl fidl::encoding::TypeMarker for HostSetLeSecurityModeRequest {
1368 type Owned = Self;
1369
1370 #[inline(always)]
1371 fn inline_align(_context: fidl::encoding::Context) -> usize {
1372 4
1373 }
1374
1375 #[inline(always)]
1376 fn inline_size(_context: fidl::encoding::Context) -> usize {
1377 4
1378 }
1379 }
1380
1381 unsafe impl<D: fidl::encoding::ResourceDialect>
1382 fidl::encoding::Encode<HostSetLeSecurityModeRequest, D> for &HostSetLeSecurityModeRequest
1383 {
1384 #[inline]
1385 unsafe fn encode(
1386 self,
1387 encoder: &mut fidl::encoding::Encoder<'_, D>,
1388 offset: usize,
1389 _depth: fidl::encoding::Depth,
1390 ) -> fidl::Result<()> {
1391 encoder.debug_check_bounds::<HostSetLeSecurityModeRequest>(offset);
1392 fidl::encoding::Encode::<HostSetLeSecurityModeRequest, D>::encode(
1394 (
1395 <fidl_fuchsia_bluetooth_sys_common::LeSecurityMode as fidl::encoding::ValueTypeMarker>::borrow(&self.le_security_mode),
1396 ),
1397 encoder, offset, _depth
1398 )
1399 }
1400 }
1401 unsafe impl<
1402 D: fidl::encoding::ResourceDialect,
1403 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys_common::LeSecurityMode, D>,
1404 > fidl::encoding::Encode<HostSetLeSecurityModeRequest, D> for (T0,)
1405 {
1406 #[inline]
1407 unsafe fn encode(
1408 self,
1409 encoder: &mut fidl::encoding::Encoder<'_, D>,
1410 offset: usize,
1411 depth: fidl::encoding::Depth,
1412 ) -> fidl::Result<()> {
1413 encoder.debug_check_bounds::<HostSetLeSecurityModeRequest>(offset);
1414 self.0.encode(encoder, offset + 0, depth)?;
1418 Ok(())
1419 }
1420 }
1421
1422 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1423 for HostSetLeSecurityModeRequest
1424 {
1425 #[inline(always)]
1426 fn new_empty() -> Self {
1427 Self {
1428 le_security_mode: fidl::new_empty!(
1429 fidl_fuchsia_bluetooth_sys_common::LeSecurityMode,
1430 D
1431 ),
1432 }
1433 }
1434
1435 #[inline]
1436 unsafe fn decode(
1437 &mut self,
1438 decoder: &mut fidl::encoding::Decoder<'_, D>,
1439 offset: usize,
1440 _depth: fidl::encoding::Depth,
1441 ) -> fidl::Result<()> {
1442 decoder.debug_check_bounds::<Self>(offset);
1443 fidl::decode!(
1445 fidl_fuchsia_bluetooth_sys_common::LeSecurityMode,
1446 D,
1447 &mut self.le_security_mode,
1448 decoder,
1449 offset + 0,
1450 _depth
1451 )?;
1452 Ok(())
1453 }
1454 }
1455
1456 impl fidl::encoding::ValueTypeMarker for HostSetLocalNameRequest {
1457 type Borrowed<'a> = &'a Self;
1458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1459 value
1460 }
1461 }
1462
1463 unsafe impl fidl::encoding::TypeMarker for HostSetLocalNameRequest {
1464 type Owned = Self;
1465
1466 #[inline(always)]
1467 fn inline_align(_context: fidl::encoding::Context) -> usize {
1468 8
1469 }
1470
1471 #[inline(always)]
1472 fn inline_size(_context: fidl::encoding::Context) -> usize {
1473 16
1474 }
1475 }
1476
1477 unsafe impl<D: fidl::encoding::ResourceDialect>
1478 fidl::encoding::Encode<HostSetLocalNameRequest, D> for &HostSetLocalNameRequest
1479 {
1480 #[inline]
1481 unsafe fn encode(
1482 self,
1483 encoder: &mut fidl::encoding::Encoder<'_, D>,
1484 offset: usize,
1485 _depth: fidl::encoding::Depth,
1486 ) -> fidl::Result<()> {
1487 encoder.debug_check_bounds::<HostSetLocalNameRequest>(offset);
1488 fidl::encoding::Encode::<HostSetLocalNameRequest, D>::encode(
1490 (<fidl::encoding::BoundedString<248> as fidl::encoding::ValueTypeMarker>::borrow(
1491 &self.local_name,
1492 ),),
1493 encoder,
1494 offset,
1495 _depth,
1496 )
1497 }
1498 }
1499 unsafe impl<
1500 D: fidl::encoding::ResourceDialect,
1501 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<248>, D>,
1502 > fidl::encoding::Encode<HostSetLocalNameRequest, D> for (T0,)
1503 {
1504 #[inline]
1505 unsafe fn encode(
1506 self,
1507 encoder: &mut fidl::encoding::Encoder<'_, D>,
1508 offset: usize,
1509 depth: fidl::encoding::Depth,
1510 ) -> fidl::Result<()> {
1511 encoder.debug_check_bounds::<HostSetLocalNameRequest>(offset);
1512 self.0.encode(encoder, offset + 0, depth)?;
1516 Ok(())
1517 }
1518 }
1519
1520 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1521 for HostSetLocalNameRequest
1522 {
1523 #[inline(always)]
1524 fn new_empty() -> Self {
1525 Self { local_name: fidl::new_empty!(fidl::encoding::BoundedString<248>, D) }
1526 }
1527
1528 #[inline]
1529 unsafe fn decode(
1530 &mut self,
1531 decoder: &mut fidl::encoding::Decoder<'_, D>,
1532 offset: usize,
1533 _depth: fidl::encoding::Depth,
1534 ) -> fidl::Result<()> {
1535 decoder.debug_check_bounds::<Self>(offset);
1536 fidl::decode!(
1538 fidl::encoding::BoundedString<248>,
1539 D,
1540 &mut self.local_name,
1541 decoder,
1542 offset + 0,
1543 _depth
1544 )?;
1545 Ok(())
1546 }
1547 }
1548
1549 impl fidl::encoding::ValueTypeMarker for HostWatchStateResponse {
1550 type Borrowed<'a> = &'a Self;
1551 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1552 value
1553 }
1554 }
1555
1556 unsafe impl fidl::encoding::TypeMarker for HostWatchStateResponse {
1557 type Owned = Self;
1558
1559 #[inline(always)]
1560 fn inline_align(_context: fidl::encoding::Context) -> usize {
1561 8
1562 }
1563
1564 #[inline(always)]
1565 fn inline_size(_context: fidl::encoding::Context) -> usize {
1566 16
1567 }
1568 }
1569
1570 unsafe impl<D: fidl::encoding::ResourceDialect>
1571 fidl::encoding::Encode<HostWatchStateResponse, D> for &HostWatchStateResponse
1572 {
1573 #[inline]
1574 unsafe fn encode(
1575 self,
1576 encoder: &mut fidl::encoding::Encoder<'_, D>,
1577 offset: usize,
1578 _depth: fidl::encoding::Depth,
1579 ) -> fidl::Result<()> {
1580 encoder.debug_check_bounds::<HostWatchStateResponse>(offset);
1581 fidl::encoding::Encode::<HostWatchStateResponse, D>::encode(
1583 (
1584 <fidl_fuchsia_bluetooth_sys_common::HostInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1585 ),
1586 encoder, offset, _depth
1587 )
1588 }
1589 }
1590 unsafe impl<
1591 D: fidl::encoding::ResourceDialect,
1592 T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth_sys_common::HostInfo, D>,
1593 > fidl::encoding::Encode<HostWatchStateResponse, D> for (T0,)
1594 {
1595 #[inline]
1596 unsafe fn encode(
1597 self,
1598 encoder: &mut fidl::encoding::Encoder<'_, D>,
1599 offset: usize,
1600 depth: fidl::encoding::Depth,
1601 ) -> fidl::Result<()> {
1602 encoder.debug_check_bounds::<HostWatchStateResponse>(offset);
1603 self.0.encode(encoder, offset + 0, depth)?;
1607 Ok(())
1608 }
1609 }
1610
1611 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1612 for HostWatchStateResponse
1613 {
1614 #[inline(always)]
1615 fn new_empty() -> Self {
1616 Self { info: fidl::new_empty!(fidl_fuchsia_bluetooth_sys_common::HostInfo, D) }
1617 }
1618
1619 #[inline]
1620 unsafe fn decode(
1621 &mut self,
1622 decoder: &mut fidl::encoding::Decoder<'_, D>,
1623 offset: usize,
1624 _depth: fidl::encoding::Depth,
1625 ) -> fidl::Result<()> {
1626 decoder.debug_check_bounds::<Self>(offset);
1627 fidl::decode!(
1629 fidl_fuchsia_bluetooth_sys_common::HostInfo,
1630 D,
1631 &mut self.info,
1632 decoder,
1633 offset + 0,
1634 _depth
1635 )?;
1636 Ok(())
1637 }
1638 }
1639
1640 impl fidl::encoding::ValueTypeMarker for BondingDelegateWatchBondsResponse {
1641 type Borrowed<'a> = &'a Self;
1642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1643 value
1644 }
1645 }
1646
1647 unsafe impl fidl::encoding::TypeMarker for BondingDelegateWatchBondsResponse {
1648 type Owned = Self;
1649
1650 #[inline(always)]
1651 fn inline_align(_context: fidl::encoding::Context) -> usize {
1652 8
1653 }
1654
1655 #[inline(always)]
1656 fn inline_size(_context: fidl::encoding::Context) -> usize {
1657 16
1658 }
1659 }
1660
1661 unsafe impl<D: fidl::encoding::ResourceDialect>
1662 fidl::encoding::Encode<BondingDelegateWatchBondsResponse, D>
1663 for &BondingDelegateWatchBondsResponse
1664 {
1665 #[inline]
1666 unsafe fn encode(
1667 self,
1668 encoder: &mut fidl::encoding::Encoder<'_, D>,
1669 offset: usize,
1670 _depth: fidl::encoding::Depth,
1671 ) -> fidl::Result<()> {
1672 encoder.debug_check_bounds::<BondingDelegateWatchBondsResponse>(offset);
1673 encoder.write_num::<u64>(self.ordinal(), offset);
1674 match self {
1675 BondingDelegateWatchBondsResponse::Updated(ref val) => {
1676 fidl::encoding::encode_in_envelope::<fidl_fuchsia_bluetooth_sys_common::BondingData, D>(
1677 <fidl_fuchsia_bluetooth_sys_common::BondingData as fidl::encoding::ValueTypeMarker>::borrow(val),
1678 encoder, offset + 8, _depth
1679 )
1680 }
1681 BondingDelegateWatchBondsResponse::Removed(ref val) => {
1682 fidl::encoding::encode_in_envelope::<fidl_fuchsia_bluetooth_common::PeerId, D>(
1683 <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(val),
1684 encoder, offset + 8, _depth
1685 )
1686 }
1687 BondingDelegateWatchBondsResponse::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1688 }
1689 }
1690 }
1691
1692 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1693 for BondingDelegateWatchBondsResponse
1694 {
1695 #[inline(always)]
1696 fn new_empty() -> Self {
1697 Self::__SourceBreaking { unknown_ordinal: 0 }
1698 }
1699
1700 #[inline]
1701 unsafe fn decode(
1702 &mut self,
1703 decoder: &mut fidl::encoding::Decoder<'_, D>,
1704 offset: usize,
1705 mut depth: fidl::encoding::Depth,
1706 ) -> fidl::Result<()> {
1707 decoder.debug_check_bounds::<Self>(offset);
1708 #[allow(unused_variables)]
1709 let next_out_of_line = decoder.next_out_of_line();
1710 let handles_before = decoder.remaining_handles();
1711 let (ordinal, inlined, num_bytes, num_handles) =
1712 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1713
1714 let member_inline_size = match ordinal {
1715 1 => <fidl_fuchsia_bluetooth_sys_common::BondingData as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1716 2 => <fidl_fuchsia_bluetooth_common::PeerId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1717 0 => return Err(fidl::Error::UnknownUnionTag),
1718 _ => num_bytes as usize,
1719 };
1720
1721 if inlined != (member_inline_size <= 4) {
1722 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1723 }
1724 let _inner_offset;
1725 if inlined {
1726 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1727 _inner_offset = offset + 8;
1728 } else {
1729 depth.increment()?;
1730 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1731 }
1732 match ordinal {
1733 1 => {
1734 #[allow(irrefutable_let_patterns)]
1735 if let BondingDelegateWatchBondsResponse::Updated(_) = self {
1736 } else {
1738 *self = BondingDelegateWatchBondsResponse::Updated(fidl::new_empty!(
1740 fidl_fuchsia_bluetooth_sys_common::BondingData,
1741 D
1742 ));
1743 }
1744 #[allow(irrefutable_let_patterns)]
1745 if let BondingDelegateWatchBondsResponse::Updated(ref mut val) = self {
1746 fidl::decode!(
1747 fidl_fuchsia_bluetooth_sys_common::BondingData,
1748 D,
1749 val,
1750 decoder,
1751 _inner_offset,
1752 depth
1753 )?;
1754 } else {
1755 unreachable!()
1756 }
1757 }
1758 2 => {
1759 #[allow(irrefutable_let_patterns)]
1760 if let BondingDelegateWatchBondsResponse::Removed(_) = self {
1761 } else {
1763 *self = BondingDelegateWatchBondsResponse::Removed(fidl::new_empty!(
1765 fidl_fuchsia_bluetooth_common::PeerId,
1766 D
1767 ));
1768 }
1769 #[allow(irrefutable_let_patterns)]
1770 if let BondingDelegateWatchBondsResponse::Removed(ref mut val) = self {
1771 fidl::decode!(
1772 fidl_fuchsia_bluetooth_common::PeerId,
1773 D,
1774 val,
1775 decoder,
1776 _inner_offset,
1777 depth
1778 )?;
1779 } else {
1780 unreachable!()
1781 }
1782 }
1783 #[allow(deprecated)]
1784 ordinal => {
1785 for _ in 0..num_handles {
1786 decoder.drop_next_handle()?;
1787 }
1788 *self = BondingDelegateWatchBondsResponse::__SourceBreaking {
1789 unknown_ordinal: ordinal,
1790 };
1791 }
1792 }
1793 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1794 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1795 }
1796 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1797 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1798 }
1799 Ok(())
1800 }
1801 }
1802
1803 impl fidl::encoding::ValueTypeMarker for PeerWatcherGetNextResponse {
1804 type Borrowed<'a> = &'a Self;
1805 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1806 value
1807 }
1808 }
1809
1810 unsafe impl fidl::encoding::TypeMarker for PeerWatcherGetNextResponse {
1811 type Owned = Self;
1812
1813 #[inline(always)]
1814 fn inline_align(_context: fidl::encoding::Context) -> usize {
1815 8
1816 }
1817
1818 #[inline(always)]
1819 fn inline_size(_context: fidl::encoding::Context) -> usize {
1820 16
1821 }
1822 }
1823
1824 unsafe impl<D: fidl::encoding::ResourceDialect>
1825 fidl::encoding::Encode<PeerWatcherGetNextResponse, D> for &PeerWatcherGetNextResponse
1826 {
1827 #[inline]
1828 unsafe fn encode(
1829 self,
1830 encoder: &mut fidl::encoding::Encoder<'_, D>,
1831 offset: usize,
1832 _depth: fidl::encoding::Depth,
1833 ) -> fidl::Result<()> {
1834 encoder.debug_check_bounds::<PeerWatcherGetNextResponse>(offset);
1835 encoder.write_num::<u64>(self.ordinal(), offset);
1836 match self {
1837 PeerWatcherGetNextResponse::Updated(ref val) => {
1838 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::Peer>, D>(
1839 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::Peer> as fidl::encoding::ValueTypeMarker>::borrow(val),
1840 encoder, offset + 8, _depth
1841 )
1842 }
1843 PeerWatcherGetNextResponse::Removed(ref val) => {
1844 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_common::PeerId>, D>(
1845 <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_common::PeerId> as fidl::encoding::ValueTypeMarker>::borrow(val),
1846 encoder, offset + 8, _depth
1847 )
1848 }
1849 PeerWatcherGetNextResponse::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
1850 }
1851 }
1852 }
1853
1854 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1855 for PeerWatcherGetNextResponse
1856 {
1857 #[inline(always)]
1858 fn new_empty() -> Self {
1859 Self::__SourceBreaking { unknown_ordinal: 0 }
1860 }
1861
1862 #[inline]
1863 unsafe fn decode(
1864 &mut self,
1865 decoder: &mut fidl::encoding::Decoder<'_, D>,
1866 offset: usize,
1867 mut depth: fidl::encoding::Depth,
1868 ) -> fidl::Result<()> {
1869 decoder.debug_check_bounds::<Self>(offset);
1870 #[allow(unused_variables)]
1871 let next_out_of_line = decoder.next_out_of_line();
1872 let handles_before = decoder.remaining_handles();
1873 let (ordinal, inlined, num_bytes, num_handles) =
1874 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1875
1876 let member_inline_size = match ordinal {
1877 1 => <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_sys_common::Peer> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1878 2 => <fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_common::PeerId> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1879 0 => return Err(fidl::Error::UnknownUnionTag),
1880 _ => num_bytes as usize,
1881 };
1882
1883 if inlined != (member_inline_size <= 4) {
1884 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1885 }
1886 let _inner_offset;
1887 if inlined {
1888 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1889 _inner_offset = offset + 8;
1890 } else {
1891 depth.increment()?;
1892 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1893 }
1894 match ordinal {
1895 1 => {
1896 #[allow(irrefutable_let_patterns)]
1897 if let PeerWatcherGetNextResponse::Updated(_) = self {
1898 } else {
1900 *self = PeerWatcherGetNextResponse::Updated(fidl::new_empty!(
1902 fidl::encoding::UnboundedVector<
1903 fidl_fuchsia_bluetooth_sys_common::Peer,
1904 >,
1905 D
1906 ));
1907 }
1908 #[allow(irrefutable_let_patterns)]
1909 if let PeerWatcherGetNextResponse::Updated(ref mut val) = self {
1910 fidl::decode!(
1911 fidl::encoding::UnboundedVector<
1912 fidl_fuchsia_bluetooth_sys_common::Peer,
1913 >,
1914 D,
1915 val,
1916 decoder,
1917 _inner_offset,
1918 depth
1919 )?;
1920 } else {
1921 unreachable!()
1922 }
1923 }
1924 2 => {
1925 #[allow(irrefutable_let_patterns)]
1926 if let PeerWatcherGetNextResponse::Removed(_) = self {
1927 } else {
1929 *self = PeerWatcherGetNextResponse::Removed(fidl::new_empty!(
1931 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_common::PeerId>,
1932 D
1933 ));
1934 }
1935 #[allow(irrefutable_let_patterns)]
1936 if let PeerWatcherGetNextResponse::Removed(ref mut val) = self {
1937 fidl::decode!(
1938 fidl::encoding::UnboundedVector<fidl_fuchsia_bluetooth_common::PeerId>,
1939 D,
1940 val,
1941 decoder,
1942 _inner_offset,
1943 depth
1944 )?;
1945 } else {
1946 unreachable!()
1947 }
1948 }
1949 #[allow(deprecated)]
1950 ordinal => {
1951 for _ in 0..num_handles {
1952 decoder.drop_next_handle()?;
1953 }
1954 *self =
1955 PeerWatcherGetNextResponse::__SourceBreaking { unknown_ordinal: ordinal };
1956 }
1957 }
1958 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1959 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1960 }
1961 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1962 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1963 }
1964 Ok(())
1965 }
1966 }
1967}