flex_alloc::storage

Struct SpillStorage

Source
pub struct SpillStorage<'a, I: 'a, A> { /* private fields */ }
Expand description

An allocator which consumes the provided fixed storage before deferring to the contained A instance allocator for further allocations

Trait Implementations§

Source§

impl<'a, I, A> AllocateIn for SpillStorage<'a, I, A>
where I: AllocateIn<Alloc = Fixed<'a>>, A: Allocator,

Source§

type Alloc = Spill<'a, A>

The type of the allocator instance
Source§

fn allocate_in( self, layout: Layout, ) -> Result<(NonNull<[u8]>, Self::Alloc), AllocError>

Try to allocate a slice of a memory corresponding to layout, returning the new allocation and the allocator instance
Source§

fn allocate_zeroed_in( self, layout: Layout, ) -> Result<(NonNull<[u8]>, Self::Alloc), AllocError>

Try to allocate a slice of a memory corresponding to layout, returning the new allocation and the allocator instance. The memory will be initialized with zeroes.
Source§

impl<'a, I: Clone + 'a, A: Clone> Clone for SpillStorage<'a, I, A>

Source§

fn clone(&self) -> SpillStorage<'a, I, A>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, I: Debug + 'a, A: Debug> Debug for SpillStorage<'a, I, A>

Source§

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

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

impl<'a, I: Default + 'a, A: Default> Default for SpillStorage<'a, I, A>

Source§

fn default() -> SpillStorage<'a, I, A>

Returns the “default value” for a type. Read more
Source§

impl<'a, T, A: Allocator> VecNewIn<T> for SpillStorage<'a, &'a mut [MaybeUninit<T>], A>

Source§

type Config = Spill<'a, A>

The associated Vec configuration type.
Source§

fn buffer_try_new_in( self, capacity: <Self::Config as VecConfig>::Index, exact: bool, ) -> Result<<Self::Config as VecConfig>::Buffer<T>, StorageError>

Try to create a new buffer given an allocation target.

Auto Trait Implementations§

§

impl<'a, I, A> Freeze for SpillStorage<'a, I, A>
where I: Freeze, A: Freeze,

§

impl<'a, I, A> RefUnwindSafe for SpillStorage<'a, I, A>

§

impl<'a, I, A> Send for SpillStorage<'a, I, A>
where I: Send, A: Send,

§

impl<'a, I, A> Sync for SpillStorage<'a, I, A>
where I: Sync, A: Sync,

§

impl<'a, I, A> Unpin for SpillStorage<'a, I, A>
where I: Unpin, A: Unpin,

§

impl<'a, I, A> !UnwindSafe for SpillStorage<'a, I, 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, A> ToOwnedIn<A> for T
where T: Clone + 'static, A: Allocator,

Source§

type Owned = T

The owned representation of this type.
Source§

fn try_to_owned_in<I>( &self, _alloc_in: I, ) -> Result<<T as ToOwnedIn<A>>::Owned, StorageError>
where I: AllocateIn<Alloc = A>,

To to create an owned copy of this instance in a given allocation target.
Source§

fn to_owned_in<I>(&self, alloc_in: I) -> Self::Owned
where I: AllocateIn<Alloc = A>,

Create an owned copy of this instance in a given allocation target.
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.
Source§

impl<T, C> VecNewIn<T> for C
where C: AllocateIn,

Source§

type Config = <C as AllocateIn>::Alloc

The associated Vec configuration type.
Source§

fn buffer_try_new_in( self, capacity: <<C as VecNewIn<T>>::Config as VecConfig>::Index, exact: bool, ) -> Result<<<C as VecNewIn<T>>::Config as VecConfig>::Buffer<T>, StorageError>

Try to create a new buffer given an allocation target.