fidl_test_triangle__common/
fidl_test_triangle__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 ConscriptIssueResponse {
13    pub response: Option<String>,
14}
15
16impl fidl::Persistable for ConscriptIssueResponse {}
17
18pub mod conscript_ordinals {
19    pub const SERVE: u64 = 0xec2f1bfefaaf878;
20    pub const ISSUE: u64 = 0x4bcc695ef98ec8a9;
21}
22
23mod internal {
24    use super::*;
25
26    impl fidl::encoding::ValueTypeMarker for ConscriptIssueResponse {
27        type Borrowed<'a> = &'a Self;
28        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
29            value
30        }
31    }
32
33    unsafe impl fidl::encoding::TypeMarker for ConscriptIssueResponse {
34        type Owned = Self;
35
36        #[inline(always)]
37        fn inline_align(_context: fidl::encoding::Context) -> usize {
38            8
39        }
40
41        #[inline(always)]
42        fn inline_size(_context: fidl::encoding::Context) -> usize {
43            16
44        }
45    }
46
47    unsafe impl<D: fidl::encoding::ResourceDialect>
48        fidl::encoding::Encode<ConscriptIssueResponse, D> for &ConscriptIssueResponse
49    {
50        #[inline]
51        unsafe fn encode(
52            self,
53            encoder: &mut fidl::encoding::Encoder<'_, D>,
54            offset: usize,
55            _depth: fidl::encoding::Depth,
56        ) -> fidl::Result<()> {
57            encoder.debug_check_bounds::<ConscriptIssueResponse>(offset);
58            // Delegate to tuple encoding.
59            fidl::encoding::Encode::<ConscriptIssueResponse, D>::encode(
60                (
61                    <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
62                ),
63                encoder, offset, _depth
64            )
65        }
66    }
67    unsafe impl<
68            D: fidl::encoding::ResourceDialect,
69            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
70        > fidl::encoding::Encode<ConscriptIssueResponse, D> for (T0,)
71    {
72        #[inline]
73        unsafe fn encode(
74            self,
75            encoder: &mut fidl::encoding::Encoder<'_, D>,
76            offset: usize,
77            depth: fidl::encoding::Depth,
78        ) -> fidl::Result<()> {
79            encoder.debug_check_bounds::<ConscriptIssueResponse>(offset);
80            // Zero out padding regions. There's no need to apply masks
81            // because the unmasked parts will be overwritten by fields.
82            // Write the fields.
83            self.0.encode(encoder, offset + 0, depth)?;
84            Ok(())
85        }
86    }
87
88    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
89        for ConscriptIssueResponse
90    {
91        #[inline(always)]
92        fn new_empty() -> Self {
93            Self {
94                response: fidl::new_empty!(
95                    fidl::encoding::Optional<fidl::encoding::UnboundedString>,
96                    D
97                ),
98            }
99        }
100
101        #[inline]
102        unsafe fn decode(
103            &mut self,
104            decoder: &mut fidl::encoding::Decoder<'_, D>,
105            offset: usize,
106            _depth: fidl::encoding::Depth,
107        ) -> fidl::Result<()> {
108            decoder.debug_check_bounds::<Self>(offset);
109            // Verify that padding bytes are zero.
110            fidl::decode!(
111                fidl::encoding::Optional<fidl::encoding::UnboundedString>,
112                D,
113                &mut self.response,
114                decoder,
115                offset + 0,
116                _depth
117            )?;
118            Ok(())
119        }
120    }
121}