fidl_test_systemactivitygovernor__common/
fidl_test_systemactivitygovernor__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, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct RealmFactoryCreateRealmExtResponse {
13    pub activity_governor_moniker: String,
14}
15
16impl fidl::Persistable for RealmFactoryCreateRealmExtResponse {}
17
18#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct RealmFactoryCreateRealmResponse {
20    pub activity_governor_moniker: String,
21}
22
23impl fidl::Persistable for RealmFactoryCreateRealmResponse {}
24
25pub mod realm_factory_ordinals {
26    pub const CREATE_REALM: u64 = 0x3fcb27aa634a2df3;
27    pub const CREATE_REALM_EXT: u64 = 0x63a655ff630a0db0;
28}
29
30mod internal {
31    use super::*;
32
33    impl fidl::encoding::ValueTypeMarker for RealmFactoryCreateRealmExtResponse {
34        type Borrowed<'a> = &'a Self;
35        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
36            value
37        }
38    }
39
40    unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmExtResponse {
41        type Owned = Self;
42
43        #[inline(always)]
44        fn inline_align(_context: fidl::encoding::Context) -> usize {
45            8
46        }
47
48        #[inline(always)]
49        fn inline_size(_context: fidl::encoding::Context) -> usize {
50            16
51        }
52    }
53
54    unsafe impl<D: fidl::encoding::ResourceDialect>
55        fidl::encoding::Encode<RealmFactoryCreateRealmExtResponse, D>
56        for &RealmFactoryCreateRealmExtResponse
57    {
58        #[inline]
59        unsafe fn encode(
60            self,
61            encoder: &mut fidl::encoding::Encoder<'_, D>,
62            offset: usize,
63            _depth: fidl::encoding::Depth,
64        ) -> fidl::Result<()> {
65            encoder.debug_check_bounds::<RealmFactoryCreateRealmExtResponse>(offset);
66            // Delegate to tuple encoding.
67            fidl::encoding::Encode::<RealmFactoryCreateRealmExtResponse, D>::encode(
68                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
69                    &self.activity_governor_moniker,
70                ),),
71                encoder,
72                offset,
73                _depth,
74            )
75        }
76    }
77    unsafe impl<
78            D: fidl::encoding::ResourceDialect,
79            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
80        > fidl::encoding::Encode<RealmFactoryCreateRealmExtResponse, D> for (T0,)
81    {
82        #[inline]
83        unsafe fn encode(
84            self,
85            encoder: &mut fidl::encoding::Encoder<'_, D>,
86            offset: usize,
87            depth: fidl::encoding::Depth,
88        ) -> fidl::Result<()> {
89            encoder.debug_check_bounds::<RealmFactoryCreateRealmExtResponse>(offset);
90            // Zero out padding regions. There's no need to apply masks
91            // because the unmasked parts will be overwritten by fields.
92            // Write the fields.
93            self.0.encode(encoder, offset + 0, depth)?;
94            Ok(())
95        }
96    }
97
98    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
99        for RealmFactoryCreateRealmExtResponse
100    {
101        #[inline(always)]
102        fn new_empty() -> Self {
103            Self { activity_governor_moniker: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
104        }
105
106        #[inline]
107        unsafe fn decode(
108            &mut self,
109            decoder: &mut fidl::encoding::Decoder<'_, D>,
110            offset: usize,
111            _depth: fidl::encoding::Depth,
112        ) -> fidl::Result<()> {
113            decoder.debug_check_bounds::<Self>(offset);
114            // Verify that padding bytes are zero.
115            fidl::decode!(
116                fidl::encoding::UnboundedString,
117                D,
118                &mut self.activity_governor_moniker,
119                decoder,
120                offset + 0,
121                _depth
122            )?;
123            Ok(())
124        }
125    }
126
127    impl fidl::encoding::ValueTypeMarker for RealmFactoryCreateRealmResponse {
128        type Borrowed<'a> = &'a Self;
129        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
130            value
131        }
132    }
133
134    unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmResponse {
135        type Owned = Self;
136
137        #[inline(always)]
138        fn inline_align(_context: fidl::encoding::Context) -> usize {
139            8
140        }
141
142        #[inline(always)]
143        fn inline_size(_context: fidl::encoding::Context) -> usize {
144            16
145        }
146    }
147
148    unsafe impl<D: fidl::encoding::ResourceDialect>
149        fidl::encoding::Encode<RealmFactoryCreateRealmResponse, D>
150        for &RealmFactoryCreateRealmResponse
151    {
152        #[inline]
153        unsafe fn encode(
154            self,
155            encoder: &mut fidl::encoding::Encoder<'_, D>,
156            offset: usize,
157            _depth: fidl::encoding::Depth,
158        ) -> fidl::Result<()> {
159            encoder.debug_check_bounds::<RealmFactoryCreateRealmResponse>(offset);
160            // Delegate to tuple encoding.
161            fidl::encoding::Encode::<RealmFactoryCreateRealmResponse, D>::encode(
162                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
163                    &self.activity_governor_moniker,
164                ),),
165                encoder,
166                offset,
167                _depth,
168            )
169        }
170    }
171    unsafe impl<
172            D: fidl::encoding::ResourceDialect,
173            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
174        > fidl::encoding::Encode<RealmFactoryCreateRealmResponse, D> for (T0,)
175    {
176        #[inline]
177        unsafe fn encode(
178            self,
179            encoder: &mut fidl::encoding::Encoder<'_, D>,
180            offset: usize,
181            depth: fidl::encoding::Depth,
182        ) -> fidl::Result<()> {
183            encoder.debug_check_bounds::<RealmFactoryCreateRealmResponse>(offset);
184            // Zero out padding regions. There's no need to apply masks
185            // because the unmasked parts will be overwritten by fields.
186            // Write the fields.
187            self.0.encode(encoder, offset + 0, depth)?;
188            Ok(())
189        }
190    }
191
192    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
193        for RealmFactoryCreateRealmResponse
194    {
195        #[inline(always)]
196        fn new_empty() -> Self {
197            Self { activity_governor_moniker: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
198        }
199
200        #[inline]
201        unsafe fn decode(
202            &mut self,
203            decoder: &mut fidl::encoding::Decoder<'_, D>,
204            offset: usize,
205            _depth: fidl::encoding::Depth,
206        ) -> fidl::Result<()> {
207            decoder.debug_check_bounds::<Self>(offset);
208            // Verify that padding bytes are zero.
209            fidl::decode!(
210                fidl::encoding::UnboundedString,
211                D,
212                &mut self.activity_governor_moniker,
213                decoder,
214                offset + 0,
215                _depth
216            )?;
217            Ok(())
218        }
219    }
220}