fidl_fuchsia_inspect_common/
fidl_fuchsia_inspect_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
11pub type TreeName = String;
12
13pub const DEFAULT_TREE_NAME: &str = "root";
14
15pub const MAX_NAME_LENGTH: u64 = 4096;
16
17pub const MAX_TREE_NAME_LENGTH: u64 = 2040;
19
20#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
21pub struct TreeNameIteratorGetNextResponse {
22 pub name: Vec<String>,
23}
24
25impl fidl::Persistable for TreeNameIteratorGetNextResponse {}
26
27mod internal {
28 use super::*;
29
30 impl fidl::encoding::ValueTypeMarker for TreeNameIteratorGetNextResponse {
31 type Borrowed<'a> = &'a Self;
32 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
33 value
34 }
35 }
36
37 unsafe impl fidl::encoding::TypeMarker for TreeNameIteratorGetNextResponse {
38 type Owned = Self;
39
40 #[inline(always)]
41 fn inline_align(_context: fidl::encoding::Context) -> usize {
42 8
43 }
44
45 #[inline(always)]
46 fn inline_size(_context: fidl::encoding::Context) -> usize {
47 16
48 }
49 }
50
51 unsafe impl<D: fidl::encoding::ResourceDialect>
52 fidl::encoding::Encode<TreeNameIteratorGetNextResponse, D>
53 for &TreeNameIteratorGetNextResponse
54 {
55 #[inline]
56 unsafe fn encode(
57 self,
58 encoder: &mut fidl::encoding::Encoder<'_, D>,
59 offset: usize,
60 _depth: fidl::encoding::Depth,
61 ) -> fidl::Result<()> {
62 encoder.debug_check_bounds::<TreeNameIteratorGetNextResponse>(offset);
63 fidl::encoding::Encode::<TreeNameIteratorGetNextResponse, D>::encode(
65 (
66 <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
67 ),
68 encoder, offset, _depth
69 )
70 }
71 }
72 unsafe impl<
73 D: fidl::encoding::ResourceDialect,
74 T0: fidl::encoding::Encode<
75 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
76 D,
77 >,
78 > fidl::encoding::Encode<TreeNameIteratorGetNextResponse, D> for (T0,)
79 {
80 #[inline]
81 unsafe fn encode(
82 self,
83 encoder: &mut fidl::encoding::Encoder<'_, D>,
84 offset: usize,
85 depth: fidl::encoding::Depth,
86 ) -> fidl::Result<()> {
87 encoder.debug_check_bounds::<TreeNameIteratorGetNextResponse>(offset);
88 self.0.encode(encoder, offset + 0, depth)?;
92 Ok(())
93 }
94 }
95
96 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
97 for TreeNameIteratorGetNextResponse
98 {
99 #[inline(always)]
100 fn new_empty() -> Self {
101 Self {
102 name: fidl::new_empty!(
103 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
104 D
105 ),
106 }
107 }
108
109 #[inline]
110 unsafe fn decode(
111 &mut self,
112 decoder: &mut fidl::encoding::Decoder<'_, D>,
113 offset: usize,
114 _depth: fidl::encoding::Depth,
115 ) -> fidl::Result<()> {
116 decoder.debug_check_bounds::<Self>(offset);
117 fidl::decode!(
119 fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
120 D,
121 &mut self.name,
122 decoder,
123 offset + 0,
124 _depth
125 )?;
126 Ok(())
127 }
128 }
129}