1#![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
11pub type PingString = String;
12
13pub type PongString = String;
14
15#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16pub struct PingPingRequest {
17 pub ping: String,
18}
19
20impl fidl::Persistable for PingPingRequest {}
21
22#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23pub struct PingPingResponse {
24 pub pong: String,
25}
26
27impl fidl::Persistable for PingPingResponse {}
28
29mod internal {
30 use super::*;
31
32 impl fidl::encoding::ValueTypeMarker for PingPingRequest {
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 PingPingRequest {
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<PingPingRequest, D>
54 for &PingPingRequest
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::<PingPingRequest>(offset);
64 fidl::encoding::Encode::<PingPingRequest, D>::encode(
66 (<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(
67 &self.ping,
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::BoundedString<100>, D>,
78 > fidl::encoding::Encode<PingPingRequest, 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::<PingPingRequest>(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 PingPingRequest {
97 #[inline(always)]
98 fn new_empty() -> Self {
99 Self { ping: fidl::new_empty!(fidl::encoding::BoundedString<100>, 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::BoundedString<100>,
113 D,
114 &mut self.ping,
115 decoder,
116 offset + 0,
117 _depth
118 )?;
119 Ok(())
120 }
121 }
122
123 impl fidl::encoding::ValueTypeMarker for PingPingResponse {
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 PingPingResponse {
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> fidl::encoding::Encode<PingPingResponse, D>
145 for &PingPingResponse
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::<PingPingResponse>(offset);
155 fidl::encoding::Encode::<PingPingResponse, D>::encode(
157 (<fidl::encoding::BoundedString<105> as fidl::encoding::ValueTypeMarker>::borrow(
158 &self.pong,
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::BoundedString<105>, D>,
169 > fidl::encoding::Encode<PingPingResponse, 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::<PingPingResponse>(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> for PingPingResponse {
188 #[inline(always)]
189 fn new_empty() -> Self {
190 Self { pong: fidl::new_empty!(fidl::encoding::BoundedString<105>, D) }
191 }
192
193 #[inline]
194 unsafe fn decode(
195 &mut self,
196 decoder: &mut fidl::encoding::Decoder<'_, D>,
197 offset: usize,
198 _depth: fidl::encoding::Depth,
199 ) -> fidl::Result<()> {
200 decoder.debug_check_bounds::<Self>(offset);
201 fidl::decode!(
203 fidl::encoding::BoundedString<105>,
204 D,
205 &mut self.pong,
206 decoder,
207 offset + 0,
208 _depth
209 )?;
210 Ok(())
211 }
212 }
213}