fidl_test_triangle_common/
fidl_test_triangle_common.rs1#![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
18mod internal {
19 use super::*;
20
21 impl fidl::encoding::ValueTypeMarker for ConscriptIssueResponse {
22 type Borrowed<'a> = &'a Self;
23 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24 value
25 }
26 }
27
28 unsafe impl fidl::encoding::TypeMarker for ConscriptIssueResponse {
29 type Owned = Self;
30
31 #[inline(always)]
32 fn inline_align(_context: fidl::encoding::Context) -> usize {
33 8
34 }
35
36 #[inline(always)]
37 fn inline_size(_context: fidl::encoding::Context) -> usize {
38 16
39 }
40 }
41
42 unsafe impl<D: fidl::encoding::ResourceDialect>
43 fidl::encoding::Encode<ConscriptIssueResponse, D> for &ConscriptIssueResponse
44 {
45 #[inline]
46 unsafe fn encode(
47 self,
48 encoder: &mut fidl::encoding::Encoder<'_, D>,
49 offset: usize,
50 _depth: fidl::encoding::Depth,
51 ) -> fidl::Result<()> {
52 encoder.debug_check_bounds::<ConscriptIssueResponse>(offset);
53 fidl::encoding::Encode::<ConscriptIssueResponse, D>::encode(
55 (
56 <fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.response),
57 ),
58 encoder, offset, _depth
59 )
60 }
61 }
62 unsafe impl<
63 D: fidl::encoding::ResourceDialect,
64 T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
65 > fidl::encoding::Encode<ConscriptIssueResponse, D> for (T0,)
66 {
67 #[inline]
68 unsafe fn encode(
69 self,
70 encoder: &mut fidl::encoding::Encoder<'_, D>,
71 offset: usize,
72 depth: fidl::encoding::Depth,
73 ) -> fidl::Result<()> {
74 encoder.debug_check_bounds::<ConscriptIssueResponse>(offset);
75 self.0.encode(encoder, offset + 0, depth)?;
79 Ok(())
80 }
81 }
82
83 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
84 for ConscriptIssueResponse
85 {
86 #[inline(always)]
87 fn new_empty() -> Self {
88 Self {
89 response: fidl::new_empty!(
90 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
91 D
92 ),
93 }
94 }
95
96 #[inline]
97 unsafe fn decode(
98 &mut self,
99 decoder: &mut fidl::encoding::Decoder<'_, D>,
100 offset: usize,
101 _depth: fidl::encoding::Depth,
102 ) -> fidl::Result<()> {
103 decoder.debug_check_bounds::<Self>(offset);
104 fidl::decode!(
106 fidl::encoding::Optional<fidl::encoding::UnboundedString>,
107 D,
108 &mut self.response,
109 decoder,
110 offset + 0,
111 _depth
112 )?;
113 Ok(())
114 }
115 }
116}