#[repr(transparent)]pub struct Buffer(pub [u8; 8]);
Expand description
A Buffer describes the location of a data buffer in the byte stream as a packed 64-bit struct.
Tuple Fields§
§0: [u8; 8]
Implementations§
Source§impl<'a> Buffer
impl<'a> Buffer
pub fn new( padding: u16, alignment_exponent: u8, compression: Compression, length: u32, ) -> Buffer
Sourcepub fn padding(&self) -> u16
pub fn padding(&self) -> u16
The length of any padding bytes written immediately before the buffer.
pub fn set_padding(&mut self, x: u16)
Sourcepub fn alignment_exponent(&self) -> u8
pub fn alignment_exponent(&self) -> u8
The minimum alignment of the buffer, stored as an exponent of 2.
pub fn set_alignment_exponent(&mut self, x: u8)
Sourcepub fn compression(&self) -> Compression
pub fn compression(&self) -> Compression
The compression algorithm used to compress the buffer.
pub fn set_compression(&mut self, x: Compression)
pub fn set_length(&mut self, x: u32)
Trait Implementations§
Source§impl<'a> Verifiable for Buffer
impl<'a> Verifiable for Buffer
Source§fn run_verifier(
v: &mut Verifier<'_, '_>,
pos: usize,
) -> Result<(), InvalidFlatbuffer>
fn run_verifier( v: &mut Verifier<'_, '_>, pos: usize, ) -> Result<(), InvalidFlatbuffer>
Runs the verifier for this type, assuming its at position
pos
in the verifier’s buffer.
Should not need to be called directly.impl Copy for Buffer
impl SimpleToVerifyInSlice for Buffer
impl StructuralPartialEq for Buffer
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more