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