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
// automatically generated by the FlatBuffers compiler, do not modify


// @generated

use crate::main_generated::*;
use core::mem;
use core::cmp::Ordering;

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

pub enum ACLOffset {}
#[derive(Copy, Clone, PartialEq)]

/// Access Control Grant - Permission to access purchased data
pub struct ACL<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

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

impl<'a> ACL<'a> {
  pub const VT_GRANT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_LISTING_ID: flatbuffers::VOffsetT = 6;
  pub const VT_BUYER_PEER_ID: flatbuffers::VOffsetT = 8;
  pub const VT_BUYER_ENCRYPTION_PUBKEY: flatbuffers::VOffsetT = 10;
  pub const VT_ACCESS_TYPE: flatbuffers::VOffsetT = 12;
  pub const VT_TIER_NAME: flatbuffers::VOffsetT = 14;
  pub const VT_GRANTED_AT: flatbuffers::VOffsetT = 16;
  pub const VT_EXPIRES_AT: flatbuffers::VOffsetT = 18;
  pub const VT_PAYMENT_TX_HASH: flatbuffers::VOffsetT = 20;
  pub const VT_PAYMENT_METHOD: flatbuffers::VOffsetT = 22;
  pub const VT_PROVIDER_SIGNATURE: flatbuffers::VOffsetT = 24;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    ACL { _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 ACLArgs<'args>
  ) -> flatbuffers::WIPOffset<ACL<'bldr>> {
    let mut builder = ACLBuilder::new(_fbb);
    builder.add_EXPIRES_AT(args.EXPIRES_AT);
    builder.add_GRANTED_AT(args.GRANTED_AT);
    if let Some(x) = args.PROVIDER_SIGNATURE { builder.add_PROVIDER_SIGNATURE(x); }
    if let Some(x) = args.PAYMENT_TX_HASH { builder.add_PAYMENT_TX_HASH(x); }
    if let Some(x) = args.TIER_NAME { builder.add_TIER_NAME(x); }
    if let Some(x) = args.BUYER_ENCRYPTION_PUBKEY { builder.add_BUYER_ENCRYPTION_PUBKEY(x); }
    if let Some(x) = args.BUYER_PEER_ID { builder.add_BUYER_PEER_ID(x); }
    if let Some(x) = args.LISTING_ID { builder.add_LISTING_ID(x); }
    if let Some(x) = args.GRANT_ID { builder.add_GRANT_ID(x); }
    builder.add_PAYMENT_METHOD(args.PAYMENT_METHOD);
    builder.add_ACCESS_TYPE(args.ACCESS_TYPE);
    builder.finish()
  }

  pub fn unpack(&self) -> ACLT {
    let GRANT_ID = {
      let x = self.GRANT_ID();
      x.to_string()
    };
    let LISTING_ID = {
      let x = self.LISTING_ID();
      x.to_string()
    };
    let BUYER_PEER_ID = {
      let x = self.BUYER_PEER_ID();
      x.to_string()
    };
    let BUYER_ENCRYPTION_PUBKEY = self.BUYER_ENCRYPTION_PUBKEY().map(|x| {
      x.into_iter().collect()
    });
    let ACCESS_TYPE = self.ACCESS_TYPE();
    let TIER_NAME = self.TIER_NAME().map(|x| {
      x.to_string()
    });
    let GRANTED_AT = self.GRANTED_AT();
    let EXPIRES_AT = self.EXPIRES_AT();
    let PAYMENT_TX_HASH = self.PAYMENT_TX_HASH().map(|x| {
      x.to_string()
    });
    let PAYMENT_METHOD = self.PAYMENT_METHOD();
    let PROVIDER_SIGNATURE = self.PROVIDER_SIGNATURE().map(|x| {
      x.into_iter().collect()
    });
    ACLT {
      GRANT_ID,
      LISTING_ID,
      BUYER_PEER_ID,
      BUYER_ENCRYPTION_PUBKEY,
      ACCESS_TYPE,
      TIER_NAME,
      GRANTED_AT,
      EXPIRES_AT,
      PAYMENT_TX_HASH,
      PAYMENT_METHOD,
      PROVIDER_SIGNATURE,
    }
  }

  /// Unique identifier for this grant
  #[inline]
  pub fn GRANT_ID(&self) -> &'a str {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ACL::VT_GRANT_ID, None).unwrap()}
  }
  /// ID of the listing this grant applies to
  #[inline]
  pub fn LISTING_ID(&self) -> &'a str {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ACL::VT_LISTING_ID, None).unwrap()}
  }
  /// Peer ID of the buyer/grantee
  #[inline]
  pub fn BUYER_PEER_ID(&self) -> &'a str {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ACL::VT_BUYER_PEER_ID, None).unwrap()}
  }
  /// Buyer's encryption public key for encrypted delivery
  #[inline]
  pub fn BUYER_ENCRYPTION_PUBKEY(&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>>>(ACL::VT_BUYER_ENCRYPTION_PUBKEY, None)}
  }
  /// Type of access granted
  #[inline]
  pub fn ACCESS_TYPE(&self) -> accessType {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<accessType>(ACL::VT_ACCESS_TYPE, Some(accessType::OneTime)).unwrap()}
  }
  /// Name of the pricing tier purchased
  #[inline]
  pub fn TIER_NAME(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ACL::VT_TIER_NAME, None)}
  }
  /// Unix timestamp when access was granted
  #[inline]
  pub fn GRANTED_AT(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ACL::VT_GRANTED_AT, Some(0)).unwrap()}
  }
  /// Unix timestamp when access expires (0 = never expires)
  #[inline]
  pub fn EXPIRES_AT(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ACL::VT_EXPIRES_AT, Some(0)).unwrap()}
  }
  /// Transaction hash or reference proving payment
  #[inline]
  pub fn PAYMENT_TX_HASH(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ACL::VT_PAYMENT_TX_HASH, None)}
  }
  /// Payment method used
  #[inline]
  pub fn PAYMENT_METHOD(&self) -> paymentMethod {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<paymentMethod>(ACL::VT_PAYMENT_METHOD, Some(paymentMethod::Crypto_ETH)).unwrap()}
  }
  /// Ed25519 signature from provider
  #[inline]
  pub fn PROVIDER_SIGNATURE(&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>>>(ACL::VT_PROVIDER_SIGNATURE, None)}
  }
}

