pub trait Push: Sized {
type Output;
// Required method
unsafe fn push(&self, dst: &mut [u8], written_len: usize);
// Provided methods
fn size() -> usize { ... }
fn alignment() -> PushAlignment { ... }
}
Expand description
Trait to abstract over functionality needed to write values (either owned or referenced). Used in FlatBufferBuilder and implemented for generated types.
Required Associated Types§
Required Methods§
Sourceunsafe fn push(&self, dst: &mut [u8], written_len: usize)
unsafe fn push(&self, dst: &mut [u8], written_len: usize)
§Safety
dst is aligned to Self::alignment
and has length greater than or equal to Self::size
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.