fidl_fuchsia_inspect__common/
fidl_fuchsia_inspect__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
11pub type TreeName = String;
12
13pub const DEFAULT_TREE_NAME: &str = "root";
14
15pub const MAX_NAME_LENGTH: u64 = 4096;
16
17/// Maximum length of an Inspect Tree, specified by the format.
18pub 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
27pub mod inspect_sink_ordinals {
28    pub const PUBLISH: u64 = 0xf9ceb1ab8ec6b4b;
29    pub const ESCROW: u64 = 0x4b683186a65d2d16;
30    pub const FETCH_ESCROW: u64 = 0x7b9faa1a6f8e666a;
31}
32
33pub mod tree_ordinals {
34    pub const GET_CONTENT: u64 = 0x6ce0c1e42f903b47;
35    pub const LIST_CHILD_NAMES: u64 = 0x577c988a830784a3;
36    pub const OPEN_CHILD: u64 = 0x526e35326e80a1b3;
37}
38
39pub mod tree_name_iterator_ordinals {
40    pub const GET_NEXT: u64 = 0x6a7d7af5a325c8ac;
41}
42
43mod internal {
44    use super::*;
45
46    impl fidl::encoding::ValueTypeMarker for TreeNameIteratorGetNextResponse {
47        type Borrowed<'a> = &'a Self;
48        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
49            value
50        }
51    }
52
53    unsafe impl fidl::encoding::TypeMarker for TreeNameIteratorGetNextResponse {
54        type Owned = Self;
55
56        #[inline(always)]
57        fn inline_align(_context: fidl::encoding::Context) -> usize {
58            8
59        }
60
61        #[inline(always)]
62        fn inline_size(_context: fidl::encoding::Context) -> usize {
63            16
64        }
65    }
66
67    unsafe impl<D: fidl::encoding::ResourceDialect>
68        fidl::encoding::Encode<TreeNameIteratorGetNextResponse, D>
69        for &TreeNameIteratorGetNextResponse
70    {
71        #[inline]
72        unsafe fn encode(
73            self,
74            encoder: &mut fidl::encoding::Encoder<'_, D>,
75            offset: usize,
76            _depth: fidl::encoding::Depth,
77        ) -> fidl::Result<()> {
78            encoder.debug_check_bounds::<TreeNameIteratorGetNextResponse>(offset);
79            // Delegate to tuple encoding.
80            fidl::encoding::Encode::<TreeNameIteratorGetNextResponse, D>::encode(
81                (
82                    <fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
83                ),
84                encoder, offset, _depth
85            )
86        }
87    }
88    unsafe impl<
89            D: fidl::encoding::ResourceDialect,
90            T0: fidl::encoding::Encode<
91                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
92                D,
93            >,
94        > fidl::encoding::Encode<TreeNameIteratorGetNextResponse, D> for (T0,)
95    {
96        #[inline]
97        unsafe fn encode(
98            self,
99            encoder: &mut fidl::encoding::Encoder<'_, D>,
100            offset: usize,
101            depth: fidl::encoding::Depth,
102        ) -> fidl::Result<()> {
103            encoder.debug_check_bounds::<TreeNameIteratorGetNextResponse>(offset);
104            // Zero out padding regions. There's no need to apply masks
105            // because the unmasked parts will be overwritten by fields.
106            // Write the fields.
107            self.0.encode(encoder, offset + 0, depth)?;
108            Ok(())
109        }
110    }
111
112    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
113        for TreeNameIteratorGetNextResponse
114    {
115        #[inline(always)]
116        fn new_empty() -> Self {
117            Self {
118                name: fidl::new_empty!(
119                    fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
120                    D
121                ),
122            }
123        }
124
125        #[inline]
126        unsafe fn decode(
127            &mut self,
128            decoder: &mut fidl::encoding::Decoder<'_, D>,
129            offset: usize,
130            _depth: fidl::encoding::Depth,
131        ) -> fidl::Result<()> {
132            decoder.debug_check_bounds::<Self>(offset);
133            // Verify that padding bytes are zero.
134            fidl::decode!(
135                fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<2040>>,
136                D,
137                &mut self.name,
138                decoder,
139                offset + 0,
140                _depth
141            )?;
142            Ok(())
143        }
144    }
145}