selium_remote_client_protocol/fbs/remote_client/protocol/
scalar_value_generated.rs1extern crate alloc;
4use super::*;
5pub enum ScalarValueOffset {}
6#[derive(Copy, Clone, PartialEq)]
7
8pub struct ScalarValue<'a> {
9 pub _tab: ::flatbuffers::Table<'a>,
10}
11
12impl<'a> ::flatbuffers::Follow<'a> for ScalarValue<'a> {
13 type Inner = ScalarValue<'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> ScalarValue<'a> {
21 pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
22 pub const VT_BITS: ::flatbuffers::VOffsetT = 6;
23
24 #[inline]
25 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
26 ScalarValue { _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 ScalarValueArgs
32 ) -> ::flatbuffers::WIPOffset<ScalarValue<'bldr>> {
33 let mut builder = ScalarValueBuilder::new(_fbb);
34 builder.add_bits(args.bits);
35 builder.add_kind(args.kind);
36 builder.finish()
37 }
38
39
40 #[inline]
41 pub fn kind(&self) -> AbiScalarType {
42 unsafe { self._tab.get::<AbiScalarType>(ScalarValue::VT_KIND, Some(AbiScalarType::I8)).unwrap()}
46 }
47 #[inline]
48 pub fn bits(&self) -> u64 {
49 unsafe { self._tab.get::<u64>(ScalarValue::VT_BITS, Some(0)).unwrap()}
53 }
54}
55
56impl ::flatbuffers::Verifiable for ScalarValue<'_> {
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::<AbiScalarType>("kind", Self::VT_KIND, false)?
63 .visit_field::<u64>("bits", Self::VT_BITS, false)?
64 .finish();
65 Ok(())
66 }
67}
68pub struct ScalarValueArgs {
69 pub kind: AbiScalarType,
70 pub bits: u64,
71}
72impl<'a> Default for ScalarValueArgs {
73 #[inline]
74 fn default() -> Self {
75 ScalarValueArgs {
76 kind: AbiScalarType::I8,
77 bits: 0,
78 }
79 }
80}
81
82pub struct ScalarValueBuilder<'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> ScalarValueBuilder<'a, 'b, A> {
87 #[inline]
88 pub fn add_kind(&mut self, kind: AbiScalarType) {
89 self.fbb_.push_slot::<AbiScalarType>(ScalarValue::VT_KIND, kind, AbiScalarType::I8);
90 }
91 #[inline]
92 pub fn add_bits(&mut self, bits: u64) {
93 self.fbb_.push_slot::<u64>(ScalarValue::VT_BITS, bits, 0);
94 }
95 #[inline]
96 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ScalarValueBuilder<'a, 'b, A> {
97 let start = _fbb.start_table();
98 ScalarValueBuilder {
99 fbb_: _fbb,
100 start_: start,
101 }
102 }
103 #[inline]
104 pub fn finish(self) -> ::flatbuffers::WIPOffset<ScalarValue<'a>> {
105 let o = self.fbb_.end_table(self.start_);
106 ::flatbuffers::WIPOffset::new(o.value())
107 }
108}
109
110impl ::core::fmt::Debug for ScalarValue<'_> {
111 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
112 let mut ds = f.debug_struct("ScalarValue");
113 ds.field("kind", &self.kind());
114 ds.field("bits", &self.bits());
115 ds.finish()
116 }
117}