fidl_fuchsia_bluetooth_fastpair__common/
fidl_fuchsia_bluetooth_fastpair__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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 ProviderWatcherOnPairingCompleteRequest {
13    pub id: fidl_fuchsia_bluetooth__common::PeerId,
14}
15
16impl fidl::Persistable for ProviderWatcherOnPairingCompleteRequest {}
17
18mod internal {
19    use super::*;
20
21    impl fidl::encoding::ValueTypeMarker for ProviderWatcherOnPairingCompleteRequest {
22        type Borrowed<'a> = &'a Self;
23        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24            value
25        }
26    }
27
28    unsafe impl fidl::encoding::TypeMarker for ProviderWatcherOnPairingCompleteRequest {
29        type Owned = Self;
30
31        #[inline(always)]
32        fn inline_align(_context: fidl::encoding::Context) -> usize {
33            8
34        }
35
36        #[inline(always)]
37        fn inline_size(_context: fidl::encoding::Context) -> usize {
38            8
39        }
40    }
41
42    unsafe impl<D: fidl::encoding::ResourceDialect>
43        fidl::encoding::Encode<ProviderWatcherOnPairingCompleteRequest, D>
44        for &ProviderWatcherOnPairingCompleteRequest
45    {
46        #[inline]
47        unsafe fn encode(
48            self,
49            encoder: &mut fidl::encoding::Encoder<'_, D>,
50            offset: usize,
51            _depth: fidl::encoding::Depth,
52        ) -> fidl::Result<()> {
53            encoder.debug_check_bounds::<ProviderWatcherOnPairingCompleteRequest>(offset);
54            // Delegate to tuple encoding.
55            fidl::encoding::Encode::<ProviderWatcherOnPairingCompleteRequest, D>::encode(
56                (
57                    <fidl_fuchsia_bluetooth__common::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
58                ),
59                encoder, offset, _depth
60            )
61        }
62    }
63    unsafe impl<
64            D: fidl::encoding::ResourceDialect,
65            T0: fidl::encoding::Encode<fidl_fuchsia_bluetooth__common::PeerId, D>,
66        > fidl::encoding::Encode<ProviderWatcherOnPairingCompleteRequest, D> for (T0,)
67    {
68        #[inline]
69        unsafe fn encode(
70            self,
71            encoder: &mut fidl::encoding::Encoder<'_, D>,
72            offset: usize,
73            depth: fidl::encoding::Depth,
74        ) -> fidl::Result<()> {
75            encoder.debug_check_bounds::<ProviderWatcherOnPairingCompleteRequest>(offset);
76            // Zero out padding regions. There's no need to apply masks
77            // because the unmasked parts will be overwritten by fields.
78            // Write the fields.
79            self.0.encode(encoder, offset + 0, depth)?;
80            Ok(())
81        }
82    }
83
84    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
85        for ProviderWatcherOnPairingCompleteRequest
86    {
87        #[inline(always)]
88        fn new_empty() -> Self {
89            Self { id: fidl::new_empty!(fidl_fuchsia_bluetooth__common::PeerId, D) }
90        }
91
92        #[inline]
93        unsafe fn decode(
94            &mut self,
95            decoder: &mut fidl::encoding::Decoder<'_, D>,
96            offset: usize,
97            _depth: fidl::encoding::Depth,
98        ) -> fidl::Result<()> {
99            decoder.debug_check_bounds::<Self>(offset);
100            // Verify that padding bytes are zero.
101            fidl::decode!(
102                fidl_fuchsia_bluetooth__common::PeerId,
103                D,
104                &mut self.id,
105                decoder,
106                offset + 0,
107                _depth
108            )?;
109            Ok(())
110        }
111    }
112}