Skip to main content

rustfs_protos/generated/flatbuffers_generated/
models.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2// @generated
3
4extern crate alloc;
5
6#[allow(unused_imports, dead_code)]
7pub mod models {
8
9    extern crate alloc;
10
11    pub enum PingBodyOffset {}
12    #[derive(Copy, Clone, PartialEq)]
13
14    pub struct PingBody<'a> {
15        pub _tab: ::flatbuffers::Table<'a>,
16    }
17
18    impl<'a> ::flatbuffers::Follow<'a> for PingBody<'a> {
19        type Inner = PingBody<'a>;
20        #[inline]
21        unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
22            Self {
23                _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
24            }
25        }
26    }
27
28    impl<'a> PingBody<'a> {
29        pub const VT_PAYLOAD: ::flatbuffers::VOffsetT = 4;
30
31        pub const fn get_fully_qualified_name() -> &'static str {
32            "models.PingBody"
33        }
34
35        #[inline]
36        pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
37            PingBody { _tab: table }
38        }
39        #[allow(unused_mut)]
40        pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
41            _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
42            args: &'args PingBodyArgs<'args>,
43        ) -> ::flatbuffers::WIPOffset<PingBody<'bldr>> {
44            let mut builder = PingBodyBuilder::new(_fbb);
45            if let Some(x) = args.payload {
46                builder.add_payload(x);
47            }
48            builder.finish()
49        }
50
51        #[inline]
52        pub fn payload(&self) -> Option<::flatbuffers::Vector<'a, u8>> {
53            // Safety:
54            // Created from valid Table for this object
55            // which contains a valid value in this slot
56            unsafe {
57                self._tab
58                    .get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u8>>>(PingBody::VT_PAYLOAD, None)
59            }
60        }
61    }
62
63    impl ::flatbuffers::Verifiable for PingBody<'_> {
64        #[inline]
65        fn run_verifier(v: &mut ::flatbuffers::Verifier, pos: usize) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
66            v.visit_table(pos)?
67                .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u8>>>("payload", Self::VT_PAYLOAD, false)?
68                .finish();
69            Ok(())
70        }
71    }
72    pub struct PingBodyArgs<'a> {
73        pub payload: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u8>>>,
74    }
75    impl<'a> Default for PingBodyArgs<'a> {
76        #[inline]
77        fn default() -> Self {
78            PingBodyArgs { payload: None }
79        }
80    }
81
82    pub struct PingBodyBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
83        fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
84        start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
85    }
86    impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PingBodyBuilder<'a, 'b, A> {
87        #[inline]
88        pub fn add_payload(&mut self, payload: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b, u8>>) {
89            self.fbb_
90                .push_slot_always::<::flatbuffers::WIPOffset<_>>(PingBody::VT_PAYLOAD, payload);
91        }
92        #[inline]
93        pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PingBodyBuilder<'a, 'b, A> {
94            let start = _fbb.start_table();
95            PingBodyBuilder {
96                fbb_: _fbb,
97                start_: start,
98            }
99        }
100        #[inline]
101        pub fn finish(self) -> ::flatbuffers::WIPOffset<PingBody<'a>> {
102            let o = self.fbb_.end_table(self.start_);
103            ::flatbuffers::WIPOffset::new(o.value())
104        }
105    }
106
107    impl ::core::fmt::Debug for PingBody<'_> {
108        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
109            let mut ds = f.debug_struct("PingBody");
110            ds.field("payload", &self.payload());
111            ds.finish()
112        }
113    }
114} // pub mod models