spacedatastandards-org 1.73.12

Space data standards framework based on CCSDS standards and Google FlatBuffers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
// automatically generated by the FlatBuffers compiler, do not modify


// @generated

use core::mem;
use core::cmp::Ordering;

extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};

#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_COORD_FRAME: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_COORD_FRAME: i8 = 12;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_COORD_FRAME: [CoordFrame; 13] = [
  CoordFrame::ECEF,
  CoordFrame::ECI_J2000,
  CoordFrame::ECI_MOD,
  CoordFrame::ECI_TOD,
  CoordFrame::TEME,
  CoordFrame::NED,
  CoordFrame::ENU,
  CoordFrame::BODY,
  CoordFrame::MOON_CI,
  CoordFrame::MOON_CF,
  CoordFrame::MARS_CI,
  CoordFrame::GEOCENTRIC,
  CoordFrame::GEODETIC,
];

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct CoordFrame(pub i8);
#[allow(non_upper_case_globals)]
impl CoordFrame {
  pub const ECEF: Self = Self(0);
  pub const ECI_J2000: Self = Self(1);
  pub const ECI_MOD: Self = Self(2);
  pub const ECI_TOD: Self = Self(3);
  pub const TEME: Self = Self(4);
  pub const NED: Self = Self(5);
  pub const ENU: Self = Self(6);
  pub const BODY: Self = Self(7);
  pub const MOON_CI: Self = Self(8);
  pub const MOON_CF: Self = Self(9);
  pub const MARS_CI: Self = Self(10);
  pub const GEOCENTRIC: Self = Self(11);
  pub const GEODETIC: Self = Self(12);

  pub const ENUM_MIN: i8 = 0;
  pub const ENUM_MAX: i8 = 12;
  pub const ENUM_VALUES: &'static [Self] = &[
    Self::ECEF,
    Self::ECI_J2000,
    Self::ECI_MOD,
    Self::ECI_TOD,
    Self::TEME,
    Self::NED,
    Self::ENU,
    Self::BODY,
    Self::MOON_CI,
    Self::MOON_CF,
    Self::MARS_CI,
    Self::GEOCENTRIC,
    Self::GEODETIC,
  ];
  /// Returns the variant's name or "" if unknown.
  pub fn variant_name(self) -> Option<&'static str> {
    match self {
      Self::ECEF => Some("ECEF"),
      Self::ECI_J2000 => Some("ECI_J2000"),
      Self::ECI_MOD => Some("ECI_MOD"),
      Self::ECI_TOD => Some("ECI_TOD"),
      Self::TEME => Some("TEME"),
      Self::NED => Some("NED"),
      Self::ENU => Some("ENU"),
      Self::BODY => Some("BODY"),
      Self::MOON_CI => Some("MOON_CI"),
      Self::MOON_CF => Some("MOON_CF"),
      Self::MARS_CI => Some("MARS_CI"),
      Self::GEOCENTRIC => Some("GEOCENTRIC"),
      Self::GEODETIC => Some("GEODETIC"),
      _ => None,
    }
  }
}
impl core::fmt::Debug for CoordFrame {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    if let Some(name) = self.variant_name() {
      f.write_str(name)
    } else {
      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
    }
  }
}
impl<'a> flatbuffers::Follow<'a> for CoordFrame {
  type Inner = Self;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
    Self(b)
  }
}

impl flatbuffers::Push for CoordFrame {
    type Output = CoordFrame;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        flatbuffers::emplace_scalar::<i8>(dst, self.0);
    }
}

impl flatbuffers::EndianScalar for CoordFrame {
  type Scalar = i8;
  #[inline]
  fn to_little_endian(self) -> i8 {
    self.0.to_le()
  }
  #[inline]
  #[allow(clippy::wrong_self_convention)]
  fn from_little_endian(v: i8) -> Self {
    let b = i8::from_le(v);
    Self(b)
  }
}

impl<'a> flatbuffers::Verifiable for CoordFrame {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    i8::run_verifier(v, pos)
  }
}

