Skip to main content

fidl_fuchsia_developer_remotecontrol_connector__common/
fidl_fuchsia_developer_remotecontrol_connector__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, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12#[repr(C)]
13pub struct ConnectorEstablishCircuitResponse {
14    pub overnet_id: u64,
15}
16
17impl fidl::Persistable for ConnectorEstablishCircuitResponse {}
18
19pub mod connector_ordinals {
20    pub const ESTABLISH_CIRCUIT: u64 = 0x34f64270f6eb7feb;
21    pub const FDOMAIN_TOOLBOX_SOCKET: u64 = 0x6fec63852eec8566;
22}
23
24mod internal {
25    use super::*;
26
27    impl fidl::encoding::ValueTypeMarker for ConnectorEstablishCircuitResponse {
28        type Borrowed<'a> = &'a Self;
29        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
30            value
31        }
32    }
33
34    unsafe impl fidl::encoding::TypeMarker for ConnectorEstablishCircuitResponse {
35        type Owned = Self;
36
37        #[inline(always)]
38        fn inline_align(_context: fidl::encoding::Context) -> usize {
39            8
40        }
41
42        #[inline(always)]
43        fn inline_size(_context: fidl::encoding::Context) -> usize {
44            8
45        }
46        #[inline(always)]
47        fn encode_is_copy() -> bool {
48            true
49        }
50
51        #[inline(always)]
52        fn decode_is_copy() -> bool {
53            true
54        }
55    }
56
57    unsafe impl<D: fidl::encoding::ResourceDialect>
58        fidl::encoding::Encode<ConnectorEstablishCircuitResponse, D>
59        for &ConnectorEstablishCircuitResponse
60    {
61        #[inline]
62        unsafe fn encode(
63            self,
64            encoder: &mut fidl::encoding::Encoder<'_, D>,
65            offset: usize,
66            _depth: fidl::encoding::Depth,
67        ) -> fidl::Result<()> {
68            encoder.debug_check_bounds::<ConnectorEstablishCircuitResponse>(offset);
69            unsafe {
70                // Copy the object into the buffer.
71                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
72                (buf_ptr as *mut ConnectorEstablishCircuitResponse)
73                    .write_unaligned((self as *const ConnectorEstablishCircuitResponse).read());
74                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
75                // done second because the memcpy will write garbage to these bytes.
76            }
77            Ok(())
78        }
79    }
80    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
81        fidl::encoding::Encode<ConnectorEstablishCircuitResponse, D> for (T0,)
82    {
83        #[inline]
84        unsafe fn encode(
85            self,
86            encoder: &mut fidl::encoding::Encoder<'_, D>,
87            offset: usize,
88            depth: fidl::encoding::Depth,
89        ) -> fidl::Result<()> {
90            encoder.debug_check_bounds::<ConnectorEstablishCircuitResponse>(offset);
91            // Zero out padding regions. There's no need to apply masks
92            // because the unmasked parts will be overwritten by fields.
93            // Write the fields.
94            self.0.encode(encoder, offset + 0, depth)?;
95            Ok(())
96        }
97    }
98
99    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
100        for ConnectorEstablishCircuitResponse
101    {
102        #[inline(always)]
103        fn new_empty() -> Self {
104            Self { overnet_id: fidl::new_empty!(u64, D) }
105        }
106
107        #[inline]
108        unsafe fn decode(
109            &mut self,
110            decoder: &mut fidl::encoding::Decoder<'_, D>,
111            offset: usize,
112            _depth: fidl::encoding::Depth,
113        ) -> fidl::Result<()> {
114            decoder.debug_check_bounds::<Self>(offset);
115            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
116            // Verify that padding bytes are zero.
117            // Copy from the buffer into the object.
118            unsafe {
119                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
120            }
121            Ok(())
122        }
123    }
124}