diff --git a/src/datasets/log/log_capnp.rs b/src/datasets/log/log_capnp.rs
index 49c1d47..2af81a5 100644
--- a/src/datasets/log/log_capnp.rs
+++ b/src/datasets/log/log_capnp.rs
@@ -834,7 +834,7 @@ pub mod logs {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
- pub fn set_logs(&mut self, value: ::capnp::struct_list::Reader<'a,crate::datasets::log::log_capnp::log::Owned>) -> ::capnp::Result<()> {
+ pub fn set_logs(&mut self, value: ::capnp::struct_list::Reader<'_,crate::datasets::log::log_capnp::log::Owned>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
diff --git a/src/datasets/log/log_generated.rs b/src/datasets/log/log_generated.rs
index 7e0968e..a8e95e5 100644
--- a/src/datasets/log/log_generated.rs
+++ b/src/datasets/log/log_generated.rs
@@ -1,511 +1,511 @@
-// 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};
-
-#[allow(unused_imports, dead_code)]
-pub mod log {
-
- use core::mem;
- use core::cmp::Ordering;
-
- extern crate flatbuffers;
- use self::flatbuffers::{EndianScalar, Follow};
-
-// struct Address, aligned to 1
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Address(pub [u8; 4]);
-impl Default for Address {
- fn default() -> Self {
- Self([0; 4])
- }
-}
-impl core::fmt::Debug for Address {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Address")
- .field("x0", &self.x0())
- .field("x1", &self.x1())
- .field("x2", &self.x2())
- .field("x3", &self.x3())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Address {}
-impl<'a> flatbuffers::Follow<'a> for Address {
- type Inner = &'a Address;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Address>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Address {
- type Inner = &'a Address;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::
(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Address {
- type Output = Address;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Address as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Address {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Address {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- x0: u8,
- x1: u8,
- x2: u8,
- x3: u8,
- ) -> Self {
- let mut s = Self([0; 4]);
- s.set_x0(x0);
- s.set_x1(x1);
- s.set_x2(x2);
- s.set_x3(x3);
- s
- }
-
- pub fn x0(&self) -> u8 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x0(&mut self, x: u8) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x1(&self) -> u8 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[1..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x1(&mut self, x: u8) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[1..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x2(&self) -> u8 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[2..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x2(&mut self, x: u8) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[2..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x3(&self) -> u8 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[3..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x3(&mut self, x: u8) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[3..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-pub enum LogOffset {}
-#[derive(Copy, Clone, PartialEq)]
-
-pub struct Log<'a> {
- pub _tab: flatbuffers::Table<'a>,
-}
-
-impl<'a> flatbuffers::Follow<'a> for Log<'a> {
- type Inner = Log<'a>;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self { _tab: flatbuffers::Table::new(buf, loc) }
- }
-}
-
-impl<'a> Log<'a> {
- pub const VT_ADDRESS: flatbuffers::VOffsetT = 4;
- pub const VT_IDENTITY: flatbuffers::VOffsetT = 6;
- pub const VT_USERID: flatbuffers::VOffsetT = 8;
- pub const VT_DATE: flatbuffers::VOffsetT = 10;
- pub const VT_REQUEST: flatbuffers::VOffsetT = 12;
- pub const VT_CODE: flatbuffers::VOffsetT = 14;
- pub const VT_SIZE_: flatbuffers::VOffsetT = 16;
-
- #[inline]
- pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
- Log { _tab: table }
- }
- #[allow(unused_mut)]
- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
- args: &'args LogArgs<'args>
- ) -> flatbuffers::WIPOffset> {
- let mut builder = LogBuilder::new(_fbb);
- builder.add_size_(args.size_);
- if let Some(x) = args.request { builder.add_request(x); }
- if let Some(x) = args.date { builder.add_date(x); }
- if let Some(x) = args.userid { builder.add_userid(x); }
- if let Some(x) = args.identity { builder.add_identity(x); }
- if let Some(x) = args.address { builder.add_address(x); }
- builder.add_code(args.code);
- builder.finish()
- }
-
-
- #[inline]
- pub fn address(&self) -> Option<&'a Address> {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Log::VT_ADDRESS, None)}
- }
- #[inline]
- pub fn identity(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Log::VT_IDENTITY, None).unwrap()}
- }
- #[inline]
- pub fn userid(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Log::VT_USERID, None).unwrap()}
- }
- #[inline]
- pub fn date(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Log::VT_DATE, None).unwrap()}
- }
- #[inline]
- pub fn request(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Log::VT_REQUEST, None).unwrap()}
- }
- #[inline]
- pub fn code(&self) -> u16 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Log::VT_CODE, Some(0)).unwrap()}
- }
- #[inline]
- pub fn size_(&self) -> u64 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Log::VT_SIZE_, Some(0)).unwrap()}
- }
-}
-
-impl flatbuffers::Verifiable for Log<'_> {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.visit_table(pos)?
- .visit_field::("address", Self::VT_ADDRESS, false)?
- .visit_field::>("identity", Self::VT_IDENTITY, true)?
- .visit_field::>("userid", Self::VT_USERID, true)?
- .visit_field::>("date", Self::VT_DATE, true)?
- .visit_field::>("request", Self::VT_REQUEST, true)?
- .visit_field::("code", Self::VT_CODE, false)?
- .visit_field::("size_", Self::VT_SIZE_, false)?
- .finish();
- Ok(())
- }
-}
-pub struct LogArgs<'a> {
- pub address: Option<&'a Address>,
- pub identity: Option>,
- pub userid: Option>,
- pub date: Option>,
- pub request: Option>,
- pub code: u16,
- pub size_: u64,
-}
-impl<'a> Default for LogArgs<'a> {
- #[inline]
- fn default() -> Self {
- LogArgs {
- address: None,
- identity: None, // required field
- userid: None, // required field
- date: None, // required field
- request: None, // required field
- code: 0,
- size_: 0,
- }
- }
-}
-
-pub struct LogBuilder<'a: 'b, 'b> {
- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
- start_: flatbuffers::WIPOffset,
-}
-impl<'a: 'b, 'b> LogBuilder<'a, 'b> {
- #[inline]
- pub fn add_address(&mut self, address: &Address) {
- self.fbb_.push_slot_always::<&Address>(Log::VT_ADDRESS, address);
- }
- #[inline]
- pub fn add_identity(&mut self, identity: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Log::VT_IDENTITY, identity);
- }
- #[inline]
- pub fn add_userid(&mut self, userid: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Log::VT_USERID, userid);
- }
- #[inline]
- pub fn add_date(&mut self, date: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Log::VT_DATE, date);
- }
- #[inline]
- pub fn add_request(&mut self, request: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Log::VT_REQUEST, request);
- }
- #[inline]
- pub fn add_code(&mut self, code: u16) {
- self.fbb_.push_slot::(Log::VT_CODE, code, 0);
- }
- #[inline]
- pub fn add_size_(&mut self, size_: u64) {
- self.fbb_.push_slot::(Log::VT_SIZE_, size_, 0);
- }
- #[inline]
- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LogBuilder<'a, 'b> {
- let start = _fbb.start_table();
- LogBuilder {
- fbb_: _fbb,
- start_: start,
- }
- }
- #[inline]
- pub fn finish(self) -> flatbuffers::WIPOffset> {
- let o = self.fbb_.end_table(self.start_);
- self.fbb_.required(o, Log::VT_IDENTITY,"identity");
- self.fbb_.required(o, Log::VT_USERID,"userid");
- self.fbb_.required(o, Log::VT_DATE,"date");
- self.fbb_.required(o, Log::VT_REQUEST,"request");
- flatbuffers::WIPOffset::new(o.value())
- }
-}
-
-impl core::fmt::Debug for Log<'_> {
- fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
- let mut ds = f.debug_struct("Log");
- ds.field("address", &self.address());
- ds.field("identity", &self.identity());
- ds.field("userid", &self.userid());
- ds.field("date", &self.date());
- ds.field("request", &self.request());
- ds.field("code", &self.code());
- ds.field("size_", &self.size_());
- ds.finish()
- }
-}
-pub enum LogsOffset {}
-#[derive(Copy, Clone, PartialEq)]
-
-pub struct Logs<'a> {
- pub _tab: flatbuffers::Table<'a>,
-}
-
-impl<'a> flatbuffers::Follow<'a> for Logs<'a> {
- type Inner = Logs<'a>;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self { _tab: flatbuffers::Table::new(buf, loc) }
- }
-}
-
-impl<'a> Logs<'a> {
- pub const VT_LOGS: flatbuffers::VOffsetT = 4;
-
- #[inline]
- pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
- Logs { _tab: table }
- }
- #[allow(unused_mut)]
- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
- args: &'args LogsArgs<'args>
- ) -> flatbuffers::WIPOffset> {
- let mut builder = LogsBuilder::new(_fbb);
- if let Some(x) = args.logs { builder.add_logs(x); }
- builder.finish()
- }
-
-
- #[inline]
- pub fn logs(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>>>(Logs::VT_LOGS, None).unwrap()}
- }
-}
-
-impl flatbuffers::Verifiable for Logs<'_> {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.visit_table(pos)?
- .visit_field::>>>("logs", Self::VT_LOGS, true)?
- .finish();
- Ok(())
- }
-}
-pub struct LogsArgs<'a> {
- pub logs: Option>>>>,
-}
-impl<'a> Default for LogsArgs<'a> {
- #[inline]
- fn default() -> Self {
- LogsArgs {
- logs: None, // required field
- }
- }
-}
-
-pub struct LogsBuilder<'a: 'b, 'b> {
- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
- start_: flatbuffers::WIPOffset,
-}
-impl<'a: 'b, 'b> LogsBuilder<'a, 'b> {
- #[inline]
- pub fn add_logs(&mut self, logs: flatbuffers::WIPOffset>>>) {
- self.fbb_.push_slot_always::>(Logs::VT_LOGS, logs);
- }
- #[inline]
- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LogsBuilder<'a, 'b> {
- let start = _fbb.start_table();
- LogsBuilder {
- fbb_: _fbb,
- start_: start,
- }
- }
- #[inline]
- pub fn finish(self) -> flatbuffers::WIPOffset> {
- let o = self.fbb_.end_table(self.start_);
- self.fbb_.required(o, Logs::VT_LOGS,"logs");
- flatbuffers::WIPOffset::new(o.value())
- }
-}
-
-impl core::fmt::Debug for Logs<'_> {
- fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
- let mut ds = f.debug_struct("Logs");
- ds.field("logs", &self.logs());
- ds.finish()
- }
-}
-} // pub mod log
-
+// 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};
+
+#[allow(unused_imports, dead_code)]
+pub mod log {
+
+ use core::mem;
+ use core::cmp::Ordering;
+
+ extern crate flatbuffers;
+ use self::flatbuffers::{EndianScalar, Follow};
+
+// struct Address, aligned to 1
+#[repr(transparent)]
+#[derive(Clone, Copy, PartialEq)]
+pub struct Address(pub [u8; 4]);
+impl Default for Address {
+ fn default() -> Self {
+ Self([0; 4])
+ }
+}
+impl core::fmt::Debug for Address {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
+ f.debug_struct("Address")
+ .field("x0", &self.x0())
+ .field("x1", &self.x1())
+ .field("x2", &self.x2())
+ .field("x3", &self.x3())
+ .finish()
+ }
+}
+
+impl flatbuffers::SimpleToVerifyInSlice for Address {}
+impl<'a> flatbuffers::Follow<'a> for Address {
+ type Inner = &'a Address;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ <&'a Address>::follow(buf, loc)
+ }
+}
+impl<'a> flatbuffers::Follow<'a> for &'a Address {
+ type Inner = &'a Address;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ flatbuffers::follow_cast_ref::(buf, loc)
+ }
+}
+impl<'b> flatbuffers::Push for Address {
+ type Output = Address;
+ #[inline]
+ unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
+ let src = ::core::slice::from_raw_parts(self as *const Address as *const u8, Self::size());
+ dst.copy_from_slice(src);
+ }
+}
+
+impl<'a> flatbuffers::Verifiable for Address {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.in_buffer::(pos)
+ }
+}
+
+impl<'a> Address {
+ #[allow(clippy::too_many_arguments)]
+ pub fn new(
+ x0: u8,
+ x1: u8,
+ x2: u8,
+ x3: u8,
+ ) -> Self {
+ let mut s = Self([0; 4]);
+ s.set_x0(x0);
+ s.set_x1(x1);
+ s.set_x2(x2);
+ s.set_x3(x3);
+ s
+ }
+
+ pub fn x0(&self) -> u8 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[0..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_x0(&mut self, x: u8) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[0..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+ pub fn x1(&self) -> u8 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[1..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_x1(&mut self, x: u8) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[1..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+ pub fn x2(&self) -> u8 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[2..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_x2(&mut self, x: u8) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[2..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+ pub fn x3(&self) -> u8 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[3..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_x3(&mut self, x: u8) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[3..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+}
+
+pub enum LogOffset {}
+#[derive(Copy, Clone, PartialEq)]
+
+pub struct Log<'a> {
+ pub _tab: flatbuffers::Table<'a>,
+}
+
+impl<'a> flatbuffers::Follow<'a> for Log<'a> {
+ type Inner = Log<'a>;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ Self { _tab: flatbuffers::Table::new(buf, loc) }
+ }
+}
+
+impl<'a> Log<'a> {
+ pub const VT_ADDRESS: flatbuffers::VOffsetT = 4;
+ pub const VT_IDENTITY: flatbuffers::VOffsetT = 6;
+ pub const VT_USERID: flatbuffers::VOffsetT = 8;
+ pub const VT_DATE: flatbuffers::VOffsetT = 10;
+ pub const VT_REQUEST: flatbuffers::VOffsetT = 12;
+ pub const VT_CODE: flatbuffers::VOffsetT = 14;
+ pub const VT_SIZE_: flatbuffers::VOffsetT = 16;
+
+ #[inline]
+ pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
+ Log { _tab: table }
+ }
+ #[allow(unused_mut)]
+ pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
+ _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
+ args: &'args LogArgs<'args>
+ ) -> flatbuffers::WIPOffset> {
+ let mut builder = LogBuilder::new(_fbb);
+ builder.add_size_(args.size_);
+ if let Some(x) = args.request { builder.add_request(x); }
+ if let Some(x) = args.date { builder.add_date(x); }
+ if let Some(x) = args.userid { builder.add_userid(x); }
+ if let Some(x) = args.identity { builder.add_identity(x); }
+ if let Some(x) = args.address { builder.add_address(x); }
+ builder.add_code(args.code);
+ builder.finish()
+ }
+
+
+ #[inline]
+ pub fn address(&self) -> Option<&'a Address> {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::(Log::VT_ADDRESS, None)}
+ }
+ #[inline]
+ pub fn identity(&self) -> &'a str {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>(Log::VT_IDENTITY, None).unwrap()}
+ }
+ #[inline]
+ pub fn userid(&self) -> &'a str {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>(Log::VT_USERID, None).unwrap()}
+ }
+ #[inline]
+ pub fn date(&self) -> &'a str {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>(Log::VT_DATE, None).unwrap()}
+ }
+ #[inline]
+ pub fn request(&self) -> &'a str {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>(Log::VT_REQUEST, None).unwrap()}
+ }
+ #[inline]
+ pub fn code(&self) -> u16 {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::(Log::VT_CODE, Some(0)).unwrap()}
+ }
+ #[inline]
+ pub fn size_(&self) -> u64 {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::(Log::VT_SIZE_, Some(0)).unwrap()}
+ }
+}
+
+impl flatbuffers::Verifiable for Log<'_> {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::("address", Self::VT_ADDRESS, false)?
+ .visit_field::>("identity", Self::VT_IDENTITY, true)?
+ .visit_field::>("userid", Self::VT_USERID, true)?
+ .visit_field::>("date", Self::VT_DATE, true)?
+ .visit_field::>("request", Self::VT_REQUEST, true)?
+ .visit_field::("code", Self::VT_CODE, false)?
+ .visit_field::("size_", Self::VT_SIZE_, false)?
+ .finish();
+ Ok(())
+ }
+}
+pub struct LogArgs<'a> {
+ pub address: Option<&'a Address>,
+ pub identity: Option>,
+ pub userid: Option>,
+ pub date: Option>,
+ pub request: Option>,
+ pub code: u16,
+ pub size_: u64,
+}
+impl<'a> Default for LogArgs<'a> {
+ #[inline]
+ fn default() -> Self {
+ LogArgs {
+ address: None,
+ identity: None, // required field
+ userid: None, // required field
+ date: None, // required field
+ request: None, // required field
+ code: 0,
+ size_: 0,
+ }
+ }
+}
+
+pub struct LogBuilder<'a: 'b, 'b> {
+ fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
+ start_: flatbuffers::WIPOffset,
+}
+impl<'a: 'b, 'b> LogBuilder<'a, 'b> {
+ #[inline]
+ pub fn add_address(&mut self, address: &Address) {
+ self.fbb_.push_slot_always::<&Address>(Log::VT_ADDRESS, address);
+ }
+ #[inline]
+ pub fn add_identity(&mut self, identity: flatbuffers::WIPOffset<&'b str>) {
+ self.fbb_.push_slot_always::>(Log::VT_IDENTITY, identity);
+ }
+ #[inline]
+ pub fn add_userid(&mut self, userid: flatbuffers::WIPOffset<&'b str>) {
+ self.fbb_.push_slot_always::>(Log::VT_USERID, userid);
+ }
+ #[inline]
+ pub fn add_date(&mut self, date: flatbuffers::WIPOffset<&'b str>) {
+ self.fbb_.push_slot_always::>(Log::VT_DATE, date);
+ }
+ #[inline]
+ pub fn add_request(&mut self, request: flatbuffers::WIPOffset<&'b str>) {
+ self.fbb_.push_slot_always::>(Log::VT_REQUEST, request);
+ }
+ #[inline]
+ pub fn add_code(&mut self, code: u16) {
+ self.fbb_.push_slot::(Log::VT_CODE, code, 0);
+ }
+ #[inline]
+ pub fn add_size_(&mut self, size_: u64) {
+ self.fbb_.push_slot::(Log::VT_SIZE_, size_, 0);
+ }
+ #[inline]
+ pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LogBuilder<'a, 'b> {
+ let start = _fbb.start_table();
+ LogBuilder {
+ fbb_: _fbb,
+ start_: start,
+ }
+ }
+ #[inline]
+ pub fn finish(self) -> flatbuffers::WIPOffset> {
+ let o = self.fbb_.end_table(self.start_);
+ self.fbb_.required(o, Log::VT_IDENTITY,"identity");
+ self.fbb_.required(o, Log::VT_USERID,"userid");
+ self.fbb_.required(o, Log::VT_DATE,"date");
+ self.fbb_.required(o, Log::VT_REQUEST,"request");
+ flatbuffers::WIPOffset::new(o.value())
+ }
+}
+
+impl core::fmt::Debug for Log<'_> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ let mut ds = f.debug_struct("Log");
+ ds.field("address", &self.address());
+ ds.field("identity", &self.identity());
+ ds.field("userid", &self.userid());
+ ds.field("date", &self.date());
+ ds.field("request", &self.request());
+ ds.field("code", &self.code());
+ ds.field("size_", &self.size_());
+ ds.finish()
+ }
+}
+pub enum LogsOffset {}
+#[derive(Copy, Clone, PartialEq)]
+
+pub struct Logs<'a> {
+ pub _tab: flatbuffers::Table<'a>,
+}
+
+impl<'a> flatbuffers::Follow<'a> for Logs<'a> {
+ type Inner = Logs<'a>;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ Self { _tab: flatbuffers::Table::new(buf, loc) }
+ }
+}
+
+impl<'a> Logs<'a> {
+ pub const VT_LOGS: flatbuffers::VOffsetT = 4;
+
+ #[inline]
+ pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
+ Logs { _tab: table }
+ }
+ #[allow(unused_mut)]
+ pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
+ _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
+ args: &'args LogsArgs<'args>
+ ) -> flatbuffers::WIPOffset> {
+ let mut builder = LogsBuilder::new(_fbb);
+ if let Some(x) = args.logs { builder.add_logs(x); }
+ builder.finish()
+ }
+
+
+ #[inline]
+ pub fn logs(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset>> {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>>>(Logs::VT_LOGS, None).unwrap()}
+ }
+}
+
+impl flatbuffers::Verifiable for Logs<'_> {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::>>>("logs", Self::VT_LOGS, true)?
+ .finish();
+ Ok(())
+ }
+}
+pub struct LogsArgs<'a> {
+ pub logs: Option>>>>,
+}
+impl<'a> Default for LogsArgs<'a> {
+ #[inline]
+ fn default() -> Self {
+ LogsArgs {
+ logs: None, // required field
+ }
+ }
+}
+
+pub struct LogsBuilder<'a: 'b, 'b> {
+ fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
+ start_: flatbuffers::WIPOffset,
+}
+impl<'a: 'b, 'b> LogsBuilder<'a, 'b> {
+ #[inline]
+ pub fn add_logs(&mut self, logs: flatbuffers::WIPOffset>>>) {
+ self.fbb_.push_slot_always::>(Logs::VT_LOGS, logs);
+ }
+ #[inline]
+ pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LogsBuilder<'a, 'b> {
+ let start = _fbb.start_table();
+ LogsBuilder {
+ fbb_: _fbb,
+ start_: start,
+ }
+ }
+ #[inline]
+ pub fn finish(self) -> flatbuffers::WIPOffset> {
+ let o = self.fbb_.end_table(self.start_);
+ self.fbb_.required(o, Logs::VT_LOGS,"logs");
+ flatbuffers::WIPOffset::new(o.value())
+ }
+}
+
+impl core::fmt::Debug for Logs<'_> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ let mut ds = f.debug_struct("Logs");
+ ds.field("logs", &self.logs());
+ ds.finish()
+ }
+}
+} // pub mod log
+
diff --git a/src/datasets/mesh/mesh_capnp.rs b/src/datasets/mesh/mesh_capnp.rs
index c5f1059..c3ca683 100644
--- a/src/datasets/mesh/mesh_capnp.rs
+++ b/src/datasets/mesh/mesh_capnp.rs
@@ -719,7 +719,7 @@ pub mod mesh {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
- pub fn set_triangles(&mut self, value: ::capnp::struct_list::Reader<'a,crate::datasets::mesh::mesh_capnp::triangle::Owned>) -> ::capnp::Result<()> {
+ pub fn set_triangles(&mut self, value: ::capnp::struct_list::Reader<'_,crate::datasets::mesh::mesh_capnp::triangle::Owned>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
diff --git a/src/datasets/mesh/mesh_generated.rs b/src/datasets/mesh/mesh_generated.rs
index f637d18..24e0015 100644
--- a/src/datasets/mesh/mesh_generated.rs
+++ b/src/datasets/mesh/mesh_generated.rs
@@ -1,396 +1,396 @@
-// 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};
-
-#[allow(unused_imports, dead_code)]
-pub mod mesh {
-
- use core::mem;
- use core::cmp::Ordering;
-
- extern crate flatbuffers;
- use self::flatbuffers::{EndianScalar, Follow};
-
-// struct Vector3, aligned to 4
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Vector3(pub [u8; 12]);
-impl Default for Vector3 {
- fn default() -> Self {
- Self([0; 12])
- }
-}
-impl core::fmt::Debug for Vector3 {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Vector3")
- .field("x", &self.x())
- .field("y", &self.y())
- .field("z", &self.z())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Vector3 {}
-impl<'a> flatbuffers::Follow<'a> for Vector3 {
- type Inner = &'a Vector3;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Vector3>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Vector3 {
- type Inner = &'a Vector3;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Vector3 {
- type Output = Vector3;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Vector3 as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Vector3 {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Vector3 {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- x: f32,
- y: f32,
- z: f32,
- ) -> Self {
- let mut s = Self([0; 12]);
- s.set_x(x);
- s.set_y(y);
- s.set_z(z);
- s
- }
-
- pub fn x(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn y(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[4..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_y(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[4..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn z(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[8..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_z(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[8..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-// struct Triangle, aligned to 4
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Triangle(pub [u8; 48]);
-impl Default for Triangle {
- fn default() -> Self {
- Self([0; 48])
- }
-}
-impl core::fmt::Debug for Triangle {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Triangle")
- .field("v0", &self.v0())
- .field("v1", &self.v1())
- .field("v2", &self.v2())
- .field("normal", &self.normal())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Triangle {}
-impl<'a> flatbuffers::Follow<'a> for Triangle {
- type Inner = &'a Triangle;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Triangle>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Triangle {
- type Inner = &'a Triangle;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Triangle {
- type Output = Triangle;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Triangle as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Triangle {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Triangle {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- v0: &Vector3,
- v1: &Vector3,
- v2: &Vector3,
- normal: &Vector3,
- ) -> Self {
- let mut s = Self([0; 48]);
- s.set_v0(v0);
- s.set_v1(v1);
- s.set_v2(v2);
- s.set_normal(normal);
- s
- }
-
- pub fn v0(&self) -> &Vector3 {
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid struct in this slot
- unsafe { &*(self.0[0..].as_ptr() as *const Vector3) }
- }
-
- #[allow(clippy::identity_op)]
- pub fn set_v0(&mut self, x: &Vector3) {
- self.0[0..0 + 12].copy_from_slice(&x.0)
- }
-
- pub fn v1(&self) -> &Vector3 {
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid struct in this slot
- unsafe { &*(self.0[12..].as_ptr() as *const Vector3) }
- }
-
- #[allow(clippy::identity_op)]
- pub fn set_v1(&mut self, x: &Vector3) {
- self.0[12..12 + 12].copy_from_slice(&x.0)
- }
-
- pub fn v2(&self) -> &Vector3 {
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid struct in this slot
- unsafe { &*(self.0[24..].as_ptr() as *const Vector3) }
- }
-
- #[allow(clippy::identity_op)]
- pub fn set_v2(&mut self, x: &Vector3) {
- self.0[24..24 + 12].copy_from_slice(&x.0)
- }
-
- pub fn normal(&self) -> &Vector3 {
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid struct in this slot
- unsafe { &*(self.0[36..].as_ptr() as *const Vector3) }
- }
-
- #[allow(clippy::identity_op)]
- pub fn set_normal(&mut self, x: &Vector3) {
- self.0[36..36 + 12].copy_from_slice(&x.0)
- }
-
-}
-
-pub enum MeshOffset {}
-#[derive(Copy, Clone, PartialEq)]
-
-pub struct Mesh<'a> {
- pub _tab: flatbuffers::Table<'a>,
-}
-
-impl<'a> flatbuffers::Follow<'a> for Mesh<'a> {
- type Inner = Mesh<'a>;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self { _tab: flatbuffers::Table::new(buf, loc) }
- }
-}
-
-impl<'a> Mesh<'a> {
- pub const VT_TRIANGLES: flatbuffers::VOffsetT = 4;
-
- #[inline]
- pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
- Mesh { _tab: table }
- }
- #[allow(unused_mut)]
- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
- args: &'args MeshArgs<'args>
- ) -> flatbuffers::WIPOffset> {
- let mut builder = MeshBuilder::new(_fbb);
- if let Some(x) = args.triangles { builder.add_triangles(x); }
- builder.finish()
- }
-
-
- #[inline]
- pub fn triangles(&self) -> flatbuffers::Vector<'a, Triangle> {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>>(Mesh::VT_TRIANGLES, None).unwrap()}
- }
-}
-
-impl flatbuffers::Verifiable for Mesh<'_> {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.visit_table(pos)?
- .visit_field::>>("triangles", Self::VT_TRIANGLES, true)?
- .finish();
- Ok(())
- }
-}
-pub struct MeshArgs<'a> {
- pub triangles: Option>>,
-}
-impl<'a> Default for MeshArgs<'a> {
- #[inline]
- fn default() -> Self {
- MeshArgs {
- triangles: None, // required field
- }
- }
-}
-
-pub struct MeshBuilder<'a: 'b, 'b> {
- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
- start_: flatbuffers::WIPOffset,
-}
-impl<'a: 'b, 'b> MeshBuilder<'a, 'b> {
- #[inline]
- pub fn add_triangles(&mut self, triangles: flatbuffers::WIPOffset>) {
- self.fbb_.push_slot_always::>(Mesh::VT_TRIANGLES, triangles);
- }
- #[inline]
- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MeshBuilder<'a, 'b> {
- let start = _fbb.start_table();
- MeshBuilder {
- fbb_: _fbb,
- start_: start,
- }
- }
- #[inline]
- pub fn finish(self) -> flatbuffers::WIPOffset> {
- let o = self.fbb_.end_table(self.start_);
- self.fbb_.required(o, Mesh::VT_TRIANGLES,"triangles");
- flatbuffers::WIPOffset::new(o.value())
- }
-}
-
-impl core::fmt::Debug for Mesh<'_> {
- fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
- let mut ds = f.debug_struct("Mesh");
- ds.field("triangles", &self.triangles());
- ds.finish()
- }
-}
-} // pub mod mesh
-
+// 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};
+
+#[allow(unused_imports, dead_code)]
+pub mod mesh {
+
+ use core::mem;
+ use core::cmp::Ordering;
+
+ extern crate flatbuffers;
+ use self::flatbuffers::{EndianScalar, Follow};
+
+// struct Vector3, aligned to 4
+#[repr(transparent)]
+#[derive(Clone, Copy, PartialEq)]
+pub struct Vector3(pub [u8; 12]);
+impl Default for Vector3 {
+ fn default() -> Self {
+ Self([0; 12])
+ }
+}
+impl core::fmt::Debug for Vector3 {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
+ f.debug_struct("Vector3")
+ .field("x", &self.x())
+ .field("y", &self.y())
+ .field("z", &self.z())
+ .finish()
+ }
+}
+
+impl flatbuffers::SimpleToVerifyInSlice for Vector3 {}
+impl<'a> flatbuffers::Follow<'a> for Vector3 {
+ type Inner = &'a Vector3;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ <&'a Vector3>::follow(buf, loc)
+ }
+}
+impl<'a> flatbuffers::Follow<'a> for &'a Vector3 {
+ type Inner = &'a Vector3;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ flatbuffers::follow_cast_ref::(buf, loc)
+ }
+}
+impl<'b> flatbuffers::Push for Vector3 {
+ type Output = Vector3;
+ #[inline]
+ unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
+ let src = ::core::slice::from_raw_parts(self as *const Vector3 as *const u8, Self::size());
+ dst.copy_from_slice(src);
+ }
+}
+
+impl<'a> flatbuffers::Verifiable for Vector3 {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.in_buffer::(pos)
+ }
+}
+
+impl<'a> Vector3 {
+ #[allow(clippy::too_many_arguments)]
+ pub fn new(
+ x: f32,
+ y: f32,
+ z: f32,
+ ) -> Self {
+ let mut s = Self([0; 12]);
+ s.set_x(x);
+ s.set_y(y);
+ s.set_z(z);
+ s
+ }
+
+ pub fn x(&self) -> f32 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[0..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_x(&mut self, x: f32) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[0..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+ pub fn y(&self) -> f32 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[4..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_y(&mut self, x: f32) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[4..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+ pub fn z(&self) -> f32 {
+ let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ EndianScalar::from_little_endian(unsafe {
+ core::ptr::copy_nonoverlapping(
+ self.0[8..].as_ptr(),
+ mem.as_mut_ptr() as *mut u8,
+ core::mem::size_of::<::Scalar>(),
+ );
+ mem.assume_init()
+ })
+ }
+
+ pub fn set_z(&mut self, x: f32) {
+ let x_le = x.to_little_endian();
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid value in this slot
+ unsafe {
+ core::ptr::copy_nonoverlapping(
+ &x_le as *const _ as *const u8,
+ self.0[8..].as_mut_ptr(),
+ core::mem::size_of::<::Scalar>(),
+ );
+ }
+ }
+
+}
+
+// struct Triangle, aligned to 4
+#[repr(transparent)]
+#[derive(Clone, Copy, PartialEq)]
+pub struct Triangle(pub [u8; 48]);
+impl Default for Triangle {
+ fn default() -> Self {
+ Self([0; 48])
+ }
+}
+impl core::fmt::Debug for Triangle {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
+ f.debug_struct("Triangle")
+ .field("v0", &self.v0())
+ .field("v1", &self.v1())
+ .field("v2", &self.v2())
+ .field("normal", &self.normal())
+ .finish()
+ }
+}
+
+impl flatbuffers::SimpleToVerifyInSlice for Triangle {}
+impl<'a> flatbuffers::Follow<'a> for Triangle {
+ type Inner = &'a Triangle;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ <&'a Triangle>::follow(buf, loc)
+ }
+}
+impl<'a> flatbuffers::Follow<'a> for &'a Triangle {
+ type Inner = &'a Triangle;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ flatbuffers::follow_cast_ref::(buf, loc)
+ }
+}
+impl<'b> flatbuffers::Push for Triangle {
+ type Output = Triangle;
+ #[inline]
+ unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
+ let src = ::core::slice::from_raw_parts(self as *const Triangle as *const u8, Self::size());
+ dst.copy_from_slice(src);
+ }
+}
+
+impl<'a> flatbuffers::Verifiable for Triangle {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.in_buffer::(pos)
+ }
+}
+
+impl<'a> Triangle {
+ #[allow(clippy::too_many_arguments)]
+ pub fn new(
+ v0: &Vector3,
+ v1: &Vector3,
+ v2: &Vector3,
+ normal: &Vector3,
+ ) -> Self {
+ let mut s = Self([0; 48]);
+ s.set_v0(v0);
+ s.set_v1(v1);
+ s.set_v2(v2);
+ s.set_normal(normal);
+ s
+ }
+
+ pub fn v0(&self) -> &Vector3 {
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid struct in this slot
+ unsafe { &*(self.0[0..].as_ptr() as *const Vector3) }
+ }
+
+ #[allow(clippy::identity_op)]
+ pub fn set_v0(&mut self, x: &Vector3) {
+ self.0[0..0 + 12].copy_from_slice(&x.0)
+ }
+
+ pub fn v1(&self) -> &Vector3 {
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid struct in this slot
+ unsafe { &*(self.0[12..].as_ptr() as *const Vector3) }
+ }
+
+ #[allow(clippy::identity_op)]
+ pub fn set_v1(&mut self, x: &Vector3) {
+ self.0[12..12 + 12].copy_from_slice(&x.0)
+ }
+
+ pub fn v2(&self) -> &Vector3 {
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid struct in this slot
+ unsafe { &*(self.0[24..].as_ptr() as *const Vector3) }
+ }
+
+ #[allow(clippy::identity_op)]
+ pub fn set_v2(&mut self, x: &Vector3) {
+ self.0[24..24 + 12].copy_from_slice(&x.0)
+ }
+
+ pub fn normal(&self) -> &Vector3 {
+ // Safety:
+ // Created from a valid Table for this object
+ // Which contains a valid struct in this slot
+ unsafe { &*(self.0[36..].as_ptr() as *const Vector3) }
+ }
+
+ #[allow(clippy::identity_op)]
+ pub fn set_normal(&mut self, x: &Vector3) {
+ self.0[36..36 + 12].copy_from_slice(&x.0)
+ }
+
+}
+
+pub enum MeshOffset {}
+#[derive(Copy, Clone, PartialEq)]
+
+pub struct Mesh<'a> {
+ pub _tab: flatbuffers::Table<'a>,
+}
+
+impl<'a> flatbuffers::Follow<'a> for Mesh<'a> {
+ type Inner = Mesh<'a>;
+ #[inline]
+ unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
+ Self { _tab: flatbuffers::Table::new(buf, loc) }
+ }
+}
+
+impl<'a> Mesh<'a> {
+ pub const VT_TRIANGLES: flatbuffers::VOffsetT = 4;
+
+ #[inline]
+ pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
+ Mesh { _tab: table }
+ }
+ #[allow(unused_mut)]
+ pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
+ _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
+ args: &'args MeshArgs<'args>
+ ) -> flatbuffers::WIPOffset> {
+ let mut builder = MeshBuilder::new(_fbb);
+ if let Some(x) = args.triangles { builder.add_triangles(x); }
+ builder.finish()
+ }
+
+
+ #[inline]
+ pub fn triangles(&self) -> flatbuffers::Vector<'a, Triangle> {
+ // Safety:
+ // Created from valid Table for this object
+ // which contains a valid value in this slot
+ unsafe { self._tab.get::>>(Mesh::VT_TRIANGLES, None).unwrap()}
+ }
+}
+
+impl flatbuffers::Verifiable for Mesh<'_> {
+ #[inline]
+ fn run_verifier(
+ v: &mut flatbuffers::Verifier, pos: usize
+ ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
+ use self::flatbuffers::Verifiable;
+ v.visit_table(pos)?
+ .visit_field::>>("triangles", Self::VT_TRIANGLES, true)?
+ .finish();
+ Ok(())
+ }
+}
+pub struct MeshArgs<'a> {
+ pub triangles: Option>>,
+}
+impl<'a> Default for MeshArgs<'a> {
+ #[inline]
+ fn default() -> Self {
+ MeshArgs {
+ triangles: None, // required field
+ }
+ }
+}
+
+pub struct MeshBuilder<'a: 'b, 'b> {
+ fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
+ start_: flatbuffers::WIPOffset,
+}
+impl<'a: 'b, 'b> MeshBuilder<'a, 'b> {
+ #[inline]
+ pub fn add_triangles(&mut self, triangles: flatbuffers::WIPOffset>) {
+ self.fbb_.push_slot_always::>(Mesh::VT_TRIANGLES, triangles);
+ }
+ #[inline]
+ pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MeshBuilder<'a, 'b> {
+ let start = _fbb.start_table();
+ MeshBuilder {
+ fbb_: _fbb,
+ start_: start,
+ }
+ }
+ #[inline]
+ pub fn finish(self) -> flatbuffers::WIPOffset> {
+ let o = self.fbb_.end_table(self.start_);
+ self.fbb_.required(o, Mesh::VT_TRIANGLES,"triangles");
+ flatbuffers::WIPOffset::new(o.value())
+ }
+}
+
+impl core::fmt::Debug for Mesh<'_> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ let mut ds = f.debug_struct("Mesh");
+ ds.field("triangles", &self.triangles());
+ ds.finish()
+ }
+}
+} // pub mod mesh
+
diff --git a/src/datasets/minecraft_savedata/minecraft_savedata_capnp.rs b/src/datasets/minecraft_savedata/minecraft_savedata_capnp.rs
index cb1957d..757b2d8 100644
--- a/src/datasets/minecraft_savedata/minecraft_savedata_capnp.rs
+++ b/src/datasets/minecraft_savedata/minecraft_savedata_capnp.rs
@@ -2551,7 +2551,7 @@ pub mod recipe_book {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
- pub fn set_recipes(&mut self, value: ::capnp::text_list::Reader<'a>) -> ::capnp::Result<()> {
+ pub fn set_recipes(&mut self, value: ::capnp::text_list::Reader<'_>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
@@ -2567,7 +2567,7 @@ pub mod recipe_book {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None)
}
#[inline]
- pub fn set_to_be_displayed(&mut self, value: ::capnp::text_list::Reader<'a>) -> ::capnp::Result<()> {
+ pub fn set_to_be_displayed(&mut self, value: ::capnp::text_list::Reader<'_>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false)
}
#[inline]
@@ -3292,7 +3292,7 @@ pub mod player {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(3), ::core::option::Option::None)
}
#[inline]
- pub fn set_inventory(&mut self, value: ::capnp::struct_list::Reader<'a,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::item::Owned>) -> ::capnp::Result<()> {
+ pub fn set_inventory(&mut self, value: ::capnp::struct_list::Reader<'_,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::item::Owned>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(3), value, false)
}
#[inline]
@@ -3308,7 +3308,7 @@ pub mod player {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(4), ::core::option::Option::None)
}
#[inline]
- pub fn set_ender_items(&mut self, value: ::capnp::struct_list::Reader<'a,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::item::Owned>) -> ::capnp::Result<()> {
+ pub fn set_ender_items(&mut self, value: ::capnp::struct_list::Reader<'_,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::item::Owned>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(4), value, false)
}
#[inline]
@@ -6601,7 +6601,7 @@ pub mod players {
::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None)
}
#[inline]
- pub fn set_players(&mut self, value: ::capnp::struct_list::Reader<'a,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::player::Owned>) -> ::capnp::Result<()> {
+ pub fn set_players(&mut self, value: ::capnp::struct_list::Reader<'_,crate::datasets::minecraft_savedata::minecraft_savedata_capnp::player::Owned>) -> ::capnp::Result<()> {
::capnp::traits::SetPointerBuilder::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false)
}
#[inline]
diff --git a/src/datasets/minecraft_savedata/minecraft_savedata_generated.rs b/src/datasets/minecraft_savedata/minecraft_savedata_generated.rs
index 6589e04..2da2b76 100644
--- a/src/datasets/minecraft_savedata/minecraft_savedata_generated.rs
+++ b/src/datasets/minecraft_savedata/minecraft_savedata_generated.rs
@@ -1,2434 +1,2434 @@
-// 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};
-
-#[allow(unused_imports, dead_code)]
-pub mod minecraft_savedata {
-
- 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_GAME_TYPE: i8 = 0;
-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
-pub const ENUM_MAX_GAME_TYPE: i8 = 3;
-#[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_GAME_TYPE: [GameType; 4] = [
- GameType::Survival,
- GameType::Creative,
- GameType::Adventure,
- GameType::Spectator,
-];
-
-#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
-#[repr(transparent)]
-pub struct GameType(pub i8);
-#[allow(non_upper_case_globals)]
-impl GameType {
- pub const Survival: Self = Self(0);
- pub const Creative: Self = Self(1);
- pub const Adventure: Self = Self(2);
- pub const Spectator: Self = Self(3);
-
- pub const ENUM_MIN: i8 = 0;
- pub const ENUM_MAX: i8 = 3;
- pub const ENUM_VALUES: &'static [Self] = &[
- Self::Survival,
- Self::Creative,
- Self::Adventure,
- Self::Spectator,
- ];
- /// Returns the variant's name or "" if unknown.
- pub fn variant_name(self) -> Option<&'static str> {
- match self {
- Self::Survival => Some("Survival"),
- Self::Creative => Some("Creative"),
- Self::Adventure => Some("Adventure"),
- Self::Spectator => Some("Spectator"),
- _ => None,
- }
- }
-}
-impl core::fmt::Debug for GameType {
- 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!("", self.0))
- }
- }
-}
-impl<'a> flatbuffers::Follow<'a> for GameType {
- type Inner = Self;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- let b = flatbuffers::read_scalar_at::(buf, loc);
- Self(b)
- }
-}
-
-impl flatbuffers::Push for GameType {
- type Output = GameType;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- flatbuffers::emplace_scalar::(dst, self.0);
- }
-}
-
-impl flatbuffers::EndianScalar for GameType {
- 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 GameType {
- #[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 GameType {}
-// struct Abilities, aligned to 4
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Abilities(pub [u8; 16]);
-impl Default for Abilities {
- fn default() -> Self {
- Self([0; 16])
- }
-}
-impl core::fmt::Debug for Abilities {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Abilities")
- .field("walk_speed", &self.walk_speed())
- .field("fly_speed", &self.fly_speed())
- .field("may_fly", &self.may_fly())
- .field("flying", &self.flying())
- .field("invulnerable", &self.invulnerable())
- .field("may_build", &self.may_build())
- .field("instabuild", &self.instabuild())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Abilities {}
-impl<'a> flatbuffers::Follow<'a> for Abilities {
- type Inner = &'a Abilities;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Abilities>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Abilities {
- type Inner = &'a Abilities;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Abilities {
- type Output = Abilities;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Abilities as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Abilities {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Abilities {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- walk_speed: f32,
- fly_speed: f32,
- may_fly: bool,
- flying: bool,
- invulnerable: bool,
- may_build: bool,
- instabuild: bool,
- ) -> Self {
- let mut s = Self([0; 16]);
- s.set_walk_speed(walk_speed);
- s.set_fly_speed(fly_speed);
- s.set_may_fly(may_fly);
- s.set_flying(flying);
- s.set_invulnerable(invulnerable);
- s.set_may_build(may_build);
- s.set_instabuild(instabuild);
- s
- }
-
- pub fn walk_speed(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_walk_speed(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn fly_speed(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[4..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_fly_speed(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[4..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn may_fly(&self) -> bool {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[8..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_may_fly(&mut self, x: bool) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[8..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn flying(&self) -> bool {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[9..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_flying(&mut self, x: bool) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[9..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn invulnerable(&self) -> bool {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[10..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_invulnerable(&mut self, x: bool) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[10..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn may_build(&self) -> bool {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[11..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_may_build(&mut self, x: bool) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[11..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn instabuild(&self) -> bool {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[12..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_instabuild(&mut self, x: bool) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[12..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-// struct Vector2f, aligned to 4
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Vector2f(pub [u8; 8]);
-impl Default for Vector2f {
- fn default() -> Self {
- Self([0; 8])
- }
-}
-impl core::fmt::Debug for Vector2f {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Vector2f")
- .field("x", &self.x())
- .field("y", &self.y())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Vector2f {}
-impl<'a> flatbuffers::Follow<'a> for Vector2f {
- type Inner = &'a Vector2f;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Vector2f>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Vector2f {
- type Inner = &'a Vector2f;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Vector2f {
- type Output = Vector2f;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Vector2f as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Vector2f {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Vector2f {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- x: f32,
- y: f32,
- ) -> Self {
- let mut s = Self([0; 8]);
- s.set_x(x);
- s.set_y(y);
- s
- }
-
- pub fn x(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn y(&self) -> f32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[4..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_y(&mut self, x: f32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[4..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-// struct Vector3d, aligned to 8
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Vector3d(pub [u8; 24]);
-impl Default for Vector3d {
- fn default() -> Self {
- Self([0; 24])
- }
-}
-impl core::fmt::Debug for Vector3d {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Vector3d")
- .field("x", &self.x())
- .field("y", &self.y())
- .field("z", &self.z())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Vector3d {}
-impl<'a> flatbuffers::Follow<'a> for Vector3d {
- type Inner = &'a Vector3d;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Vector3d>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Vector3d {
- type Inner = &'a Vector3d;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Vector3d {
- type Output = Vector3d;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Vector3d as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Vector3d {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Vector3d {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- x: f64,
- y: f64,
- z: f64,
- ) -> Self {
- let mut s = Self([0; 24]);
- s.set_x(x);
- s.set_y(y);
- s.set_z(z);
- s
- }
-
- pub fn x(&self) -> f64 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x(&mut self, x: f64) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn y(&self) -> f64 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[8..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_y(&mut self, x: f64) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[8..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn z(&self) -> f64 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[16..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_z(&mut self, x: f64) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[16..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-// struct Uuid, aligned to 4
-#[repr(transparent)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Uuid(pub [u8; 16]);
-impl Default for Uuid {
- fn default() -> Self {
- Self([0; 16])
- }
-}
-impl core::fmt::Debug for Uuid {
- fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
- f.debug_struct("Uuid")
- .field("x0", &self.x0())
- .field("x1", &self.x1())
- .field("x2", &self.x2())
- .field("x3", &self.x3())
- .finish()
- }
-}
-
-impl flatbuffers::SimpleToVerifyInSlice for Uuid {}
-impl<'a> flatbuffers::Follow<'a> for Uuid {
- type Inner = &'a Uuid;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- <&'a Uuid>::follow(buf, loc)
- }
-}
-impl<'a> flatbuffers::Follow<'a> for &'a Uuid {
- type Inner = &'a Uuid;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- flatbuffers::follow_cast_ref::(buf, loc)
- }
-}
-impl<'b> flatbuffers::Push for Uuid {
- type Output = Uuid;
- #[inline]
- unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
- let src = ::core::slice::from_raw_parts(self as *const Uuid as *const u8, Self::size());
- dst.copy_from_slice(src);
- }
-}
-
-impl<'a> flatbuffers::Verifiable for Uuid {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.in_buffer::(pos)
- }
-}
-
-impl<'a> Uuid {
- #[allow(clippy::too_many_arguments)]
- pub fn new(
- x0: u32,
- x1: u32,
- x2: u32,
- x3: u32,
- ) -> Self {
- let mut s = Self([0; 16]);
- s.set_x0(x0);
- s.set_x1(x1);
- s.set_x2(x2);
- s.set_x3(x3);
- s
- }
-
- pub fn x0(&self) -> u32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[0..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x0(&mut self, x: u32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[0..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x1(&self) -> u32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[4..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x1(&mut self, x: u32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[4..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x2(&self) -> u32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[8..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x2(&mut self, x: u32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[8..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
- pub fn x3(&self) -> u32 {
- let mut mem = core::mem::MaybeUninit::<::Scalar>::uninit();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- EndianScalar::from_little_endian(unsafe {
- core::ptr::copy_nonoverlapping(
- self.0[12..].as_ptr(),
- mem.as_mut_ptr() as *mut u8,
- core::mem::size_of::<::Scalar>(),
- );
- mem.assume_init()
- })
- }
-
- pub fn set_x3(&mut self, x: u32) {
- let x_le = x.to_little_endian();
- // Safety:
- // Created from a valid Table for this object
- // Which contains a valid value in this slot
- unsafe {
- core::ptr::copy_nonoverlapping(
- &x_le as *const _ as *const u8,
- self.0[12..].as_mut_ptr(),
- core::mem::size_of::<::Scalar>(),
- );
- }
- }
-
-}
-
-pub enum ItemOffset {}
-#[derive(Copy, Clone, PartialEq)]
-
-pub struct Item<'a> {
- pub _tab: flatbuffers::Table<'a>,
-}
-
-impl<'a> flatbuffers::Follow<'a> for Item<'a> {
- type Inner = Item<'a>;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self { _tab: flatbuffers::Table::new(buf, loc) }
- }
-}
-
-impl<'a> Item<'a> {
- pub const VT_COUNT: flatbuffers::VOffsetT = 4;
- pub const VT_SLOT: flatbuffers::VOffsetT = 6;
- pub const VT_ID: flatbuffers::VOffsetT = 8;
-
- #[inline]
- pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
- Item { _tab: table }
- }
- #[allow(unused_mut)]
- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
- args: &'args ItemArgs<'args>
- ) -> flatbuffers::WIPOffset- > {
- let mut builder = ItemBuilder::new(_fbb);
- if let Some(x) = args.id { builder.add_id(x); }
- builder.add_slot(args.slot);
- builder.add_count(args.count);
- builder.finish()
- }
-
-
- #[inline]
- pub fn count(&self) -> i8 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Item::VT_COUNT, Some(0)).unwrap()}
- }
- #[inline]
- pub fn slot(&self) -> u8 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Item::VT_SLOT, Some(0)).unwrap()}
- }
- #[inline]
- pub fn id(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Item::VT_ID, None).unwrap()}
- }
-}
-
-impl flatbuffers::Verifiable for Item<'_> {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.visit_table(pos)?
- .visit_field::("count", Self::VT_COUNT, false)?
- .visit_field::("slot", Self::VT_SLOT, false)?
- .visit_field::>("id", Self::VT_ID, true)?
- .finish();
- Ok(())
- }
-}
-pub struct ItemArgs<'a> {
- pub count: i8,
- pub slot: u8,
- pub id: Option>,
-}
-impl<'a> Default for ItemArgs<'a> {
- #[inline]
- fn default() -> Self {
- ItemArgs {
- count: 0,
- slot: 0,
- id: None, // required field
- }
- }
-}
-
-pub struct ItemBuilder<'a: 'b, 'b> {
- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
- start_: flatbuffers::WIPOffset,
-}
-impl<'a: 'b, 'b> ItemBuilder<'a, 'b> {
- #[inline]
- pub fn add_count(&mut self, count: i8) {
- self.fbb_.push_slot::(Item::VT_COUNT, count, 0);
- }
- #[inline]
- pub fn add_slot(&mut self, slot: u8) {
- self.fbb_.push_slot::(Item::VT_SLOT, slot, 0);
- }
- #[inline]
- pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Item::VT_ID, id);
- }
- #[inline]
- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ItemBuilder<'a, 'b> {
- let start = _fbb.start_table();
- ItemBuilder {
- fbb_: _fbb,
- start_: start,
- }
- }
- #[inline]
- pub fn finish(self) -> flatbuffers::WIPOffset
- > {
- let o = self.fbb_.end_table(self.start_);
- self.fbb_.required(o, Item::VT_ID,"id");
- flatbuffers::WIPOffset::new(o.value())
- }
-}
-
-impl core::fmt::Debug for Item<'_> {
- fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
- let mut ds = f.debug_struct("Item");
- ds.field("count", &self.count());
- ds.field("slot", &self.slot());
- ds.field("id", &self.id());
- ds.finish()
- }
-}
-pub enum EntityOffset {}
-#[derive(Copy, Clone, PartialEq)]
-
-pub struct Entity<'a> {
- pub _tab: flatbuffers::Table<'a>,
-}
-
-impl<'a> flatbuffers::Follow<'a> for Entity<'a> {
- type Inner = Entity<'a>;
- #[inline]
- unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
- Self { _tab: flatbuffers::Table::new(buf, loc) }
- }
-}
-
-impl<'a> Entity<'a> {
- pub const VT_ID: flatbuffers::VOffsetT = 4;
- pub const VT_POS: flatbuffers::VOffsetT = 6;
- pub const VT_MOTION: flatbuffers::VOffsetT = 8;
- pub const VT_ROTATION: flatbuffers::VOffsetT = 10;
- pub const VT_FALL_DISTANCE: flatbuffers::VOffsetT = 12;
- pub const VT_FIRE: flatbuffers::VOffsetT = 14;
- pub const VT_AIR: flatbuffers::VOffsetT = 16;
- pub const VT_ON_GROUND: flatbuffers::VOffsetT = 18;
- pub const VT_NO_GRAVITY: flatbuffers::VOffsetT = 20;
- pub const VT_INVULNERABLE: flatbuffers::VOffsetT = 22;
- pub const VT_PORTAL_COOLDOWN: flatbuffers::VOffsetT = 24;
- pub const VT_UUID: flatbuffers::VOffsetT = 26;
- pub const VT_CUSTOM_NAME: flatbuffers::VOffsetT = 28;
- pub const VT_CUSTOM_NAME_VISIBLE: flatbuffers::VOffsetT = 30;
- pub const VT_SILENT: flatbuffers::VOffsetT = 32;
- pub const VT_GLOWING: flatbuffers::VOffsetT = 34;
-
- #[inline]
- pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
- Entity { _tab: table }
- }
- #[allow(unused_mut)]
- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
- args: &'args EntityArgs<'args>
- ) -> flatbuffers::WIPOffset> {
- let mut builder = EntityBuilder::new(_fbb);
- if let Some(x) = args.custom_name { builder.add_custom_name(x); }
- if let Some(x) = args.uuid { builder.add_uuid(x); }
- builder.add_portal_cooldown(args.portal_cooldown);
- builder.add_fall_distance(args.fall_distance);
- if let Some(x) = args.rotation { builder.add_rotation(x); }
- if let Some(x) = args.motion { builder.add_motion(x); }
- if let Some(x) = args.pos { builder.add_pos(x); }
- if let Some(x) = args.id { builder.add_id(x); }
- builder.add_air(args.air);
- builder.add_fire(args.fire);
- builder.add_glowing(args.glowing);
- builder.add_silent(args.silent);
- builder.add_custom_name_visible(args.custom_name_visible);
- builder.add_invulnerable(args.invulnerable);
- builder.add_no_gravity(args.no_gravity);
- builder.add_on_ground(args.on_ground);
- builder.finish()
- }
-
-
- #[inline]
- pub fn id(&self) -> &'a str {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::>(Entity::VT_ID, None).unwrap()}
- }
- #[inline]
- pub fn pos(&self) -> &'a Vector3d {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_POS, None).unwrap()}
- }
- #[inline]
- pub fn motion(&self) -> &'a Vector3d {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_MOTION, None).unwrap()}
- }
- #[inline]
- pub fn rotation(&self) -> &'a Vector2f {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_ROTATION, None).unwrap()}
- }
- #[inline]
- pub fn fall_distance(&self) -> f32 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_FALL_DISTANCE, Some(0.0)).unwrap()}
- }
- #[inline]
- pub fn fire(&self) -> u16 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_FIRE, Some(0)).unwrap()}
- }
- #[inline]
- pub fn air(&self) -> u16 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_AIR, Some(0)).unwrap()}
- }
- #[inline]
- pub fn on_ground(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_ON_GROUND, Some(false)).unwrap()}
- }
- #[inline]
- pub fn no_gravity(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_NO_GRAVITY, Some(false)).unwrap()}
- }
- #[inline]
- pub fn invulnerable(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_INVULNERABLE, Some(false)).unwrap()}
- }
- #[inline]
- pub fn portal_cooldown(&self) -> i32 {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_PORTAL_COOLDOWN, Some(0)).unwrap()}
- }
- #[inline]
- pub fn uuid(&self) -> &'a Uuid {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_UUID, None).unwrap()}
- }
- #[inline]
- pub fn custom_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::>(Entity::VT_CUSTOM_NAME, None)}
- }
- #[inline]
- pub fn custom_name_visible(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_CUSTOM_NAME_VISIBLE, Some(false)).unwrap()}
- }
- #[inline]
- pub fn silent(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_SILENT, Some(false)).unwrap()}
- }
- #[inline]
- pub fn glowing(&self) -> bool {
- // Safety:
- // Created from valid Table for this object
- // which contains a valid value in this slot
- unsafe { self._tab.get::(Entity::VT_GLOWING, Some(false)).unwrap()}
- }
-}
-
-impl flatbuffers::Verifiable for Entity<'_> {
- #[inline]
- fn run_verifier(
- v: &mut flatbuffers::Verifier, pos: usize
- ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
- use self::flatbuffers::Verifiable;
- v.visit_table(pos)?
- .visit_field::>("id", Self::VT_ID, true)?
- .visit_field::("pos", Self::VT_POS, true)?
- .visit_field::("motion", Self::VT_MOTION, true)?
- .visit_field::("rotation", Self::VT_ROTATION, true)?
- .visit_field::("fall_distance", Self::VT_FALL_DISTANCE, false)?
- .visit_field::("fire", Self::VT_FIRE, false)?
- .visit_field::("air", Self::VT_AIR, false)?
- .visit_field::("on_ground", Self::VT_ON_GROUND, false)?
- .visit_field::("no_gravity", Self::VT_NO_GRAVITY, false)?
- .visit_field::("invulnerable", Self::VT_INVULNERABLE, false)?
- .visit_field::("portal_cooldown", Self::VT_PORTAL_COOLDOWN, false)?
- .visit_field::("uuid", Self::VT_UUID, true)?
- .visit_field::>("custom_name", Self::VT_CUSTOM_NAME, false)?
- .visit_field::("custom_name_visible", Self::VT_CUSTOM_NAME_VISIBLE, false)?
- .visit_field::("silent", Self::VT_SILENT, false)?
- .visit_field::("glowing", Self::VT_GLOWING, false)?
- .finish();
- Ok(())
- }
-}
-pub struct EntityArgs<'a> {
- pub id: Option>,
- pub pos: Option<&'a Vector3d>,
- pub motion: Option<&'a Vector3d>,
- pub rotation: Option<&'a Vector2f>,
- pub fall_distance: f32,
- pub fire: u16,
- pub air: u16,
- pub on_ground: bool,
- pub no_gravity: bool,
- pub invulnerable: bool,
- pub portal_cooldown: i32,
- pub uuid: Option<&'a Uuid>,
- pub custom_name: Option>,
- pub custom_name_visible: bool,
- pub silent: bool,
- pub glowing: bool,
-}
-impl<'a> Default for EntityArgs<'a> {
- #[inline]
- fn default() -> Self {
- EntityArgs {
- id: None, // required field
- pos: None, // required field
- motion: None, // required field
- rotation: None, // required field
- fall_distance: 0.0,
- fire: 0,
- air: 0,
- on_ground: false,
- no_gravity: false,
- invulnerable: false,
- portal_cooldown: 0,
- uuid: None, // required field
- custom_name: None,
- custom_name_visible: false,
- silent: false,
- glowing: false,
- }
- }
-}
-
-pub struct EntityBuilder<'a: 'b, 'b> {
- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
- start_: flatbuffers::WIPOffset,
-}
-impl<'a: 'b, 'b> EntityBuilder<'a, 'b> {
- #[inline]
- pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b str>) {
- self.fbb_.push_slot_always::>(Entity::VT_ID, id);
- }
- #[inline]
- pub fn add_pos(&mut self, pos: &Vector3d) {
- self.fbb_.push_slot_always::<&Vector3d>(Entity::VT_POS, pos);
- }
- #[inline]
- pub fn add_motion(&mut self, motion: &Vector3d) {
- self.fbb_.push_slot_always::<&Vector3d>(Entity::VT_MOTION, motion);
- }
- #[inline]
- pub fn add_rotation(&mut self, rotation: &Vector2f) {
- self.fbb_.push_slot_always::<&Vector2f>(Entity::VT_ROTATION, rotation);
- }
- #[inline]
- pub fn add_fall_distance(&mut self, fall_distance: f32) {
- self.fbb_.push_slot::(Entity::VT_FALL_DISTANCE, fall_distance, 0.0);
- }
- #[inline]
- pub fn add_fire(&mut self, fire: u16) {
- self.fbb_.push_slot::(Entity::VT_FIRE, fire, 0);
- }
- #[inline]
- pub fn add_air(&mut self, air: u16) {
- self.fbb_.push_slot::