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