Skip to main content

selium_remote_client_protocol/fbs/remote_client/protocol/
abi_signature_generated.rs

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