selium_remote_client_protocol/fbs/remote_client/protocol/
channel_ref_generated.rs1extern crate alloc;
4use super::*;
5pub enum ChannelRefOffset {}
6#[derive(Copy, Clone, PartialEq)]
7
8pub struct ChannelRef<'a> {
9 pub _tab: ::flatbuffers::Table<'a>,
10}
11
12impl<'a> ::flatbuffers::Follow<'a> for ChannelRef<'a> {
13 type Inner = ChannelRef<'a>;
14 #[inline]
15 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
16 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
17 }
18}
19
20impl<'a> ChannelRef<'a> {
21 pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
22 pub const VT_HANDLE: ::flatbuffers::VOffsetT = 6;
23
24 #[inline]
25 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
26 ChannelRef { _tab: table }
27 }
28 #[allow(unused_mut)]
29 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
30 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
31 args: &'args ChannelRefArgs
32 ) -> ::flatbuffers::WIPOffset<ChannelRef<'bldr>> {
33 let mut builder = ChannelRefBuilder::new(_fbb);
34 builder.add_handle(args.handle);
35 builder.add_kind(args.kind);
36 builder.finish()
37 }
38
39
40 #[inline]
41 pub fn kind(&self) -> ChannelRefKind {
42 unsafe { self._tab.get::<ChannelRefKind>(ChannelRef::VT_KIND, Some(ChannelRefKind::Strong)).unwrap()}
46 }
47 #[inline]
48 pub fn handle(&self) -> u64 {
49 unsafe { self._tab.get::<u64>(ChannelRef::VT_HANDLE, Some(0)).unwrap()}
53 }
54}
55
56impl ::flatbuffers::Verifiable for ChannelRef<'_> {
57 #[inline]
58 fn run_verifier(
59 v: &mut ::flatbuffers::Verifier, pos: usize
60 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
61 v.visit_table(pos)?
62 .visit_field::<ChannelRefKind>("kind", Self::VT_KIND, false)?
63 .visit_field::<u64>("handle", Self::VT_HANDLE, false)?
64 .finish();
65 Ok(())
66 }
67}
68pub struct ChannelRefArgs {
69 pub kind: ChannelRefKind,
70 pub handle: u64,
71}
72impl<'a> Default for ChannelRefArgs {
73 #[inline]
74 fn default() -> Self {
75 ChannelRefArgs {
76 kind: ChannelRefKind::Strong,
77 handle: 0,
78 }
79 }
80}
81
82pub struct ChannelRefBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
83 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
84 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
85}
86impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ChannelRefBuilder<'a, 'b, A> {
87 #[inline]
88 pub fn add_kind(&mut self, kind: ChannelRefKind) {
89 self.fbb_.push_slot::<ChannelRefKind>(ChannelRef::VT_KIND, kind, ChannelRefKind::Strong);
90 }
91 #[inline]
92 pub fn add_handle(&mut self, handle: u64) {
93 self.fbb_.push_slot::<u64>(ChannelRef::VT_HANDLE, handle, 0);
94 }
95 #[inline]
96 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ChannelRefBuilder<'a, 'b, A> {
97 let start = _fbb.start_table();
98 ChannelRefBuilder {
99 fbb_: _fbb,
100 start_: start,
101 }
102 }
103 #[inline]
104 pub fn finish(self) -> ::flatbuffers::WIPOffset<ChannelRef<'a>> {
105 let o = self.fbb_.end_table(self.start_);
106 ::flatbuffers::WIPOffset::new(o.value())
107 }
108}
109
110impl ::core::fmt::Debug for ChannelRef<'_> {
111 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
112 let mut ds = f.debug_struct("ChannelRef");
113 ds.field("kind", &self.kind());
114 ds.field("handle", &self.handle());
115 ds.finish()
116 }
117}