fidl_fuchsia_hardware_compat_common/
fidl_fuchsia_hardware_compat_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 LeafGetStringResponse {
13 pub response: String,
14}
15
16impl fidl::Persistable for LeafGetStringResponse {}
17
18mod internal {
19 use super::*;
20
21 impl fidl::encoding::ValueTypeMarker for LeafGetStringResponse {
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 LeafGetStringResponse {
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> fidl::encoding::Encode<LeafGetStringResponse, D>
43 for &LeafGetStringResponse
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::<LeafGetStringResponse>(offset);
53 fidl::encoding::Encode::<LeafGetStringResponse, D>::encode(
55 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
56 &self.response,
57 ),),
58 encoder,
59 offset,
60 _depth,
61 )
62 }
63 }
64 unsafe impl<
65 D: fidl::encoding::ResourceDialect,
66 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
67 > fidl::encoding::Encode<LeafGetStringResponse, D> for (T0,)
68 {
69 #[inline]
70 unsafe fn encode(
71 self,
72 encoder: &mut fidl::encoding::Encoder<'_, D>,
73 offset: usize,
74 depth: fidl::encoding::Depth,
75 ) -> fidl::Result<()> {
76 encoder.debug_check_bounds::<LeafGetStringResponse>(offset);
77 self.0.encode(encoder, offset + 0, depth)?;
81 Ok(())
82 }
83 }
84
85 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LeafGetStringResponse {
86 #[inline(always)]
87 fn new_empty() -> Self {
88 Self { response: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
89 }
90
91 #[inline]
92 unsafe fn decode(
93 &mut self,
94 decoder: &mut fidl::encoding::Decoder<'_, D>,
95 offset: usize,
96 _depth: fidl::encoding::Depth,
97 ) -> fidl::Result<()> {
98 decoder.debug_check_bounds::<Self>(offset);
99 fidl::decode!(
101 fidl::encoding::UnboundedString,
102 D,
103 &mut self.response,
104 decoder,
105 offset + 0,
106 _depth
107 )?;
108 Ok(())
109 }
110 }
111}