impl flatbuffers::SimpleToVerifyInSlice for CoordFrame {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_ELLIPSOID: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_ELLIPSOID: i8 = 5;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_ELLIPSOID: [Ellipsoid; 6] = [
  Ellipsoid::WGS84,
  Ellipsoid::GRS80,
  Ellipsoid::WGS72,
  Ellipsoid::SPHERE,
  Ellipsoid::MOON,
  Ellipsoid::MARS,
];

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct Ellipsoid(pub i8);
#[allow(non_upper_case_globals)]
impl Ellipsoid {
  pub const WGS84: Self = Self(0);
  pub const GRS80: Self = Self(1);
  pub const WGS72: Self = Self(2);
  pub const SPHERE: Self = Self(3);
  pub const MOON: Self = Self(4);
  pub const MARS: Self = Self(5);

  pub const ENUM_MIN: i8 = 0;
  pub const ENUM_MAX: i8 = 5;
  pub const ENUM_VALUES: &'static [Self] = &[
    Self::WGS84,
    Self::GRS80,
    Self::WGS72,
    Self::SPHERE,
    Self::MOON,
    Self::MARS,
  ];
  /// Returns the variant's name or "" if unknown.
  pub fn variant_name(self) -> Option<&'static str> {
    match self {
      Self::WGS84 => Some("WGS84"),
      Self::GRS80 => Some("GRS80"),
      Self::WGS72 => Some("WGS72"),
      Self::SPHERE => Some("SPHERE"),
      Self::MOON => Some("MOON"),
      Self::MARS => Some("MARS"),
      _ => None,
    }
  }
}
impl core::fmt::Debug for Ellipsoid {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    if let Some(name) = self.variant_name() {
      f.write_str(name)
    } else {
      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
    }
  }
}
impl<'a> flatbuffers::Follow<'a> for Ellipsoid {
  type Inner = Self;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
    Self(b)
  }
}

impl flatbuffers::Push for Ellipsoid {
    type Output = Ellipsoid;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        flatbuffers::emplace_scalar::<i8>(dst, self.0);
    }
}

impl flatbuffers::EndianScalar for Ellipsoid {
  type Scalar = i8;
  #[inline]
  fn to_little_endian(self) -> i8 {
    self.0.to_le()
  }
  #[inline]
  #[allow(clippy::wrong_self_convention)]
  fn from_little_endian(v: i8) -> Self {
    let b = i8::from_le(v);
    Self(b)
  }
}

impl<'a> flatbuffers::Verifiable for Ellipsoid {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    i8::run_verifier(v, pos)
  }
}

impl flatbuffers::SimpleToVerifyInSlice for Ellipsoid {}
pub enum CRDOffset {}
#[derive(Copy, Clone, PartialEq)]

/// Coordinate Systems
pub struct CRD<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for CRD<'a> {
  type Inner = CRD<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: flatbuffers::Table::new(buf, loc) }
  }
}

