fidl_test_processbuilder_common/
fidl_test_processbuilder_common.rs

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