Skip to main content

BumpSettings

Struct BumpSettings 

Source
pub struct BumpSettings<const MIN_ALIGN: usize = 1, const UP: bool = true, const GUARANTEED_ALLOCATED: bool = true, const CLAIMABLE: bool = true, const DEALLOCATES: bool = true, const SHRINKS: bool = true, const MINIMUM_CHUNK_SIZE: usize = 512>;
Expand description

Implementor of BumpAllocatorSettings.

See the module documentation for how to use this type.

Trait Implementations§

Source§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> BumpAllocatorSettings for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

Source§

const MINIMUM_CHUNK_SIZE: usize = MINIMUM_CHUNK_SIZE

The minimum size for bump allocation chunk.
Source§

type MinimumAlignment = MinimumAlignment<MIN_ALIGN>

The minimum alignment.
Source§

type Up = Bool<UP>

The bump direction.
Source§

type GuaranteedAllocated = Bool<GUARANTEED_ALLOCATED>

Whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Source§

type Claimable = Bool<CLAIMABLE>

Whether the allocator can be claimed.
Source§

type Deallocates = Bool<DEALLOCATES>

Whether the allocator tries to free allocations.
Source§

type Shrinks = Bool<SHRINKS>

Whether the allocator tries to shrink allocations.
Source§

type WithMinimumAlignment<const VALUE: usize> = BumpSettings<VALUE, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE> where MinimumAlignment<VALUE>: SupportedMinimumAlignment

Changes the minimum alignment.
Source§

type WithUp<const VALUE: bool> = BumpSettings<MIN_ALIGN, VALUE, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

Changes the bump direction.
Source§

type WithGuaranteedAllocated<const VALUE: bool> = BumpSettings<MIN_ALIGN, UP, VALUE, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

Changes whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Source§

type WithClaimable<const VALUE: bool> = BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, VALUE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

Changes whether the allocator can be claimed.
Source§

type WithDeallocates<const VALUE: bool> = BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, VALUE, SHRINKS, MINIMUM_CHUNK_SIZE>

Changes whether the allocator tries to free allocations.
Source§

type WithShrinks<const VALUE: bool> = BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, VALUE, MINIMUM_CHUNK_SIZE>

Changes whether the allocator tries to shrink allocations.
Source§

type WithMinimumChunkSize<const VALUE: usize> = BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, VALUE>

Changes the minimum chunk size.
Source§

const MIN_ALIGN: usize = <Self::MinimumAlignment>::VALUE

The minimum alignment.
Source§

const UP: bool = <Self::Up>::VALUE

The bump direction.
Source§

const GUARANTEED_ALLOCATED: bool = <Self::GuaranteedAllocated>::VALUE

Whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Source§

const CLAIMABLE: bool = <Self::Claimable>::VALUE

Whether the allocator can be claimed.
Source§

const DEALLOCATES: bool = <Self::Deallocates>::VALUE

Whether the allocator tries to free allocations.
Source§

const SHRINKS: bool = <Self::Shrinks>::VALUE

Whether the allocator tries to shrink allocations.

Auto Trait Implementations§

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> Freeze for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> RefUnwindSafe for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> Send for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> Sync for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> Unpin for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

§

impl<const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const CLAIMABLE: bool, const DEALLOCATES: bool, const SHRINKS: bool, const MINIMUM_CHUNK_SIZE: usize> UnwindSafe for BumpSettings<MIN_ALIGN, UP, GUARANTEED_ALLOCATED, CLAIMABLE, DEALLOCATES, SHRINKS, MINIMUM_CHUNK_SIZE>

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.