impl<'a> CRD<'a> {
  pub const VT_X: flatbuffers::VOffsetT = 4;
  pub const VT_Y: flatbuffers::VOffsetT = 6;
  pub const VT_Z: flatbuffers::VOffsetT = 8;
  pub const VT_VX: flatbuffers::VOffsetT = 10;
  pub const VT_VY: flatbuffers::VOffsetT = 12;
  pub const VT_VZ: flatbuffers::VOffsetT = 14;
  pub const VT_FRAME: flatbuffers::VOffsetT = 16;
  pub const VT_ELLIPSOID: flatbuffers::VOffsetT = 18;
  pub const VT_RESERVED: flatbuffers::VOffsetT = 20;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    CRD { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args CRDArgs<'args>
  ) -> flatbuffers::WIPOffset<CRD<'bldr>> {
    let mut builder = CRDBuilder::new(_fbb);
    builder.add_VZ(args.VZ);
    builder.add_VY(args.VY);
    builder.add_VX(args.VX);
    builder.add_Z(args.Z);
    builder.add_Y(args.Y);
    builder.add_X(args.X);
    if let Some(x) = args.RESERVED { builder.add_RESERVED(x); }
    builder.add_ELLIPSOID(args.ELLIPSOID);
    builder.add_FRAME(args.FRAME);
    builder.finish()
  }

  pub fn unpack(&self) -> CRDT {
    let X = self.X();
    let Y = self.Y();
    let Z = self.Z();
    let VX = self.VX();
    let VY = self.VY();
    let VZ = self.VZ();
    let FRAME = self.FRAME();
    let ELLIPSOID = self.ELLIPSOID();
    let RESERVED = self.RESERVED().map(|x| {
      x.into_iter().collect()
    });
    CRDT {
      X,
      Y,
      Z,
      VX,
      VY,
      VZ,
      FRAME,
      ELLIPSOID,
      RESERVED,
    }
  }

  #[inline]
  pub fn X(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_X, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn Y(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_Y, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn Z(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_Z, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn VX(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_VX, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn VY(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_VY, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn VZ(&self) -> f64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<f64>(CRD::VT_VZ, Some(0.0)).unwrap()}
  }
  #[inline]
  pub fn FRAME(&self) -> u8 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u8>(CRD::VT_FRAME, Some(0)).unwrap()}
  }
  #[inline]
  pub fn ELLIPSOID(&self) -> u8 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u8>(CRD::VT_ELLIPSOID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn RESERVED(&self) -> Option<flatbuffers::Vector<'a, u8>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(CRD::VT_RESERVED, None)}
  }
}

impl flatbuffers::Verifiable for CRD<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<f64>("X", Self::VT_X, false)?
     .visit_field::<f64>("Y", Self::VT_Y, false)?
     .visit_field::<f64>("Z", Self::VT_Z, false)?
     .visit_field::<f64>("VX", Self::VT_VX, false)?
     .visit_field::<f64>("VY", Self::VT_VY, false)?
     .visit_field::<f64>("VZ", Self::VT_VZ, false)?
     .visit_field::<u8>("FRAME", Self::VT_FRAME, false)?
     .visit_field::<u8>("ELLIPSOID", Self::VT_ELLIPSOID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("RESERVED", Self::VT_RESERVED, false)?
     .finish();
    Ok(())
  }
}
pub struct CRDArgs<'a> {
    pub X: f64,
    pub Y: f64,
    pub Z: f64,
    pub VX: f64,
    pub VY: f64,
    pub VZ: f64,
    pub FRAME: u8,
    pub ELLIPSOID: u8,
    pub RESERVED: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
}
impl<'a> Default for CRDArgs<'a> {
  #[inline]
  fn default() -> Self {
    CRDArgs {
      X: 0.0,
      Y: 0.0,
      Z: 0.0,
      VX: 0.0,
      VY: 0.0,
      VZ: 0.0,
      FRAME: 0,
      ELLIPSOID: 0,
      RESERVED: None,
    }
  }
}