impl flatbuffers::Verifiable for ACL<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("GRANT_ID", Self::VT_GRANT_ID, true)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("LISTING_ID", Self::VT_LISTING_ID, true)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("BUYER_PEER_ID", Self::VT_BUYER_PEER_ID, true)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("BUYER_ENCRYPTION_PUBKEY", Self::VT_BUYER_ENCRYPTION_PUBKEY, false)?
     .visit_field::<accessType>("ACCESS_TYPE", Self::VT_ACCESS_TYPE, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("TIER_NAME", Self::VT_TIER_NAME, false)?
     .visit_field::<u64>("GRANTED_AT", Self::VT_GRANTED_AT, false)?
     .visit_field::<u64>("EXPIRES_AT", Self::VT_EXPIRES_AT, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("PAYMENT_TX_HASH", Self::VT_PAYMENT_TX_HASH, false)?
     .visit_field::<paymentMethod>("PAYMENT_METHOD", Self::VT_PAYMENT_METHOD, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("PROVIDER_SIGNATURE", Self::VT_PROVIDER_SIGNATURE, false)?
     .finish();
    Ok(())
  }
}
pub struct ACLArgs<'a> {
    pub GRANT_ID: Option<flatbuffers::WIPOffset<&'a str>>,
    pub LISTING_ID: Option<flatbuffers::WIPOffset<&'a str>>,
    pub BUYER_PEER_ID: Option<flatbuffers::WIPOffset<&'a str>>,
    pub BUYER_ENCRYPTION_PUBKEY: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
    pub ACCESS_TYPE: accessType,
    pub TIER_NAME: Option<flatbuffers::WIPOffset<&'a str>>,
    pub GRANTED_AT: u64,
    pub EXPIRES_AT: u64,
    pub PAYMENT_TX_HASH: Option<flatbuffers::WIPOffset<&'a str>>,
    pub PAYMENT_METHOD: paymentMethod,
    pub PROVIDER_SIGNATURE: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
}
impl<'a> Default for ACLArgs<'a> {
  #[inline]
  fn default() -> Self {
    ACLArgs {
      GRANT_ID: None, // required field
      LISTING_ID: None, // required field
      BUYER_PEER_ID: None, // required field
      BUYER_ENCRYPTION_PUBKEY: None,
      ACCESS_TYPE: accessType::OneTime,
      TIER_NAME: None,
      GRANTED_AT: 0,
      EXPIRES_AT: 0,
      PAYMENT_TX_HASH: None,
      PAYMENT_METHOD: paymentMethod::Crypto_ETH,
      PROVIDER_SIGNATURE: None,
    }
  }
}

