flex_alloc::storage

Struct FatBuffer

Source
pub struct FatBuffer<T: ?Sized, H: BufferHeader<T>, A: Allocator> { /* private fields */ }
Expand description

A slice allocation handle which stores the header metadata in the handle.

Trait Implementations§

Source§

impl<T, H, A> ConstDefault for FatBuffer<T, H, A>

Source§

const DEFAULT: Self = _

The constant default value.
Source§

impl<T: Debug + ?Sized, H: Debug + BufferHeader<T>, A: Debug + Allocator> Debug for FatBuffer<T, H, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ?Sized, H: BufferHeader<T>, A: Allocator> Drop for FatBuffer<T, H, A>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T: ?Sized, H: BufferHeader<T>, A: Allocator> RawBuffer for FatBuffer<T, H, A>

Source§

type RawData = T

The concrete data type.
Source§

fn data_ptr(&self) -> *const T

Access the data as a readonly pointer.
Source§

fn data_ptr_mut(&mut self) -> *mut T

Access the data as a mutable pointer.
Source§

impl<T, I: Index, A: Allocator> VecBuffer for FatBuffer<T, VecHeader<I>, A>

Source§

type Item = T

The type of the items stored in the Vec.
Source§

type Index = I

The index type used to store the capacity and length.
Source§

fn capacity(&self) -> I

Access the capacity of the buffer.
Source§

fn length(&self) -> I

Access the number of items stored in the buffer.
Source§

unsafe fn set_length(&mut self, len: I)

Set the current length of the buffer. Read more
Source§

fn grow_buffer( &mut self, capacity: Self::Index, exact: bool, ) -> Result<(), StorageError>

Attempt to resize this buffer to a new capacity. The exact flag determines whether a larger capacity would be acceptable.
Source§

fn shrink_buffer(&mut self, capacity: Self::Index) -> Result<(), StorageError>

Attempt to resize this buffer to a new, smaller capacity.
Source§

fn as_uninit_slice(&mut self) -> &mut [MaybeUninit<Self::Item>]

Access the contiguous memory contained in this buffer as a slice of MaybeUnint<Self::Item>. The length of this slice must correspond to self.capacity().
Source§

fn as_slice(&self) -> &[Self::Item]

Access the items contained in this buffer as a slice of Self::Item. The length of this slice must correspond to self.length().
Source§

fn as_mut_slice(&mut self) -> &mut [Self::Item]

Access the items contained in this buffer as a mutable slice of Self::Item. The length of this slice must correspond to self.length().
Source§

unsafe fn uninit_index(&mut self, index: usize) -> &mut MaybeUninit<Self::Item>

Access an index of the buffer as a mutable reference to a MaybeUninit<Self::Item>. Read more
Source§

impl<T: ?Sized, H: BufferHeader<T>, A: AllocatorZeroizes> ZeroizeOnDrop for FatBuffer<T, H, A>

Auto Trait Implementations§

§

impl<T, H, A> Freeze for FatBuffer<T, H, A>
where H: Freeze, A: Freeze, T: ?Sized,

§

impl<T, H, A> RefUnwindSafe for FatBuffer<T, H, A>

§

impl<T, H, A> !Send for FatBuffer<T, H, A>

§

impl<T, H, A> !Sync for FatBuffer<T, H, A>

§

impl<T, H, A> Unpin for FatBuffer<T, H, A>
where H: Unpin, A: Unpin, T: ?Sized,

§

impl<T, H, A> UnwindSafe for FatBuffer<T, H, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.