pub struct CRDBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CRDBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_X(&mut self, X: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_X, X, 0.0);
  }
  #[inline]
  pub fn add_Y(&mut self, Y: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_Y, Y, 0.0);
  }
  #[inline]
  pub fn add_Z(&mut self, Z: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_Z, Z, 0.0);
  }
  #[inline]
  pub fn add_VX(&mut self, VX: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_VX, VX, 0.0);
  }
  #[inline]
  pub fn add_VY(&mut self, VY: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_VY, VY, 0.0);
  }
  #[inline]
  pub fn add_VZ(&mut self, VZ: f64) {
    self.fbb_.push_slot::<f64>(CRD::VT_VZ, VZ, 0.0);
  }
  #[inline]
  pub fn add_FRAME(&mut self, FRAME: u8) {
    self.fbb_.push_slot::<u8>(CRD::VT_FRAME, FRAME, 0);
  }
  #[inline]
  pub fn add_ELLIPSOID(&mut self, ELLIPSOID: u8) {
    self.fbb_.push_slot::<u8>(CRD::VT_ELLIPSOID, ELLIPSOID, 0);
  }
  #[inline]
  pub fn add_RESERVED(&mut self, RESERVED: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(CRD::VT_RESERVED, RESERVED);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CRDBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    CRDBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<CRD<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for CRD<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("CRD");
      ds.field("X", &self.X());
      ds.field("Y", &self.Y());
      ds.field("Z", &self.Z());
      ds.field("VX", &self.VX());
      ds.field("VY", &self.VY());
      ds.field("VZ", &self.VZ());
      ds.field("FRAME", &self.FRAME());
      ds.field("ELLIPSOID", &self.ELLIPSOID());
      ds.field("RESERVED", &self.RESERVED());
      ds.finish()
  }
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct CRDT {
  pub X: f64,
  pub Y: f64,
  pub Z: f64,
  pub VX: f64,
  pub VY: f64,
  pub VZ: f64,
  pub FRAME: u8,
  pub ELLIPSOID: u8,
  pub RESERVED: Option<Vec<u8>>,
}
impl Default for CRDT {
  fn default() -> Self {
    Self {
      X: 0.0,
      Y: 0.0,
      Z: 0.0,
      VX: 0.0,
      VY: 0.0,
      VZ: 0.0,
      FRAME: 0,
      ELLIPSOID: 0,
      RESERVED: None,
    }
  }
}
impl CRDT {
  pub fn pack<'b, A: flatbuffers::Allocator + 'b>(
    &self,
    _fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>
  ) -> flatbuffers::WIPOffset<CRD<'b>> {
    let X = self.X;
    let Y = self.Y;
    let Z = self.Z;
    let VX = self.VX;
    let VY = self.VY;
    let VZ = self.VZ;
    let FRAME = self.FRAME;
    let ELLIPSOID = self.ELLIPSOID;
    let RESERVED = self.RESERVED.as_ref().map(|x|{
      _fbb.create_vector(x)
    });
    CRD::create(_fbb, &CRDArgs{
      X,
      Y,
      Z,
      VX,
      VY,
      VZ,
      FRAME,
      ELLIPSOID,
      RESERVED,
    })
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `CRD`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_CRD_unchecked`.
pub fn root_as_CRD(buf: &[u8]) -> Result<CRD, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root::<CRD>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `CRD` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_CRD_unchecked`.
pub fn size_prefixed_root_as_CRD(buf: &[u8]) -> Result<CRD, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root::<CRD>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `CRD` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_CRD_unchecked`.
pub fn root_as_CRD_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<CRD<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root_with_opts::<CRD<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `CRD` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_CRD_unchecked`.
pub fn size_prefixed_root_as_CRD_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<CRD<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root_with_opts::<CRD<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a CRD and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `CRD`.
pub unsafe fn root_as_CRD_unchecked(buf: &[u8]) -> CRD {
  flatbuffers::root_unchecked::<CRD>(buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed CRD and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `CRD`.
pub unsafe fn size_prefixed_root_as_CRD_unchecked(buf: &[u8]) -> CRD {
  flatbuffers::size_prefixed_root_unchecked::<CRD>(buf)
}
pub const CRD_IDENTIFIER: &str = "$CRD";

#[inline]
pub fn CRD_buffer_has_identifier(buf: &[u8]) -> bool {
  flatbuffers::buffer_has_identifier(buf, CRD_IDENTIFIER, false)
}

#[inline]
pub fn CRD_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
  flatbuffers::buffer_has_identifier(buf, CRD_IDENTIFIER, true)
}

#[inline]
pub fn finish_CRD_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
    root: flatbuffers::WIPOffset<CRD<'a>>) {
  fbb.finish(root, Some(CRD_IDENTIFIER));
}

#[inline]
pub fn finish_size_prefixed_CRD_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<CRD<'a>>) {
  fbb.finish_size_prefixed(root, Some(CRD_IDENTIFIER));
}