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