pub trait Append {
// Required methods
fn append_bytes(&mut self, bytes: &[u8]) -> Result<(), BufferTooSmall>;
fn append_bytes_zeroed(
&mut self,
len: usize,
) -> Result<&mut [u8], BufferTooSmall>;
fn can_append(&self, bytes: usize) -> bool;
// Provided methods
fn append_value<T>(&mut self, value: &T) -> Result<(), BufferTooSmall>
where T: IntoBytes + Immutable + ?Sized { ... }
fn append_byte(&mut self, byte: u8) -> Result<(), BufferTooSmall> { ... }
fn append_value_zeroed<T>(
&mut self,
) -> Result<Ref<&mut [u8], T>, BufferTooSmall>
where T: FromBytes + KnownLayout + Immutable + Unaligned { ... }
fn append_array_zeroed<T>(
&mut self,
num_elems: usize,
) -> Result<Ref<&mut [u8], [T]>, BufferTooSmall>
where T: FromBytes + Immutable + Unaligned { ... }
}
Required Methods§
fn append_bytes(&mut self, bytes: &[u8]) -> Result<(), BufferTooSmall>
fn append_bytes_zeroed( &mut self, len: usize, ) -> Result<&mut [u8], BufferTooSmall>
fn can_append(&self, bytes: usize) -> bool
Provided Methods§
fn append_value<T>(&mut self, value: &T) -> Result<(), BufferTooSmall>where
T: IntoBytes + Immutable + ?Sized,
fn append_byte(&mut self, byte: u8) -> Result<(), BufferTooSmall>
fn append_value_zeroed<T>(
&mut self,
) -> Result<Ref<&mut [u8], T>, BufferTooSmall>where
T: FromBytes + KnownLayout + Immutable + Unaligned,
fn append_array_zeroed<T>(
&mut self,
num_elems: usize,
) -> Result<Ref<&mut [u8], [T]>, BufferTooSmall>where
T: FromBytes + Immutable + Unaligned,
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.