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<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>, D>,
432 > fidl::encoding::Encode<UtilGetArgumentsResponse, D> for (T0,)
433 {
434 #[inline]
435 unsafe fn encode(
436 self,
437 encoder: &mut fidl::encoding::Encoder<'_, D>,
438 offset: usize,
439 depth: fidl::encoding::Depth,
440 ) -> fidl::Result<()> {
441 encoder.debug_check_bounds::<UtilGetArgumentsResponse>(offset);
442 self.0.encode(encoder, offset + 0, depth)?;
446 Ok(())
447 }
448 }
449
450 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
451 for UtilGetArgumentsResponse
452 {
453 #[inline(always)]
454 fn new_empty() -> Self {
455 Self {
456 args: fidl::new_empty!(
457 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
458 D
459 ),
460 }
461 }
462
463 #[inline]
464 unsafe fn decode(
465 &mut self,
466 decoder: &mut fidl::encoding::Decoder<'_, D>,
467 offset: usize,
468 _depth: fidl::encoding::Depth,
469 ) -> fidl::Result<()> {
470 decoder.debug_check_bounds::<Self>(offset);
471 fidl::decode!(
473 fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
474 D,
475 &mut self.args,
476 decoder,
477 offset + 0,
478 _depth
479 )?;
480 Ok(())
481 }
482 }
483
484 impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentCountResponse {
485 type Borrowed<'a> = &'a Self;
486 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
487 value
488 }
489 }
490
491 unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentCountResponse {
492 type Owned = Self;
493
494 #[inline(always)]
495 fn inline_align(_context: fidl::encoding::Context) -> usize {
496 8
497 }
498
499 #[inline(always)]
500 fn inline_size(_context: fidl::encoding::Context) -> usize {
501 8
502 }
503 #[inline(always)]
504 fn encode_is_copy() -> bool {
505 true
506 }
507
508 #[inline(always)]
509 fn decode_is_copy() -> bool {
510 true
511 }
512 }
513
514 unsafe impl<D: fidl::encoding::ResourceDialect>
515 fidl::encoding::Encode<UtilGetEnvironmentCountResponse, D>
516 for &UtilGetEnvironmentCountResponse
517 {
518 #[inline]
519 unsafe fn encode(
520 self,
521 encoder: &mut fidl::encoding::Encoder<'_, D>,
522 offset: usize,
523 _depth: fidl::encoding::Depth,
524 ) -> fidl::Result<()> {
525 encoder.debug_check_bounds::<UtilGetEnvironmentCountResponse>(offset);
526 unsafe {
527 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
529 (buf_ptr as *mut UtilGetEnvironmentCountResponse)
530 .write_unaligned((self as *const UtilGetEnvironmentCountResponse).read());
531 }
534 Ok(())
535 }
536 }
537 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
538 fidl::encoding::Encode<UtilGetEnvironmentCountResponse, D> for (T0,)
539 {
540 #[inline]
541 unsafe fn encode(
542 self,
543 encoder: &mut fidl::encoding::Encoder<'_, D>,
544 offset: usize,
545 depth: fidl::encoding::Depth,
546 ) -> fidl::Result<()> {
547 encoder.debug_check_bounds::<UtilGetEnvironmentCountResponse>(offset);
548 self.0.encode(encoder, offset + 0, depth)?;
552 Ok(())
553 }
554 }
555
556 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
557 for UtilGetEnvironmentCountResponse
558 {
559 #[inline(always)]
560 fn new_empty() -> Self {
561 Self { count: fidl::new_empty!(u64, D) }
562 }
563
564 #[inline]
565 unsafe fn decode(
566 &mut self,
567 decoder: &mut fidl::encoding::Decoder<'_, D>,
568 offset: usize,
569 _depth: fidl::encoding::Depth,
570 ) -> fidl::Result<()> {
571 decoder.debug_check_bounds::<Self>(offset);
572 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
573 unsafe {
576 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
577 }
578 Ok(())
579 }
580 }
581
582 impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentResponse {
583 type Borrowed<'a> = &'a Self;
584 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
585 value
586 }
587 }
588
589 unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentResponse {
590 type Owned = Self;
591
592 #[inline(always)]
593 fn inline_align(_context: fidl::encoding::Context) -> usize {
594 8
595 }
596
597 #[inline(always)]
598 fn inline_size(_context: fidl::encoding::Context) -> usize {
599 16
600 }
601 }
602
603 unsafe impl<D: fidl::encoding::ResourceDialect>
604 fidl::encoding::Encode<UtilGetEnvironmentResponse, D> for &UtilGetEnvironmentResponse
605 {
606 #[inline]
607 unsafe fn encode(
608 self,
609 encoder: &mut fidl::encoding::Encoder<'_, D>,
610 offset: usize,
611 _depth: fidl::encoding::Depth,
612 ) -> fidl::Result<()> {
613 encoder.debug_check_bounds::<UtilGetEnvironmentResponse>(offset);
614 fidl::encoding::Encode::<UtilGetEnvironmentResponse, D>::encode(
616 (
617 <fidl::encoding::UnboundedVector<EnvVar> as fidl::encoding::ValueTypeMarker>::borrow(&self.vars),
618 ),
619 encoder, offset, _depth
620 )
621 }
622 }
623 unsafe impl<
624 D: fidl::encoding::ResourceDialect,
625 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<EnvVar>, D>,
626 > fidl::encoding::Encode<UtilGetEnvironmentResponse, D> for (T0,)
627 {
628 #[inline]
629 unsafe fn encode(
630 self,
631 encoder: &mut fidl::encoding::Encoder<'_, D>,
632 offset: usize,
633 depth: fidl::encoding::Depth,
634 ) -> fidl::Result<()> {
635 encoder.debug_check_bounds::<UtilGetEnvironmentResponse>(offset);
636 self.0.encode(encoder, offset + 0, depth)?;
640 Ok(())
641 }
642 }
643
644 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
645 for UtilGetEnvironmentResponse
646 {
647 #[inline(always)]
648 fn new_empty() -> Self {
649 Self { vars: fidl::new_empty!(fidl::encoding::UnboundedVector<EnvVar>, D) }
650 }
651
652 #[inline]
653 unsafe fn decode(
654 &mut self,
655 decoder: &mut fidl::encoding::Decoder<'_, D>,
656 offset: usize,
657 _depth: fidl::encoding::Depth,
658 ) -> fidl::Result<()> {
659 decoder.debug_check_bounds::<Self>(offset);
660 fidl::decode!(
662 fidl::encoding::UnboundedVector<EnvVar>,
663 D,
664 &mut self.vars,
665 decoder,
666 offset + 0,
667 _depth
668 )?;
669 Ok(())
670 }
671 }
672
673 impl fidl::encoding::ValueTypeMarker for UtilGetLifecycleKoidResponse {
674 type Borrowed<'a> = &'a Self;
675 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
676 value
677 }
678 }
679
680 unsafe impl fidl::encoding::TypeMarker for UtilGetLifecycleKoidResponse {
681 type Owned = Self;
682
683 #[inline(always)]
684 fn inline_align(_context: fidl::encoding::Context) -> usize {
685 8
686 }
687
688 #[inline(always)]
689 fn inline_size(_context: fidl::encoding::Context) -> usize {
690 8
691 }
692 #[inline(always)]
693 fn encode_is_copy() -> bool {
694 true
695 }
696
697 #[inline(always)]
698 fn decode_is_copy() -> bool {
699 true
700 }
701 }
702
703 unsafe impl<D: fidl::encoding::ResourceDialect>
704 fidl::encoding::Encode<UtilGetLifecycleKoidResponse, D> for &UtilGetLifecycleKoidResponse
705 {
706 #[inline]
707 unsafe fn encode(
708 self,
709 encoder: &mut fidl::encoding::Encoder<'_, D>,
710 offset: usize,
711 _depth: fidl::encoding::Depth,
712 ) -> fidl::Result<()> {
713 encoder.debug_check_bounds::<UtilGetLifecycleKoidResponse>(offset);
714 unsafe {
715 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
717 (buf_ptr as *mut UtilGetLifecycleKoidResponse)
718 .write_unaligned((self as *const UtilGetLifecycleKoidResponse).read());
719 }
722 Ok(())
723 }
724 }
725 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
726 fidl::encoding::Encode<UtilGetLifecycleKoidResponse, D> for (T0,)
727 {
728 #[inline]
729 unsafe fn encode(
730 self,
731 encoder: &mut fidl::encoding::Encoder<'_, D>,
732 offset: usize,
733 depth: fidl::encoding::Depth,
734 ) -> fidl::Result<()> {
735 encoder.debug_check_bounds::<UtilGetLifecycleKoidResponse>(offset);
736 self.0.encode(encoder, offset + 0, depth)?;
740 Ok(())
741 }
742 }
743
744 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
745 for UtilGetLifecycleKoidResponse
746 {
747 #[inline(always)]
748 fn new_empty() -> Self {
749 Self { koid: fidl::new_empty!(u64, D) }
750 }
751
752 #[inline]
753 unsafe fn decode(
754 &mut self,
755 decoder: &mut fidl::encoding::Decoder<'_, D>,
756 offset: usize,
757 _depth: fidl::encoding::Depth,
758 ) -> fidl::Result<()> {
759 decoder.debug_check_bounds::<Self>(offset);
760 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
761 unsafe {
764 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
765 }
766 Ok(())
767 }
768 }
769
770 impl fidl::encoding::ValueTypeMarker for UtilReadFileRequest {
771 type Borrowed<'a> = &'a Self;
772 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
773 value
774 }
775 }
776
777 unsafe impl fidl::encoding::TypeMarker for UtilReadFileRequest {
778 type Owned = Self;
779
780 #[inline(always)]
781 fn inline_align(_context: fidl::encoding::Context) -> usize {
782 8
783 }
784
785 #[inline(always)]
786 fn inline_size(_context: fidl::encoding::Context) -> usize {
787 16
788 }
789 }
790
791 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UtilReadFileRequest, D>
792 for &UtilReadFileRequest
793 {
794 #[inline]
795 unsafe fn encode(
796 self,
797 encoder: &mut fidl::encoding::Encoder<'_, D>,
798 offset: usize,
799 _depth: fidl::encoding::Depth,
800 ) -> fidl::Result<()> {
801 encoder.debug_check_bounds::<UtilReadFileRequest>(offset);
802 fidl::encoding::Encode::<UtilReadFileRequest, D>::encode(
804 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
805 &self.path,
806 ),),
807 encoder,
808 offset,
809 _depth,
810 )
811 }
812 }
813 unsafe impl<
814 D: fidl::encoding::ResourceDialect,
815 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
816 > fidl::encoding::Encode<UtilReadFileRequest, D> for (T0,)
817 {
818 #[inline]
819 unsafe fn encode(
820 self,
821 encoder: &mut fidl::encoding::Encoder<'_, D>,
822 offset: usize,
823 depth: fidl::encoding::Depth,
824 ) -> fidl::Result<()> {
825 encoder.debug_check_bounds::<UtilReadFileRequest>(offset);
826 self.0.encode(encoder, offset + 0, depth)?;
830 Ok(())
831 }
832 }
833
834 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileRequest {
835 #[inline(always)]
836 fn new_empty() -> Self {
837 Self { path: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
838 }
839
840 #[inline]
841 unsafe fn decode(
842 &mut self,
843 decoder: &mut fidl::encoding::Decoder<'_, D>,
844 offset: usize,
845 _depth: fidl::encoding::Depth,
846 ) -> fidl::Result<()> {
847 decoder.debug_check_bounds::<Self>(offset);
848 fidl::decode!(
850 fidl::encoding::UnboundedString,
851 D,
852 &mut self.path,
853 decoder,
854 offset + 0,
855 _depth
856 )?;
857 Ok(())
858 }
859 }
860
861 impl fidl::encoding::ValueTypeMarker for UtilReadFileResponse {
862 type Borrowed<'a> = &'a Self;
863 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
864 value
865 }
866 }
867
868 unsafe impl fidl::encoding::TypeMarker for UtilReadFileResponse {
869 type Owned = Self;
870
871 #[inline(always)]
872 fn inline_align(_context: fidl::encoding::Context) -> usize {
873 8
874 }
875
876 #[inline(always)]
877 fn inline_size(_context: fidl::encoding::Context) -> usize {
878 16
879 }
880 }
881
882 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UtilReadFileResponse, D>
883 for &UtilReadFileResponse
884 {
885 #[inline]
886 unsafe fn encode(
887 self,
888 encoder: &mut fidl::encoding::Encoder<'_, D>,
889 offset: usize,
890 _depth: fidl::encoding::Depth,
891 ) -> fidl::Result<()> {
892 encoder.debug_check_bounds::<UtilReadFileResponse>(offset);
893 fidl::encoding::Encode::<UtilReadFileResponse, D>::encode(
895 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
896 &self.contents,
897 ),),
898 encoder,
899 offset,
900 _depth,
901 )
902 }
903 }
904 unsafe impl<
905 D: fidl::encoding::ResourceDialect,
906 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
907 > fidl::encoding::Encode<UtilReadFileResponse, D> for (T0,)
908 {
909 #[inline]
910 unsafe fn encode(
911 self,
912 encoder: &mut fidl::encoding::Encoder<'_, D>,
913 offset: usize,
914 depth: fidl::encoding::Depth,
915 ) -> fidl::Result<()> {
916 encoder.debug_check_bounds::<UtilReadFileResponse>(offset);
917 self.0.encode(encoder, offset + 0, depth)?;
921 Ok(())
922 }
923 }
924
925 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileResponse {
926 #[inline(always)]
927 fn new_empty() -> Self {
928 Self { contents: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
929 }
930
931 #[inline]
932 unsafe fn decode(
933 &mut self,
934 decoder: &mut fidl::encoding::Decoder<'_, D>,
935 offset: usize,
936 _depth: fidl::encoding::Depth,
937 ) -> fidl::Result<()> {
938 decoder.debug_check_bounds::<Self>(offset);
939 fidl::decode!(
941 fidl::encoding::UnboundedString,
942 D,
943 &mut self.contents,
944 decoder,
945 offset + 0,
946 _depth
947 )?;
948 Ok(())
949 }
950 }
951}