pub struct ACLBuilder<'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> ACLBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_GRANT_ID(&mut self, GRANT_ID: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_GRANT_ID, GRANT_ID);
  }
  #[inline]
  pub fn add_LISTING_ID(&mut self, LISTING_ID: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_LISTING_ID, LISTING_ID);
  }
  #[inline]
  pub fn add_BUYER_PEER_ID(&mut self, BUYER_PEER_ID: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_BUYER_PEER_ID, BUYER_PEER_ID);
  }
  #[inline]
  pub fn add_BUYER_ENCRYPTION_PUBKEY(&mut self, BUYER_ENCRYPTION_PUBKEY: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_BUYER_ENCRYPTION_PUBKEY, BUYER_ENCRYPTION_PUBKEY);
  }
  #[inline]
  pub fn add_ACCESS_TYPE(&mut self, ACCESS_TYPE: accessType) {
    self.fbb_.push_slot::<accessType>(ACL::VT_ACCESS_TYPE, ACCESS_TYPE, accessType::OneTime);
  }
  #[inline]
  pub fn add_TIER_NAME(&mut self, TIER_NAME: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_TIER_NAME, TIER_NAME);
  }
  #[inline]
  pub fn add_GRANTED_AT(&mut self, GRANTED_AT: u64) {
    self.fbb_.push_slot::<u64>(ACL::VT_GRANTED_AT, GRANTED_AT, 0);
  }
  #[inline]
  pub fn add_EXPIRES_AT(&mut self, EXPIRES_AT: u64) {
    self.fbb_.push_slot::<u64>(ACL::VT_EXPIRES_AT, EXPIRES_AT, 0);
  }
  #[inline]
  pub fn add_PAYMENT_TX_HASH(&mut self, PAYMENT_TX_HASH: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_PAYMENT_TX_HASH, PAYMENT_TX_HASH);
  }
  #[inline]
  pub fn add_PAYMENT_METHOD(&mut self, PAYMENT_METHOD: paymentMethod) {
    self.fbb_.push_slot::<paymentMethod>(ACL::VT_PAYMENT_METHOD, PAYMENT_METHOD, paymentMethod::Crypto_ETH);
  }
  #[inline]
  pub fn add_PROVIDER_SIGNATURE(&mut self, PROVIDER_SIGNATURE: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ACL::VT_PROVIDER_SIGNATURE, PROVIDER_SIGNATURE);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ACLBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    ACLBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<ACL<'a>> {
    let o = self.fbb_.end_table(self.start_);
    self.fbb_.required(o, ACL::VT_GRANT_ID,"GRANT_ID");
    self.fbb_.required(o, ACL::VT_LISTING_ID,"LISTING_ID");
    self.fbb_.required(o, ACL::VT_BUYER_PEER_ID,"BUYER_PEER_ID");
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for ACL<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("ACL");
      ds.field("GRANT_ID", &self.GRANT_ID());
      ds.field("LISTING_ID", &self.LISTING_ID());
      ds.field("BUYER_PEER_ID", &self.BUYER_PEER_ID());
      ds.field("BUYER_ENCRYPTION_PUBKEY", &self.BUYER_ENCRYPTION_PUBKEY());
      ds.field("ACCESS_TYPE", &self.ACCESS_TYPE());
      ds.field("TIER_NAME", &self.TIER_NAME());
      ds.field("GRANTED_AT", &self.GRANTED_AT());
      ds.field("EXPIRES_AT", &self.EXPIRES_AT());
      ds.field("PAYMENT_TX_HASH", &self.PAYMENT_TX_HASH());
      ds.field("PAYMENT_METHOD", &self.PAYMENT_METHOD());
      ds.field("PROVIDER_SIGNATURE", &self.PROVIDER_SIGNATURE());
      ds.finish()
  }
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct ACLT {
  pub GRANT_ID: String,
  pub LISTING_ID: String,
  pub BUYER_PEER_ID: String,
  pub BUYER_ENCRYPTION_PUBKEY: Option<Vec<u8>>,
  pub ACCESS_TYPE: accessType,
  pub TIER_NAME: Option<String>,
  pub GRANTED_AT: u64,
  pub EXPIRES_AT: u64,
  pub PAYMENT_TX_HASH: Option<String>,
  pub PAYMENT_METHOD: paymentMethod,
  pub PROVIDER_SIGNATURE: Option<Vec<u8>>,
}
impl Default for ACLT {
  fn default() -> Self {
    Self {
      GRANT_ID: "".to_string(),
      LISTING_ID: "".to_string(),
      BUYER_PEER_ID: "".to_string(),
      BUYER_ENCRYPTION_PUBKEY: None,
      ACCESS_TYPE: accessType::OneTime,
      TIER_NAME: None,
      GRANTED_AT: 0,
      EXPIRES_AT: 0,
      PAYMENT_TX_HASH: None,
      PAYMENT_METHOD: paymentMethod::Crypto_ETH,
      PROVIDER_SIGNATURE: None,
    }
  }
}
impl ACLT {
  pub fn pack<'b, A: flatbuffers::Allocator + 'b>(
    &self,
    _fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>
  ) -> flatbuffers::WIPOffset<ACL<'b>> {
    let GRANT_ID = Some({
      let x = &self.GRANT_ID;
      _fbb.create_string(x)
    });
    let LISTING_ID = Some({
      let x = &self.LISTING_ID;
      _fbb.create_string(x)
    });
    let BUYER_PEER_ID = Some({
      let x = &self.BUYER_PEER_ID;
      _fbb.create_string(x)
    });
    let BUYER_ENCRYPTION_PUBKEY = self.BUYER_ENCRYPTION_PUBKEY.as_ref().map(|x|{
      _fbb.create_vector(x)
    });
    let ACCESS_TYPE = self.ACCESS_TYPE;
    let TIER_NAME = self.TIER_NAME.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let GRANTED_AT = self.GRANTED_AT;
    let EXPIRES_AT = self.EXPIRES_AT;
    let PAYMENT_TX_HASH = self.PAYMENT_TX_HASH.as_ref().map(|x|{
      _fbb.create_string(x)
    });
    let PAYMENT_METHOD = self.PAYMENT_METHOD;
    let PROVIDER_SIGNATURE = self.PROVIDER_SIGNATURE.as_ref().map(|x|{
      _fbb.create_vector(x)
    });
    ACL::create(_fbb, &ACLArgs{
      GRANT_ID,
      LISTING_ID,
      BUYER_PEER_ID,
      BUYER_ENCRYPTION_PUBKEY,
      ACCESS_TYPE,
      TIER_NAME,
      GRANTED_AT,
      EXPIRES_AT,
      PAYMENT_TX_HASH,
      PAYMENT_METHOD,
      PROVIDER_SIGNATURE,
    })
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `ACL`
/// 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_ACL_unchecked`.
pub fn root_as_ACL(buf: &[u8]) -> Result<ACL, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root::<ACL>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `ACL` 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_ACL_unchecked`.
pub fn size_prefixed_root_as_ACL(buf: &[u8]) -> Result<ACL, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root::<ACL>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `ACL` 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_ACL_unchecked`.
pub fn root_as_ACL_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ACL<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root_with_opts::<ACL<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `ACL` 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_ACL_unchecked`.
pub fn size_prefixed_root_as_ACL_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ACL<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root_with_opts::<ACL<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a ACL and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `ACL`.
pub unsafe fn root_as_ACL_unchecked(buf: &[u8]) -> ACL {
  flatbuffers::root_unchecked::<ACL>(buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed ACL and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `ACL`.
pub unsafe fn size_prefixed_root_as_ACL_unchecked(buf: &[u8]) -> ACL {
  flatbuffers::size_prefixed_root_unchecked::<ACL>(buf)
}
pub const ACL_IDENTIFIER: &str = "$ACL";

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

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

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

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