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 const DEFAULT_REALM: &str = "gis_default";
12
13pub const GUEST_INTERACTION_MAX_LENGTH: u32 = 1024;
14
15#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16#[repr(C)]
17pub struct CommandListenerOnStartedRequest {
18 pub status: i32,
19}
20
21impl fidl::Persistable for CommandListenerOnStartedRequest {}
22
23#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24#[repr(C)]
25pub struct CommandListenerOnTerminatedRequest {
26 pub status: i32,
27 pub return_code: i32,
28}
29
30impl fidl::Persistable for CommandListenerOnTerminatedRequest {}
31
32#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct EnvironmentVariable {
35 pub key: String,
36 pub value: String,
37}
38
39impl fidl::Persistable for EnvironmentVariable {}
40
41#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42#[repr(C)]
43pub struct InteractionGetFileResponse {
44 pub status: i32,
45}
46
47impl fidl::Persistable for InteractionGetFileResponse {}
48
49#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
50#[repr(C)]
51pub struct InteractionPutFileResponse {
52 pub status: i32,
53}
54
55impl fidl::Persistable for InteractionPutFileResponse {}
56
57mod internal {
58 use super::*;
59
60 impl fidl::encoding::ValueTypeMarker for CommandListenerOnStartedRequest {
61 type Borrowed<'a> = &'a Self;
62 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
63 value
64 }
65 }
66
67 unsafe impl fidl::encoding::TypeMarker for CommandListenerOnStartedRequest {
68 type Owned = Self;
69
70 #[inline(always)]
71 fn inline_align(_context: fidl::encoding::Context) -> usize {
72 4
73 }
74
75 #[inline(always)]
76 fn inline_size(_context: fidl::encoding::Context) -> usize {
77 4
78 }
79 #[inline(always)]
80 fn encode_is_copy() -> bool {
81 true
82 }
83
84 #[inline(always)]
85 fn decode_is_copy() -> bool {
86 true
87 }
88 }
89
90 unsafe impl<D: fidl::encoding::ResourceDialect>
91 fidl::encoding::Encode<CommandListenerOnStartedRequest, D>
92 for &CommandListenerOnStartedRequest
93 {
94 #[inline]
95 unsafe fn encode(
96 self,
97 encoder: &mut fidl::encoding::Encoder<'_, D>,
98 offset: usize,
99 _depth: fidl::encoding::Depth,
100 ) -> fidl::Result<()> {
101 encoder.debug_check_bounds::<CommandListenerOnStartedRequest>(offset);
102 unsafe {
103 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
105 (buf_ptr as *mut CommandListenerOnStartedRequest)
106 .write_unaligned((self as *const CommandListenerOnStartedRequest).read());
107 }
110 Ok(())
111 }
112 }
113 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
114 fidl::encoding::Encode<CommandListenerOnStartedRequest, D> for (T0,)
115 {
116 #[inline]
117 unsafe fn encode(
118 self,
119 encoder: &mut fidl::encoding::Encoder<'_, D>,
120 offset: usize,
121 depth: fidl::encoding::Depth,
122 ) -> fidl::Result<()> {
123 encoder.debug_check_bounds::<CommandListenerOnStartedRequest>(offset);
124 self.0.encode(encoder, offset + 0, depth)?;
128 Ok(())
129 }
130 }
131
132 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
133 for CommandListenerOnStartedRequest
134 {
135 #[inline(always)]
136 fn new_empty() -> Self {
137 Self { status: fidl::new_empty!(i32, D) }
138 }
139
140 #[inline]
141 unsafe fn decode(
142 &mut self,
143 decoder: &mut fidl::encoding::Decoder<'_, D>,
144 offset: usize,
145 _depth: fidl::encoding::Depth,
146 ) -> fidl::Result<()> {
147 decoder.debug_check_bounds::<Self>(offset);
148 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
149 unsafe {
152 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
153 }
154 Ok(())
155 }
156 }
157
158 impl fidl::encoding::ValueTypeMarker for CommandListenerOnTerminatedRequest {
159 type Borrowed<'a> = &'a Self;
160 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
161 value
162 }
163 }
164
165 unsafe impl fidl::encoding::TypeMarker for CommandListenerOnTerminatedRequest {
166 type Owned = Self;
167
168 #[inline(always)]
169 fn inline_align(_context: fidl::encoding::Context) -> usize {
170 4
171 }
172
173 #[inline(always)]
174 fn inline_size(_context: fidl::encoding::Context) -> usize {
175 8
176 }
177 #[inline(always)]
178 fn encode_is_copy() -> bool {
179 true
180 }
181
182 #[inline(always)]
183 fn decode_is_copy() -> bool {
184 true
185 }
186 }
187
188 unsafe impl<D: fidl::encoding::ResourceDialect>
189 fidl::encoding::Encode<CommandListenerOnTerminatedRequest, D>
190 for &CommandListenerOnTerminatedRequest
191 {
192 #[inline]
193 unsafe fn encode(
194 self,
195 encoder: &mut fidl::encoding::Encoder<'_, D>,
196 offset: usize,
197 _depth: fidl::encoding::Depth,
198 ) -> fidl::Result<()> {
199 encoder.debug_check_bounds::<CommandListenerOnTerminatedRequest>(offset);
200 unsafe {
201 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
203 (buf_ptr as *mut CommandListenerOnTerminatedRequest)
204 .write_unaligned((self as *const CommandListenerOnTerminatedRequest).read());
205 }
208 Ok(())
209 }
210 }
211 unsafe impl<
212 D: fidl::encoding::ResourceDialect,
213 T0: fidl::encoding::Encode<i32, D>,
214 T1: fidl::encoding::Encode<i32, D>,
215 > fidl::encoding::Encode<CommandListenerOnTerminatedRequest, D> for (T0, T1)
216 {
217 #[inline]
218 unsafe fn encode(
219 self,
220 encoder: &mut fidl::encoding::Encoder<'_, D>,
221 offset: usize,
222 depth: fidl::encoding::Depth,
223 ) -> fidl::Result<()> {
224 encoder.debug_check_bounds::<CommandListenerOnTerminatedRequest>(offset);
225 self.0.encode(encoder, offset + 0, depth)?;
229 self.1.encode(encoder, offset + 4, depth)?;
230 Ok(())
231 }
232 }
233
234 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
235 for CommandListenerOnTerminatedRequest
236 {
237 #[inline(always)]
238 fn new_empty() -> Self {
239 Self { status: fidl::new_empty!(i32, D), return_code: fidl::new_empty!(i32, D) }
240 }
241
242 #[inline]
243 unsafe fn decode(
244 &mut self,
245 decoder: &mut fidl::encoding::Decoder<'_, D>,
246 offset: usize,
247 _depth: fidl::encoding::Depth,
248 ) -> fidl::Result<()> {
249 decoder.debug_check_bounds::<Self>(offset);
250 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
251 unsafe {
254 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
255 }
256 Ok(())
257 }
258 }
259
260 impl fidl::encoding::ValueTypeMarker for EnvironmentVariable {
261 type Borrowed<'a> = &'a Self;
262 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
263 value
264 }
265 }
266
267 unsafe impl fidl::encoding::TypeMarker for EnvironmentVariable {
268 type Owned = Self;
269
270 #[inline(always)]
271 fn inline_align(_context: fidl::encoding::Context) -> usize {
272 8
273 }
274
275 #[inline(always)]
276 fn inline_size(_context: fidl::encoding::Context) -> usize {
277 32
278 }
279 }
280
281 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvironmentVariable, D>
282 for &EnvironmentVariable
283 {
284 #[inline]
285 unsafe fn encode(
286 self,
287 encoder: &mut fidl::encoding::Encoder<'_, D>,
288 offset: usize,
289 _depth: fidl::encoding::Depth,
290 ) -> fidl::Result<()> {
291 encoder.debug_check_bounds::<EnvironmentVariable>(offset);
292 fidl::encoding::Encode::<EnvironmentVariable, D>::encode(
294 (
295 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
296 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
297 ),
298 encoder, offset, _depth
299 )
300 }
301 }
302 unsafe impl<
303 D: fidl::encoding::ResourceDialect,
304 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
305 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
306 > fidl::encoding::Encode<EnvironmentVariable, D> for (T0, T1)
307 {
308 #[inline]
309 unsafe fn encode(
310 self,
311 encoder: &mut fidl::encoding::Encoder<'_, D>,
312 offset: usize,
313 depth: fidl::encoding::Depth,
314 ) -> fidl::Result<()> {
315 encoder.debug_check_bounds::<EnvironmentVariable>(offset);
316 self.0.encode(encoder, offset + 0, depth)?;
320 self.1.encode(encoder, offset + 16, depth)?;
321 Ok(())
322 }
323 }
324
325 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvironmentVariable {
326 #[inline(always)]
327 fn new_empty() -> Self {
328 Self {
329 key: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
330 value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
331 }
332 }
333
334 #[inline]
335 unsafe fn decode(
336 &mut self,
337 decoder: &mut fidl::encoding::Decoder<'_, D>,
338 offset: usize,
339 _depth: fidl::encoding::Depth,
340 ) -> fidl::Result<()> {
341 decoder.debug_check_bounds::<Self>(offset);
342 fidl::decode!(
344 fidl::encoding::BoundedString<1024>,
345 D,
346 &mut self.key,
347 decoder,
348 offset + 0,
349 _depth
350 )?;
351 fidl::decode!(
352 fidl::encoding::BoundedString<1024>,
353 D,
354 &mut self.value,
355 decoder,
356 offset + 16,
357 _depth
358 )?;
359 Ok(())
360 }
361 }
362
363 impl fidl::encoding::ValueTypeMarker for InteractionGetFileResponse {
364 type Borrowed<'a> = &'a Self;
365 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
366 value
367 }
368 }
369
370 unsafe impl fidl::encoding::TypeMarker for InteractionGetFileResponse {
371 type Owned = Self;
372
373 #[inline(always)]
374 fn inline_align(_context: fidl::encoding::Context) -> usize {
375 4
376 }
377
378 #[inline(always)]
379 fn inline_size(_context: fidl::encoding::Context) -> usize {
380 4
381 }
382 #[inline(always)]
383 fn encode_is_copy() -> bool {
384 true
385 }
386
387 #[inline(always)]
388 fn decode_is_copy() -> bool {
389 true
390 }
391 }
392
393 unsafe impl<D: fidl::encoding::ResourceDialect>
394 fidl::encoding::Encode<InteractionGetFileResponse, D> for &InteractionGetFileResponse
395 {
396 #[inline]
397 unsafe fn encode(
398 self,
399 encoder: &mut fidl::encoding::Encoder<'_, D>,
400 offset: usize,
401 _depth: fidl::encoding::Depth,
402 ) -> fidl::Result<()> {
403 encoder.debug_check_bounds::<InteractionGetFileResponse>(offset);
404 unsafe {
405 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
407 (buf_ptr as *mut InteractionGetFileResponse)
408 .write_unaligned((self as *const InteractionGetFileResponse).read());
409 }
412 Ok(())
413 }
414 }
415 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
416 fidl::encoding::Encode<InteractionGetFileResponse, D> for (T0,)
417 {
418 #[inline]
419 unsafe fn encode(
420 self,
421 encoder: &mut fidl::encoding::Encoder<'_, D>,
422 offset: usize,
423 depth: fidl::encoding::Depth,
424 ) -> fidl::Result<()> {
425 encoder.debug_check_bounds::<InteractionGetFileResponse>(offset);
426 self.0.encode(encoder, offset + 0, depth)?;
430 Ok(())
431 }
432 }
433
434 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
435 for InteractionGetFileResponse
436 {
437 #[inline(always)]
438 fn new_empty() -> Self {
439 Self { status: fidl::new_empty!(i32, D) }
440 }
441
442 #[inline]
443 unsafe fn decode(
444 &mut self,
445 decoder: &mut fidl::encoding::Decoder<'_, D>,
446 offset: usize,
447 _depth: fidl::encoding::Depth,
448 ) -> fidl::Result<()> {
449 decoder.debug_check_bounds::<Self>(offset);
450 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
451 unsafe {
454 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
455 }
456 Ok(())
457 }
458 }
459
460 impl fidl::encoding::ValueTypeMarker for InteractionPutFileResponse {
461 type Borrowed<'a> = &'a Self;
462 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
463 value
464 }
465 }
466
467 unsafe impl fidl::encoding::TypeMarker for InteractionPutFileResponse {
468 type Owned = Self;
469
470 #[inline(always)]
471 fn inline_align(_context: fidl::encoding::Context) -> usize {
472 4
473 }
474
475 #[inline(always)]
476 fn inline_size(_context: fidl::encoding::Context) -> usize {
477 4
478 }
479 #[inline(always)]
480 fn encode_is_copy() -> bool {
481 true
482 }
483
484 #[inline(always)]
485 fn decode_is_copy() -> bool {
486 true
487 }
488 }
489
490 unsafe impl<D: fidl::encoding::ResourceDialect>
491 fidl::encoding::Encode<InteractionPutFileResponse, D> for &InteractionPutFileResponse
492 {
493 #[inline]
494 unsafe fn encode(
495 self,
496 encoder: &mut fidl::encoding::Encoder<'_, D>,
497 offset: usize,
498 _depth: fidl::encoding::Depth,
499 ) -> fidl::Result<()> {
500 encoder.debug_check_bounds::<InteractionPutFileResponse>(offset);
501 unsafe {
502 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
504 (buf_ptr as *mut InteractionPutFileResponse)
505 .write_unaligned((self as *const InteractionPutFileResponse).read());
506 }
509 Ok(())
510 }
511 }
512 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
513 fidl::encoding::Encode<InteractionPutFileResponse, D> for (T0,)
514 {
515 #[inline]
516 unsafe fn encode(
517 self,
518 encoder: &mut fidl::encoding::Encoder<'_, D>,
519 offset: usize,
520 depth: fidl::encoding::Depth,
521 ) -> fidl::Result<()> {
522 encoder.debug_check_bounds::<InteractionPutFileResponse>(offset);
523 self.0.encode(encoder, offset + 0, depth)?;
527 Ok(())
528 }
529 }
530
531 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
532 for InteractionPutFileResponse
533 {
534 #[inline(always)]
535 fn new_empty() -> Self {
536 Self { status: fidl::new_empty!(i32, D) }
537 }
538
539 #[inline]
540 unsafe fn decode(
541 &mut self,
542 decoder: &mut fidl::encoding::Decoder<'_, D>,
543 offset: usize,
544 _depth: fidl::encoding::Depth,
545 ) -> fidl::Result<()> {
546 decoder.debug_check_bounds::<Self>(offset);
547 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
548 unsafe {
551 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
552 }
553 Ok(())
554 }
555 }
556}