pub struct MessageBuffer(/* private fields */);
Expand description
An owned container for a validated Message
Safely decoding a flatbuffer requires validating the various embedded offsets,
see Verifier
. This is a potentially expensive operation, and it is therefore desirable
to only do this once. crate::root_as_message
performs this validation on construction,
however, it returns a Message
borrowing the provided byte slice. This prevents
storing this Message
in the same data structure that owns the buffer, as this
would require self-referential borrows.
MessageBuffer
solves this problem by providing a safe API for a Message
without a lifetime bound.
Implementations§
Source§impl MessageBuffer
impl MessageBuffer
Trait Implementations§
Source§impl Clone for MessageBuffer
impl Clone for MessageBuffer
Source§fn clone(&self) -> MessageBuffer
fn clone(&self) -> MessageBuffer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MessageBuffer
impl RefUnwindSafe for MessageBuffer
impl Send for MessageBuffer
impl Sync for MessageBuffer
impl Unpin for MessageBuffer
impl UnwindSafe for MessageBuffer
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