Skip to main content

selium_remote_client_protocol/fbs/remote_client/protocol/
abi_param_generated.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2// @generated
3extern crate alloc;
4use super::*;
5pub enum AbiParamOffset {}
6#[derive(Copy, Clone, PartialEq)]
7
8pub struct AbiParam<'a> {
9  pub _tab: ::flatbuffers::Table<'a>,
10}
11
12impl<'a> ::flatbuffers::Follow<'a> for AbiParam<'a> {
13  type Inner = AbiParam<'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> AbiParam<'a> {
21  pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
22  pub const VT_SCALAR_TYPE: ::flatbuffers::VOffsetT = 6;
23
24  #[inline]
25  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
26    AbiParam { _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 AbiParamArgs
32  ) -> ::flatbuffers::WIPOffset<AbiParam<'bldr>> {
33    let mut builder = AbiParamBuilder::new(_fbb);
34    builder.add_scalar_type(args.scalar_type);
35    builder.add_kind(args.kind);
36    builder.finish()
37  }
38
39
40  #[inline]
41  pub fn kind(&self) -> AbiParamKind {
42    // Safety:
43    // Created from valid Table for this object
44    // which contains a valid value in this slot
45    unsafe { self._tab.get::<AbiParamKind>(AbiParam::VT_KIND, Some(AbiParamKind::Scalar)).unwrap()}
46  }
47  #[inline]
48  pub fn scalar_type(&self) -> AbiScalarType {
49    // Safety:
50    // Created from valid Table for this object
51    // which contains a valid value in this slot
52    unsafe { self._tab.get::<AbiScalarType>(AbiParam::VT_SCALAR_TYPE, Some(AbiScalarType::I8)).unwrap()}
53  }
54}
55
56impl ::flatbuffers::Verifiable for AbiParam<'_> {
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::<AbiParamKind>("kind", Self::VT_KIND, false)?
63     .visit_field::<AbiScalarType>("scalar_type", Self::VT_SCALAR_TYPE, false)?
64     .finish();
65    Ok(())
66  }
67}
68pub struct AbiParamArgs {
69    pub kind: AbiParamKind,
70    pub scalar_type: AbiScalarType,
71}
72impl<'a> Default for AbiParamArgs {
73  #[inline]
74  fn default() -> Self {
75    AbiParamArgs {
76      kind: AbiParamKind::Scalar,
77      scalar_type: AbiScalarType::I8,
78    }
79  }
80}
81
82pub struct AbiParamBuilder<'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> AbiParamBuilder<'a, 'b, A> {
87  #[inline]
88  pub fn add_kind(&mut self, kind: AbiParamKind) {
89    self.fbb_.push_slot::<AbiParamKind>(AbiParam::VT_KIND, kind, AbiParamKind::Scalar);
90  }
91  #[inline]
92  pub fn add_scalar_type(&mut self, scalar_type: AbiScalarType) {
93    self.fbb_.push_slot::<AbiScalarType>(AbiParam::VT_SCALAR_TYPE, scalar_type, AbiScalarType::I8);
94  }
95  #[inline]
96  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> AbiParamBuilder<'a, 'b, A> {
97    let start = _fbb.start_table();
98    AbiParamBuilder {
99      fbb_: _fbb,
100      start_: start,
101    }
102  }
103  #[inline]
104  pub fn finish(self) -> ::flatbuffers::WIPOffset<AbiParam<'a>> {
105    let o = self.fbb_.end_table(self.start_);
106    ::flatbuffers::WIPOffset::new(o.value())
107  }
108}
109
110impl ::core::fmt::Debug for AbiParam<'_> {
111  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
112    let mut ds = f.debug_struct("AbiParam");
113      ds.field("kind", &self.kind());
114      ds.field("scalar_type", &self.scalar_type());
115      ds.finish()
116  }
117}