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