pub trait ManagedVecItemPayload {
// Required methods
fn new_buffer() -> Self;
fn payload_size() -> usize;
fn payload_slice(&self) -> &[u8] ⓘ;
fn payload_slice_mut(&mut self) -> &mut [u8] ⓘ;
unsafe fn slice_unchecked<S: ManagedVecItemPayload>(
&self,
index: usize,
) -> &S;
unsafe fn slice_unchecked_mut<S: ManagedVecItemPayload>(
&mut self,
index: usize,
) -> &mut S;
}
Expand description
Describes the binary represetnation of a ManagedVecItem.
It is always an array that can be allocated directly on stack.
Required Methods§
fn new_buffer() -> Self
fn payload_size() -> usize
fn payload_slice(&self) -> &[u8] ⓘ
fn payload_slice_mut(&mut self) -> &mut [u8] ⓘ
Sourceunsafe fn slice_unchecked<S: ManagedVecItemPayload>(&self, index: usize) -> &S
unsafe fn slice_unchecked<S: ManagedVecItemPayload>(&self, index: usize) -> &S
Takes a sub-payload item.
§Safety
Only works correctly if the given index is correct, otherwise undefined behavior is possible.
Sourceunsafe fn slice_unchecked_mut<S: ManagedVecItemPayload>(
&mut self,
index: usize,
) -> &mut S
unsafe fn slice_unchecked_mut<S: ManagedVecItemPayload>( &mut self, index: usize, ) -> &mut S
Takes a sub-payload item.
§Safety
Only works correctly if the given index is correct, otherwise undefined behavior is possible.
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.