1extern crate alloc;
4
5#[allow(unused_imports, dead_code)]
6pub mod nmp {
7
8 #[allow(unused_imports, dead_code)]
9 pub mod threading {
10
11 #[deprecated(
12 since = "2.0.0",
13 note = "Use associated constants instead. This will no longer be generated in 2021."
14 )]
15 pub const ENUM_MIN_THREAD_POINTER_KIND: u8 = 0;
16 #[deprecated(
17 since = "2.0.0",
18 note = "Use associated constants instead. This will no longer be generated in 2021."
19 )]
20 pub const ENUM_MAX_THREAD_POINTER_KIND: u8 = 2;
21 #[deprecated(
22 since = "2.0.0",
23 note = "Use associated constants instead. This will no longer be generated in 2021."
24 )]
25 #[allow(non_camel_case_types)]
26 pub const ENUM_VALUES_THREAD_POINTER_KIND: [ThreadPointerKind; 3] = [
27 ThreadPointerKind::Event,
28 ThreadPointerKind::Address,
29 ThreadPointerKind::External,
30 ];
31
32 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
33 #[repr(transparent)]
34 pub struct ThreadPointerKind(pub u8);
35 #[allow(non_upper_case_globals)]
36 impl ThreadPointerKind {
37 pub const Event: Self = Self(0);
38 pub const Address: Self = Self(1);
39 pub const External: Self = Self(2);
40
41 pub const ENUM_MIN: u8 = 0;
42 pub const ENUM_MAX: u8 = 2;
43 pub const ENUM_VALUES: &'static [Self] = &[Self::Event, Self::Address, Self::External];
44 pub fn variant_name(self) -> Option<&'static str> {
46 match self {
47 Self::Event => Some("Event"),
48 Self::Address => Some("Address"),
49 Self::External => Some("External"),
50 _ => None,
51 }
52 }
53 }
54 impl ::core::fmt::Debug for ThreadPointerKind {
55 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
56 if let Some(name) = self.variant_name() {
57 f.write_str(name)
58 } else {
59 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
60 }
61 }
62 }
63 impl<'a> ::flatbuffers::Follow<'a> for ThreadPointerKind {
64 type Inner = Self;
65 #[inline]
66 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
67 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
68 Self(b)
69 }
70 }
71
72 impl ::flatbuffers::Push for ThreadPointerKind {
73 type Output = ThreadPointerKind;
74 #[inline]
75 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
76 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
77 }
78 }
79
80 impl ::flatbuffers::EndianScalar for ThreadPointerKind {
81 type Scalar = u8;
82 #[inline]
83 fn to_little_endian(self) -> u8 {
84 self.0.to_le()
85 }
86 #[inline]
87 #[allow(clippy::wrong_self_convention)]
88 fn from_little_endian(v: u8) -> Self {
89 let b = u8::from_le(v);
90 Self(b)
91 }
92 }
93
94 impl<'a> ::flatbuffers::Verifiable for ThreadPointerKind {
95 #[inline]
96 fn run_verifier(
97 v: &mut ::flatbuffers::Verifier,
98 pos: usize,
99 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
100 u8::run_verifier(v, pos)
101 }
102 }
103
104 impl ::flatbuffers::SimpleToVerifyInSlice for ThreadPointerKind {}
105 #[deprecated(
106 since = "2.0.0",
107 note = "Use associated constants instead. This will no longer be generated in 2021."
108 )]
109 pub const ENUM_MIN_TIMELINE_BLOCK_KIND: u8 = 0;
110 #[deprecated(
111 since = "2.0.0",
112 note = "Use associated constants instead. This will no longer be generated in 2021."
113 )]
114 pub const ENUM_MAX_TIMELINE_BLOCK_KIND: u8 = 1;
115 #[deprecated(
116 since = "2.0.0",
117 note = "Use associated constants instead. This will no longer be generated in 2021."
118 )]
119 #[allow(non_camel_case_types)]
120 pub const ENUM_VALUES_TIMELINE_BLOCK_KIND: [TimelineBlockKind; 2] =
121 [TimelineBlockKind::Standalone, TimelineBlockKind::Module];
122
123 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
124 #[repr(transparent)]
125 pub struct TimelineBlockKind(pub u8);
126 #[allow(non_upper_case_globals)]
127 impl TimelineBlockKind {
128 pub const Standalone: Self = Self(0);
129 pub const Module: Self = Self(1);
130
131 pub const ENUM_MIN: u8 = 0;
132 pub const ENUM_MAX: u8 = 1;
133 pub const ENUM_VALUES: &'static [Self] = &[Self::Standalone, Self::Module];
134 pub fn variant_name(self) -> Option<&'static str> {
136 match self {
137 Self::Standalone => Some("Standalone"),
138 Self::Module => Some("Module"),
139 _ => None,
140 }
141 }
142 }
143 impl ::core::fmt::Debug for TimelineBlockKind {
144 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
145 if let Some(name) = self.variant_name() {
146 f.write_str(name)
147 } else {
148 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
149 }
150 }
151 }
152 impl<'a> ::flatbuffers::Follow<'a> for TimelineBlockKind {
153 type Inner = Self;
154 #[inline]
155 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
156 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
157 Self(b)
158 }
159 }
160
161 impl ::flatbuffers::Push for TimelineBlockKind {
162 type Output = TimelineBlockKind;
163 #[inline]
164 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
165 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
166 }
167 }
168
169 impl ::flatbuffers::EndianScalar for TimelineBlockKind {
170 type Scalar = u8;
171 #[inline]
172 fn to_little_endian(self) -> u8 {
173 self.0.to_le()
174 }
175 #[inline]
176 #[allow(clippy::wrong_self_convention)]
177 fn from_little_endian(v: u8) -> Self {
178 let b = u8::from_le(v);
179 Self(b)
180 }
181 }
182
183 impl<'a> ::flatbuffers::Verifiable for TimelineBlockKind {
184 #[inline]
185 fn run_verifier(
186 v: &mut ::flatbuffers::Verifier,
187 pos: usize,
188 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
189 u8::run_verifier(v, pos)
190 }
191 }
192
193 impl ::flatbuffers::SimpleToVerifyInSlice for TimelineBlockKind {}
194 pub enum ThreadPointerOffset {}
195 #[derive(Copy, Clone, PartialEq)]
196
197 pub struct ThreadPointer<'a> {
198 pub _tab: ::flatbuffers::Table<'a>,
199 }
200
201 impl<'a> ::flatbuffers::Follow<'a> for ThreadPointer<'a> {
202 type Inner = ThreadPointer<'a>;
203 #[inline]
204 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
205 Self {
206 _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
207 }
208 }
209 }
210
211 impl<'a> ThreadPointer<'a> {
212 pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
213 pub const VT_ID: ::flatbuffers::VOffsetT = 6;
214 pub const VT_COORD: ::flatbuffers::VOffsetT = 8;
215 pub const VT_URI: ::flatbuffers::VOffsetT = 10;
216 pub const VT_RELAY: ::flatbuffers::VOffsetT = 12;
217 pub const VT_HAS_KIND_NUM: ::flatbuffers::VOffsetT = 14;
218 pub const VT_KIND_NUM: ::flatbuffers::VOffsetT = 16;
219
220 #[inline]
221 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
222 ThreadPointer { _tab: table }
223 }
224 #[allow(unused_mut)]
225 pub fn create<
226 'bldr: 'args,
227 'args: 'mut_bldr,
228 'mut_bldr,
229 A: ::flatbuffers::Allocator + 'bldr,
230 >(
231 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
232 args: &'args ThreadPointerArgs<'args>,
233 ) -> ::flatbuffers::WIPOffset<ThreadPointer<'bldr>> {
234 let mut builder = ThreadPointerBuilder::new(_fbb);
235 builder.add_kind_num(args.kind_num);
236 if let Some(x) = args.relay {
237 builder.add_relay(x);
238 }
239 if let Some(x) = args.uri {
240 builder.add_uri(x);
241 }
242 if let Some(x) = args.coord {
243 builder.add_coord(x);
244 }
245 if let Some(x) = args.id {
246 builder.add_id(x);
247 }
248 builder.add_has_kind_num(args.has_kind_num);
249 builder.add_kind(args.kind);
250 builder.finish()
251 }
252
253 #[inline]
254 pub fn kind(&self) -> ThreadPointerKind {
255 unsafe {
259 self._tab
260 .get::<ThreadPointerKind>(
261 ThreadPointer::VT_KIND,
262 Some(ThreadPointerKind::Event),
263 )
264 .unwrap()
265 }
266 }
267 #[inline]
268 pub fn id(&self) -> Option<&'a str> {
269 unsafe {
273 self._tab
274 .get::<::flatbuffers::ForwardsUOffset<&str>>(ThreadPointer::VT_ID, None)
275 }
276 }
277 #[inline]
278 pub fn coord(&self) -> Option<&'a str> {
279 unsafe {
283 self._tab
284 .get::<::flatbuffers::ForwardsUOffset<&str>>(ThreadPointer::VT_COORD, None)
285 }
286 }
287 #[inline]
288 pub fn uri(&self) -> Option<&'a str> {
289 unsafe {
293 self._tab
294 .get::<::flatbuffers::ForwardsUOffset<&str>>(ThreadPointer::VT_URI, None)
295 }
296 }
297 #[inline]
298 pub fn relay(&self) -> Option<&'a str> {
299 unsafe {
303 self._tab
304 .get::<::flatbuffers::ForwardsUOffset<&str>>(ThreadPointer::VT_RELAY, None)
305 }
306 }
307 #[inline]
308 pub fn has_kind_num(&self) -> bool {
309 unsafe {
313 self._tab
314 .get::<bool>(ThreadPointer::VT_HAS_KIND_NUM, Some(false))
315 .unwrap()
316 }
317 }
318 #[inline]
319 pub fn kind_num(&self) -> u32 {
320 unsafe {
324 self._tab
325 .get::<u32>(ThreadPointer::VT_KIND_NUM, Some(0))
326 .unwrap()
327 }
328 }
329 }
330
331 impl ::flatbuffers::Verifiable for ThreadPointer<'_> {
332 #[inline]
333 fn run_verifier(
334 v: &mut ::flatbuffers::Verifier,
335 pos: usize,
336 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
337 v.visit_table(pos)?
338 .visit_field::<ThreadPointerKind>("kind", Self::VT_KIND, false)?
339 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
340 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
341 "coord",
342 Self::VT_COORD,
343 false,
344 )?
345 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
346 "uri",
347 Self::VT_URI,
348 false,
349 )?
350 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
351 "relay",
352 Self::VT_RELAY,
353 false,
354 )?
355 .visit_field::<bool>("has_kind_num", Self::VT_HAS_KIND_NUM, false)?
356 .visit_field::<u32>("kind_num", Self::VT_KIND_NUM, false)?
357 .finish();
358 Ok(())
359 }
360 }
361 pub struct ThreadPointerArgs<'a> {
362 pub kind: ThreadPointerKind,
363 pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
364 pub coord: Option<::flatbuffers::WIPOffset<&'a str>>,
365 pub uri: Option<::flatbuffers::WIPOffset<&'a str>>,
366 pub relay: Option<::flatbuffers::WIPOffset<&'a str>>,
367 pub has_kind_num: bool,
368 pub kind_num: u32,
369 }
370 impl<'a> Default for ThreadPointerArgs<'a> {
371 #[inline]
372 fn default() -> Self {
373 ThreadPointerArgs {
374 kind: ThreadPointerKind::Event,
375 id: None,
376 coord: None,
377 uri: None,
378 relay: None,
379 has_kind_num: false,
380 kind_num: 0,
381 }
382 }
383 }
384
385 pub struct ThreadPointerBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
386 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
387 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
388 }
389 impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ThreadPointerBuilder<'a, 'b, A> {
390 #[inline]
391 pub fn add_kind(&mut self, kind: ThreadPointerKind) {
392 self.fbb_.push_slot::<ThreadPointerKind>(
393 ThreadPointer::VT_KIND,
394 kind,
395 ThreadPointerKind::Event,
396 );
397 }
398 #[inline]
399 pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
400 self.fbb_
401 .push_slot_always::<::flatbuffers::WIPOffset<_>>(ThreadPointer::VT_ID, id);
402 }
403 #[inline]
404 pub fn add_coord(&mut self, coord: ::flatbuffers::WIPOffset<&'b str>) {
405 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
406 ThreadPointer::VT_COORD,
407 coord,
408 );
409 }
410 #[inline]
411 pub fn add_uri(&mut self, uri: ::flatbuffers::WIPOffset<&'b str>) {
412 self.fbb_
413 .push_slot_always::<::flatbuffers::WIPOffset<_>>(ThreadPointer::VT_URI, uri);
414 }
415 #[inline]
416 pub fn add_relay(&mut self, relay: ::flatbuffers::WIPOffset<&'b str>) {
417 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
418 ThreadPointer::VT_RELAY,
419 relay,
420 );
421 }
422 #[inline]
423 pub fn add_has_kind_num(&mut self, has_kind_num: bool) {
424 self.fbb_
425 .push_slot::<bool>(ThreadPointer::VT_HAS_KIND_NUM, has_kind_num, false);
426 }
427 #[inline]
428 pub fn add_kind_num(&mut self, kind_num: u32) {
429 self.fbb_
430 .push_slot::<u32>(ThreadPointer::VT_KIND_NUM, kind_num, 0);
431 }
432 #[inline]
433 pub fn new(
434 _fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
435 ) -> ThreadPointerBuilder<'a, 'b, A> {
436 let start = _fbb.start_table();
437 ThreadPointerBuilder {
438 fbb_: _fbb,
439 start_: start,
440 }
441 }
442 #[inline]
443 pub fn finish(self) -> ::flatbuffers::WIPOffset<ThreadPointer<'a>> {
444 let o = self.fbb_.end_table(self.start_);
445 ::flatbuffers::WIPOffset::new(o.value())
446 }
447 }
448
449 impl ::core::fmt::Debug for ThreadPointer<'_> {
450 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
451 let mut ds = f.debug_struct("ThreadPointer");
452 ds.field("kind", &self.kind());
453 ds.field("id", &self.id());
454 ds.field("coord", &self.coord());
455 ds.field("uri", &self.uri());
456 ds.field("relay", &self.relay());
457 ds.field("has_kind_num", &self.has_kind_num());
458 ds.field("kind_num", &self.kind_num());
459 ds.finish()
460 }
461 }
462 pub enum ThreadEdgeOffset {}
463 #[derive(Copy, Clone, PartialEq)]
464
465 pub struct ThreadEdge<'a> {
466 pub _tab: ::flatbuffers::Table<'a>,
467 }
468
469 impl<'a> ::flatbuffers::Follow<'a> for ThreadEdge<'a> {
470 type Inner = ThreadEdge<'a>;
471 #[inline]
472 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
473 Self {
474 _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
475 }
476 }
477 }
478
479 impl<'a> ThreadEdge<'a> {
480 pub const VT_EVENT_ID: ::flatbuffers::VOffsetT = 4;
481 pub const VT_AUTHOR_PUBKEY: ::flatbuffers::VOffsetT = 6;
482 pub const VT_KIND: ::flatbuffers::VOffsetT = 8;
483 pub const VT_CREATED_AT: ::flatbuffers::VOffsetT = 10;
484 pub const VT_PARENT: ::flatbuffers::VOffsetT = 12;
485 pub const VT_ROOT: ::flatbuffers::VOffsetT = 14;
486 pub const VT_PARENT_AUTHOR_PUBKEY: ::flatbuffers::VOffsetT = 16;
487
488 #[inline]
489 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
490 ThreadEdge { _tab: table }
491 }
492 #[allow(unused_mut)]
493 pub fn create<
494 'bldr: 'args,
495 'args: 'mut_bldr,
496 'mut_bldr,
497 A: ::flatbuffers::Allocator + 'bldr,
498 >(
499 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
500 args: &'args ThreadEdgeArgs<'args>,
501 ) -> ::flatbuffers::WIPOffset<ThreadEdge<'bldr>> {
502 let mut builder = ThreadEdgeBuilder::new(_fbb);
503 builder.add_created_at(args.created_at);
504 if let Some(x) = args.parent_author_pubkey {
505 builder.add_parent_author_pubkey(x);
506 }
507 if let Some(x) = args.root {
508 builder.add_root(x);
509 }
510 if let Some(x) = args.parent {
511 builder.add_parent(x);
512 }
513 builder.add_kind(args.kind);
514 if let Some(x) = args.author_pubkey {
515 builder.add_author_pubkey(x);
516 }
517 if let Some(x) = args.event_id {
518 builder.add_event_id(x);
519 }
520 builder.finish()
521 }
522
523 #[inline]
524 pub fn event_id(&self) -> Option<&'a str> {
525 unsafe {
529 self._tab
530 .get::<::flatbuffers::ForwardsUOffset<&str>>(ThreadEdge::VT_EVENT_ID, None)
531 }
532 }
533 #[inline]
534 pub fn author_pubkey(&self) -> Option<&'a str> {
535 unsafe {
539 self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(
540 ThreadEdge::VT_AUTHOR_PUBKEY,
541 None,
542 )
543 }
544 }
545 #[inline]
546 pub fn kind(&self) -> u32 {
547 unsafe { self._tab.get::<u32>(ThreadEdge::VT_KIND, Some(0)).unwrap() }
551 }
552 #[inline]
553 pub fn created_at(&self) -> u64 {
554 unsafe {
558 self._tab
559 .get::<u64>(ThreadEdge::VT_CREATED_AT, Some(0))
560 .unwrap()
561 }
562 }
563 #[inline]
564 pub fn parent(&self) -> Option<ThreadPointer<'a>> {
565 unsafe {
569 self._tab
570 .get::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
571 ThreadEdge::VT_PARENT,
572 None,
573 )
574 }
575 }
576 #[inline]
577 pub fn root(&self) -> Option<ThreadPointer<'a>> {
578 unsafe {
582 self._tab
583 .get::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
584 ThreadEdge::VT_ROOT,
585 None,
586 )
587 }
588 }
589 #[inline]
590 pub fn parent_author_pubkey(&self) -> Option<&'a str> {
591 unsafe {
595 self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(
596 ThreadEdge::VT_PARENT_AUTHOR_PUBKEY,
597 None,
598 )
599 }
600 }
601 }
602
603 impl ::flatbuffers::Verifiable for ThreadEdge<'_> {
604 #[inline]
605 fn run_verifier(
606 v: &mut ::flatbuffers::Verifier,
607 pos: usize,
608 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
609 v.visit_table(pos)?
610 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
611 "event_id",
612 Self::VT_EVENT_ID,
613 false,
614 )?
615 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
616 "author_pubkey",
617 Self::VT_AUTHOR_PUBKEY,
618 false,
619 )?
620 .visit_field::<u32>("kind", Self::VT_KIND, false)?
621 .visit_field::<u64>("created_at", Self::VT_CREATED_AT, false)?
622 .visit_field::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
623 "parent",
624 Self::VT_PARENT,
625 false,
626 )?
627 .visit_field::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
628 "root",
629 Self::VT_ROOT,
630 false,
631 )?
632 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
633 "parent_author_pubkey",
634 Self::VT_PARENT_AUTHOR_PUBKEY,
635 false,
636 )?
637 .finish();
638 Ok(())
639 }
640 }
641 pub struct ThreadEdgeArgs<'a> {
642 pub event_id: Option<::flatbuffers::WIPOffset<&'a str>>,
643 pub author_pubkey: Option<::flatbuffers::WIPOffset<&'a str>>,
644 pub kind: u32,
645 pub created_at: u64,
646 pub parent: Option<::flatbuffers::WIPOffset<ThreadPointer<'a>>>,
647 pub root: Option<::flatbuffers::WIPOffset<ThreadPointer<'a>>>,
648 pub parent_author_pubkey: Option<::flatbuffers::WIPOffset<&'a str>>,
649 }
650 impl<'a> Default for ThreadEdgeArgs<'a> {
651 #[inline]
652 fn default() -> Self {
653 ThreadEdgeArgs {
654 event_id: None,
655 author_pubkey: None,
656 kind: 0,
657 created_at: 0,
658 parent: None,
659 root: None,
660 parent_author_pubkey: None,
661 }
662 }
663 }
664
665 pub struct ThreadEdgeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
666 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
667 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
668 }
669 impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ThreadEdgeBuilder<'a, 'b, A> {
670 #[inline]
671 pub fn add_event_id(&mut self, event_id: ::flatbuffers::WIPOffset<&'b str>) {
672 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
673 ThreadEdge::VT_EVENT_ID,
674 event_id,
675 );
676 }
677 #[inline]
678 pub fn add_author_pubkey(&mut self, author_pubkey: ::flatbuffers::WIPOffset<&'b str>) {
679 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
680 ThreadEdge::VT_AUTHOR_PUBKEY,
681 author_pubkey,
682 );
683 }
684 #[inline]
685 pub fn add_kind(&mut self, kind: u32) {
686 self.fbb_.push_slot::<u32>(ThreadEdge::VT_KIND, kind, 0);
687 }
688 #[inline]
689 pub fn add_created_at(&mut self, created_at: u64) {
690 self.fbb_
691 .push_slot::<u64>(ThreadEdge::VT_CREATED_AT, created_at, 0);
692 }
693 #[inline]
694 pub fn add_parent(&mut self, parent: ::flatbuffers::WIPOffset<ThreadPointer<'b>>) {
695 self.fbb_
696 .push_slot_always::<::flatbuffers::WIPOffset<ThreadPointer>>(
697 ThreadEdge::VT_PARENT,
698 parent,
699 );
700 }
701 #[inline]
702 pub fn add_root(&mut self, root: ::flatbuffers::WIPOffset<ThreadPointer<'b>>) {
703 self.fbb_
704 .push_slot_always::<::flatbuffers::WIPOffset<ThreadPointer>>(
705 ThreadEdge::VT_ROOT,
706 root,
707 );
708 }
709 #[inline]
710 pub fn add_parent_author_pubkey(
711 &mut self,
712 parent_author_pubkey: ::flatbuffers::WIPOffset<&'b str>,
713 ) {
714 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
715 ThreadEdge::VT_PARENT_AUTHOR_PUBKEY,
716 parent_author_pubkey,
717 );
718 }
719 #[inline]
720 pub fn new(
721 _fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
722 ) -> ThreadEdgeBuilder<'a, 'b, A> {
723 let start = _fbb.start_table();
724 ThreadEdgeBuilder {
725 fbb_: _fbb,
726 start_: start,
727 }
728 }
729 #[inline]
730 pub fn finish(self) -> ::flatbuffers::WIPOffset<ThreadEdge<'a>> {
731 let o = self.fbb_.end_table(self.start_);
732 ::flatbuffers::WIPOffset::new(o.value())
733 }
734 }
735
736 impl ::core::fmt::Debug for ThreadEdge<'_> {
737 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
738 let mut ds = f.debug_struct("ThreadEdge");
739 ds.field("event_id", &self.event_id());
740 ds.field("author_pubkey", &self.author_pubkey());
741 ds.field("kind", &self.kind());
742 ds.field("created_at", &self.created_at());
743 ds.field("parent", &self.parent());
744 ds.field("root", &self.root());
745 ds.field("parent_author_pubkey", &self.parent_author_pubkey());
746 ds.finish()
747 }
748 }
749 pub enum BlockEventIdOffset {}
750 #[derive(Copy, Clone, PartialEq)]
751
752 pub struct BlockEventId<'a> {
753 pub _tab: ::flatbuffers::Table<'a>,
754 }
755
756 impl<'a> ::flatbuffers::Follow<'a> for BlockEventId<'a> {
757 type Inner = BlockEventId<'a>;
758 #[inline]
759 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
760 Self {
761 _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
762 }
763 }
764 }
765
766 impl<'a> BlockEventId<'a> {
767 pub const VT_ID: ::flatbuffers::VOffsetT = 4;
768
769 #[inline]
770 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
771 BlockEventId { _tab: table }
772 }
773 #[allow(unused_mut)]
774 pub fn create<
775 'bldr: 'args,
776 'args: 'mut_bldr,
777 'mut_bldr,
778 A: ::flatbuffers::Allocator + 'bldr,
779 >(
780 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
781 args: &'args BlockEventIdArgs<'args>,
782 ) -> ::flatbuffers::WIPOffset<BlockEventId<'bldr>> {
783 let mut builder = BlockEventIdBuilder::new(_fbb);
784 if let Some(x) = args.id {
785 builder.add_id(x);
786 }
787 builder.finish()
788 }
789
790 #[inline]
791 pub fn id(&self) -> Option<&'a str> {
792 unsafe {
796 self._tab
797 .get::<::flatbuffers::ForwardsUOffset<&str>>(BlockEventId::VT_ID, None)
798 }
799 }
800 }
801
802 impl ::flatbuffers::Verifiable for BlockEventId<'_> {
803 #[inline]
804 fn run_verifier(
805 v: &mut ::flatbuffers::Verifier,
806 pos: usize,
807 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
808 v.visit_table(pos)?
809 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
810 .finish();
811 Ok(())
812 }
813 }
814 pub struct BlockEventIdArgs<'a> {
815 pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
816 }
817 impl<'a> Default for BlockEventIdArgs<'a> {
818 #[inline]
819 fn default() -> Self {
820 BlockEventIdArgs { id: None }
821 }
822 }
823
824 pub struct BlockEventIdBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
825 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
826 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
827 }
828 impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> BlockEventIdBuilder<'a, 'b, A> {
829 #[inline]
830 pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
831 self.fbb_
832 .push_slot_always::<::flatbuffers::WIPOffset<_>>(BlockEventId::VT_ID, id);
833 }
834 #[inline]
835 pub fn new(
836 _fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
837 ) -> BlockEventIdBuilder<'a, 'b, A> {
838 let start = _fbb.start_table();
839 BlockEventIdBuilder {
840 fbb_: _fbb,
841 start_: start,
842 }
843 }
844 #[inline]
845 pub fn finish(self) -> ::flatbuffers::WIPOffset<BlockEventId<'a>> {
846 let o = self.fbb_.end_table(self.start_);
847 ::flatbuffers::WIPOffset::new(o.value())
848 }
849 }
850
851 impl ::core::fmt::Debug for BlockEventId<'_> {
852 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
853 let mut ds = f.debug_struct("BlockEventId");
854 ds.field("id", &self.id());
855 ds.finish()
856 }
857 }
858 pub enum TimelineBlockEntryOffset {}
859 #[derive(Copy, Clone, PartialEq)]
860
861 pub struct TimelineBlockEntry<'a> {
862 pub _tab: ::flatbuffers::Table<'a>,
863 }
864
865 impl<'a> ::flatbuffers::Follow<'a> for TimelineBlockEntry<'a> {
866 type Inner = TimelineBlockEntry<'a>;
867 #[inline]
868 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
869 Self {
870 _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
871 }
872 }
873 }
874
875 impl<'a> TimelineBlockEntry<'a> {
876 pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
877 pub const VT_STANDALONE_ID: ::flatbuffers::VOffsetT = 6;
878 pub const VT_STANDALONE_ROOT: ::flatbuffers::VOffsetT = 8;
879 pub const VT_MODULE_EVENT_IDS: ::flatbuffers::VOffsetT = 10;
880 pub const VT_MODULE_HAS_GAP: ::flatbuffers::VOffsetT = 12;
881 pub const VT_MODULE_ROOT: ::flatbuffers::VOffsetT = 14;
882
883 #[inline]
884 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
885 TimelineBlockEntry { _tab: table }
886 }
887 #[allow(unused_mut)]
888 pub fn create<
889 'bldr: 'args,
890 'args: 'mut_bldr,
891 'mut_bldr,
892 A: ::flatbuffers::Allocator + 'bldr,
893 >(
894 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
895 args: &'args TimelineBlockEntryArgs<'args>,
896 ) -> ::flatbuffers::WIPOffset<TimelineBlockEntry<'bldr>> {
897 let mut builder = TimelineBlockEntryBuilder::new(_fbb);
898 if let Some(x) = args.module_root {
899 builder.add_module_root(x);
900 }
901 if let Some(x) = args.module_event_ids {
902 builder.add_module_event_ids(x);
903 }
904 if let Some(x) = args.standalone_root {
905 builder.add_standalone_root(x);
906 }
907 if let Some(x) = args.standalone_id {
908 builder.add_standalone_id(x);
909 }
910 builder.add_module_has_gap(args.module_has_gap);
911 builder.add_kind(args.kind);
912 builder.finish()
913 }
914
915 #[inline]
916 pub fn kind(&self) -> TimelineBlockKind {
917 unsafe {
921 self._tab
922 .get::<TimelineBlockKind>(
923 TimelineBlockEntry::VT_KIND,
924 Some(TimelineBlockKind::Standalone),
925 )
926 .unwrap()
927 }
928 }
929 #[inline]
930 pub fn standalone_id(&self) -> Option<&'a str> {
931 unsafe {
935 self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(
936 TimelineBlockEntry::VT_STANDALONE_ID,
937 None,
938 )
939 }
940 }
941 #[inline]
942 pub fn standalone_root(&self) -> Option<ThreadPointer<'a>> {
943 unsafe {
947 self._tab
948 .get::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
949 TimelineBlockEntry::VT_STANDALONE_ROOT,
950 None,
951 )
952 }
953 }
954 #[inline]
955 pub fn module_event_ids(
956 &self,
957 ) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId<'a>>>>
958 {
959 unsafe {
963 self._tab.get::<::flatbuffers::ForwardsUOffset<
964 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId>>,
965 >>(TimelineBlockEntry::VT_MODULE_EVENT_IDS, None)
966 }
967 }
968 #[inline]
969 pub fn module_has_gap(&self) -> bool {
970 unsafe {
974 self._tab
975 .get::<bool>(TimelineBlockEntry::VT_MODULE_HAS_GAP, Some(false))
976 .unwrap()
977 }
978 }
979 #[inline]
980 pub fn module_root(&self) -> Option<ThreadPointer<'a>> {
981 unsafe {
985 self._tab
986 .get::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
987 TimelineBlockEntry::VT_MODULE_ROOT,
988 None,
989 )
990 }
991 }
992 }
993
994 impl ::flatbuffers::Verifiable for TimelineBlockEntry<'_> {
995 #[inline]
996 fn run_verifier(
997 v: &mut ::flatbuffers::Verifier,
998 pos: usize,
999 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1000 v.visit_table(pos)?
1001 .visit_field::<TimelineBlockKind>("kind", Self::VT_KIND, false)?
1002 .visit_field::<::flatbuffers::ForwardsUOffset<&str>>(
1003 "standalone_id",
1004 Self::VT_STANDALONE_ID,
1005 false,
1006 )?
1007 .visit_field::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
1008 "standalone_root",
1009 Self::VT_STANDALONE_ROOT,
1010 false,
1011 )?
1012 .visit_field::<::flatbuffers::ForwardsUOffset<
1013 ::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<BlockEventId>>,
1014 >>("module_event_ids", Self::VT_MODULE_EVENT_IDS, false)?
1015 .visit_field::<bool>("module_has_gap", Self::VT_MODULE_HAS_GAP, false)?
1016 .visit_field::<::flatbuffers::ForwardsUOffset<ThreadPointer>>(
1017 "module_root",
1018 Self::VT_MODULE_ROOT,
1019 false,
1020 )?
1021 .finish();
1022 Ok(())
1023 }
1024 }
1025 pub struct TimelineBlockEntryArgs<'a> {
1026 pub kind: TimelineBlockKind,
1027 pub standalone_id: Option<::flatbuffers::WIPOffset<&'a str>>,
1028 pub standalone_root: Option<::flatbuffers::WIPOffset<ThreadPointer<'a>>>,
1029 pub module_event_ids: Option<
1030 ::flatbuffers::WIPOffset<
1031 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId<'a>>>,
1032 >,
1033 >,
1034 pub module_has_gap: bool,
1035 pub module_root: Option<::flatbuffers::WIPOffset<ThreadPointer<'a>>>,
1036 }
1037 impl<'a> Default for TimelineBlockEntryArgs<'a> {
1038 #[inline]
1039 fn default() -> Self {
1040 TimelineBlockEntryArgs {
1041 kind: TimelineBlockKind::Standalone,
1042 standalone_id: None,
1043 standalone_root: None,
1044 module_event_ids: None,
1045 module_has_gap: false,
1046 module_root: None,
1047 }
1048 }
1049 }
1050
1051 pub struct TimelineBlockEntryBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
1052 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1053 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
1054 }
1055 impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> TimelineBlockEntryBuilder<'a, 'b, A> {
1056 #[inline]
1057 pub fn add_kind(&mut self, kind: TimelineBlockKind) {
1058 self.fbb_.push_slot::<TimelineBlockKind>(
1059 TimelineBlockEntry::VT_KIND,
1060 kind,
1061 TimelineBlockKind::Standalone,
1062 );
1063 }
1064 #[inline]
1065 pub fn add_standalone_id(&mut self, standalone_id: ::flatbuffers::WIPOffset<&'b str>) {
1066 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
1067 TimelineBlockEntry::VT_STANDALONE_ID,
1068 standalone_id,
1069 );
1070 }
1071 #[inline]
1072 pub fn add_standalone_root(
1073 &mut self,
1074 standalone_root: ::flatbuffers::WIPOffset<ThreadPointer<'b>>,
1075 ) {
1076 self.fbb_
1077 .push_slot_always::<::flatbuffers::WIPOffset<ThreadPointer>>(
1078 TimelineBlockEntry::VT_STANDALONE_ROOT,
1079 standalone_root,
1080 );
1081 }
1082 #[inline]
1083 pub fn add_module_event_ids(
1084 &mut self,
1085 module_event_ids: ::flatbuffers::WIPOffset<
1086 ::flatbuffers::Vector<'b, ::flatbuffers::ForwardsUOffset<BlockEventId<'b>>>,
1087 >,
1088 ) {
1089 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
1090 TimelineBlockEntry::VT_MODULE_EVENT_IDS,
1091 module_event_ids,
1092 );
1093 }
1094 #[inline]
1095 pub fn add_module_has_gap(&mut self, module_has_gap: bool) {
1096 self.fbb_.push_slot::<bool>(
1097 TimelineBlockEntry::VT_MODULE_HAS_GAP,
1098 module_has_gap,
1099 false,
1100 );
1101 }
1102 #[inline]
1103 pub fn add_module_root(
1104 &mut self,
1105 module_root: ::flatbuffers::WIPOffset<ThreadPointer<'b>>,
1106 ) {
1107 self.fbb_
1108 .push_slot_always::<::flatbuffers::WIPOffset<ThreadPointer>>(
1109 TimelineBlockEntry::VT_MODULE_ROOT,
1110 module_root,
1111 );
1112 }
1113 #[inline]
1114 pub fn new(
1115 _fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1116 ) -> TimelineBlockEntryBuilder<'a, 'b, A> {
1117 let start = _fbb.start_table();
1118 TimelineBlockEntryBuilder {
1119 fbb_: _fbb,
1120 start_: start,
1121 }
1122 }
1123 #[inline]
1124 pub fn finish(self) -> ::flatbuffers::WIPOffset<TimelineBlockEntry<'a>> {
1125 let o = self.fbb_.end_table(self.start_);
1126 ::flatbuffers::WIPOffset::new(o.value())
1127 }
1128 }
1129
1130 impl ::core::fmt::Debug for TimelineBlockEntry<'_> {
1131 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1132 let mut ds = f.debug_struct("TimelineBlockEntry");
1133 ds.field("kind", &self.kind());
1134 ds.field("standalone_id", &self.standalone_id());
1135 ds.field("standalone_root", &self.standalone_root());
1136 ds.field("module_event_ids", &self.module_event_ids());
1137 ds.field("module_has_gap", &self.module_has_gap());
1138 ds.field("module_root", &self.module_root());
1139 ds.finish()
1140 }
1141 }
1142 pub enum ThreadingSnapshotOffset {}
1143 #[derive(Copy, Clone, PartialEq)]
1144
1145 pub struct ThreadingSnapshot<'a> {
1146 pub _tab: ::flatbuffers::Table<'a>,
1147 }
1148
1149 impl<'a> ::flatbuffers::Follow<'a> for ThreadingSnapshot<'a> {
1150 type Inner = ThreadingSnapshot<'a>;
1151 #[inline]
1152 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1153 Self {
1154 _tab: unsafe { ::flatbuffers::Table::new(buf, loc) },
1155 }
1156 }
1157 }
1158
1159 impl<'a> ThreadingSnapshot<'a> {
1160 pub const VT_SCHEMA_VERSION: ::flatbuffers::VOffsetT = 4;
1161 pub const VT_EDGES: ::flatbuffers::VOffsetT = 6;
1162 pub const VT_BLOCKS: ::flatbuffers::VOffsetT = 8;
1163 pub const VT_PENDING_ANCESTOR_IDS: ::flatbuffers::VOffsetT = 10;
1164
1165 #[inline]
1166 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
1167 ThreadingSnapshot { _tab: table }
1168 }
1169 #[allow(unused_mut)]
1170 pub fn create<
1171 'bldr: 'args,
1172 'args: 'mut_bldr,
1173 'mut_bldr,
1174 A: ::flatbuffers::Allocator + 'bldr,
1175 >(
1176 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
1177 args: &'args ThreadingSnapshotArgs<'args>,
1178 ) -> ::flatbuffers::WIPOffset<ThreadingSnapshot<'bldr>> {
1179 let mut builder = ThreadingSnapshotBuilder::new(_fbb);
1180 if let Some(x) = args.pending_ancestor_ids {
1181 builder.add_pending_ancestor_ids(x);
1182 }
1183 if let Some(x) = args.blocks {
1184 builder.add_blocks(x);
1185 }
1186 if let Some(x) = args.edges {
1187 builder.add_edges(x);
1188 }
1189 builder.add_schema_version(args.schema_version);
1190 builder.finish()
1191 }
1192
1193 #[inline]
1194 pub fn schema_version(&self) -> u32 {
1195 unsafe {
1199 self._tab
1200 .get::<u32>(ThreadingSnapshot::VT_SCHEMA_VERSION, Some(1))
1201 .unwrap()
1202 }
1203 }
1204 #[inline]
1205 pub fn edges(
1206 &self,
1207 ) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ThreadEdge<'a>>>>
1208 {
1209 unsafe {
1213 self._tab.get::<::flatbuffers::ForwardsUOffset<
1214 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ThreadEdge>>,
1215 >>(ThreadingSnapshot::VT_EDGES, None)
1216 }
1217 }
1218 #[inline]
1219 pub fn blocks(
1220 &self,
1221 ) -> Option<
1222 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<TimelineBlockEntry<'a>>>,
1223 > {
1224 unsafe {
1228 self._tab.get::<::flatbuffers::ForwardsUOffset<
1229 ::flatbuffers::Vector<
1230 'a,
1231 ::flatbuffers::ForwardsUOffset<TimelineBlockEntry>,
1232 >,
1233 >>(ThreadingSnapshot::VT_BLOCKS, None)
1234 }
1235 }
1236 #[inline]
1237 pub fn pending_ancestor_ids(
1238 &self,
1239 ) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId<'a>>>>
1240 {
1241 unsafe {
1245 self._tab.get::<::flatbuffers::ForwardsUOffset<
1246 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId>>,
1247 >>(ThreadingSnapshot::VT_PENDING_ANCESTOR_IDS, None)
1248 }
1249 }
1250 }
1251
1252 impl ::flatbuffers::Verifiable for ThreadingSnapshot<'_> {
1253 #[inline]
1254 fn run_verifier(
1255 v: &mut ::flatbuffers::Verifier,
1256 pos: usize,
1257 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
1258 v.visit_table(pos)?
1259 .visit_field::<u32>("schema_version", Self::VT_SCHEMA_VERSION, false)?
1260 .visit_field::<::flatbuffers::ForwardsUOffset<
1261 ::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<ThreadEdge>>,
1262 >>("edges", Self::VT_EDGES, false)?
1263 .visit_field::<::flatbuffers::ForwardsUOffset<
1264 ::flatbuffers::Vector<
1265 '_,
1266 ::flatbuffers::ForwardsUOffset<TimelineBlockEntry>,
1267 >,
1268 >>("blocks", Self::VT_BLOCKS, false)?
1269 .visit_field::<::flatbuffers::ForwardsUOffset<
1270 ::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<BlockEventId>>,
1271 >>(
1272 "pending_ancestor_ids", Self::VT_PENDING_ANCESTOR_IDS, false
1273 )?
1274 .finish();
1275 Ok(())
1276 }
1277 }
1278 pub struct ThreadingSnapshotArgs<'a> {
1279 pub schema_version: u32,
1280 pub edges: Option<
1281 ::flatbuffers::WIPOffset<
1282 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ThreadEdge<'a>>>,
1283 >,
1284 >,
1285 pub blocks: Option<
1286 ::flatbuffers::WIPOffset<
1287 ::flatbuffers::Vector<
1288 'a,
1289 ::flatbuffers::ForwardsUOffset<TimelineBlockEntry<'a>>,
1290 >,
1291 >,
1292 >,
1293 pub pending_ancestor_ids: Option<
1294 ::flatbuffers::WIPOffset<
1295 ::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<BlockEventId<'a>>>,
1296 >,
1297 >,
1298 }
1299 impl<'a> Default for ThreadingSnapshotArgs<'a> {
1300 #[inline]
1301 fn default() -> Self {
1302 ThreadingSnapshotArgs {
1303 schema_version: 1,
1304 edges: None,
1305 blocks: None,
1306 pending_ancestor_ids: None,
1307 }
1308 }
1309 }
1310
1311 pub struct ThreadingSnapshotBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
1312 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1313 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
1314 }
1315 impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ThreadingSnapshotBuilder<'a, 'b, A> {
1316 #[inline]
1317 pub fn add_schema_version(&mut self, schema_version: u32) {
1318 self.fbb_
1319 .push_slot::<u32>(ThreadingSnapshot::VT_SCHEMA_VERSION, schema_version, 1);
1320 }
1321 #[inline]
1322 pub fn add_edges(
1323 &mut self,
1324 edges: ::flatbuffers::WIPOffset<
1325 ::flatbuffers::Vector<'b, ::flatbuffers::ForwardsUOffset<ThreadEdge<'b>>>,
1326 >,
1327 ) {
1328 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
1329 ThreadingSnapshot::VT_EDGES,
1330 edges,
1331 );
1332 }
1333 #[inline]
1334 pub fn add_blocks(
1335 &mut self,
1336 blocks: ::flatbuffers::WIPOffset<
1337 ::flatbuffers::Vector<
1338 'b,
1339 ::flatbuffers::ForwardsUOffset<TimelineBlockEntry<'b>>,
1340 >,
1341 >,
1342 ) {
1343 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
1344 ThreadingSnapshot::VT_BLOCKS,
1345 blocks,
1346 );
1347 }
1348 #[inline]
1349 pub fn add_pending_ancestor_ids(
1350 &mut self,
1351 pending_ancestor_ids: ::flatbuffers::WIPOffset<
1352 ::flatbuffers::Vector<'b, ::flatbuffers::ForwardsUOffset<BlockEventId<'b>>>,
1353 >,
1354 ) {
1355 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(
1356 ThreadingSnapshot::VT_PENDING_ANCESTOR_IDS,
1357 pending_ancestor_ids,
1358 );
1359 }
1360 #[inline]
1361 pub fn new(
1362 _fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1363 ) -> ThreadingSnapshotBuilder<'a, 'b, A> {
1364 let start = _fbb.start_table();
1365 ThreadingSnapshotBuilder {
1366 fbb_: _fbb,
1367 start_: start,
1368 }
1369 }
1370 #[inline]
1371 pub fn finish(self) -> ::flatbuffers::WIPOffset<ThreadingSnapshot<'a>> {
1372 let o = self.fbb_.end_table(self.start_);
1373 ::flatbuffers::WIPOffset::new(o.value())
1374 }
1375 }
1376
1377 impl ::core::fmt::Debug for ThreadingSnapshot<'_> {
1378 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1379 let mut ds = f.debug_struct("ThreadingSnapshot");
1380 ds.field("schema_version", &self.schema_version());
1381 ds.field("edges", &self.edges());
1382 ds.field("blocks", &self.blocks());
1383 ds.field("pending_ancestor_ids", &self.pending_ancestor_ids());
1384 ds.finish()
1385 }
1386 }
1387 #[inline]
1388 pub fn root_as_threading_snapshot(
1395 buf: &[u8],
1396 ) -> Result<ThreadingSnapshot<'_>, ::flatbuffers::InvalidFlatbuffer> {
1397 ::flatbuffers::root::<ThreadingSnapshot>(buf)
1398 }
1399 #[inline]
1400 pub fn size_prefixed_root_as_threading_snapshot(
1407 buf: &[u8],
1408 ) -> Result<ThreadingSnapshot<'_>, ::flatbuffers::InvalidFlatbuffer> {
1409 ::flatbuffers::size_prefixed_root::<ThreadingSnapshot>(buf)
1410 }
1411 #[inline]
1412 pub fn root_as_threading_snapshot_with_opts<'b, 'o>(
1419 opts: &'o ::flatbuffers::VerifierOptions,
1420 buf: &'b [u8],
1421 ) -> Result<ThreadingSnapshot<'b>, ::flatbuffers::InvalidFlatbuffer> {
1422 ::flatbuffers::root_with_opts::<ThreadingSnapshot<'b>>(opts, buf)
1423 }
1424 #[inline]
1425 pub fn size_prefixed_root_as_threading_snapshot_with_opts<'b, 'o>(
1432 opts: &'o ::flatbuffers::VerifierOptions,
1433 buf: &'b [u8],
1434 ) -> Result<ThreadingSnapshot<'b>, ::flatbuffers::InvalidFlatbuffer> {
1435 ::flatbuffers::size_prefixed_root_with_opts::<ThreadingSnapshot<'b>>(opts, buf)
1436 }
1437 #[inline]
1438 pub unsafe fn root_as_threading_snapshot_unchecked(buf: &[u8]) -> ThreadingSnapshot<'_> {
1442 unsafe { ::flatbuffers::root_unchecked::<ThreadingSnapshot>(buf) }
1443 }
1444 #[inline]
1445 pub unsafe fn size_prefixed_root_as_threading_snapshot_unchecked(
1449 buf: &[u8],
1450 ) -> ThreadingSnapshot<'_> {
1451 unsafe { ::flatbuffers::size_prefixed_root_unchecked::<ThreadingSnapshot>(buf) }
1452 }
1453 pub const THREADING_SNAPSHOT_IDENTIFIER: &str = "NTHR";
1454
1455 #[inline]
1456 pub fn threading_snapshot_buffer_has_identifier(buf: &[u8]) -> bool {
1457 ::flatbuffers::buffer_has_identifier(buf, THREADING_SNAPSHOT_IDENTIFIER, false)
1458 }
1459
1460 #[inline]
1461 pub fn threading_snapshot_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
1462 ::flatbuffers::buffer_has_identifier(buf, THREADING_SNAPSHOT_IDENTIFIER, true)
1463 }
1464
1465 #[inline]
1466 pub fn finish_threading_snapshot_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
1467 fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1468 root: ::flatbuffers::WIPOffset<ThreadingSnapshot<'a>>,
1469 ) {
1470 fbb.finish(root, Some(THREADING_SNAPSHOT_IDENTIFIER));
1471 }
1472
1473 #[inline]
1474 pub fn finish_size_prefixed_threading_snapshot_buffer<
1475 'a,
1476 'b,
1477 A: ::flatbuffers::Allocator + 'a,
1478 >(
1479 fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
1480 root: ::flatbuffers::WIPOffset<ThreadingSnapshot<'a>>,
1481 ) {
1482 fbb.finish_size_prefixed(root, Some(THREADING_SNAPSHOT_IDENTIFIER));
1483 }
1484 } }