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
11#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct EnvVar {
13 pub key: String,
14 pub value: String,
15}
16
17impl fidl::Persistable for EnvVar {}
18
19#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
20pub struct UtilDumpNamespaceResponse {
21 pub contents: String,
22}
23
24impl fidl::Persistable for UtilDumpNamespaceResponse {}
25
26#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27#[repr(C)]
28pub struct UtilGetArgumentCountResponse {
29 pub count: u64,
30}
31
32impl fidl::Persistable for UtilGetArgumentCountResponse {}
33
34#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct UtilGetArgumentsResponse {
36 pub args: Vec<String>,
37}
38
39impl fidl::Persistable for UtilGetArgumentsResponse {}
40
41#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42#[repr(C)]
43pub struct UtilGetEnvironmentCountResponse {
44 pub count: u64,
45}
46
47impl fidl::Persistable for UtilGetEnvironmentCountResponse {}
48
49#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
50pub struct UtilGetEnvironmentResponse {
51 pub vars: Vec<EnvVar>,
52}
53
54impl fidl::Persistable for UtilGetEnvironmentResponse {}
55
56#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
57#[repr(C)]
58pub struct UtilGetLifecycleKoidResponse {
59 pub koid: u64,
60}
61
62impl fidl::Persistable for UtilGetLifecycleKoidResponse {}
63
64#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct UtilReadFileRequest {
66 pub path: String,
67}
68
69impl fidl::Persistable for UtilReadFileRequest {}
70
71#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
72pub struct UtilReadFileResponse {
73 pub contents: String,
74}
75
76impl fidl::Persistable for UtilReadFileResponse {}
77
78pub mod util_ordinals {
79 pub const GET_ARGUMENTS: u64 = 0x50ff7f790c425519;
80 pub const GET_ARGUMENT_COUNT: u64 = 0x41ef27d234ed7098;
81 pub const GET_ENVIRONMENT: u64 = 0x451e633adf04ec23;
82 pub const GET_ENVIRONMENT_COUNT: u64 = 0xe01fe768fb1be1a;
83 pub const DUMP_NAMESPACE: u64 = 0x73826cecc1a7f3a4;
84 pub const READ_FILE: u64 = 0x2ea8e2e4b427a391;
85 pub const GET_LIFECYCLE_KOID: u64 = 0xdaecfc0fe4c8f60;
86}
87
88mod internal {
89 use super::*;
90
91 impl fidl::encoding::ValueTypeMarker for EnvVar {
92 type Borrowed<'a> = &'a Self;
93 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
94 value
95 }
96 }
97
98 unsafe impl fidl::encoding::TypeMarker for EnvVar {
99 type Owned = Self;
100
101 #[inline(always)]
102 fn inline_align(_context: fidl::encoding::Context) -> usize {
103 8
104 }
105
106 #[inline(always)]
107 fn inline_size(_context: fidl::encoding::Context) -> usize {
108 32
109 }
110 }
111
112 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvVar, D> for &EnvVar {
113 #[inline]
114 unsafe fn encode(
115 self,
116 encoder: &mut fidl::encoding::Encoder<'_, D>,
117 offset: usize,
118 _depth: fidl::encoding::Depth,
119 ) -> fidl::Result<()> {
120 encoder.debug_check_bounds::<EnvVar>(offset);
121 fidl::encoding::Encode::<EnvVar, D>::encode(
123 (
124 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
125 &self.key,
126 ),
127 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
128 &self.value,
129 ),
130 ),
131 encoder,
132 offset,
133 _depth,
134 )
135 }
136 }
137 unsafe impl<
138 D: fidl::encoding::ResourceDialect,
139 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
140 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
141 > fidl::encoding::Encode<EnvVar, D> for (T0, T1)
142 {
143 #[inline]
144 unsafe fn encode(
145 self,
146 encoder: &mut fidl::encoding::Encoder<'_, D>,
147 offset: usize,
148 depth: fidl::encoding::Depth,
149 ) -> fidl::Result<()> {
150 encoder.debug_check_bounds::<EnvVar>(offset);
151 self.0.encode(encoder, offset + 0, depth)?;
155 self.1.encode(encoder, offset + 16, depth)?;
156 Ok(())
157 }
158 }
159
160 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvVar {
161 #[inline(always)]
162 fn new_empty() -> Self {
163 Self {
164 key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
165 value: fidl::new_empty!(fidl::encoding::UnboundedString, D),
166 }
167 }
168
169 #[inline]
170 unsafe fn decode(
171 &mut self,
172 decoder: &mut fidl::encoding::Decoder<'_, D>,
173 offset: usize,
174 _depth: fidl::encoding::Depth,
175 ) -> fidl::Result<()> {
176 decoder.debug_check_bounds::<Self>(offset);
177 fidl::decode!(
179 fidl::encoding::UnboundedString,
180 D,
181 &mut self.key,
182 decoder,
183 offset + 0,
184 _depth
185 )?;
186 fidl::decode!(
187 fidl::encoding::UnboundedString,
188 D,
189 &mut self.value,
190 decoder,
191 offset + 16,
192 _depth
193 )?;
194 Ok(())
195 }
196 }
197
198 impl fidl::encoding::ValueTypeMarker for UtilDumpNamespaceResponse {
199 type Borrowed<'a> = &'a Self;
200 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
201 value
202 }
203 }
204
205 unsafe impl fidl::encoding::TypeMarker for UtilDumpNamespaceResponse {
206 type Owned = Self;
207
208 #[inline(always)]
209 fn inline_align(_context: fidl::encoding::Context) -> usize {
210 8
211 }
212
213 #[inline(always)]
214 fn inline_size(_context: fidl::encoding::Context) -> usize {
215 16
216 }
217 }
218
219 unsafe impl<D: fidl::encoding::ResourceDialect>
220 fidl::encoding::Encode<UtilDumpNamespaceResponse, D> for &UtilDumpNamespaceResponse
221 {
222 #[inline]
223 unsafe fn encode(
224 self,
225 encoder: &mut fidl::encoding::Encoder<'_, D>,
226 offset: usize,
227 _depth: fidl::encoding::Depth,
228 ) -> fidl::Result<()> {
229 encoder.debug_check_bounds::<UtilDumpNamespaceResponse>(offset);
230 fidl::encoding::Encode::<UtilDumpNamespaceResponse, D>::encode(
232 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
233 &self.contents,
234 ),),
235 encoder,
236 offset,
237 _depth,
238 )
239 }
240 }
241 unsafe impl<
242 D: fidl::encoding::ResourceDialect,
243 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
244 > fidl::encoding::Encode<UtilDumpNamespaceResponse, D> for (T0,)
245 {
246 #[inline]
247 unsafe fn encode(
248 self,
249 encoder: &mut fidl::encoding::Encoder<'_, D>,
250 offset: usize,
251 depth: fidl::encoding::Depth,
252 ) -> fidl::Result<()> {
253 encoder.debug_check_bounds::<UtilDumpNamespaceResponse>(offset);
254 self.0.encode(encoder, offset + 0, depth)?;
258 Ok(())
259 }
260 }
261
262 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
263 for UtilDumpNamespaceResponse
264 {
265 #[inline(always)]
266 fn new_empty() -> Self {
267 Self { contents: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
268 }
269
270 #[inline]
271 unsafe fn decode(
272 &mut self,
273 decoder: &mut fidl::encoding::Decoder<'_, D>,
274 offset: usize,
275 _depth: fidl::encoding::Depth,
276 ) -> fidl::Result<()> {
277 decoder.debug_check_bounds::<Self>(offset);
278 fidl::decode!(
280 fidl::encoding::UnboundedString,
281 D,
282 &mut self.contents,
283 decoder,
284 offset + 0,
285 _depth
286 )?;
287 Ok(())
288 }
289 }
290
291 impl fidl::encoding::ValueTypeMarker for UtilGetArgumentCountResponse {
292 type Borrowed<'a> = &'a Self;
293 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
294 value
295 }
296 }
297
298 unsafe impl fidl::encoding::TypeMarker for UtilGetArgumentCountResponse {
299 type Owned = Self;
300
301 #[inline(always)]
302 fn inline_align(_context: fidl::encoding::Context) -> usize {
303 8
304 }
305
306 #[inline(always)]
307 fn inline_size(_context: fidl::encoding::Context) -> usize {
308 8
309 }
310 #[inline(always)]
311 fn encode_is_copy() -> bool {
312 true
313 }
314
315 #[inline(always)]
316 fn decode_is_copy() -> bool {
317 true
318 }
319 }
320
321 unsafe impl<D: fidl::encoding::ResourceDialect>
322 fidl::encoding::Encode<UtilGetArgumentCountResponse, D> for &UtilGetArgumentCountResponse
323 {
324 #[inline]
325 unsafe fn encode(
326 self,
327 encoder: &mut fidl::encoding::Encoder<'_, D>,
328 offset: usize,
329 _depth: fidl::encoding::Depth,
330 ) -> fidl::Result<()> {
331 encoder.debug_check_bounds::<UtilGetArgumentCountResponse>(offset);
332 unsafe {
333 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
335 (buf_ptr as *mut UtilGetArgumentCountResponse)
336 .write_unaligned((self as *const UtilGetArgumentCountResponse).read());
337 }
340 Ok(())
341 }
342 }
343 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
344 fidl::encoding::Encode<UtilGetArgumentCountResponse, D> for (T0,)
345 {
346 #[inline]
347 unsafe fn encode(
348 self,
349 encoder: &mut fidl::encoding::Encoder<'_, D>,
350 offset: usize,
351 depth: fidl::encoding::Depth,
352 ) -> fidl::Result<()> {
353 encoder.debug_check_bounds::<UtilGetArgumentCountResponse>(offset);
354 self.0.encode(encoder, offset + 0, depth)?;
358 Ok(())
359 }
360 }
361
362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
363 for UtilGetArgumentCountResponse
364 {
365 #[inline(always)]
366 fn new_empty() -> Self {
367 Self { count: fidl::new_empty!(u64, D) }
368 }
369
370 #[inline]
371 unsafe fn decode(
372 &mut self,
373 decoder: &mut fidl::encoding::Decoder<'_, D>,
374 offset: usize,
375 _depth: fidl::encoding::Depth,
376 ) -> fidl::Result<()> {
377 decoder.debug_check_bounds::<Self>(offset);
378 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
379 unsafe {
382 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
383 }
384 Ok(())
385 }
386 }
387
388 impl fidl::encoding::ValueTypeMarker for UtilGetArgumentsResponse {
389 type Borrowed<'a> = &'a Self;
390 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
391 value
392 }
393 }
394
395 unsafe impl fidl::encoding::TypeMarker for UtilGetArgumentsResponse {
396 type Owned = Self;
397
398 #[inline(always)]
399 fn inline_align(_context: fidl::encoding::Context) -> usize {
400 8
401 }
402
403 #[inline(always)]
404 fn inline_size(_context: fidl::encoding::Context) -> usize {
405 16
406 }
407 }
408
409 unsafe impl<D: fidl::encoding::ResourceDialect>
410 fidl::encoding::Encode<UtilGetArgumentsResponse, D> for &UtilGetArgumentsResponse
411 {
412 #[inline]
413 unsafe fn encode(
414 self,
415 encoder: &mut fidl::encoding::Encoder<'_, D>,
416 offset: usize,
417 _depth: fidl::encoding::Depth,
418 ) -> fidl::Result<()> {
419 encoder.debug_check_bounds::<UtilGetArgumentsResponse>(offset);
420 fidl::encoding::Encode::<UtilGetArgumentsResponse, D>::encode(
422 (
423 <fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.args),
424 ),
425 encoder, offset, _depth
426 )
427 }
428 }
429 unsafe impl<
430 D: fidl::encoding::ResourceDialect,
431 T0: fidl::encoding::Encode<
432 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
433 D,
434 >,
435 > fidl::encoding::Encode<UtilGetArgumentsResponse, D> for (T0,)
436 {
437 #[inline]
438 unsafe fn encode(
439 self,
440 encoder: &mut fidl::encoding::Encoder<'_, D>,
441 offset: usize,
442 depth: fidl::encoding::Depth,
443 ) -> fidl::Result<()> {
444 encoder.debug_check_bounds::<UtilGetArgumentsResponse>(offset);
445 self.0.encode(encoder, offset + 0, depth)?;
449 Ok(())
450 }
451 }
452
453 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
454 for UtilGetArgumentsResponse
455 {
456 #[inline(always)]
457 fn new_empty() -> Self {
458 Self {
459 args: fidl::new_empty!(
460 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
461 D
462 ),
463 }
464 }
465
466 #[inline]
467 unsafe fn decode(
468 &mut self,
469 decoder: &mut fidl::encoding::Decoder<'_, D>,
470 offset: usize,
471 _depth: fidl::encoding::Depth,
472 ) -> fidl::Result<()> {
473 decoder.debug_check_bounds::<Self>(offset);
474 fidl::decode!(
476 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
477 D,
478 &mut self.args,
479 decoder,
480 offset + 0,
481 _depth
482 )?;
483 Ok(())
484 }
485 }
486
487 impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentCountResponse {
488 type Borrowed<'a> = &'a Self;
489 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
490 value
491 }
492 }
493
494 unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentCountResponse {
495 type Owned = Self;
496
497 #[inline(always)]
498 fn inline_align(_context: fidl::encoding::Context) -> usize {
499 8
500 }
501
502 #[inline(always)]
503 fn inline_size(_context: fidl::encoding::Context) -> usize {
504 8
505 }
506 #[inline(always)]
507 fn encode_is_copy() -> bool {
508 true
509 }
510
511 #[inline(always)]
512 fn decode_is_copy() -> bool {
513 true
514 }
515 }
516
517 unsafe impl<D: fidl::encoding::ResourceDialect>
518 fidl::encoding::Encode<UtilGetEnvironmentCountResponse, D>
519 for &UtilGetEnvironmentCountResponse
520 {
521 #[inline]
522 unsafe fn encode(
523 self,
524 encoder: &mut fidl::encoding::Encoder<'_, D>,
525 offset: usize,
526 _depth: fidl::encoding::Depth,
527 ) -> fidl::Result<()> {
528 encoder.debug_check_bounds::<UtilGetEnvironmentCountResponse>(offset);
529 unsafe {
530 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
532 (buf_ptr as *mut UtilGetEnvironmentCountResponse)
533 .write_unaligned((self as *const UtilGetEnvironmentCountResponse).read());
534 }
537 Ok(())
538 }
539 }
540 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
541 fidl::encoding::Encode<UtilGetEnvironmentCountResponse, D> for (T0,)
542 {
543 #[inline]
544 unsafe fn encode(
545 self,
546 encoder: &mut fidl::encoding::Encoder<'_, D>,
547 offset: usize,
548 depth: fidl::encoding::Depth,
549 ) -> fidl::Result<()> {
550 encoder.debug_check_bounds::<UtilGetEnvironmentCountResponse>(offset);
551 self.0.encode(encoder, offset + 0, depth)?;
555 Ok(())
556 }
557 }
558
559 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
560 for UtilGetEnvironmentCountResponse
561 {
562 #[inline(always)]
563 fn new_empty() -> Self {
564 Self { count: fidl::new_empty!(u64, D) }
565 }
566
567 #[inline]
568 unsafe fn decode(
569 &mut self,
570 decoder: &mut fidl::encoding::Decoder<'_, D>,
571 offset: usize,
572 _depth: fidl::encoding::Depth,
573 ) -> fidl::Result<()> {
574 decoder.debug_check_bounds::<Self>(offset);
575 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
576 unsafe {
579 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
580 }
581 Ok(())
582 }
583 }
584
585 impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentResponse {
586 type Borrowed<'a> = &'a Self;
587 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
588 value
589 }
590 }
591
592 unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentResponse {
593 type Owned = Self;
594
595 #[inline(always)]
596 fn inline_align(_context: fidl::encoding::Context) -> usize {
597 8
598 }
599
600 #[inline(always)]
601 fn inline_size(_context: fidl::encoding::Context) -> usize {
602 16
603 }
604 }
605
606 unsafe impl<D: fidl::encoding::ResourceDialect>
607 fidl::encoding::Encode<UtilGetEnvironmentResponse, D> for &UtilGetEnvironmentResponse
608 {
609 #[inline]
610 unsafe fn encode(
611 self,
612 encoder: &mut fidl::encoding::Encoder<'_, D>,
613 offset: usize,
614 _depth: fidl::encoding::Depth,
615 ) -> fidl::Result<()> {
616 encoder.debug_check_bounds::<UtilGetEnvironmentResponse>(offset);
617 fidl::encoding::Encode::<UtilGetEnvironmentResponse, D>::encode(
619 (
620 <fidl::encoding::UnboundedVector<EnvVar> as fidl::encoding::ValueTypeMarker>::borrow(&self.vars),
621 ),
622 encoder, offset, _depth
623 )
624 }
625 }
626 unsafe impl<
627 D: fidl::encoding::ResourceDialect,
628 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<EnvVar>, D>,
629 > fidl::encoding::Encode<UtilGetEnvironmentResponse, D> for (T0,)
630 {
631 #[inline]
632 unsafe fn encode(
633 self,
634 encoder: &mut fidl::encoding::Encoder<'_, D>,
635 offset: usize,
636 depth: fidl::encoding::Depth,
637 ) -> fidl::Result<()> {
638 encoder.debug_check_bounds::<UtilGetEnvironmentResponse>(offset);
639 self.0.encode(encoder, offset + 0, depth)?;
643 Ok(())
644 }
645 }
646
647 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
648 for UtilGetEnvironmentResponse
649 {
650 #[inline(always)]
651 fn new_empty() -> Self {
652 Self { vars: fidl::new_empty!(fidl::encoding::UnboundedVector<EnvVar>, D) }
653 }
654
655 #[inline]
656 unsafe fn decode(
657 &mut self,
658 decoder: &mut fidl::encoding::Decoder<'_, D>,
659 offset: usize,
660 _depth: fidl::encoding::Depth,
661 ) -> fidl::Result<()> {
662 decoder.debug_check_bounds::<Self>(offset);
663 fidl::decode!(
665 fidl::encoding::UnboundedVector<EnvVar>,
666 D,
667 &mut self.vars,
668 decoder,
669 offset + 0,
670 _depth
671 )?;
672 Ok(())
673 }
674 }
675
676 impl fidl::encoding::ValueTypeMarker for UtilGetLifecycleKoidResponse {
677 type Borrowed<'a> = &'a Self;
678 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
679 value
680 }
681 }
682
683 unsafe impl fidl::encoding::TypeMarker for UtilGetLifecycleKoidResponse {
684 type Owned = Self;
685
686 #[inline(always)]
687 fn inline_align(_context: fidl::encoding::Context) -> usize {
688 8
689 }
690
691 #[inline(always)]
692 fn inline_size(_context: fidl::encoding::Context) -> usize {
693 8
694 }
695 #[inline(always)]
696 fn encode_is_copy() -> bool {
697 true
698 }
699
700 #[inline(always)]
701 fn decode_is_copy() -> bool {
702 true
703 }
704 }
705
706 unsafe impl<D: fidl::encoding::ResourceDialect>
707 fidl::encoding::Encode<UtilGetLifecycleKoidResponse, D> for &UtilGetLifecycleKoidResponse
708 {
709 #[inline]
710 unsafe fn encode(
711 self,
712 encoder: &mut fidl::encoding::Encoder<'_, D>,
713 offset: usize,
714 _depth: fidl::encoding::Depth,
715 ) -> fidl::Result<()> {
716 encoder.debug_check_bounds::<UtilGetLifecycleKoidResponse>(offset);
717 unsafe {
718 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
720 (buf_ptr as *mut UtilGetLifecycleKoidResponse)
721 .write_unaligned((self as *const UtilGetLifecycleKoidResponse).read());
722 }
725 Ok(())
726 }
727 }
728 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
729 fidl::encoding::Encode<UtilGetLifecycleKoidResponse, D> for (T0,)
730 {
731 #[inline]
732 unsafe fn encode(
733 self,
734 encoder: &mut fidl::encoding::Encoder<'_, D>,
735 offset: usize,
736 depth: fidl::encoding::Depth,
737 ) -> fidl::Result<()> {
738 encoder.debug_check_bounds::<UtilGetLifecycleKoidResponse>(offset);
739 self.0.encode(encoder, offset + 0, depth)?;
743 Ok(())
744 }
745 }
746
747 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
748 for UtilGetLifecycleKoidResponse
749 {
750 #[inline(always)]
751 fn new_empty() -> Self {
752 Self { koid: fidl::new_empty!(u64, D) }
753 }
754
755 #[inline]
756 unsafe fn decode(
757 &mut self,
758 decoder: &mut fidl::encoding::Decoder<'_, D>,
759 offset: usize,
760 _depth: fidl::encoding::Depth,
761 ) -> fidl::Result<()> {
762 decoder.debug_check_bounds::<Self>(offset);
763 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
764 unsafe {
767 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
768 }
769 Ok(())
770 }
771 }
772
773 impl fidl::encoding::ValueTypeMarker for UtilReadFileRequest {
774 type Borrowed<'a> = &'a Self;
775 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
776 value
777 }
778 }
779
780 unsafe impl fidl::encoding::TypeMarker for UtilReadFileRequest {
781 type Owned = Self;
782
783 #[inline(always)]
784 fn inline_align(_context: fidl::encoding::Context) -> usize {
785 8
786 }
787
788 #[inline(always)]
789 fn inline_size(_context: fidl::encoding::Context) -> usize {
790 16
791 }
792 }
793
794 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UtilReadFileRequest, D>
795 for &UtilReadFileRequest
796 {
797 #[inline]
798 unsafe fn encode(
799 self,
800 encoder: &mut fidl::encoding::Encoder<'_, D>,
801 offset: usize,
802 _depth: fidl::encoding::Depth,
803 ) -> fidl::Result<()> {
804 encoder.debug_check_bounds::<UtilReadFileRequest>(offset);
805 fidl::encoding::Encode::<UtilReadFileRequest, D>::encode(
807 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
808 &self.path,
809 ),),
810 encoder,
811 offset,
812 _depth,
813 )
814 }
815 }
816 unsafe impl<
817 D: fidl::encoding::ResourceDialect,
818 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
819 > fidl::encoding::Encode<UtilReadFileRequest, D> for (T0,)
820 {
821 #[inline]
822 unsafe fn encode(
823 self,
824 encoder: &mut fidl::encoding::Encoder<'_, D>,
825 offset: usize,
826 depth: fidl::encoding::Depth,
827 ) -> fidl::Result<()> {
828 encoder.debug_check_bounds::<UtilReadFileRequest>(offset);
829 self.0.encode(encoder, offset + 0, depth)?;
833 Ok(())
834 }
835 }
836
837 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileRequest {
838 #[inline(always)]
839 fn new_empty() -> Self {
840 Self { path: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
841 }
842
843 #[inline]
844 unsafe fn decode(
845 &mut self,
846 decoder: &mut fidl::encoding::Decoder<'_, D>,
847 offset: usize,
848 _depth: fidl::encoding::Depth,
849 ) -> fidl::Result<()> {
850 decoder.debug_check_bounds::<Self>(offset);
851 fidl::decode!(
853 fidl::encoding::UnboundedString,
854 D,
855 &mut self.path,
856 decoder,
857 offset + 0,
858 _depth
859 )?;
860 Ok(())
861 }
862 }
863
864 impl fidl::encoding::ValueTypeMarker for UtilReadFileResponse {
865 type Borrowed<'a> = &'a Self;
866 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
867 value
868 }
869 }
870
871 unsafe impl fidl::encoding::TypeMarker for UtilReadFileResponse {
872 type Owned = Self;
873
874 #[inline(always)]
875 fn inline_align(_context: fidl::encoding::Context) -> usize {
876 8
877 }
878
879 #[inline(always)]
880 fn inline_size(_context: fidl::encoding::Context) -> usize {
881 16
882 }
883 }
884
885 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UtilReadFileResponse, D>
886 for &UtilReadFileResponse
887 {
888 #[inline]
889 unsafe fn encode(
890 self,
891 encoder: &mut fidl::encoding::Encoder<'_, D>,
892 offset: usize,
893 _depth: fidl::encoding::Depth,
894 ) -> fidl::Result<()> {
895 encoder.debug_check_bounds::<UtilReadFileResponse>(offset);
896 fidl::encoding::Encode::<UtilReadFileResponse, D>::encode(
898 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
899 &self.contents,
900 ),),
901 encoder,
902 offset,
903 _depth,
904 )
905 }
906 }
907 unsafe impl<
908 D: fidl::encoding::ResourceDialect,
909 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
910 > fidl::encoding::Encode<UtilReadFileResponse, D> for (T0,)
911 {
912 #[inline]
913 unsafe fn encode(
914 self,
915 encoder: &mut fidl::encoding::Encoder<'_, D>,
916 offset: usize,
917 depth: fidl::encoding::Depth,
918 ) -> fidl::Result<()> {
919 encoder.debug_check_bounds::<UtilReadFileResponse>(offset);
920 self.0.encode(encoder, offset + 0, depth)?;
924 Ok(())
925 }
926 }
927
928 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileResponse {
929 #[inline(always)]
930 fn new_empty() -> Self {
931 Self { contents: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
932 }
933
934 #[inline]
935 unsafe fn decode(
936 &mut self,
937 decoder: &mut fidl::encoding::Decoder<'_, D>,
938 offset: usize,
939 _depth: fidl::encoding::Depth,
940 ) -> fidl::Result<()> {
941 decoder.debug_check_bounds::<Self>(offset);
942 fidl::decode!(
944 fidl::encoding::UnboundedString,
945 D,
946 &mut self.contents,
947 decoder,
948 offset + 0,
949 _depth
950 )?;
951 Ok(())
952 }
953 }
954}