pub type FlatVec<T, L = usize> = GenericVec<[MaybeInvalid<T>], L>;Expand description
Growable flat vector of sized items.
It doesn’t allocate memory on the heap but instead stores its contents in the same memory behind itself.
Obviously, this type is DST.
Aliased Type§
pub struct FlatVec<T, L = usize> { /* private fields */ }Trait Implementations§
Source§impl<T, L> FlatDefault for FlatVec<T, L>
impl<T, L> FlatDefault for FlatVec<T, L>
type DefaultEmplacer = Empty
Source§fn default_emplacer() -> Empty
fn default_emplacer() -> Empty
Initialize uninitialized memory into valid default state. Read more
Source§impl<T, L> FlatUnsized for FlatVec<T, L>
impl<T, L> FlatUnsized for FlatVec<T, L>
Source§type AlignAs = FlatVecAlignAs<T, L>
type AlignAs = FlatVecAlignAs<T, L>
Sized type that has the same alignment as
Self.unsafe fn ptr_from_bytes(bytes: *mut [u8]) -> *mut Self
unsafe fn ptr_to_bytes(this: *mut Self) -> *mut [u8]
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
unsafe fn from_mut_bytes_unchecked(bytes: &mut [u8]) -> &mut Self
fn as_bytes(&self) -> &[u8] ⓘ
Source§fn new_in_place<I: Emplacer<Self>>(
bytes: &mut [u8],
emplacer: I,
) -> Result<&mut Self, Error>
fn new_in_place<I: Emplacer<Self>>( bytes: &mut [u8], emplacer: I, ) -> Result<&mut Self, Error>
Create a new instance of
Self initializing raw memory into default state of Self.fn assign_in_place<I: Emplacer<Self>>( &mut self, emplacer: I, ) -> Result<&mut Self, Error>
Source§impl<T, L> FlatValidate for FlatVec<T, L>
impl<T, L> FlatValidate for FlatVec<T, L>
unsafe fn validate_unchecked(bytes: &[u8]) -> Result<(), Error>
unsafe fn validate_ptr(this: *const Self) -> Result<(), Error>
Source§fn validate(bytes: &[u8]) -> Result<(), Error>
fn validate(bytes: &[u8]) -> Result<(), Error>
Check that memory contents of
this is valid for Self.