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