@ignex/nova 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/docs/architecture.md +146 -0
- package/docs/publishing.md +119 -0
- package/docs/wire-format.md +170 -0
- package/index.ts +61 -0
- package/package.json +89 -0
- package/prebuilds/linux-x64/libignex_ffi.so +0 -0
- package/public/client.ts +23 -0
- package/public/nats.ts +19 -0
- package/public/server.ts +35 -0
- package/rust/Cargo.toml +19 -0
- package/rust/src/ffi.rs +135 -0
- package/rust/src/generated/backend.rs +2817 -0
- package/rust/src/generated/mod.rs +2 -0
- package/rust/src/lib.rs +9 -0
- package/rust/src/transcode/generated.rs +1352 -0
- package/rust/src/transcode/mod.rs +2 -0
- package/src/bridge/nats.ts +269 -0
- package/src/bridge/subjects.ts +30 -0
- package/src/core/auth.ts +56 -0
- package/src/core/backpressure.ts +39 -0
- package/src/core/client-heartbeat.ts +27 -0
- package/src/core/client-reconnect.ts +35 -0
- package/src/core/client-state.ts +76 -0
- package/src/core/client-wire.ts +72 -0
- package/src/core/client.ts +176 -0
- package/src/core/groups.ts +52 -0
- package/src/core/int64-guard.ts +44 -0
- package/src/core/metrics.ts +105 -0
- package/src/core/outbound.ts +76 -0
- package/src/core/replay.ts +31 -0
- package/src/core/ring.ts +85 -0
- package/src/core/rooms.ts +44 -0
- package/src/core/routing.ts +94 -0
- package/src/core/server.ts +294 -0
- package/src/core/state.ts +179 -0
- package/src/generated/direct-ser.ts +495 -0
- package/src/generated/fbs/backend.fbs +139 -0
- package/src/generated/registry.ts +341 -0
- package/src/generated/rust/backend_generated.rs +2817 -0
- package/src/generated/ts/backend.ts +25 -0
- package/src/generated/ts/big-val.ts +106 -0
- package/src/generated/ts/complex.ts +303 -0
- package/src/generated/ts/customer.ts +137 -0
- package/src/generated/ts/hello.ts +123 -0
- package/src/generated/ts/join-group.ts +78 -0
- package/src/generated/ts/leave-group.ts +78 -0
- package/src/generated/ts/order-billing.ts +137 -0
- package/src/generated/ts/order-line.ts +144 -0
- package/src/generated/ts/order.ts +236 -0
- package/src/generated/ts/ping.ts +74 -0
- package/src/generated/ts/pong.ts +74 -0
- package/src/generated/ts/portfolio-position.ts +120 -0
- package/src/generated/ts/portfolio-snapshot.ts +170 -0
- package/src/generated/ts/quote.ts +148 -0
- package/src/generated/ts/side.ts +8 -0
- package/src/generated/ts/snapshot-request.ts +78 -0
- package/src/generated/ts/subscribe.ts +78 -0
- package/src/generated/ts/tags.ts +9 -0
- package/src/generated/ts/trade.ts +135 -0
- package/src/generated/ts/unsubscribe.ts +78 -0
- package/src/generated/ts/welcome.ts +112 -0
- package/src/generated/ts-ser.ts +465 -0
- package/src/generated/wire-registry.json +20 -0
- package/src/native/codec.ts +35 -0
- package/src/native/ffi.ts +214 -0
- package/src/native/loader.ts +55 -0
- package/src/schema/index.ts +217 -0
- package/src/server.ts +87 -0
- package/src/transport/byte-buffer-pool.ts +63 -0
- package/src/transport/scratch.ts +48 -0
- package/src/transport/stats.ts +44 -0
- package/src/transport/transport.ts +106 -0
|
@@ -0,0 +1,2817 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
// @generated
|
|
3
|
+
|
|
4
|
+
extern crate alloc;
|
|
5
|
+
|
|
6
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
7
|
+
pub const ENUM_MIN_SIDE: i32 = 0;
|
|
8
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
9
|
+
pub const ENUM_MAX_SIDE: i32 = 1;
|
|
10
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
11
|
+
#[allow(non_camel_case_types)]
|
|
12
|
+
pub const ENUM_VALUES_SIDE: [Side; 2] = [
|
|
13
|
+
Side::BUY,
|
|
14
|
+
Side::SELL,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
|
18
|
+
#[repr(transparent)]
|
|
19
|
+
pub struct Side(pub i32);
|
|
20
|
+
#[allow(non_upper_case_globals)]
|
|
21
|
+
impl Side {
|
|
22
|
+
pub const BUY: Self = Self(0);
|
|
23
|
+
pub const SELL: Self = Self(1);
|
|
24
|
+
|
|
25
|
+
pub const ENUM_MIN: i32 = 0;
|
|
26
|
+
pub const ENUM_MAX: i32 = 1;
|
|
27
|
+
pub const ENUM_VALUES: &'static [Self] = &[
|
|
28
|
+
Self::BUY,
|
|
29
|
+
Self::SELL,
|
|
30
|
+
];
|
|
31
|
+
/// Returns the variant's name or "" if unknown.
|
|
32
|
+
pub fn variant_name(self) -> Option<&'static str> {
|
|
33
|
+
match self {
|
|
34
|
+
Self::BUY => Some("BUY"),
|
|
35
|
+
Self::SELL => Some("SELL"),
|
|
36
|
+
_ => None,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
impl ::core::fmt::Debug for Side {
|
|
41
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
|
42
|
+
if let Some(name) = self.variant_name() {
|
|
43
|
+
f.write_str(name)
|
|
44
|
+
} else {
|
|
45
|
+
f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
impl<'a> ::flatbuffers::Follow<'a> for Side {
|
|
50
|
+
type Inner = Self;
|
|
51
|
+
#[inline]
|
|
52
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
53
|
+
let b = unsafe { ::flatbuffers::read_scalar_at::<i32>(buf, loc) };
|
|
54
|
+
Self(b)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
impl ::flatbuffers::Push for Side {
|
|
59
|
+
type Output = Side;
|
|
60
|
+
#[inline]
|
|
61
|
+
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
|
62
|
+
unsafe { ::flatbuffers::emplace_scalar::<i32>(dst, self.0) };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
impl ::flatbuffers::EndianScalar for Side {
|
|
67
|
+
type Scalar = i32;
|
|
68
|
+
#[inline]
|
|
69
|
+
fn to_little_endian(self) -> i32 {
|
|
70
|
+
self.0.to_le()
|
|
71
|
+
}
|
|
72
|
+
#[inline]
|
|
73
|
+
#[allow(clippy::wrong_self_convention)]
|
|
74
|
+
fn from_little_endian(v: i32) -> Self {
|
|
75
|
+
let b = i32::from_le(v);
|
|
76
|
+
Self(b)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
impl<'a> ::flatbuffers::Verifiable for Side {
|
|
81
|
+
#[inline]
|
|
82
|
+
fn run_verifier(
|
|
83
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
84
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
85
|
+
i32::run_verifier(v, pos)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
impl ::flatbuffers::SimpleToVerifyInSlice for Side {}
|
|
90
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
91
|
+
pub const ENUM_MIN_TAGS: i32 = 0;
|
|
92
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
93
|
+
pub const ENUM_MAX_TAGS: i32 = 2;
|
|
94
|
+
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
|
|
95
|
+
#[allow(non_camel_case_types)]
|
|
96
|
+
pub const ENUM_VALUES_TAGS: [Tags; 3] = [
|
|
97
|
+
Tags::HOT,
|
|
98
|
+
Tags::NEW,
|
|
99
|
+
Tags::SALE,
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
|
|
103
|
+
#[repr(transparent)]
|
|
104
|
+
pub struct Tags(pub i32);
|
|
105
|
+
#[allow(non_upper_case_globals)]
|
|
106
|
+
impl Tags {
|
|
107
|
+
pub const HOT: Self = Self(0);
|
|
108
|
+
pub const NEW: Self = Self(1);
|
|
109
|
+
pub const SALE: Self = Self(2);
|
|
110
|
+
|
|
111
|
+
pub const ENUM_MIN: i32 = 0;
|
|
112
|
+
pub const ENUM_MAX: i32 = 2;
|
|
113
|
+
pub const ENUM_VALUES: &'static [Self] = &[
|
|
114
|
+
Self::HOT,
|
|
115
|
+
Self::NEW,
|
|
116
|
+
Self::SALE,
|
|
117
|
+
];
|
|
118
|
+
/// Returns the variant's name or "" if unknown.
|
|
119
|
+
pub fn variant_name(self) -> Option<&'static str> {
|
|
120
|
+
match self {
|
|
121
|
+
Self::HOT => Some("HOT"),
|
|
122
|
+
Self::NEW => Some("NEW"),
|
|
123
|
+
Self::SALE => Some("SALE"),
|
|
124
|
+
_ => None,
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
impl ::core::fmt::Debug for Tags {
|
|
129
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
|
130
|
+
if let Some(name) = self.variant_name() {
|
|
131
|
+
f.write_str(name)
|
|
132
|
+
} else {
|
|
133
|
+
f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
impl<'a> ::flatbuffers::Follow<'a> for Tags {
|
|
138
|
+
type Inner = Self;
|
|
139
|
+
#[inline]
|
|
140
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
141
|
+
let b = unsafe { ::flatbuffers::read_scalar_at::<i32>(buf, loc) };
|
|
142
|
+
Self(b)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
impl ::flatbuffers::Push for Tags {
|
|
147
|
+
type Output = Tags;
|
|
148
|
+
#[inline]
|
|
149
|
+
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
|
150
|
+
unsafe { ::flatbuffers::emplace_scalar::<i32>(dst, self.0) };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
impl ::flatbuffers::EndianScalar for Tags {
|
|
155
|
+
type Scalar = i32;
|
|
156
|
+
#[inline]
|
|
157
|
+
fn to_little_endian(self) -> i32 {
|
|
158
|
+
self.0.to_le()
|
|
159
|
+
}
|
|
160
|
+
#[inline]
|
|
161
|
+
#[allow(clippy::wrong_self_convention)]
|
|
162
|
+
fn from_little_endian(v: i32) -> Self {
|
|
163
|
+
let b = i32::from_le(v);
|
|
164
|
+
Self(b)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
impl<'a> ::flatbuffers::Verifiable for Tags {
|
|
169
|
+
#[inline]
|
|
170
|
+
fn run_verifier(
|
|
171
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
172
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
173
|
+
i32::run_verifier(v, pos)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
impl ::flatbuffers::SimpleToVerifyInSlice for Tags {}
|
|
178
|
+
pub enum QuoteOffset {}
|
|
179
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
180
|
+
|
|
181
|
+
pub struct Quote<'a> {
|
|
182
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
impl<'a> ::flatbuffers::Follow<'a> for Quote<'a> {
|
|
186
|
+
type Inner = Quote<'a>;
|
|
187
|
+
#[inline]
|
|
188
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
189
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
impl<'a> Quote<'a> {
|
|
194
|
+
pub const VT_SYMBOL: ::flatbuffers::VOffsetT = 4;
|
|
195
|
+
pub const VT_BID: ::flatbuffers::VOffsetT = 6;
|
|
196
|
+
pub const VT_ASK: ::flatbuffers::VOffsetT = 8;
|
|
197
|
+
pub const VT_BID_SIZE: ::flatbuffers::VOffsetT = 10;
|
|
198
|
+
pub const VT_ASK_SIZE: ::flatbuffers::VOffsetT = 12;
|
|
199
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 14;
|
|
200
|
+
|
|
201
|
+
#[inline]
|
|
202
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
203
|
+
Quote { _tab: table }
|
|
204
|
+
}
|
|
205
|
+
#[allow(unused_mut)]
|
|
206
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
207
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
208
|
+
args: &'args QuoteArgs<'args>
|
|
209
|
+
) -> ::flatbuffers::WIPOffset<Quote<'bldr>> {
|
|
210
|
+
let mut builder = QuoteBuilder::new(_fbb);
|
|
211
|
+
builder.add_ts(args.ts);
|
|
212
|
+
builder.add_ask_size(args.ask_size);
|
|
213
|
+
builder.add_bid_size(args.bid_size);
|
|
214
|
+
builder.add_ask(args.ask);
|
|
215
|
+
builder.add_bid(args.bid);
|
|
216
|
+
if let Some(x) = args.symbol { builder.add_symbol(x); }
|
|
217
|
+
builder.finish()
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
#[inline]
|
|
222
|
+
pub fn symbol(&self) -> Option<&'a str> {
|
|
223
|
+
// Safety:
|
|
224
|
+
// Created from valid Table for this object
|
|
225
|
+
// which contains a valid value in this slot
|
|
226
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Quote::VT_SYMBOL, None)}
|
|
227
|
+
}
|
|
228
|
+
#[inline]
|
|
229
|
+
pub fn bid(&self) -> f64 {
|
|
230
|
+
// Safety:
|
|
231
|
+
// Created from valid Table for this object
|
|
232
|
+
// which contains a valid value in this slot
|
|
233
|
+
unsafe { self._tab.get::<f64>(Quote::VT_BID, Some(0.0)).unwrap()}
|
|
234
|
+
}
|
|
235
|
+
#[inline]
|
|
236
|
+
pub fn ask(&self) -> f64 {
|
|
237
|
+
// Safety:
|
|
238
|
+
// Created from valid Table for this object
|
|
239
|
+
// which contains a valid value in this slot
|
|
240
|
+
unsafe { self._tab.get::<f64>(Quote::VT_ASK, Some(0.0)).unwrap()}
|
|
241
|
+
}
|
|
242
|
+
#[inline]
|
|
243
|
+
pub fn bid_size(&self) -> i64 {
|
|
244
|
+
// Safety:
|
|
245
|
+
// Created from valid Table for this object
|
|
246
|
+
// which contains a valid value in this slot
|
|
247
|
+
unsafe { self._tab.get::<i64>(Quote::VT_BID_SIZE, Some(0)).unwrap()}
|
|
248
|
+
}
|
|
249
|
+
#[inline]
|
|
250
|
+
pub fn ask_size(&self) -> i64 {
|
|
251
|
+
// Safety:
|
|
252
|
+
// Created from valid Table for this object
|
|
253
|
+
// which contains a valid value in this slot
|
|
254
|
+
unsafe { self._tab.get::<i64>(Quote::VT_ASK_SIZE, Some(0)).unwrap()}
|
|
255
|
+
}
|
|
256
|
+
#[inline]
|
|
257
|
+
pub fn ts(&self) -> i64 {
|
|
258
|
+
// Safety:
|
|
259
|
+
// Created from valid Table for this object
|
|
260
|
+
// which contains a valid value in this slot
|
|
261
|
+
unsafe { self._tab.get::<i64>(Quote::VT_TS, Some(0)).unwrap()}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
impl ::flatbuffers::Verifiable for Quote<'_> {
|
|
266
|
+
#[inline]
|
|
267
|
+
fn run_verifier(
|
|
268
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
269
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
270
|
+
v.visit_table(pos)?
|
|
271
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("symbol", Self::VT_SYMBOL, false)?
|
|
272
|
+
.visit_field::<f64>("bid", Self::VT_BID, false)?
|
|
273
|
+
.visit_field::<f64>("ask", Self::VT_ASK, false)?
|
|
274
|
+
.visit_field::<i64>("bid_size", Self::VT_BID_SIZE, false)?
|
|
275
|
+
.visit_field::<i64>("ask_size", Self::VT_ASK_SIZE, false)?
|
|
276
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
277
|
+
.finish();
|
|
278
|
+
Ok(())
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
pub struct QuoteArgs<'a> {
|
|
282
|
+
pub symbol: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
283
|
+
pub bid: f64,
|
|
284
|
+
pub ask: f64,
|
|
285
|
+
pub bid_size: i64,
|
|
286
|
+
pub ask_size: i64,
|
|
287
|
+
pub ts: i64,
|
|
288
|
+
}
|
|
289
|
+
impl<'a> Default for QuoteArgs<'a> {
|
|
290
|
+
#[inline]
|
|
291
|
+
fn default() -> Self {
|
|
292
|
+
QuoteArgs {
|
|
293
|
+
symbol: None,
|
|
294
|
+
bid: 0.0,
|
|
295
|
+
ask: 0.0,
|
|
296
|
+
bid_size: 0,
|
|
297
|
+
ask_size: 0,
|
|
298
|
+
ts: 0,
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
pub struct QuoteBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
304
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
305
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
306
|
+
}
|
|
307
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> QuoteBuilder<'a, 'b, A> {
|
|
308
|
+
#[inline]
|
|
309
|
+
pub fn add_symbol(&mut self, symbol: ::flatbuffers::WIPOffset<&'b str>) {
|
|
310
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Quote::VT_SYMBOL, symbol);
|
|
311
|
+
}
|
|
312
|
+
#[inline]
|
|
313
|
+
pub fn add_bid(&mut self, bid: f64) {
|
|
314
|
+
self.fbb_.push_slot::<f64>(Quote::VT_BID, bid, 0.0);
|
|
315
|
+
}
|
|
316
|
+
#[inline]
|
|
317
|
+
pub fn add_ask(&mut self, ask: f64) {
|
|
318
|
+
self.fbb_.push_slot::<f64>(Quote::VT_ASK, ask, 0.0);
|
|
319
|
+
}
|
|
320
|
+
#[inline]
|
|
321
|
+
pub fn add_bid_size(&mut self, bid_size: i64) {
|
|
322
|
+
self.fbb_.push_slot::<i64>(Quote::VT_BID_SIZE, bid_size, 0);
|
|
323
|
+
}
|
|
324
|
+
#[inline]
|
|
325
|
+
pub fn add_ask_size(&mut self, ask_size: i64) {
|
|
326
|
+
self.fbb_.push_slot::<i64>(Quote::VT_ASK_SIZE, ask_size, 0);
|
|
327
|
+
}
|
|
328
|
+
#[inline]
|
|
329
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
330
|
+
self.fbb_.push_slot::<i64>(Quote::VT_TS, ts, 0);
|
|
331
|
+
}
|
|
332
|
+
#[inline]
|
|
333
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> QuoteBuilder<'a, 'b, A> {
|
|
334
|
+
let start = _fbb.start_table();
|
|
335
|
+
QuoteBuilder {
|
|
336
|
+
fbb_: _fbb,
|
|
337
|
+
start_: start,
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
#[inline]
|
|
341
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Quote<'a>> {
|
|
342
|
+
let o = self.fbb_.end_table(self.start_);
|
|
343
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
impl ::core::fmt::Debug for Quote<'_> {
|
|
348
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
349
|
+
let mut ds = f.debug_struct("Quote");
|
|
350
|
+
ds.field("symbol", &self.symbol());
|
|
351
|
+
ds.field("bid", &self.bid());
|
|
352
|
+
ds.field("ask", &self.ask());
|
|
353
|
+
ds.field("bid_size", &self.bid_size());
|
|
354
|
+
ds.field("ask_size", &self.ask_size());
|
|
355
|
+
ds.field("ts", &self.ts());
|
|
356
|
+
ds.finish()
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
pub enum TradeOffset {}
|
|
360
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
361
|
+
|
|
362
|
+
pub struct Trade<'a> {
|
|
363
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
impl<'a> ::flatbuffers::Follow<'a> for Trade<'a> {
|
|
367
|
+
type Inner = Trade<'a>;
|
|
368
|
+
#[inline]
|
|
369
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
370
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
impl<'a> Trade<'a> {
|
|
375
|
+
pub const VT_SYMBOL: ::flatbuffers::VOffsetT = 4;
|
|
376
|
+
pub const VT_PRICE: ::flatbuffers::VOffsetT = 6;
|
|
377
|
+
pub const VT_VOLUME: ::flatbuffers::VOffsetT = 8;
|
|
378
|
+
pub const VT_SIDE: ::flatbuffers::VOffsetT = 10;
|
|
379
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 12;
|
|
380
|
+
|
|
381
|
+
#[inline]
|
|
382
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
383
|
+
Trade { _tab: table }
|
|
384
|
+
}
|
|
385
|
+
#[allow(unused_mut)]
|
|
386
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
387
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
388
|
+
args: &'args TradeArgs<'args>
|
|
389
|
+
) -> ::flatbuffers::WIPOffset<Trade<'bldr>> {
|
|
390
|
+
let mut builder = TradeBuilder::new(_fbb);
|
|
391
|
+
builder.add_ts(args.ts);
|
|
392
|
+
builder.add_volume(args.volume);
|
|
393
|
+
builder.add_price(args.price);
|
|
394
|
+
builder.add_side(args.side);
|
|
395
|
+
if let Some(x) = args.symbol { builder.add_symbol(x); }
|
|
396
|
+
builder.finish()
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
#[inline]
|
|
401
|
+
pub fn symbol(&self) -> Option<&'a str> {
|
|
402
|
+
// Safety:
|
|
403
|
+
// Created from valid Table for this object
|
|
404
|
+
// which contains a valid value in this slot
|
|
405
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Trade::VT_SYMBOL, None)}
|
|
406
|
+
}
|
|
407
|
+
#[inline]
|
|
408
|
+
pub fn price(&self) -> f64 {
|
|
409
|
+
// Safety:
|
|
410
|
+
// Created from valid Table for this object
|
|
411
|
+
// which contains a valid value in this slot
|
|
412
|
+
unsafe { self._tab.get::<f64>(Trade::VT_PRICE, Some(0.0)).unwrap()}
|
|
413
|
+
}
|
|
414
|
+
#[inline]
|
|
415
|
+
pub fn volume(&self) -> i64 {
|
|
416
|
+
// Safety:
|
|
417
|
+
// Created from valid Table for this object
|
|
418
|
+
// which contains a valid value in this slot
|
|
419
|
+
unsafe { self._tab.get::<i64>(Trade::VT_VOLUME, Some(0)).unwrap()}
|
|
420
|
+
}
|
|
421
|
+
#[inline]
|
|
422
|
+
pub fn side(&self) -> Side {
|
|
423
|
+
// Safety:
|
|
424
|
+
// Created from valid Table for this object
|
|
425
|
+
// which contains a valid value in this slot
|
|
426
|
+
unsafe { self._tab.get::<Side>(Trade::VT_SIDE, Some(Side::BUY)).unwrap()}
|
|
427
|
+
}
|
|
428
|
+
#[inline]
|
|
429
|
+
pub fn ts(&self) -> i64 {
|
|
430
|
+
// Safety:
|
|
431
|
+
// Created from valid Table for this object
|
|
432
|
+
// which contains a valid value in this slot
|
|
433
|
+
unsafe { self._tab.get::<i64>(Trade::VT_TS, Some(0)).unwrap()}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
impl ::flatbuffers::Verifiable for Trade<'_> {
|
|
438
|
+
#[inline]
|
|
439
|
+
fn run_verifier(
|
|
440
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
441
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
442
|
+
v.visit_table(pos)?
|
|
443
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("symbol", Self::VT_SYMBOL, false)?
|
|
444
|
+
.visit_field::<f64>("price", Self::VT_PRICE, false)?
|
|
445
|
+
.visit_field::<i64>("volume", Self::VT_VOLUME, false)?
|
|
446
|
+
.visit_field::<Side>("side", Self::VT_SIDE, false)?
|
|
447
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
448
|
+
.finish();
|
|
449
|
+
Ok(())
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
pub struct TradeArgs<'a> {
|
|
453
|
+
pub symbol: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
454
|
+
pub price: f64,
|
|
455
|
+
pub volume: i64,
|
|
456
|
+
pub side: Side,
|
|
457
|
+
pub ts: i64,
|
|
458
|
+
}
|
|
459
|
+
impl<'a> Default for TradeArgs<'a> {
|
|
460
|
+
#[inline]
|
|
461
|
+
fn default() -> Self {
|
|
462
|
+
TradeArgs {
|
|
463
|
+
symbol: None,
|
|
464
|
+
price: 0.0,
|
|
465
|
+
volume: 0,
|
|
466
|
+
side: Side::BUY,
|
|
467
|
+
ts: 0,
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
pub struct TradeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
473
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
474
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
475
|
+
}
|
|
476
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> TradeBuilder<'a, 'b, A> {
|
|
477
|
+
#[inline]
|
|
478
|
+
pub fn add_symbol(&mut self, symbol: ::flatbuffers::WIPOffset<&'b str>) {
|
|
479
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Trade::VT_SYMBOL, symbol);
|
|
480
|
+
}
|
|
481
|
+
#[inline]
|
|
482
|
+
pub fn add_price(&mut self, price: f64) {
|
|
483
|
+
self.fbb_.push_slot::<f64>(Trade::VT_PRICE, price, 0.0);
|
|
484
|
+
}
|
|
485
|
+
#[inline]
|
|
486
|
+
pub fn add_volume(&mut self, volume: i64) {
|
|
487
|
+
self.fbb_.push_slot::<i64>(Trade::VT_VOLUME, volume, 0);
|
|
488
|
+
}
|
|
489
|
+
#[inline]
|
|
490
|
+
pub fn add_side(&mut self, side: Side) {
|
|
491
|
+
self.fbb_.push_slot::<Side>(Trade::VT_SIDE, side, Side::BUY);
|
|
492
|
+
}
|
|
493
|
+
#[inline]
|
|
494
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
495
|
+
self.fbb_.push_slot::<i64>(Trade::VT_TS, ts, 0);
|
|
496
|
+
}
|
|
497
|
+
#[inline]
|
|
498
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> TradeBuilder<'a, 'b, A> {
|
|
499
|
+
let start = _fbb.start_table();
|
|
500
|
+
TradeBuilder {
|
|
501
|
+
fbb_: _fbb,
|
|
502
|
+
start_: start,
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
#[inline]
|
|
506
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Trade<'a>> {
|
|
507
|
+
let o = self.fbb_.end_table(self.start_);
|
|
508
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
impl ::core::fmt::Debug for Trade<'_> {
|
|
513
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
514
|
+
let mut ds = f.debug_struct("Trade");
|
|
515
|
+
ds.field("symbol", &self.symbol());
|
|
516
|
+
ds.field("price", &self.price());
|
|
517
|
+
ds.field("volume", &self.volume());
|
|
518
|
+
ds.field("side", &self.side());
|
|
519
|
+
ds.field("ts", &self.ts());
|
|
520
|
+
ds.finish()
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
pub enum PortfolioSnapshotOffset {}
|
|
524
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
525
|
+
|
|
526
|
+
pub struct PortfolioSnapshot<'a> {
|
|
527
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
impl<'a> ::flatbuffers::Follow<'a> for PortfolioSnapshot<'a> {
|
|
531
|
+
type Inner = PortfolioSnapshot<'a>;
|
|
532
|
+
#[inline]
|
|
533
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
534
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
impl<'a> PortfolioSnapshot<'a> {
|
|
539
|
+
pub const VT_ACCOUNT_ID: ::flatbuffers::VOffsetT = 4;
|
|
540
|
+
pub const VT_POSITIONS: ::flatbuffers::VOffsetT = 6;
|
|
541
|
+
pub const VT_TOTAL_VALUE: ::flatbuffers::VOffsetT = 8;
|
|
542
|
+
pub const VT_CASH: ::flatbuffers::VOffsetT = 10;
|
|
543
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 12;
|
|
544
|
+
pub const VT_UPDATED_BY: ::flatbuffers::VOffsetT = 14;
|
|
545
|
+
|
|
546
|
+
#[inline]
|
|
547
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
548
|
+
PortfolioSnapshot { _tab: table }
|
|
549
|
+
}
|
|
550
|
+
#[allow(unused_mut)]
|
|
551
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
552
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
553
|
+
args: &'args PortfolioSnapshotArgs<'args>
|
|
554
|
+
) -> ::flatbuffers::WIPOffset<PortfolioSnapshot<'bldr>> {
|
|
555
|
+
let mut builder = PortfolioSnapshotBuilder::new(_fbb);
|
|
556
|
+
builder.add_ts(args.ts);
|
|
557
|
+
builder.add_cash(args.cash);
|
|
558
|
+
builder.add_total_value(args.total_value);
|
|
559
|
+
if let Some(x) = args.updated_by { builder.add_updated_by(x); }
|
|
560
|
+
if let Some(x) = args.positions { builder.add_positions(x); }
|
|
561
|
+
if let Some(x) = args.account_id { builder.add_account_id(x); }
|
|
562
|
+
builder.finish()
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
#[inline]
|
|
567
|
+
pub fn account_id(&self) -> Option<&'a str> {
|
|
568
|
+
// Safety:
|
|
569
|
+
// Created from valid Table for this object
|
|
570
|
+
// which contains a valid value in this slot
|
|
571
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(PortfolioSnapshot::VT_ACCOUNT_ID, None)}
|
|
572
|
+
}
|
|
573
|
+
#[inline]
|
|
574
|
+
pub fn positions(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PortfolioPosition<'a>>>> {
|
|
575
|
+
// Safety:
|
|
576
|
+
// Created from valid Table for this object
|
|
577
|
+
// which contains a valid value in this slot
|
|
578
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PortfolioPosition>>>>(PortfolioSnapshot::VT_POSITIONS, None)}
|
|
579
|
+
}
|
|
580
|
+
#[inline]
|
|
581
|
+
pub fn total_value(&self) -> f64 {
|
|
582
|
+
// Safety:
|
|
583
|
+
// Created from valid Table for this object
|
|
584
|
+
// which contains a valid value in this slot
|
|
585
|
+
unsafe { self._tab.get::<f64>(PortfolioSnapshot::VT_TOTAL_VALUE, Some(0.0)).unwrap()}
|
|
586
|
+
}
|
|
587
|
+
#[inline]
|
|
588
|
+
pub fn cash(&self) -> f64 {
|
|
589
|
+
// Safety:
|
|
590
|
+
// Created from valid Table for this object
|
|
591
|
+
// which contains a valid value in this slot
|
|
592
|
+
unsafe { self._tab.get::<f64>(PortfolioSnapshot::VT_CASH, Some(0.0)).unwrap()}
|
|
593
|
+
}
|
|
594
|
+
#[inline]
|
|
595
|
+
pub fn ts(&self) -> i64 {
|
|
596
|
+
// Safety:
|
|
597
|
+
// Created from valid Table for this object
|
|
598
|
+
// which contains a valid value in this slot
|
|
599
|
+
unsafe { self._tab.get::<i64>(PortfolioSnapshot::VT_TS, Some(0)).unwrap()}
|
|
600
|
+
}
|
|
601
|
+
#[inline]
|
|
602
|
+
pub fn updated_by(&self) -> Option<&'a str> {
|
|
603
|
+
// Safety:
|
|
604
|
+
// Created from valid Table for this object
|
|
605
|
+
// which contains a valid value in this slot
|
|
606
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(PortfolioSnapshot::VT_UPDATED_BY, None)}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
impl ::flatbuffers::Verifiable for PortfolioSnapshot<'_> {
|
|
611
|
+
#[inline]
|
|
612
|
+
fn run_verifier(
|
|
613
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
614
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
615
|
+
v.visit_table(pos)?
|
|
616
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("account_id", Self::VT_ACCOUNT_ID, false)?
|
|
617
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<PortfolioPosition>>>>("positions", Self::VT_POSITIONS, false)?
|
|
618
|
+
.visit_field::<f64>("total_value", Self::VT_TOTAL_VALUE, false)?
|
|
619
|
+
.visit_field::<f64>("cash", Self::VT_CASH, false)?
|
|
620
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
621
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("updated_by", Self::VT_UPDATED_BY, false)?
|
|
622
|
+
.finish();
|
|
623
|
+
Ok(())
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
pub struct PortfolioSnapshotArgs<'a> {
|
|
627
|
+
pub account_id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
628
|
+
pub positions: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<PortfolioPosition<'a>>>>>,
|
|
629
|
+
pub total_value: f64,
|
|
630
|
+
pub cash: f64,
|
|
631
|
+
pub ts: i64,
|
|
632
|
+
pub updated_by: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
633
|
+
}
|
|
634
|
+
impl<'a> Default for PortfolioSnapshotArgs<'a> {
|
|
635
|
+
#[inline]
|
|
636
|
+
fn default() -> Self {
|
|
637
|
+
PortfolioSnapshotArgs {
|
|
638
|
+
account_id: None,
|
|
639
|
+
positions: None,
|
|
640
|
+
total_value: 0.0,
|
|
641
|
+
cash: 0.0,
|
|
642
|
+
ts: 0,
|
|
643
|
+
updated_by: None,
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
pub struct PortfolioSnapshotBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
649
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
650
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
651
|
+
}
|
|
652
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PortfolioSnapshotBuilder<'a, 'b, A> {
|
|
653
|
+
#[inline]
|
|
654
|
+
pub fn add_account_id(&mut self, account_id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
655
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PortfolioSnapshot::VT_ACCOUNT_ID, account_id);
|
|
656
|
+
}
|
|
657
|
+
#[inline]
|
|
658
|
+
pub fn add_positions(&mut self, positions: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<PortfolioPosition<'b >>>>) {
|
|
659
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PortfolioSnapshot::VT_POSITIONS, positions);
|
|
660
|
+
}
|
|
661
|
+
#[inline]
|
|
662
|
+
pub fn add_total_value(&mut self, total_value: f64) {
|
|
663
|
+
self.fbb_.push_slot::<f64>(PortfolioSnapshot::VT_TOTAL_VALUE, total_value, 0.0);
|
|
664
|
+
}
|
|
665
|
+
#[inline]
|
|
666
|
+
pub fn add_cash(&mut self, cash: f64) {
|
|
667
|
+
self.fbb_.push_slot::<f64>(PortfolioSnapshot::VT_CASH, cash, 0.0);
|
|
668
|
+
}
|
|
669
|
+
#[inline]
|
|
670
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
671
|
+
self.fbb_.push_slot::<i64>(PortfolioSnapshot::VT_TS, ts, 0);
|
|
672
|
+
}
|
|
673
|
+
#[inline]
|
|
674
|
+
pub fn add_updated_by(&mut self, updated_by: ::flatbuffers::WIPOffset<&'b str>) {
|
|
675
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PortfolioSnapshot::VT_UPDATED_BY, updated_by);
|
|
676
|
+
}
|
|
677
|
+
#[inline]
|
|
678
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PortfolioSnapshotBuilder<'a, 'b, A> {
|
|
679
|
+
let start = _fbb.start_table();
|
|
680
|
+
PortfolioSnapshotBuilder {
|
|
681
|
+
fbb_: _fbb,
|
|
682
|
+
start_: start,
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
#[inline]
|
|
686
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<PortfolioSnapshot<'a>> {
|
|
687
|
+
let o = self.fbb_.end_table(self.start_);
|
|
688
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
impl ::core::fmt::Debug for PortfolioSnapshot<'_> {
|
|
693
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
694
|
+
let mut ds = f.debug_struct("PortfolioSnapshot");
|
|
695
|
+
ds.field("account_id", &self.account_id());
|
|
696
|
+
ds.field("positions", &self.positions());
|
|
697
|
+
ds.field("total_value", &self.total_value());
|
|
698
|
+
ds.field("cash", &self.cash());
|
|
699
|
+
ds.field("ts", &self.ts());
|
|
700
|
+
ds.field("updated_by", &self.updated_by());
|
|
701
|
+
ds.finish()
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
pub enum PortfolioPositionOffset {}
|
|
705
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
706
|
+
|
|
707
|
+
pub struct PortfolioPosition<'a> {
|
|
708
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
impl<'a> ::flatbuffers::Follow<'a> for PortfolioPosition<'a> {
|
|
712
|
+
type Inner = PortfolioPosition<'a>;
|
|
713
|
+
#[inline]
|
|
714
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
715
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
impl<'a> PortfolioPosition<'a> {
|
|
720
|
+
pub const VT_SYMBOL: ::flatbuffers::VOffsetT = 4;
|
|
721
|
+
pub const VT_QUANTITY: ::flatbuffers::VOffsetT = 6;
|
|
722
|
+
pub const VT_AVG_PRICE: ::flatbuffers::VOffsetT = 8;
|
|
723
|
+
pub const VT_PNL: ::flatbuffers::VOffsetT = 10;
|
|
724
|
+
|
|
725
|
+
#[inline]
|
|
726
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
727
|
+
PortfolioPosition { _tab: table }
|
|
728
|
+
}
|
|
729
|
+
#[allow(unused_mut)]
|
|
730
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
731
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
732
|
+
args: &'args PortfolioPositionArgs<'args>
|
|
733
|
+
) -> ::flatbuffers::WIPOffset<PortfolioPosition<'bldr>> {
|
|
734
|
+
let mut builder = PortfolioPositionBuilder::new(_fbb);
|
|
735
|
+
builder.add_pnl(args.pnl);
|
|
736
|
+
builder.add_avg_price(args.avg_price);
|
|
737
|
+
builder.add_quantity(args.quantity);
|
|
738
|
+
if let Some(x) = args.symbol { builder.add_symbol(x); }
|
|
739
|
+
builder.finish()
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
#[inline]
|
|
744
|
+
pub fn symbol(&self) -> Option<&'a str> {
|
|
745
|
+
// Safety:
|
|
746
|
+
// Created from valid Table for this object
|
|
747
|
+
// which contains a valid value in this slot
|
|
748
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(PortfolioPosition::VT_SYMBOL, None)}
|
|
749
|
+
}
|
|
750
|
+
#[inline]
|
|
751
|
+
pub fn quantity(&self) -> i64 {
|
|
752
|
+
// Safety:
|
|
753
|
+
// Created from valid Table for this object
|
|
754
|
+
// which contains a valid value in this slot
|
|
755
|
+
unsafe { self._tab.get::<i64>(PortfolioPosition::VT_QUANTITY, Some(0)).unwrap()}
|
|
756
|
+
}
|
|
757
|
+
#[inline]
|
|
758
|
+
pub fn avg_price(&self) -> f64 {
|
|
759
|
+
// Safety:
|
|
760
|
+
// Created from valid Table for this object
|
|
761
|
+
// which contains a valid value in this slot
|
|
762
|
+
unsafe { self._tab.get::<f64>(PortfolioPosition::VT_AVG_PRICE, Some(0.0)).unwrap()}
|
|
763
|
+
}
|
|
764
|
+
#[inline]
|
|
765
|
+
pub fn pnl(&self) -> f64 {
|
|
766
|
+
// Safety:
|
|
767
|
+
// Created from valid Table for this object
|
|
768
|
+
// which contains a valid value in this slot
|
|
769
|
+
unsafe { self._tab.get::<f64>(PortfolioPosition::VT_PNL, Some(0.0)).unwrap()}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
impl ::flatbuffers::Verifiable for PortfolioPosition<'_> {
|
|
774
|
+
#[inline]
|
|
775
|
+
fn run_verifier(
|
|
776
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
777
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
778
|
+
v.visit_table(pos)?
|
|
779
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("symbol", Self::VT_SYMBOL, false)?
|
|
780
|
+
.visit_field::<i64>("quantity", Self::VT_QUANTITY, false)?
|
|
781
|
+
.visit_field::<f64>("avg_price", Self::VT_AVG_PRICE, false)?
|
|
782
|
+
.visit_field::<f64>("pnl", Self::VT_PNL, false)?
|
|
783
|
+
.finish();
|
|
784
|
+
Ok(())
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
pub struct PortfolioPositionArgs<'a> {
|
|
788
|
+
pub symbol: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
789
|
+
pub quantity: i64,
|
|
790
|
+
pub avg_price: f64,
|
|
791
|
+
pub pnl: f64,
|
|
792
|
+
}
|
|
793
|
+
impl<'a> Default for PortfolioPositionArgs<'a> {
|
|
794
|
+
#[inline]
|
|
795
|
+
fn default() -> Self {
|
|
796
|
+
PortfolioPositionArgs {
|
|
797
|
+
symbol: None,
|
|
798
|
+
quantity: 0,
|
|
799
|
+
avg_price: 0.0,
|
|
800
|
+
pnl: 0.0,
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
pub struct PortfolioPositionBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
806
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
807
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
808
|
+
}
|
|
809
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PortfolioPositionBuilder<'a, 'b, A> {
|
|
810
|
+
#[inline]
|
|
811
|
+
pub fn add_symbol(&mut self, symbol: ::flatbuffers::WIPOffset<&'b str>) {
|
|
812
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(PortfolioPosition::VT_SYMBOL, symbol);
|
|
813
|
+
}
|
|
814
|
+
#[inline]
|
|
815
|
+
pub fn add_quantity(&mut self, quantity: i64) {
|
|
816
|
+
self.fbb_.push_slot::<i64>(PortfolioPosition::VT_QUANTITY, quantity, 0);
|
|
817
|
+
}
|
|
818
|
+
#[inline]
|
|
819
|
+
pub fn add_avg_price(&mut self, avg_price: f64) {
|
|
820
|
+
self.fbb_.push_slot::<f64>(PortfolioPosition::VT_AVG_PRICE, avg_price, 0.0);
|
|
821
|
+
}
|
|
822
|
+
#[inline]
|
|
823
|
+
pub fn add_pnl(&mut self, pnl: f64) {
|
|
824
|
+
self.fbb_.push_slot::<f64>(PortfolioPosition::VT_PNL, pnl, 0.0);
|
|
825
|
+
}
|
|
826
|
+
#[inline]
|
|
827
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PortfolioPositionBuilder<'a, 'b, A> {
|
|
828
|
+
let start = _fbb.start_table();
|
|
829
|
+
PortfolioPositionBuilder {
|
|
830
|
+
fbb_: _fbb,
|
|
831
|
+
start_: start,
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
#[inline]
|
|
835
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<PortfolioPosition<'a>> {
|
|
836
|
+
let o = self.fbb_.end_table(self.start_);
|
|
837
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
impl ::core::fmt::Debug for PortfolioPosition<'_> {
|
|
842
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
843
|
+
let mut ds = f.debug_struct("PortfolioPosition");
|
|
844
|
+
ds.field("symbol", &self.symbol());
|
|
845
|
+
ds.field("quantity", &self.quantity());
|
|
846
|
+
ds.field("avg_price", &self.avg_price());
|
|
847
|
+
ds.field("pnl", &self.pnl());
|
|
848
|
+
ds.finish()
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
pub enum ComplexOffset {}
|
|
852
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
853
|
+
|
|
854
|
+
pub struct Complex<'a> {
|
|
855
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
impl<'a> ::flatbuffers::Follow<'a> for Complex<'a> {
|
|
859
|
+
type Inner = Complex<'a>;
|
|
860
|
+
#[inline]
|
|
861
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
862
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
impl<'a> Complex<'a> {
|
|
867
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
868
|
+
pub const VT_NAMES: ::flatbuffers::VOffsetT = 6;
|
|
869
|
+
pub const VT_PRICES: ::flatbuffers::VOffsetT = 8;
|
|
870
|
+
pub const VT_COUNTS: ::flatbuffers::VOffsetT = 10;
|
|
871
|
+
pub const VT_FLAGS: ::flatbuffers::VOffsetT = 12;
|
|
872
|
+
pub const VT_TAGS: ::flatbuffers::VOffsetT = 14;
|
|
873
|
+
pub const VT_ACTIVE: ::flatbuffers::VOffsetT = 16;
|
|
874
|
+
pub const VT_TOTAL: ::flatbuffers::VOffsetT = 18;
|
|
875
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 20;
|
|
876
|
+
|
|
877
|
+
#[inline]
|
|
878
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
879
|
+
Complex { _tab: table }
|
|
880
|
+
}
|
|
881
|
+
#[allow(unused_mut)]
|
|
882
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
883
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
884
|
+
args: &'args ComplexArgs<'args>
|
|
885
|
+
) -> ::flatbuffers::WIPOffset<Complex<'bldr>> {
|
|
886
|
+
let mut builder = ComplexBuilder::new(_fbb);
|
|
887
|
+
builder.add_ts(args.ts);
|
|
888
|
+
builder.add_total(args.total);
|
|
889
|
+
if let Some(x) = args.tags { builder.add_tags(x); }
|
|
890
|
+
if let Some(x) = args.flags { builder.add_flags(x); }
|
|
891
|
+
if let Some(x) = args.counts { builder.add_counts(x); }
|
|
892
|
+
if let Some(x) = args.prices { builder.add_prices(x); }
|
|
893
|
+
if let Some(x) = args.names { builder.add_names(x); }
|
|
894
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
895
|
+
builder.add_active(args.active);
|
|
896
|
+
builder.finish()
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
#[inline]
|
|
901
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
902
|
+
// Safety:
|
|
903
|
+
// Created from valid Table for this object
|
|
904
|
+
// which contains a valid value in this slot
|
|
905
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Complex::VT_ID, None)}
|
|
906
|
+
}
|
|
907
|
+
#[inline]
|
|
908
|
+
pub fn names(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>> {
|
|
909
|
+
// Safety:
|
|
910
|
+
// Created from valid Table for this object
|
|
911
|
+
// which contains a valid value in this slot
|
|
912
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>(Complex::VT_NAMES, None)}
|
|
913
|
+
}
|
|
914
|
+
#[inline]
|
|
915
|
+
pub fn prices(&self) -> Option<::flatbuffers::Vector<'a, f64>> {
|
|
916
|
+
// Safety:
|
|
917
|
+
// Created from valid Table for this object
|
|
918
|
+
// which contains a valid value in this slot
|
|
919
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, f64>>>(Complex::VT_PRICES, None)}
|
|
920
|
+
}
|
|
921
|
+
#[inline]
|
|
922
|
+
pub fn counts(&self) -> Option<::flatbuffers::Vector<'a, i64>> {
|
|
923
|
+
// Safety:
|
|
924
|
+
// Created from valid Table for this object
|
|
925
|
+
// which contains a valid value in this slot
|
|
926
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, i64>>>(Complex::VT_COUNTS, None)}
|
|
927
|
+
}
|
|
928
|
+
#[inline]
|
|
929
|
+
pub fn flags(&self) -> Option<::flatbuffers::Vector<'a, bool>> {
|
|
930
|
+
// Safety:
|
|
931
|
+
// Created from valid Table for this object
|
|
932
|
+
// which contains a valid value in this slot
|
|
933
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, bool>>>(Complex::VT_FLAGS, None)}
|
|
934
|
+
}
|
|
935
|
+
#[inline]
|
|
936
|
+
pub fn tags(&self) -> Option<::flatbuffers::Vector<'a, Tags>> {
|
|
937
|
+
// Safety:
|
|
938
|
+
// Created from valid Table for this object
|
|
939
|
+
// which contains a valid value in this slot
|
|
940
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, Tags>>>(Complex::VT_TAGS, None)}
|
|
941
|
+
}
|
|
942
|
+
#[inline]
|
|
943
|
+
pub fn active(&self) -> bool {
|
|
944
|
+
// Safety:
|
|
945
|
+
// Created from valid Table for this object
|
|
946
|
+
// which contains a valid value in this slot
|
|
947
|
+
unsafe { self._tab.get::<bool>(Complex::VT_ACTIVE, Some(false)).unwrap()}
|
|
948
|
+
}
|
|
949
|
+
#[inline]
|
|
950
|
+
pub fn total(&self) -> f64 {
|
|
951
|
+
// Safety:
|
|
952
|
+
// Created from valid Table for this object
|
|
953
|
+
// which contains a valid value in this slot
|
|
954
|
+
unsafe { self._tab.get::<f64>(Complex::VT_TOTAL, Some(0.0)).unwrap()}
|
|
955
|
+
}
|
|
956
|
+
#[inline]
|
|
957
|
+
pub fn ts(&self) -> i64 {
|
|
958
|
+
// Safety:
|
|
959
|
+
// Created from valid Table for this object
|
|
960
|
+
// which contains a valid value in this slot
|
|
961
|
+
unsafe { self._tab.get::<i64>(Complex::VT_TS, Some(0)).unwrap()}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
impl ::flatbuffers::Verifiable for Complex<'_> {
|
|
966
|
+
#[inline]
|
|
967
|
+
fn run_verifier(
|
|
968
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
969
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
970
|
+
v.visit_table(pos)?
|
|
971
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
972
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<&'_ str>>>>("names", Self::VT_NAMES, false)?
|
|
973
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, f64>>>("prices", Self::VT_PRICES, false)?
|
|
974
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, i64>>>("counts", Self::VT_COUNTS, false)?
|
|
975
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, bool>>>("flags", Self::VT_FLAGS, false)?
|
|
976
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, Tags>>>("tags", Self::VT_TAGS, false)?
|
|
977
|
+
.visit_field::<bool>("active", Self::VT_ACTIVE, false)?
|
|
978
|
+
.visit_field::<f64>("total", Self::VT_TOTAL, false)?
|
|
979
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
980
|
+
.finish();
|
|
981
|
+
Ok(())
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
pub struct ComplexArgs<'a> {
|
|
985
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
986
|
+
pub names: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>,
|
|
987
|
+
pub prices: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, f64>>>,
|
|
988
|
+
pub counts: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, i64>>>,
|
|
989
|
+
pub flags: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, bool>>>,
|
|
990
|
+
pub tags: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, Tags>>>,
|
|
991
|
+
pub active: bool,
|
|
992
|
+
pub total: f64,
|
|
993
|
+
pub ts: i64,
|
|
994
|
+
}
|
|
995
|
+
impl<'a> Default for ComplexArgs<'a> {
|
|
996
|
+
#[inline]
|
|
997
|
+
fn default() -> Self {
|
|
998
|
+
ComplexArgs {
|
|
999
|
+
id: None,
|
|
1000
|
+
names: None,
|
|
1001
|
+
prices: None,
|
|
1002
|
+
counts: None,
|
|
1003
|
+
flags: None,
|
|
1004
|
+
tags: None,
|
|
1005
|
+
active: false,
|
|
1006
|
+
total: 0.0,
|
|
1007
|
+
ts: 0,
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
pub struct ComplexBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1013
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1014
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1015
|
+
}
|
|
1016
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ComplexBuilder<'a, 'b, A> {
|
|
1017
|
+
#[inline]
|
|
1018
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1019
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_ID, id);
|
|
1020
|
+
}
|
|
1021
|
+
#[inline]
|
|
1022
|
+
pub fn add_names(&mut self, names: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<&'b str>>>) {
|
|
1023
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_NAMES, names);
|
|
1024
|
+
}
|
|
1025
|
+
#[inline]
|
|
1026
|
+
pub fn add_prices(&mut self, prices: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , f64>>) {
|
|
1027
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_PRICES, prices);
|
|
1028
|
+
}
|
|
1029
|
+
#[inline]
|
|
1030
|
+
pub fn add_counts(&mut self, counts: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , i64>>) {
|
|
1031
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_COUNTS, counts);
|
|
1032
|
+
}
|
|
1033
|
+
#[inline]
|
|
1034
|
+
pub fn add_flags(&mut self, flags: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , bool>>) {
|
|
1035
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_FLAGS, flags);
|
|
1036
|
+
}
|
|
1037
|
+
#[inline]
|
|
1038
|
+
pub fn add_tags(&mut self, tags: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , Tags>>) {
|
|
1039
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Complex::VT_TAGS, tags);
|
|
1040
|
+
}
|
|
1041
|
+
#[inline]
|
|
1042
|
+
pub fn add_active(&mut self, active: bool) {
|
|
1043
|
+
self.fbb_.push_slot::<bool>(Complex::VT_ACTIVE, active, false);
|
|
1044
|
+
}
|
|
1045
|
+
#[inline]
|
|
1046
|
+
pub fn add_total(&mut self, total: f64) {
|
|
1047
|
+
self.fbb_.push_slot::<f64>(Complex::VT_TOTAL, total, 0.0);
|
|
1048
|
+
}
|
|
1049
|
+
#[inline]
|
|
1050
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
1051
|
+
self.fbb_.push_slot::<i64>(Complex::VT_TS, ts, 0);
|
|
1052
|
+
}
|
|
1053
|
+
#[inline]
|
|
1054
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ComplexBuilder<'a, 'b, A> {
|
|
1055
|
+
let start = _fbb.start_table();
|
|
1056
|
+
ComplexBuilder {
|
|
1057
|
+
fbb_: _fbb,
|
|
1058
|
+
start_: start,
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
#[inline]
|
|
1062
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Complex<'a>> {
|
|
1063
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1064
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
impl ::core::fmt::Debug for Complex<'_> {
|
|
1069
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1070
|
+
let mut ds = f.debug_struct("Complex");
|
|
1071
|
+
ds.field("id", &self.id());
|
|
1072
|
+
ds.field("names", &self.names());
|
|
1073
|
+
ds.field("prices", &self.prices());
|
|
1074
|
+
ds.field("counts", &self.counts());
|
|
1075
|
+
ds.field("flags", &self.flags());
|
|
1076
|
+
ds.field("tags", &self.tags());
|
|
1077
|
+
ds.field("active", &self.active());
|
|
1078
|
+
ds.field("total", &self.total());
|
|
1079
|
+
ds.field("ts", &self.ts());
|
|
1080
|
+
ds.finish()
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
pub enum OrderOffset {}
|
|
1084
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1085
|
+
|
|
1086
|
+
pub struct Order<'a> {
|
|
1087
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
impl<'a> ::flatbuffers::Follow<'a> for Order<'a> {
|
|
1091
|
+
type Inner = Order<'a>;
|
|
1092
|
+
#[inline]
|
|
1093
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1094
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
impl<'a> Order<'a> {
|
|
1099
|
+
pub const VT_ORDER_ID: ::flatbuffers::VOffsetT = 4;
|
|
1100
|
+
pub const VT_CUSTOMER: ::flatbuffers::VOffsetT = 6;
|
|
1101
|
+
pub const VT_LINES: ::flatbuffers::VOffsetT = 8;
|
|
1102
|
+
pub const VT_NOTES: ::flatbuffers::VOffsetT = 10;
|
|
1103
|
+
pub const VT_DISCOUNTS: ::flatbuffers::VOffsetT = 12;
|
|
1104
|
+
pub const VT_ACTIVE: ::flatbuffers::VOffsetT = 14;
|
|
1105
|
+
pub const VT_CREATED_AT: ::flatbuffers::VOffsetT = 16;
|
|
1106
|
+
pub const VT_BILLING: ::flatbuffers::VOffsetT = 18;
|
|
1107
|
+
|
|
1108
|
+
#[inline]
|
|
1109
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1110
|
+
Order { _tab: table }
|
|
1111
|
+
}
|
|
1112
|
+
#[allow(unused_mut)]
|
|
1113
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1114
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1115
|
+
args: &'args OrderArgs<'args>
|
|
1116
|
+
) -> ::flatbuffers::WIPOffset<Order<'bldr>> {
|
|
1117
|
+
let mut builder = OrderBuilder::new(_fbb);
|
|
1118
|
+
builder.add_created_at(args.created_at);
|
|
1119
|
+
if let Some(x) = args.billing { builder.add_billing(x); }
|
|
1120
|
+
if let Some(x) = args.discounts { builder.add_discounts(x); }
|
|
1121
|
+
if let Some(x) = args.notes { builder.add_notes(x); }
|
|
1122
|
+
if let Some(x) = args.lines { builder.add_lines(x); }
|
|
1123
|
+
if let Some(x) = args.customer { builder.add_customer(x); }
|
|
1124
|
+
if let Some(x) = args.order_id { builder.add_order_id(x); }
|
|
1125
|
+
builder.add_active(args.active);
|
|
1126
|
+
builder.finish()
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
#[inline]
|
|
1131
|
+
pub fn order_id(&self) -> Option<&'a str> {
|
|
1132
|
+
// Safety:
|
|
1133
|
+
// Created from valid Table for this object
|
|
1134
|
+
// which contains a valid value in this slot
|
|
1135
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Order::VT_ORDER_ID, None)}
|
|
1136
|
+
}
|
|
1137
|
+
#[inline]
|
|
1138
|
+
pub fn customer(&self) -> Option<Customer<'a>> {
|
|
1139
|
+
// Safety:
|
|
1140
|
+
// Created from valid Table for this object
|
|
1141
|
+
// which contains a valid value in this slot
|
|
1142
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Customer>>(Order::VT_CUSTOMER, None)}
|
|
1143
|
+
}
|
|
1144
|
+
#[inline]
|
|
1145
|
+
pub fn lines(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<OrderLine<'a>>>> {
|
|
1146
|
+
// Safety:
|
|
1147
|
+
// Created from valid Table for this object
|
|
1148
|
+
// which contains a valid value in this slot
|
|
1149
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<OrderLine>>>>(Order::VT_LINES, None)}
|
|
1150
|
+
}
|
|
1151
|
+
#[inline]
|
|
1152
|
+
pub fn notes(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>> {
|
|
1153
|
+
// Safety:
|
|
1154
|
+
// Created from valid Table for this object
|
|
1155
|
+
// which contains a valid value in this slot
|
|
1156
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>(Order::VT_NOTES, None)}
|
|
1157
|
+
}
|
|
1158
|
+
#[inline]
|
|
1159
|
+
pub fn discounts(&self) -> Option<::flatbuffers::Vector<'a, f64>> {
|
|
1160
|
+
// Safety:
|
|
1161
|
+
// Created from valid Table for this object
|
|
1162
|
+
// which contains a valid value in this slot
|
|
1163
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, f64>>>(Order::VT_DISCOUNTS, None)}
|
|
1164
|
+
}
|
|
1165
|
+
#[inline]
|
|
1166
|
+
pub fn active(&self) -> bool {
|
|
1167
|
+
// Safety:
|
|
1168
|
+
// Created from valid Table for this object
|
|
1169
|
+
// which contains a valid value in this slot
|
|
1170
|
+
unsafe { self._tab.get::<bool>(Order::VT_ACTIVE, Some(false)).unwrap()}
|
|
1171
|
+
}
|
|
1172
|
+
#[inline]
|
|
1173
|
+
pub fn created_at(&self) -> i64 {
|
|
1174
|
+
// Safety:
|
|
1175
|
+
// Created from valid Table for this object
|
|
1176
|
+
// which contains a valid value in this slot
|
|
1177
|
+
unsafe { self._tab.get::<i64>(Order::VT_CREATED_AT, Some(0)).unwrap()}
|
|
1178
|
+
}
|
|
1179
|
+
#[inline]
|
|
1180
|
+
pub fn billing(&self) -> Option<OrderBilling<'a>> {
|
|
1181
|
+
// Safety:
|
|
1182
|
+
// Created from valid Table for this object
|
|
1183
|
+
// which contains a valid value in this slot
|
|
1184
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<OrderBilling>>(Order::VT_BILLING, None)}
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
impl ::flatbuffers::Verifiable for Order<'_> {
|
|
1189
|
+
#[inline]
|
|
1190
|
+
fn run_verifier(
|
|
1191
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1192
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1193
|
+
v.visit_table(pos)?
|
|
1194
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("order_id", Self::VT_ORDER_ID, false)?
|
|
1195
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<Customer>>("customer", Self::VT_CUSTOMER, false)?
|
|
1196
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<OrderLine>>>>("lines", Self::VT_LINES, false)?
|
|
1197
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<&'_ str>>>>("notes", Self::VT_NOTES, false)?
|
|
1198
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, f64>>>("discounts", Self::VT_DISCOUNTS, false)?
|
|
1199
|
+
.visit_field::<bool>("active", Self::VT_ACTIVE, false)?
|
|
1200
|
+
.visit_field::<i64>("created_at", Self::VT_CREATED_AT, false)?
|
|
1201
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<OrderBilling>>("billing", Self::VT_BILLING, false)?
|
|
1202
|
+
.finish();
|
|
1203
|
+
Ok(())
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
pub struct OrderArgs<'a> {
|
|
1207
|
+
pub order_id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1208
|
+
pub customer: Option<::flatbuffers::WIPOffset<Customer<'a>>>,
|
|
1209
|
+
pub lines: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<OrderLine<'a>>>>>,
|
|
1210
|
+
pub notes: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>,
|
|
1211
|
+
pub discounts: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, f64>>>,
|
|
1212
|
+
pub active: bool,
|
|
1213
|
+
pub created_at: i64,
|
|
1214
|
+
pub billing: Option<::flatbuffers::WIPOffset<OrderBilling<'a>>>,
|
|
1215
|
+
}
|
|
1216
|
+
impl<'a> Default for OrderArgs<'a> {
|
|
1217
|
+
#[inline]
|
|
1218
|
+
fn default() -> Self {
|
|
1219
|
+
OrderArgs {
|
|
1220
|
+
order_id: None,
|
|
1221
|
+
customer: None,
|
|
1222
|
+
lines: None,
|
|
1223
|
+
notes: None,
|
|
1224
|
+
discounts: None,
|
|
1225
|
+
active: false,
|
|
1226
|
+
created_at: 0,
|
|
1227
|
+
billing: None,
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
pub struct OrderBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1233
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1234
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1235
|
+
}
|
|
1236
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> OrderBuilder<'a, 'b, A> {
|
|
1237
|
+
#[inline]
|
|
1238
|
+
pub fn add_order_id(&mut self, order_id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1239
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Order::VT_ORDER_ID, order_id);
|
|
1240
|
+
}
|
|
1241
|
+
#[inline]
|
|
1242
|
+
pub fn add_customer(&mut self, customer: ::flatbuffers::WIPOffset<Customer<'b >>) {
|
|
1243
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Customer>>(Order::VT_CUSTOMER, customer);
|
|
1244
|
+
}
|
|
1245
|
+
#[inline]
|
|
1246
|
+
pub fn add_lines(&mut self, lines: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<OrderLine<'b >>>>) {
|
|
1247
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Order::VT_LINES, lines);
|
|
1248
|
+
}
|
|
1249
|
+
#[inline]
|
|
1250
|
+
pub fn add_notes(&mut self, notes: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<&'b str>>>) {
|
|
1251
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Order::VT_NOTES, notes);
|
|
1252
|
+
}
|
|
1253
|
+
#[inline]
|
|
1254
|
+
pub fn add_discounts(&mut self, discounts: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , f64>>) {
|
|
1255
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Order::VT_DISCOUNTS, discounts);
|
|
1256
|
+
}
|
|
1257
|
+
#[inline]
|
|
1258
|
+
pub fn add_active(&mut self, active: bool) {
|
|
1259
|
+
self.fbb_.push_slot::<bool>(Order::VT_ACTIVE, active, false);
|
|
1260
|
+
}
|
|
1261
|
+
#[inline]
|
|
1262
|
+
pub fn add_created_at(&mut self, created_at: i64) {
|
|
1263
|
+
self.fbb_.push_slot::<i64>(Order::VT_CREATED_AT, created_at, 0);
|
|
1264
|
+
}
|
|
1265
|
+
#[inline]
|
|
1266
|
+
pub fn add_billing(&mut self, billing: ::flatbuffers::WIPOffset<OrderBilling<'b >>) {
|
|
1267
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<OrderBilling>>(Order::VT_BILLING, billing);
|
|
1268
|
+
}
|
|
1269
|
+
#[inline]
|
|
1270
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> OrderBuilder<'a, 'b, A> {
|
|
1271
|
+
let start = _fbb.start_table();
|
|
1272
|
+
OrderBuilder {
|
|
1273
|
+
fbb_: _fbb,
|
|
1274
|
+
start_: start,
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
#[inline]
|
|
1278
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Order<'a>> {
|
|
1279
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1280
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
impl ::core::fmt::Debug for Order<'_> {
|
|
1285
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1286
|
+
let mut ds = f.debug_struct("Order");
|
|
1287
|
+
ds.field("order_id", &self.order_id());
|
|
1288
|
+
ds.field("customer", &self.customer());
|
|
1289
|
+
ds.field("lines", &self.lines());
|
|
1290
|
+
ds.field("notes", &self.notes());
|
|
1291
|
+
ds.field("discounts", &self.discounts());
|
|
1292
|
+
ds.field("active", &self.active());
|
|
1293
|
+
ds.field("created_at", &self.created_at());
|
|
1294
|
+
ds.field("billing", &self.billing());
|
|
1295
|
+
ds.finish()
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
pub enum CustomerOffset {}
|
|
1299
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1300
|
+
|
|
1301
|
+
pub struct Customer<'a> {
|
|
1302
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
impl<'a> ::flatbuffers::Follow<'a> for Customer<'a> {
|
|
1306
|
+
type Inner = Customer<'a>;
|
|
1307
|
+
#[inline]
|
|
1308
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1309
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
impl<'a> Customer<'a> {
|
|
1314
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
1315
|
+
pub const VT_NAME: ::flatbuffers::VOffsetT = 6;
|
|
1316
|
+
pub const VT_VIP: ::flatbuffers::VOffsetT = 8;
|
|
1317
|
+
pub const VT_LOYALTY_POINTS: ::flatbuffers::VOffsetT = 10;
|
|
1318
|
+
pub const VT_RATING: ::flatbuffers::VOffsetT = 12;
|
|
1319
|
+
|
|
1320
|
+
#[inline]
|
|
1321
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1322
|
+
Customer { _tab: table }
|
|
1323
|
+
}
|
|
1324
|
+
#[allow(unused_mut)]
|
|
1325
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1326
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1327
|
+
args: &'args CustomerArgs<'args>
|
|
1328
|
+
) -> ::flatbuffers::WIPOffset<Customer<'bldr>> {
|
|
1329
|
+
let mut builder = CustomerBuilder::new(_fbb);
|
|
1330
|
+
builder.add_rating(args.rating);
|
|
1331
|
+
builder.add_loyalty_points(args.loyalty_points);
|
|
1332
|
+
if let Some(x) = args.name { builder.add_name(x); }
|
|
1333
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
1334
|
+
builder.add_vip(args.vip);
|
|
1335
|
+
builder.finish()
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
#[inline]
|
|
1340
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
1341
|
+
// Safety:
|
|
1342
|
+
// Created from valid Table for this object
|
|
1343
|
+
// which contains a valid value in this slot
|
|
1344
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Customer::VT_ID, None)}
|
|
1345
|
+
}
|
|
1346
|
+
#[inline]
|
|
1347
|
+
pub fn name(&self) -> Option<&'a str> {
|
|
1348
|
+
// Safety:
|
|
1349
|
+
// Created from valid Table for this object
|
|
1350
|
+
// which contains a valid value in this slot
|
|
1351
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Customer::VT_NAME, None)}
|
|
1352
|
+
}
|
|
1353
|
+
#[inline]
|
|
1354
|
+
pub fn vip(&self) -> bool {
|
|
1355
|
+
// Safety:
|
|
1356
|
+
// Created from valid Table for this object
|
|
1357
|
+
// which contains a valid value in this slot
|
|
1358
|
+
unsafe { self._tab.get::<bool>(Customer::VT_VIP, Some(false)).unwrap()}
|
|
1359
|
+
}
|
|
1360
|
+
#[inline]
|
|
1361
|
+
pub fn loyalty_points(&self) -> i64 {
|
|
1362
|
+
// Safety:
|
|
1363
|
+
// Created from valid Table for this object
|
|
1364
|
+
// which contains a valid value in this slot
|
|
1365
|
+
unsafe { self._tab.get::<i64>(Customer::VT_LOYALTY_POINTS, Some(0)).unwrap()}
|
|
1366
|
+
}
|
|
1367
|
+
#[inline]
|
|
1368
|
+
pub fn rating(&self) -> f64 {
|
|
1369
|
+
// Safety:
|
|
1370
|
+
// Created from valid Table for this object
|
|
1371
|
+
// which contains a valid value in this slot
|
|
1372
|
+
unsafe { self._tab.get::<f64>(Customer::VT_RATING, Some(0.0)).unwrap()}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
impl ::flatbuffers::Verifiable for Customer<'_> {
|
|
1377
|
+
#[inline]
|
|
1378
|
+
fn run_verifier(
|
|
1379
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1380
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1381
|
+
v.visit_table(pos)?
|
|
1382
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
1383
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
|
|
1384
|
+
.visit_field::<bool>("vip", Self::VT_VIP, false)?
|
|
1385
|
+
.visit_field::<i64>("loyalty_points", Self::VT_LOYALTY_POINTS, false)?
|
|
1386
|
+
.visit_field::<f64>("rating", Self::VT_RATING, false)?
|
|
1387
|
+
.finish();
|
|
1388
|
+
Ok(())
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
pub struct CustomerArgs<'a> {
|
|
1392
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1393
|
+
pub name: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1394
|
+
pub vip: bool,
|
|
1395
|
+
pub loyalty_points: i64,
|
|
1396
|
+
pub rating: f64,
|
|
1397
|
+
}
|
|
1398
|
+
impl<'a> Default for CustomerArgs<'a> {
|
|
1399
|
+
#[inline]
|
|
1400
|
+
fn default() -> Self {
|
|
1401
|
+
CustomerArgs {
|
|
1402
|
+
id: None,
|
|
1403
|
+
name: None,
|
|
1404
|
+
vip: false,
|
|
1405
|
+
loyalty_points: 0,
|
|
1406
|
+
rating: 0.0,
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
pub struct CustomerBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1412
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1413
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1414
|
+
}
|
|
1415
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> CustomerBuilder<'a, 'b, A> {
|
|
1416
|
+
#[inline]
|
|
1417
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1418
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Customer::VT_ID, id);
|
|
1419
|
+
}
|
|
1420
|
+
#[inline]
|
|
1421
|
+
pub fn add_name(&mut self, name: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1422
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Customer::VT_NAME, name);
|
|
1423
|
+
}
|
|
1424
|
+
#[inline]
|
|
1425
|
+
pub fn add_vip(&mut self, vip: bool) {
|
|
1426
|
+
self.fbb_.push_slot::<bool>(Customer::VT_VIP, vip, false);
|
|
1427
|
+
}
|
|
1428
|
+
#[inline]
|
|
1429
|
+
pub fn add_loyalty_points(&mut self, loyalty_points: i64) {
|
|
1430
|
+
self.fbb_.push_slot::<i64>(Customer::VT_LOYALTY_POINTS, loyalty_points, 0);
|
|
1431
|
+
}
|
|
1432
|
+
#[inline]
|
|
1433
|
+
pub fn add_rating(&mut self, rating: f64) {
|
|
1434
|
+
self.fbb_.push_slot::<f64>(Customer::VT_RATING, rating, 0.0);
|
|
1435
|
+
}
|
|
1436
|
+
#[inline]
|
|
1437
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> CustomerBuilder<'a, 'b, A> {
|
|
1438
|
+
let start = _fbb.start_table();
|
|
1439
|
+
CustomerBuilder {
|
|
1440
|
+
fbb_: _fbb,
|
|
1441
|
+
start_: start,
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
#[inline]
|
|
1445
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Customer<'a>> {
|
|
1446
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1447
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
impl ::core::fmt::Debug for Customer<'_> {
|
|
1452
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1453
|
+
let mut ds = f.debug_struct("Customer");
|
|
1454
|
+
ds.field("id", &self.id());
|
|
1455
|
+
ds.field("name", &self.name());
|
|
1456
|
+
ds.field("vip", &self.vip());
|
|
1457
|
+
ds.field("loyalty_points", &self.loyalty_points());
|
|
1458
|
+
ds.field("rating", &self.rating());
|
|
1459
|
+
ds.finish()
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
pub enum OrderLineOffset {}
|
|
1463
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1464
|
+
|
|
1465
|
+
pub struct OrderLine<'a> {
|
|
1466
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
impl<'a> ::flatbuffers::Follow<'a> for OrderLine<'a> {
|
|
1470
|
+
type Inner = OrderLine<'a>;
|
|
1471
|
+
#[inline]
|
|
1472
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1473
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
impl<'a> OrderLine<'a> {
|
|
1478
|
+
pub const VT_SKU: ::flatbuffers::VOffsetT = 4;
|
|
1479
|
+
pub const VT_QTY: ::flatbuffers::VOffsetT = 6;
|
|
1480
|
+
pub const VT_UNIT_PRICE: ::flatbuffers::VOffsetT = 8;
|
|
1481
|
+
pub const VT_TAGS: ::flatbuffers::VOffsetT = 10;
|
|
1482
|
+
|
|
1483
|
+
#[inline]
|
|
1484
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1485
|
+
OrderLine { _tab: table }
|
|
1486
|
+
}
|
|
1487
|
+
#[allow(unused_mut)]
|
|
1488
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1489
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1490
|
+
args: &'args OrderLineArgs<'args>
|
|
1491
|
+
) -> ::flatbuffers::WIPOffset<OrderLine<'bldr>> {
|
|
1492
|
+
let mut builder = OrderLineBuilder::new(_fbb);
|
|
1493
|
+
builder.add_unit_price(args.unit_price);
|
|
1494
|
+
builder.add_qty(args.qty);
|
|
1495
|
+
if let Some(x) = args.tags { builder.add_tags(x); }
|
|
1496
|
+
if let Some(x) = args.sku { builder.add_sku(x); }
|
|
1497
|
+
builder.finish()
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
|
|
1501
|
+
#[inline]
|
|
1502
|
+
pub fn sku(&self) -> Option<&'a str> {
|
|
1503
|
+
// Safety:
|
|
1504
|
+
// Created from valid Table for this object
|
|
1505
|
+
// which contains a valid value in this slot
|
|
1506
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(OrderLine::VT_SKU, None)}
|
|
1507
|
+
}
|
|
1508
|
+
#[inline]
|
|
1509
|
+
pub fn qty(&self) -> i64 {
|
|
1510
|
+
// Safety:
|
|
1511
|
+
// Created from valid Table for this object
|
|
1512
|
+
// which contains a valid value in this slot
|
|
1513
|
+
unsafe { self._tab.get::<i64>(OrderLine::VT_QTY, Some(0)).unwrap()}
|
|
1514
|
+
}
|
|
1515
|
+
#[inline]
|
|
1516
|
+
pub fn unit_price(&self) -> f64 {
|
|
1517
|
+
// Safety:
|
|
1518
|
+
// Created from valid Table for this object
|
|
1519
|
+
// which contains a valid value in this slot
|
|
1520
|
+
unsafe { self._tab.get::<f64>(OrderLine::VT_UNIT_PRICE, Some(0.0)).unwrap()}
|
|
1521
|
+
}
|
|
1522
|
+
#[inline]
|
|
1523
|
+
pub fn tags(&self) -> Option<::flatbuffers::Vector<'a, Tags>> {
|
|
1524
|
+
// Safety:
|
|
1525
|
+
// Created from valid Table for this object
|
|
1526
|
+
// which contains a valid value in this slot
|
|
1527
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, Tags>>>(OrderLine::VT_TAGS, None)}
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
impl ::flatbuffers::Verifiable for OrderLine<'_> {
|
|
1532
|
+
#[inline]
|
|
1533
|
+
fn run_verifier(
|
|
1534
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1535
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1536
|
+
v.visit_table(pos)?
|
|
1537
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("sku", Self::VT_SKU, false)?
|
|
1538
|
+
.visit_field::<i64>("qty", Self::VT_QTY, false)?
|
|
1539
|
+
.visit_field::<f64>("unit_price", Self::VT_UNIT_PRICE, false)?
|
|
1540
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, Tags>>>("tags", Self::VT_TAGS, false)?
|
|
1541
|
+
.finish();
|
|
1542
|
+
Ok(())
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
pub struct OrderLineArgs<'a> {
|
|
1546
|
+
pub sku: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1547
|
+
pub qty: i64,
|
|
1548
|
+
pub unit_price: f64,
|
|
1549
|
+
pub tags: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, Tags>>>,
|
|
1550
|
+
}
|
|
1551
|
+
impl<'a> Default for OrderLineArgs<'a> {
|
|
1552
|
+
#[inline]
|
|
1553
|
+
fn default() -> Self {
|
|
1554
|
+
OrderLineArgs {
|
|
1555
|
+
sku: None,
|
|
1556
|
+
qty: 0,
|
|
1557
|
+
unit_price: 0.0,
|
|
1558
|
+
tags: None,
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
pub struct OrderLineBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1564
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1565
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1566
|
+
}
|
|
1567
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> OrderLineBuilder<'a, 'b, A> {
|
|
1568
|
+
#[inline]
|
|
1569
|
+
pub fn add_sku(&mut self, sku: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1570
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(OrderLine::VT_SKU, sku);
|
|
1571
|
+
}
|
|
1572
|
+
#[inline]
|
|
1573
|
+
pub fn add_qty(&mut self, qty: i64) {
|
|
1574
|
+
self.fbb_.push_slot::<i64>(OrderLine::VT_QTY, qty, 0);
|
|
1575
|
+
}
|
|
1576
|
+
#[inline]
|
|
1577
|
+
pub fn add_unit_price(&mut self, unit_price: f64) {
|
|
1578
|
+
self.fbb_.push_slot::<f64>(OrderLine::VT_UNIT_PRICE, unit_price, 0.0);
|
|
1579
|
+
}
|
|
1580
|
+
#[inline]
|
|
1581
|
+
pub fn add_tags(&mut self, tags: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , Tags>>) {
|
|
1582
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(OrderLine::VT_TAGS, tags);
|
|
1583
|
+
}
|
|
1584
|
+
#[inline]
|
|
1585
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> OrderLineBuilder<'a, 'b, A> {
|
|
1586
|
+
let start = _fbb.start_table();
|
|
1587
|
+
OrderLineBuilder {
|
|
1588
|
+
fbb_: _fbb,
|
|
1589
|
+
start_: start,
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
#[inline]
|
|
1593
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<OrderLine<'a>> {
|
|
1594
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1595
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
impl ::core::fmt::Debug for OrderLine<'_> {
|
|
1600
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1601
|
+
let mut ds = f.debug_struct("OrderLine");
|
|
1602
|
+
ds.field("sku", &self.sku());
|
|
1603
|
+
ds.field("qty", &self.qty());
|
|
1604
|
+
ds.field("unit_price", &self.unit_price());
|
|
1605
|
+
ds.field("tags", &self.tags());
|
|
1606
|
+
ds.finish()
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
pub enum OrderBillingOffset {}
|
|
1610
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1611
|
+
|
|
1612
|
+
pub struct OrderBilling<'a> {
|
|
1613
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
impl<'a> ::flatbuffers::Follow<'a> for OrderBilling<'a> {
|
|
1617
|
+
type Inner = OrderBilling<'a>;
|
|
1618
|
+
#[inline]
|
|
1619
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1620
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
impl<'a> OrderBilling<'a> {
|
|
1625
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
1626
|
+
pub const VT_NAME: ::flatbuffers::VOffsetT = 6;
|
|
1627
|
+
pub const VT_VIP: ::flatbuffers::VOffsetT = 8;
|
|
1628
|
+
pub const VT_LOYALTY_POINTS: ::flatbuffers::VOffsetT = 10;
|
|
1629
|
+
pub const VT_RATING: ::flatbuffers::VOffsetT = 12;
|
|
1630
|
+
|
|
1631
|
+
#[inline]
|
|
1632
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1633
|
+
OrderBilling { _tab: table }
|
|
1634
|
+
}
|
|
1635
|
+
#[allow(unused_mut)]
|
|
1636
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1637
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1638
|
+
args: &'args OrderBillingArgs<'args>
|
|
1639
|
+
) -> ::flatbuffers::WIPOffset<OrderBilling<'bldr>> {
|
|
1640
|
+
let mut builder = OrderBillingBuilder::new(_fbb);
|
|
1641
|
+
builder.add_rating(args.rating);
|
|
1642
|
+
builder.add_loyalty_points(args.loyalty_points);
|
|
1643
|
+
if let Some(x) = args.name { builder.add_name(x); }
|
|
1644
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
1645
|
+
builder.add_vip(args.vip);
|
|
1646
|
+
builder.finish()
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
#[inline]
|
|
1651
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
1652
|
+
// Safety:
|
|
1653
|
+
// Created from valid Table for this object
|
|
1654
|
+
// which contains a valid value in this slot
|
|
1655
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(OrderBilling::VT_ID, None)}
|
|
1656
|
+
}
|
|
1657
|
+
#[inline]
|
|
1658
|
+
pub fn name(&self) -> Option<&'a str> {
|
|
1659
|
+
// Safety:
|
|
1660
|
+
// Created from valid Table for this object
|
|
1661
|
+
// which contains a valid value in this slot
|
|
1662
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(OrderBilling::VT_NAME, None)}
|
|
1663
|
+
}
|
|
1664
|
+
#[inline]
|
|
1665
|
+
pub fn vip(&self) -> bool {
|
|
1666
|
+
// Safety:
|
|
1667
|
+
// Created from valid Table for this object
|
|
1668
|
+
// which contains a valid value in this slot
|
|
1669
|
+
unsafe { self._tab.get::<bool>(OrderBilling::VT_VIP, Some(false)).unwrap()}
|
|
1670
|
+
}
|
|
1671
|
+
#[inline]
|
|
1672
|
+
pub fn loyalty_points(&self) -> i64 {
|
|
1673
|
+
// Safety:
|
|
1674
|
+
// Created from valid Table for this object
|
|
1675
|
+
// which contains a valid value in this slot
|
|
1676
|
+
unsafe { self._tab.get::<i64>(OrderBilling::VT_LOYALTY_POINTS, Some(0)).unwrap()}
|
|
1677
|
+
}
|
|
1678
|
+
#[inline]
|
|
1679
|
+
pub fn rating(&self) -> f64 {
|
|
1680
|
+
// Safety:
|
|
1681
|
+
// Created from valid Table for this object
|
|
1682
|
+
// which contains a valid value in this slot
|
|
1683
|
+
unsafe { self._tab.get::<f64>(OrderBilling::VT_RATING, Some(0.0)).unwrap()}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
impl ::flatbuffers::Verifiable for OrderBilling<'_> {
|
|
1688
|
+
#[inline]
|
|
1689
|
+
fn run_verifier(
|
|
1690
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1691
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1692
|
+
v.visit_table(pos)?
|
|
1693
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
1694
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
|
|
1695
|
+
.visit_field::<bool>("vip", Self::VT_VIP, false)?
|
|
1696
|
+
.visit_field::<i64>("loyalty_points", Self::VT_LOYALTY_POINTS, false)?
|
|
1697
|
+
.visit_field::<f64>("rating", Self::VT_RATING, false)?
|
|
1698
|
+
.finish();
|
|
1699
|
+
Ok(())
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
pub struct OrderBillingArgs<'a> {
|
|
1703
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1704
|
+
pub name: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1705
|
+
pub vip: bool,
|
|
1706
|
+
pub loyalty_points: i64,
|
|
1707
|
+
pub rating: f64,
|
|
1708
|
+
}
|
|
1709
|
+
impl<'a> Default for OrderBillingArgs<'a> {
|
|
1710
|
+
#[inline]
|
|
1711
|
+
fn default() -> Self {
|
|
1712
|
+
OrderBillingArgs {
|
|
1713
|
+
id: None,
|
|
1714
|
+
name: None,
|
|
1715
|
+
vip: false,
|
|
1716
|
+
loyalty_points: 0,
|
|
1717
|
+
rating: 0.0,
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
pub struct OrderBillingBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1723
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1724
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1725
|
+
}
|
|
1726
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> OrderBillingBuilder<'a, 'b, A> {
|
|
1727
|
+
#[inline]
|
|
1728
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1729
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(OrderBilling::VT_ID, id);
|
|
1730
|
+
}
|
|
1731
|
+
#[inline]
|
|
1732
|
+
pub fn add_name(&mut self, name: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1733
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(OrderBilling::VT_NAME, name);
|
|
1734
|
+
}
|
|
1735
|
+
#[inline]
|
|
1736
|
+
pub fn add_vip(&mut self, vip: bool) {
|
|
1737
|
+
self.fbb_.push_slot::<bool>(OrderBilling::VT_VIP, vip, false);
|
|
1738
|
+
}
|
|
1739
|
+
#[inline]
|
|
1740
|
+
pub fn add_loyalty_points(&mut self, loyalty_points: i64) {
|
|
1741
|
+
self.fbb_.push_slot::<i64>(OrderBilling::VT_LOYALTY_POINTS, loyalty_points, 0);
|
|
1742
|
+
}
|
|
1743
|
+
#[inline]
|
|
1744
|
+
pub fn add_rating(&mut self, rating: f64) {
|
|
1745
|
+
self.fbb_.push_slot::<f64>(OrderBilling::VT_RATING, rating, 0.0);
|
|
1746
|
+
}
|
|
1747
|
+
#[inline]
|
|
1748
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> OrderBillingBuilder<'a, 'b, A> {
|
|
1749
|
+
let start = _fbb.start_table();
|
|
1750
|
+
OrderBillingBuilder {
|
|
1751
|
+
fbb_: _fbb,
|
|
1752
|
+
start_: start,
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
#[inline]
|
|
1756
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<OrderBilling<'a>> {
|
|
1757
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1758
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
impl ::core::fmt::Debug for OrderBilling<'_> {
|
|
1763
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1764
|
+
let mut ds = f.debug_struct("OrderBilling");
|
|
1765
|
+
ds.field("id", &self.id());
|
|
1766
|
+
ds.field("name", &self.name());
|
|
1767
|
+
ds.field("vip", &self.vip());
|
|
1768
|
+
ds.field("loyalty_points", &self.loyalty_points());
|
|
1769
|
+
ds.field("rating", &self.rating());
|
|
1770
|
+
ds.finish()
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
pub enum BigValOffset {}
|
|
1774
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1775
|
+
|
|
1776
|
+
pub struct BigVal<'a> {
|
|
1777
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
impl<'a> ::flatbuffers::Follow<'a> for BigVal<'a> {
|
|
1781
|
+
type Inner = BigVal<'a>;
|
|
1782
|
+
#[inline]
|
|
1783
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1784
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
impl<'a> BigVal<'a> {
|
|
1789
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
1790
|
+
pub const VT_SEQ: ::flatbuffers::VOffsetT = 6;
|
|
1791
|
+
pub const VT_WHEN: ::flatbuffers::VOffsetT = 8;
|
|
1792
|
+
|
|
1793
|
+
#[inline]
|
|
1794
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1795
|
+
BigVal { _tab: table }
|
|
1796
|
+
}
|
|
1797
|
+
#[allow(unused_mut)]
|
|
1798
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1799
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1800
|
+
args: &'args BigValArgs<'args>
|
|
1801
|
+
) -> ::flatbuffers::WIPOffset<BigVal<'bldr>> {
|
|
1802
|
+
let mut builder = BigValBuilder::new(_fbb);
|
|
1803
|
+
builder.add_when(args.when);
|
|
1804
|
+
builder.add_seq(args.seq);
|
|
1805
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
1806
|
+
builder.finish()
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
|
|
1810
|
+
#[inline]
|
|
1811
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
1812
|
+
// Safety:
|
|
1813
|
+
// Created from valid Table for this object
|
|
1814
|
+
// which contains a valid value in this slot
|
|
1815
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(BigVal::VT_ID, None)}
|
|
1816
|
+
}
|
|
1817
|
+
#[inline]
|
|
1818
|
+
pub fn seq(&self) -> i64 {
|
|
1819
|
+
// Safety:
|
|
1820
|
+
// Created from valid Table for this object
|
|
1821
|
+
// which contains a valid value in this slot
|
|
1822
|
+
unsafe { self._tab.get::<i64>(BigVal::VT_SEQ, Some(0)).unwrap()}
|
|
1823
|
+
}
|
|
1824
|
+
#[inline]
|
|
1825
|
+
pub fn when(&self) -> i64 {
|
|
1826
|
+
// Safety:
|
|
1827
|
+
// Created from valid Table for this object
|
|
1828
|
+
// which contains a valid value in this slot
|
|
1829
|
+
unsafe { self._tab.get::<i64>(BigVal::VT_WHEN, Some(0)).unwrap()}
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
impl ::flatbuffers::Verifiable for BigVal<'_> {
|
|
1834
|
+
#[inline]
|
|
1835
|
+
fn run_verifier(
|
|
1836
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1837
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1838
|
+
v.visit_table(pos)?
|
|
1839
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
1840
|
+
.visit_field::<i64>("seq", Self::VT_SEQ, false)?
|
|
1841
|
+
.visit_field::<i64>("when", Self::VT_WHEN, false)?
|
|
1842
|
+
.finish();
|
|
1843
|
+
Ok(())
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
pub struct BigValArgs<'a> {
|
|
1847
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
1848
|
+
pub seq: i64,
|
|
1849
|
+
pub when: i64,
|
|
1850
|
+
}
|
|
1851
|
+
impl<'a> Default for BigValArgs<'a> {
|
|
1852
|
+
#[inline]
|
|
1853
|
+
fn default() -> Self {
|
|
1854
|
+
BigValArgs {
|
|
1855
|
+
id: None,
|
|
1856
|
+
seq: 0,
|
|
1857
|
+
when: 0,
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
pub struct BigValBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1863
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1864
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1865
|
+
}
|
|
1866
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> BigValBuilder<'a, 'b, A> {
|
|
1867
|
+
#[inline]
|
|
1868
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
1869
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(BigVal::VT_ID, id);
|
|
1870
|
+
}
|
|
1871
|
+
#[inline]
|
|
1872
|
+
pub fn add_seq(&mut self, seq: i64) {
|
|
1873
|
+
self.fbb_.push_slot::<i64>(BigVal::VT_SEQ, seq, 0);
|
|
1874
|
+
}
|
|
1875
|
+
#[inline]
|
|
1876
|
+
pub fn add_when(&mut self, when: i64) {
|
|
1877
|
+
self.fbb_.push_slot::<i64>(BigVal::VT_WHEN, when, 0);
|
|
1878
|
+
}
|
|
1879
|
+
#[inline]
|
|
1880
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> BigValBuilder<'a, 'b, A> {
|
|
1881
|
+
let start = _fbb.start_table();
|
|
1882
|
+
BigValBuilder {
|
|
1883
|
+
fbb_: _fbb,
|
|
1884
|
+
start_: start,
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
#[inline]
|
|
1888
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<BigVal<'a>> {
|
|
1889
|
+
let o = self.fbb_.end_table(self.start_);
|
|
1890
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
impl ::core::fmt::Debug for BigVal<'_> {
|
|
1895
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
1896
|
+
let mut ds = f.debug_struct("BigVal");
|
|
1897
|
+
ds.field("id", &self.id());
|
|
1898
|
+
ds.field("seq", &self.seq());
|
|
1899
|
+
ds.field("when", &self.when());
|
|
1900
|
+
ds.finish()
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
pub enum HelloOffset {}
|
|
1904
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
1905
|
+
|
|
1906
|
+
pub struct Hello<'a> {
|
|
1907
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
impl<'a> ::flatbuffers::Follow<'a> for Hello<'a> {
|
|
1911
|
+
type Inner = Hello<'a>;
|
|
1912
|
+
#[inline]
|
|
1913
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
1914
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
impl<'a> Hello<'a> {
|
|
1919
|
+
pub const VT_VERSION: ::flatbuffers::VOffsetT = 4;
|
|
1920
|
+
pub const VT_CAPS: ::flatbuffers::VOffsetT = 6;
|
|
1921
|
+
pub const VT_LAST_SEQ: ::flatbuffers::VOffsetT = 8;
|
|
1922
|
+
|
|
1923
|
+
#[inline]
|
|
1924
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
1925
|
+
Hello { _tab: table }
|
|
1926
|
+
}
|
|
1927
|
+
#[allow(unused_mut)]
|
|
1928
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
1929
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
1930
|
+
args: &'args HelloArgs<'args>
|
|
1931
|
+
) -> ::flatbuffers::WIPOffset<Hello<'bldr>> {
|
|
1932
|
+
let mut builder = HelloBuilder::new(_fbb);
|
|
1933
|
+
builder.add_last_seq(args.last_seq);
|
|
1934
|
+
builder.add_version(args.version);
|
|
1935
|
+
if let Some(x) = args.caps { builder.add_caps(x); }
|
|
1936
|
+
builder.finish()
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
|
|
1940
|
+
#[inline]
|
|
1941
|
+
pub fn version(&self) -> i64 {
|
|
1942
|
+
// Safety:
|
|
1943
|
+
// Created from valid Table for this object
|
|
1944
|
+
// which contains a valid value in this slot
|
|
1945
|
+
unsafe { self._tab.get::<i64>(Hello::VT_VERSION, Some(0)).unwrap()}
|
|
1946
|
+
}
|
|
1947
|
+
#[inline]
|
|
1948
|
+
pub fn caps(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>> {
|
|
1949
|
+
// Safety:
|
|
1950
|
+
// Created from valid Table for this object
|
|
1951
|
+
// which contains a valid value in this slot
|
|
1952
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>(Hello::VT_CAPS, None)}
|
|
1953
|
+
}
|
|
1954
|
+
#[inline]
|
|
1955
|
+
pub fn last_seq(&self) -> i64 {
|
|
1956
|
+
// Safety:
|
|
1957
|
+
// Created from valid Table for this object
|
|
1958
|
+
// which contains a valid value in this slot
|
|
1959
|
+
unsafe { self._tab.get::<i64>(Hello::VT_LAST_SEQ, Some(0)).unwrap()}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
impl ::flatbuffers::Verifiable for Hello<'_> {
|
|
1964
|
+
#[inline]
|
|
1965
|
+
fn run_verifier(
|
|
1966
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
1967
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
1968
|
+
v.visit_table(pos)?
|
|
1969
|
+
.visit_field::<i64>("version", Self::VT_VERSION, false)?
|
|
1970
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<&'_ str>>>>("caps", Self::VT_CAPS, false)?
|
|
1971
|
+
.visit_field::<i64>("last_seq", Self::VT_LAST_SEQ, false)?
|
|
1972
|
+
.finish();
|
|
1973
|
+
Ok(())
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
pub struct HelloArgs<'a> {
|
|
1977
|
+
pub version: i64,
|
|
1978
|
+
pub caps: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>,
|
|
1979
|
+
pub last_seq: i64,
|
|
1980
|
+
}
|
|
1981
|
+
impl<'a> Default for HelloArgs<'a> {
|
|
1982
|
+
#[inline]
|
|
1983
|
+
fn default() -> Self {
|
|
1984
|
+
HelloArgs {
|
|
1985
|
+
version: 0,
|
|
1986
|
+
caps: None,
|
|
1987
|
+
last_seq: 0,
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
pub struct HelloBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
1993
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
1994
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
1995
|
+
}
|
|
1996
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> HelloBuilder<'a, 'b, A> {
|
|
1997
|
+
#[inline]
|
|
1998
|
+
pub fn add_version(&mut self, version: i64) {
|
|
1999
|
+
self.fbb_.push_slot::<i64>(Hello::VT_VERSION, version, 0);
|
|
2000
|
+
}
|
|
2001
|
+
#[inline]
|
|
2002
|
+
pub fn add_caps(&mut self, caps: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<&'b str>>>) {
|
|
2003
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Hello::VT_CAPS, caps);
|
|
2004
|
+
}
|
|
2005
|
+
#[inline]
|
|
2006
|
+
pub fn add_last_seq(&mut self, last_seq: i64) {
|
|
2007
|
+
self.fbb_.push_slot::<i64>(Hello::VT_LAST_SEQ, last_seq, 0);
|
|
2008
|
+
}
|
|
2009
|
+
#[inline]
|
|
2010
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> HelloBuilder<'a, 'b, A> {
|
|
2011
|
+
let start = _fbb.start_table();
|
|
2012
|
+
HelloBuilder {
|
|
2013
|
+
fbb_: _fbb,
|
|
2014
|
+
start_: start,
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
#[inline]
|
|
2018
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Hello<'a>> {
|
|
2019
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2020
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
impl ::core::fmt::Debug for Hello<'_> {
|
|
2025
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2026
|
+
let mut ds = f.debug_struct("Hello");
|
|
2027
|
+
ds.field("version", &self.version());
|
|
2028
|
+
ds.field("caps", &self.caps());
|
|
2029
|
+
ds.field("last_seq", &self.last_seq());
|
|
2030
|
+
ds.finish()
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
pub enum WelcomeOffset {}
|
|
2034
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2035
|
+
|
|
2036
|
+
pub struct Welcome<'a> {
|
|
2037
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
impl<'a> ::flatbuffers::Follow<'a> for Welcome<'a> {
|
|
2041
|
+
type Inner = Welcome<'a>;
|
|
2042
|
+
#[inline]
|
|
2043
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2044
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
impl<'a> Welcome<'a> {
|
|
2049
|
+
pub const VT_CLIENT_ID: ::flatbuffers::VOffsetT = 4;
|
|
2050
|
+
pub const VT_GROUPS: ::flatbuffers::VOffsetT = 6;
|
|
2051
|
+
|
|
2052
|
+
#[inline]
|
|
2053
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2054
|
+
Welcome { _tab: table }
|
|
2055
|
+
}
|
|
2056
|
+
#[allow(unused_mut)]
|
|
2057
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2058
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2059
|
+
args: &'args WelcomeArgs<'args>
|
|
2060
|
+
) -> ::flatbuffers::WIPOffset<Welcome<'bldr>> {
|
|
2061
|
+
let mut builder = WelcomeBuilder::new(_fbb);
|
|
2062
|
+
if let Some(x) = args.groups { builder.add_groups(x); }
|
|
2063
|
+
if let Some(x) = args.client_id { builder.add_client_id(x); }
|
|
2064
|
+
builder.finish()
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
#[inline]
|
|
2069
|
+
pub fn client_id(&self) -> Option<&'a str> {
|
|
2070
|
+
// Safety:
|
|
2071
|
+
// Created from valid Table for this object
|
|
2072
|
+
// which contains a valid value in this slot
|
|
2073
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Welcome::VT_CLIENT_ID, None)}
|
|
2074
|
+
}
|
|
2075
|
+
#[inline]
|
|
2076
|
+
pub fn groups(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>> {
|
|
2077
|
+
// Safety:
|
|
2078
|
+
// Created from valid Table for this object
|
|
2079
|
+
// which contains a valid value in this slot
|
|
2080
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>(Welcome::VT_GROUPS, None)}
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
impl ::flatbuffers::Verifiable for Welcome<'_> {
|
|
2085
|
+
#[inline]
|
|
2086
|
+
fn run_verifier(
|
|
2087
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2088
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2089
|
+
v.visit_table(pos)?
|
|
2090
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("client_id", Self::VT_CLIENT_ID, false)?
|
|
2091
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<&'_ str>>>>("groups", Self::VT_GROUPS, false)?
|
|
2092
|
+
.finish();
|
|
2093
|
+
Ok(())
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
pub struct WelcomeArgs<'a> {
|
|
2097
|
+
pub client_id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2098
|
+
pub groups: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<&'a str>>>>,
|
|
2099
|
+
}
|
|
2100
|
+
impl<'a> Default for WelcomeArgs<'a> {
|
|
2101
|
+
#[inline]
|
|
2102
|
+
fn default() -> Self {
|
|
2103
|
+
WelcomeArgs {
|
|
2104
|
+
client_id: None,
|
|
2105
|
+
groups: None,
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
pub struct WelcomeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2111
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2112
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2113
|
+
}
|
|
2114
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> WelcomeBuilder<'a, 'b, A> {
|
|
2115
|
+
#[inline]
|
|
2116
|
+
pub fn add_client_id(&mut self, client_id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2117
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Welcome::VT_CLIENT_ID, client_id);
|
|
2118
|
+
}
|
|
2119
|
+
#[inline]
|
|
2120
|
+
pub fn add_groups(&mut self, groups: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<&'b str>>>) {
|
|
2121
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Welcome::VT_GROUPS, groups);
|
|
2122
|
+
}
|
|
2123
|
+
#[inline]
|
|
2124
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> WelcomeBuilder<'a, 'b, A> {
|
|
2125
|
+
let start = _fbb.start_table();
|
|
2126
|
+
WelcomeBuilder {
|
|
2127
|
+
fbb_: _fbb,
|
|
2128
|
+
start_: start,
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
#[inline]
|
|
2132
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Welcome<'a>> {
|
|
2133
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2134
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
impl ::core::fmt::Debug for Welcome<'_> {
|
|
2139
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2140
|
+
let mut ds = f.debug_struct("Welcome");
|
|
2141
|
+
ds.field("client_id", &self.client_id());
|
|
2142
|
+
ds.field("groups", &self.groups());
|
|
2143
|
+
ds.finish()
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
pub enum SubscribeOffset {}
|
|
2147
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2148
|
+
|
|
2149
|
+
pub struct Subscribe<'a> {
|
|
2150
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
impl<'a> ::flatbuffers::Follow<'a> for Subscribe<'a> {
|
|
2154
|
+
type Inner = Subscribe<'a>;
|
|
2155
|
+
#[inline]
|
|
2156
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2157
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
impl<'a> Subscribe<'a> {
|
|
2162
|
+
pub const VT_TOPIC: ::flatbuffers::VOffsetT = 4;
|
|
2163
|
+
|
|
2164
|
+
#[inline]
|
|
2165
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2166
|
+
Subscribe { _tab: table }
|
|
2167
|
+
}
|
|
2168
|
+
#[allow(unused_mut)]
|
|
2169
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2170
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2171
|
+
args: &'args SubscribeArgs<'args>
|
|
2172
|
+
) -> ::flatbuffers::WIPOffset<Subscribe<'bldr>> {
|
|
2173
|
+
let mut builder = SubscribeBuilder::new(_fbb);
|
|
2174
|
+
if let Some(x) = args.topic { builder.add_topic(x); }
|
|
2175
|
+
builder.finish()
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
#[inline]
|
|
2180
|
+
pub fn topic(&self) -> Option<&'a str> {
|
|
2181
|
+
// Safety:
|
|
2182
|
+
// Created from valid Table for this object
|
|
2183
|
+
// which contains a valid value in this slot
|
|
2184
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Subscribe::VT_TOPIC, None)}
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
impl ::flatbuffers::Verifiable for Subscribe<'_> {
|
|
2189
|
+
#[inline]
|
|
2190
|
+
fn run_verifier(
|
|
2191
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2192
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2193
|
+
v.visit_table(pos)?
|
|
2194
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("topic", Self::VT_TOPIC, false)?
|
|
2195
|
+
.finish();
|
|
2196
|
+
Ok(())
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
pub struct SubscribeArgs<'a> {
|
|
2200
|
+
pub topic: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2201
|
+
}
|
|
2202
|
+
impl<'a> Default for SubscribeArgs<'a> {
|
|
2203
|
+
#[inline]
|
|
2204
|
+
fn default() -> Self {
|
|
2205
|
+
SubscribeArgs {
|
|
2206
|
+
topic: None,
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
pub struct SubscribeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2212
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2213
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2214
|
+
}
|
|
2215
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> SubscribeBuilder<'a, 'b, A> {
|
|
2216
|
+
#[inline]
|
|
2217
|
+
pub fn add_topic(&mut self, topic: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2218
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Subscribe::VT_TOPIC, topic);
|
|
2219
|
+
}
|
|
2220
|
+
#[inline]
|
|
2221
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> SubscribeBuilder<'a, 'b, A> {
|
|
2222
|
+
let start = _fbb.start_table();
|
|
2223
|
+
SubscribeBuilder {
|
|
2224
|
+
fbb_: _fbb,
|
|
2225
|
+
start_: start,
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
#[inline]
|
|
2229
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Subscribe<'a>> {
|
|
2230
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2231
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
impl ::core::fmt::Debug for Subscribe<'_> {
|
|
2236
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2237
|
+
let mut ds = f.debug_struct("Subscribe");
|
|
2238
|
+
ds.field("topic", &self.topic());
|
|
2239
|
+
ds.finish()
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
pub enum UnsubscribeOffset {}
|
|
2243
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2244
|
+
|
|
2245
|
+
pub struct Unsubscribe<'a> {
|
|
2246
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
impl<'a> ::flatbuffers::Follow<'a> for Unsubscribe<'a> {
|
|
2250
|
+
type Inner = Unsubscribe<'a>;
|
|
2251
|
+
#[inline]
|
|
2252
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2253
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
impl<'a> Unsubscribe<'a> {
|
|
2258
|
+
pub const VT_TOPIC: ::flatbuffers::VOffsetT = 4;
|
|
2259
|
+
|
|
2260
|
+
#[inline]
|
|
2261
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2262
|
+
Unsubscribe { _tab: table }
|
|
2263
|
+
}
|
|
2264
|
+
#[allow(unused_mut)]
|
|
2265
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2266
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2267
|
+
args: &'args UnsubscribeArgs<'args>
|
|
2268
|
+
) -> ::flatbuffers::WIPOffset<Unsubscribe<'bldr>> {
|
|
2269
|
+
let mut builder = UnsubscribeBuilder::new(_fbb);
|
|
2270
|
+
if let Some(x) = args.topic { builder.add_topic(x); }
|
|
2271
|
+
builder.finish()
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
#[inline]
|
|
2276
|
+
pub fn topic(&self) -> Option<&'a str> {
|
|
2277
|
+
// Safety:
|
|
2278
|
+
// Created from valid Table for this object
|
|
2279
|
+
// which contains a valid value in this slot
|
|
2280
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Unsubscribe::VT_TOPIC, None)}
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
impl ::flatbuffers::Verifiable for Unsubscribe<'_> {
|
|
2285
|
+
#[inline]
|
|
2286
|
+
fn run_verifier(
|
|
2287
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2288
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2289
|
+
v.visit_table(pos)?
|
|
2290
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("topic", Self::VT_TOPIC, false)?
|
|
2291
|
+
.finish();
|
|
2292
|
+
Ok(())
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
pub struct UnsubscribeArgs<'a> {
|
|
2296
|
+
pub topic: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2297
|
+
}
|
|
2298
|
+
impl<'a> Default for UnsubscribeArgs<'a> {
|
|
2299
|
+
#[inline]
|
|
2300
|
+
fn default() -> Self {
|
|
2301
|
+
UnsubscribeArgs {
|
|
2302
|
+
topic: None,
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
pub struct UnsubscribeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2308
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2309
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2310
|
+
}
|
|
2311
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> UnsubscribeBuilder<'a, 'b, A> {
|
|
2312
|
+
#[inline]
|
|
2313
|
+
pub fn add_topic(&mut self, topic: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2314
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Unsubscribe::VT_TOPIC, topic);
|
|
2315
|
+
}
|
|
2316
|
+
#[inline]
|
|
2317
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> UnsubscribeBuilder<'a, 'b, A> {
|
|
2318
|
+
let start = _fbb.start_table();
|
|
2319
|
+
UnsubscribeBuilder {
|
|
2320
|
+
fbb_: _fbb,
|
|
2321
|
+
start_: start,
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
#[inline]
|
|
2325
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Unsubscribe<'a>> {
|
|
2326
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2327
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
impl ::core::fmt::Debug for Unsubscribe<'_> {
|
|
2332
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2333
|
+
let mut ds = f.debug_struct("Unsubscribe");
|
|
2334
|
+
ds.field("topic", &self.topic());
|
|
2335
|
+
ds.finish()
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
pub enum JoinGroupOffset {}
|
|
2339
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2340
|
+
|
|
2341
|
+
pub struct JoinGroup<'a> {
|
|
2342
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
impl<'a> ::flatbuffers::Follow<'a> for JoinGroup<'a> {
|
|
2346
|
+
type Inner = JoinGroup<'a>;
|
|
2347
|
+
#[inline]
|
|
2348
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2349
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
impl<'a> JoinGroup<'a> {
|
|
2354
|
+
pub const VT_GROUP: ::flatbuffers::VOffsetT = 4;
|
|
2355
|
+
|
|
2356
|
+
#[inline]
|
|
2357
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2358
|
+
JoinGroup { _tab: table }
|
|
2359
|
+
}
|
|
2360
|
+
#[allow(unused_mut)]
|
|
2361
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2362
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2363
|
+
args: &'args JoinGroupArgs<'args>
|
|
2364
|
+
) -> ::flatbuffers::WIPOffset<JoinGroup<'bldr>> {
|
|
2365
|
+
let mut builder = JoinGroupBuilder::new(_fbb);
|
|
2366
|
+
if let Some(x) = args.group { builder.add_group(x); }
|
|
2367
|
+
builder.finish()
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
#[inline]
|
|
2372
|
+
pub fn group(&self) -> Option<&'a str> {
|
|
2373
|
+
// Safety:
|
|
2374
|
+
// Created from valid Table for this object
|
|
2375
|
+
// which contains a valid value in this slot
|
|
2376
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(JoinGroup::VT_GROUP, None)}
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
impl ::flatbuffers::Verifiable for JoinGroup<'_> {
|
|
2381
|
+
#[inline]
|
|
2382
|
+
fn run_verifier(
|
|
2383
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2384
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2385
|
+
v.visit_table(pos)?
|
|
2386
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("group", Self::VT_GROUP, false)?
|
|
2387
|
+
.finish();
|
|
2388
|
+
Ok(())
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
pub struct JoinGroupArgs<'a> {
|
|
2392
|
+
pub group: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2393
|
+
}
|
|
2394
|
+
impl<'a> Default for JoinGroupArgs<'a> {
|
|
2395
|
+
#[inline]
|
|
2396
|
+
fn default() -> Self {
|
|
2397
|
+
JoinGroupArgs {
|
|
2398
|
+
group: None,
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
pub struct JoinGroupBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2404
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2405
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2406
|
+
}
|
|
2407
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> JoinGroupBuilder<'a, 'b, A> {
|
|
2408
|
+
#[inline]
|
|
2409
|
+
pub fn add_group(&mut self, group: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2410
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(JoinGroup::VT_GROUP, group);
|
|
2411
|
+
}
|
|
2412
|
+
#[inline]
|
|
2413
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> JoinGroupBuilder<'a, 'b, A> {
|
|
2414
|
+
let start = _fbb.start_table();
|
|
2415
|
+
JoinGroupBuilder {
|
|
2416
|
+
fbb_: _fbb,
|
|
2417
|
+
start_: start,
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
#[inline]
|
|
2421
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<JoinGroup<'a>> {
|
|
2422
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2423
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
impl ::core::fmt::Debug for JoinGroup<'_> {
|
|
2428
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2429
|
+
let mut ds = f.debug_struct("JoinGroup");
|
|
2430
|
+
ds.field("group", &self.group());
|
|
2431
|
+
ds.finish()
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
pub enum LeaveGroupOffset {}
|
|
2435
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2436
|
+
|
|
2437
|
+
pub struct LeaveGroup<'a> {
|
|
2438
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
impl<'a> ::flatbuffers::Follow<'a> for LeaveGroup<'a> {
|
|
2442
|
+
type Inner = LeaveGroup<'a>;
|
|
2443
|
+
#[inline]
|
|
2444
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2445
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
impl<'a> LeaveGroup<'a> {
|
|
2450
|
+
pub const VT_GROUP: ::flatbuffers::VOffsetT = 4;
|
|
2451
|
+
|
|
2452
|
+
#[inline]
|
|
2453
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2454
|
+
LeaveGroup { _tab: table }
|
|
2455
|
+
}
|
|
2456
|
+
#[allow(unused_mut)]
|
|
2457
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2458
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2459
|
+
args: &'args LeaveGroupArgs<'args>
|
|
2460
|
+
) -> ::flatbuffers::WIPOffset<LeaveGroup<'bldr>> {
|
|
2461
|
+
let mut builder = LeaveGroupBuilder::new(_fbb);
|
|
2462
|
+
if let Some(x) = args.group { builder.add_group(x); }
|
|
2463
|
+
builder.finish()
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
#[inline]
|
|
2468
|
+
pub fn group(&self) -> Option<&'a str> {
|
|
2469
|
+
// Safety:
|
|
2470
|
+
// Created from valid Table for this object
|
|
2471
|
+
// which contains a valid value in this slot
|
|
2472
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(LeaveGroup::VT_GROUP, None)}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2476
|
+
impl ::flatbuffers::Verifiable for LeaveGroup<'_> {
|
|
2477
|
+
#[inline]
|
|
2478
|
+
fn run_verifier(
|
|
2479
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2480
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2481
|
+
v.visit_table(pos)?
|
|
2482
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("group", Self::VT_GROUP, false)?
|
|
2483
|
+
.finish();
|
|
2484
|
+
Ok(())
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
pub struct LeaveGroupArgs<'a> {
|
|
2488
|
+
pub group: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2489
|
+
}
|
|
2490
|
+
impl<'a> Default for LeaveGroupArgs<'a> {
|
|
2491
|
+
#[inline]
|
|
2492
|
+
fn default() -> Self {
|
|
2493
|
+
LeaveGroupArgs {
|
|
2494
|
+
group: None,
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
pub struct LeaveGroupBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2500
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2501
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2502
|
+
}
|
|
2503
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> LeaveGroupBuilder<'a, 'b, A> {
|
|
2504
|
+
#[inline]
|
|
2505
|
+
pub fn add_group(&mut self, group: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2506
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(LeaveGroup::VT_GROUP, group);
|
|
2507
|
+
}
|
|
2508
|
+
#[inline]
|
|
2509
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> LeaveGroupBuilder<'a, 'b, A> {
|
|
2510
|
+
let start = _fbb.start_table();
|
|
2511
|
+
LeaveGroupBuilder {
|
|
2512
|
+
fbb_: _fbb,
|
|
2513
|
+
start_: start,
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
#[inline]
|
|
2517
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<LeaveGroup<'a>> {
|
|
2518
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2519
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
impl ::core::fmt::Debug for LeaveGroup<'_> {
|
|
2524
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2525
|
+
let mut ds = f.debug_struct("LeaveGroup");
|
|
2526
|
+
ds.field("group", &self.group());
|
|
2527
|
+
ds.finish()
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
pub enum SnapshotRequestOffset {}
|
|
2531
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2532
|
+
|
|
2533
|
+
pub struct SnapshotRequest<'a> {
|
|
2534
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
impl<'a> ::flatbuffers::Follow<'a> for SnapshotRequest<'a> {
|
|
2538
|
+
type Inner = SnapshotRequest<'a>;
|
|
2539
|
+
#[inline]
|
|
2540
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2541
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
impl<'a> SnapshotRequest<'a> {
|
|
2546
|
+
pub const VT_TOPIC: ::flatbuffers::VOffsetT = 4;
|
|
2547
|
+
|
|
2548
|
+
#[inline]
|
|
2549
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2550
|
+
SnapshotRequest { _tab: table }
|
|
2551
|
+
}
|
|
2552
|
+
#[allow(unused_mut)]
|
|
2553
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2554
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2555
|
+
args: &'args SnapshotRequestArgs<'args>
|
|
2556
|
+
) -> ::flatbuffers::WIPOffset<SnapshotRequest<'bldr>> {
|
|
2557
|
+
let mut builder = SnapshotRequestBuilder::new(_fbb);
|
|
2558
|
+
if let Some(x) = args.topic { builder.add_topic(x); }
|
|
2559
|
+
builder.finish()
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
#[inline]
|
|
2564
|
+
pub fn topic(&self) -> Option<&'a str> {
|
|
2565
|
+
// Safety:
|
|
2566
|
+
// Created from valid Table for this object
|
|
2567
|
+
// which contains a valid value in this slot
|
|
2568
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(SnapshotRequest::VT_TOPIC, None)}
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
impl ::flatbuffers::Verifiable for SnapshotRequest<'_> {
|
|
2573
|
+
#[inline]
|
|
2574
|
+
fn run_verifier(
|
|
2575
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2576
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2577
|
+
v.visit_table(pos)?
|
|
2578
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("topic", Self::VT_TOPIC, false)?
|
|
2579
|
+
.finish();
|
|
2580
|
+
Ok(())
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
pub struct SnapshotRequestArgs<'a> {
|
|
2584
|
+
pub topic: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2585
|
+
}
|
|
2586
|
+
impl<'a> Default for SnapshotRequestArgs<'a> {
|
|
2587
|
+
#[inline]
|
|
2588
|
+
fn default() -> Self {
|
|
2589
|
+
SnapshotRequestArgs {
|
|
2590
|
+
topic: None,
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
pub struct SnapshotRequestBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2596
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2597
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2598
|
+
}
|
|
2599
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> SnapshotRequestBuilder<'a, 'b, A> {
|
|
2600
|
+
#[inline]
|
|
2601
|
+
pub fn add_topic(&mut self, topic: ::flatbuffers::WIPOffset<&'b str>) {
|
|
2602
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(SnapshotRequest::VT_TOPIC, topic);
|
|
2603
|
+
}
|
|
2604
|
+
#[inline]
|
|
2605
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> SnapshotRequestBuilder<'a, 'b, A> {
|
|
2606
|
+
let start = _fbb.start_table();
|
|
2607
|
+
SnapshotRequestBuilder {
|
|
2608
|
+
fbb_: _fbb,
|
|
2609
|
+
start_: start,
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
#[inline]
|
|
2613
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<SnapshotRequest<'a>> {
|
|
2614
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2615
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
impl ::core::fmt::Debug for SnapshotRequest<'_> {
|
|
2620
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2621
|
+
let mut ds = f.debug_struct("SnapshotRequest");
|
|
2622
|
+
ds.field("topic", &self.topic());
|
|
2623
|
+
ds.finish()
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
pub enum PingOffset {}
|
|
2627
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2628
|
+
|
|
2629
|
+
pub struct Ping<'a> {
|
|
2630
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
impl<'a> ::flatbuffers::Follow<'a> for Ping<'a> {
|
|
2634
|
+
type Inner = Ping<'a>;
|
|
2635
|
+
#[inline]
|
|
2636
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2637
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
impl<'a> Ping<'a> {
|
|
2642
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 4;
|
|
2643
|
+
|
|
2644
|
+
#[inline]
|
|
2645
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2646
|
+
Ping { _tab: table }
|
|
2647
|
+
}
|
|
2648
|
+
#[allow(unused_mut)]
|
|
2649
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2650
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2651
|
+
args: &'args PingArgs
|
|
2652
|
+
) -> ::flatbuffers::WIPOffset<Ping<'bldr>> {
|
|
2653
|
+
let mut builder = PingBuilder::new(_fbb);
|
|
2654
|
+
builder.add_ts(args.ts);
|
|
2655
|
+
builder.finish()
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
#[inline]
|
|
2660
|
+
pub fn ts(&self) -> i64 {
|
|
2661
|
+
// Safety:
|
|
2662
|
+
// Created from valid Table for this object
|
|
2663
|
+
// which contains a valid value in this slot
|
|
2664
|
+
unsafe { self._tab.get::<i64>(Ping::VT_TS, Some(0)).unwrap()}
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
impl ::flatbuffers::Verifiable for Ping<'_> {
|
|
2669
|
+
#[inline]
|
|
2670
|
+
fn run_verifier(
|
|
2671
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2672
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2673
|
+
v.visit_table(pos)?
|
|
2674
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
2675
|
+
.finish();
|
|
2676
|
+
Ok(())
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
pub struct PingArgs {
|
|
2680
|
+
pub ts: i64,
|
|
2681
|
+
}
|
|
2682
|
+
impl<'a> Default for PingArgs {
|
|
2683
|
+
#[inline]
|
|
2684
|
+
fn default() -> Self {
|
|
2685
|
+
PingArgs {
|
|
2686
|
+
ts: 0,
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
pub struct PingBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2692
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2693
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2694
|
+
}
|
|
2695
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PingBuilder<'a, 'b, A> {
|
|
2696
|
+
#[inline]
|
|
2697
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
2698
|
+
self.fbb_.push_slot::<i64>(Ping::VT_TS, ts, 0);
|
|
2699
|
+
}
|
|
2700
|
+
#[inline]
|
|
2701
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PingBuilder<'a, 'b, A> {
|
|
2702
|
+
let start = _fbb.start_table();
|
|
2703
|
+
PingBuilder {
|
|
2704
|
+
fbb_: _fbb,
|
|
2705
|
+
start_: start,
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
#[inline]
|
|
2709
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Ping<'a>> {
|
|
2710
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2711
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
impl ::core::fmt::Debug for Ping<'_> {
|
|
2716
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2717
|
+
let mut ds = f.debug_struct("Ping");
|
|
2718
|
+
ds.field("ts", &self.ts());
|
|
2719
|
+
ds.finish()
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
pub enum PongOffset {}
|
|
2723
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2724
|
+
|
|
2725
|
+
pub struct Pong<'a> {
|
|
2726
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
impl<'a> ::flatbuffers::Follow<'a> for Pong<'a> {
|
|
2730
|
+
type Inner = Pong<'a>;
|
|
2731
|
+
#[inline]
|
|
2732
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2733
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
impl<'a> Pong<'a> {
|
|
2738
|
+
pub const VT_TS: ::flatbuffers::VOffsetT = 4;
|
|
2739
|
+
|
|
2740
|
+
#[inline]
|
|
2741
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2742
|
+
Pong { _tab: table }
|
|
2743
|
+
}
|
|
2744
|
+
#[allow(unused_mut)]
|
|
2745
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2746
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2747
|
+
args: &'args PongArgs
|
|
2748
|
+
) -> ::flatbuffers::WIPOffset<Pong<'bldr>> {
|
|
2749
|
+
let mut builder = PongBuilder::new(_fbb);
|
|
2750
|
+
builder.add_ts(args.ts);
|
|
2751
|
+
builder.finish()
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
|
|
2755
|
+
#[inline]
|
|
2756
|
+
pub fn ts(&self) -> i64 {
|
|
2757
|
+
// Safety:
|
|
2758
|
+
// Created from valid Table for this object
|
|
2759
|
+
// which contains a valid value in this slot
|
|
2760
|
+
unsafe { self._tab.get::<i64>(Pong::VT_TS, Some(0)).unwrap()}
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
impl ::flatbuffers::Verifiable for Pong<'_> {
|
|
2765
|
+
#[inline]
|
|
2766
|
+
fn run_verifier(
|
|
2767
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2768
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2769
|
+
v.visit_table(pos)?
|
|
2770
|
+
.visit_field::<i64>("ts", Self::VT_TS, false)?
|
|
2771
|
+
.finish();
|
|
2772
|
+
Ok(())
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
pub struct PongArgs {
|
|
2776
|
+
pub ts: i64,
|
|
2777
|
+
}
|
|
2778
|
+
impl<'a> Default for PongArgs {
|
|
2779
|
+
#[inline]
|
|
2780
|
+
fn default() -> Self {
|
|
2781
|
+
PongArgs {
|
|
2782
|
+
ts: 0,
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
pub struct PongBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2788
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2789
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2790
|
+
}
|
|
2791
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> PongBuilder<'a, 'b, A> {
|
|
2792
|
+
#[inline]
|
|
2793
|
+
pub fn add_ts(&mut self, ts: i64) {
|
|
2794
|
+
self.fbb_.push_slot::<i64>(Pong::VT_TS, ts, 0);
|
|
2795
|
+
}
|
|
2796
|
+
#[inline]
|
|
2797
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> PongBuilder<'a, 'b, A> {
|
|
2798
|
+
let start = _fbb.start_table();
|
|
2799
|
+
PongBuilder {
|
|
2800
|
+
fbb_: _fbb,
|
|
2801
|
+
start_: start,
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
#[inline]
|
|
2805
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Pong<'a>> {
|
|
2806
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2807
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
impl ::core::fmt::Debug for Pong<'_> {
|
|
2812
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2813
|
+
let mut ds = f.debug_struct("Pong");
|
|
2814
|
+
ds.field("ts", &self.ts());
|
|
2815
|
+
ds.finish()
|
|
2816
|
+
}
|
|
2817
|
+
}
|