Trait flex_alloc::vec::buffer::VecBuffer
source · pub trait VecBuffer: RawBuffer<RawData = Self::Data> {
type Data;
type Index: Index;
// Required methods
fn capacity(&self) -> Self::Index;
fn length(&self) -> Self::Index;
unsafe fn set_length(&mut self, len: Self::Index);
fn vec_try_resize(
&mut self,
capacity: Self::Index,
exact: bool,
) -> Result<(), StorageError>;
// Provided methods
fn as_uninit_slice(&mut self) -> &mut [MaybeUninit<Self::Data>] { ... }
fn as_slice(&self) -> &[Self::Data] { ... }
fn as_mut_slice(&mut self) -> &mut [Self::Data] { ... }
unsafe fn uninit_index(
&mut self,
index: usize,
) -> &mut MaybeUninit<Self::Data> { ... }
}Required Associated Types§
Required Methods§
fn capacity(&self) -> Self::Index
fn length(&self) -> Self::Index
sourceunsafe fn set_length(&mut self, len: Self::Index)
unsafe fn set_length(&mut self, len: Self::Index)
§Safety
The capacity of the buffer must be established as greater than zero, otherwise this method may attempt to write into unallocated memory.
fn vec_try_resize( &mut self, capacity: Self::Index, exact: bool, ) -> Result<(), StorageError>
Provided Methods§
fn as_uninit_slice(&mut self) -> &mut [MaybeUninit<Self::Data>]
fn as_slice(&self) -> &[Self::Data]
fn as_mut_slice(&mut self) -> &mut [Self::Data]
unsafe fn uninit_index(&mut self, index: usize) -> &mut MaybeUninit<Self::Data>
Object Safety§
This trait is not object safe.