pub trait BumpAllocatorSettings: Sealed {
Show 20 associated items
type MinimumAlignment: SupportedMinimumAlignment;
type Up: Boolean;
type GuaranteedAllocated: Boolean;
type Claimable: Boolean;
type Deallocates: Boolean;
type Shrinks: Boolean;
type WithMinimumAlignment<const NEW_MIN_ALIGN: usize>: BumpAllocatorSettings<MinimumAlignment = MinimumAlignment<NEW_MIN_ALIGN>, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
where MinimumAlignment<NEW_MIN_ALIGN>: SupportedMinimumAlignment;
type WithUp<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Bool<VALUE>, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>;
type WithGuaranteedAllocated<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Bool<VALUE>, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>;
type WithClaimable<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Bool<VALUE>, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>;
type WithDeallocates<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Bool<VALUE>, Shrinks = Self::Shrinks>;
type WithShrinks<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Bool<VALUE>>;
type WithMinimumChunkSize<const VALUE: usize>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>;
const MINIMUM_CHUNK_SIZE: usize;
const MIN_ALIGN: usize = <Self::MinimumAlignment>::VALUE;
const UP: bool = <Self::Up>::VALUE;
const GUARANTEED_ALLOCATED: bool = <Self::GuaranteedAllocated>::VALUE;
const CLAIMABLE: bool = <Self::Claimable>::VALUE;
const DEALLOCATES: bool = <Self::Deallocates>::VALUE;
const SHRINKS: bool = <Self::Shrinks>::VALUE;
}Expand description
The trait powering bump allocator configuration.
Read the module documentation to learn about the settings.
The setting values are provided as associated constants.
Additionally they are provided as types so they can be used in equality bounds like this:
S: BumpAllocatorSettings<GuaranteedAllocated = True>Doing the same with associated constants is not (yet) possible:
// won't compile on stable
S: BumpAllocatorSettings<GUARANTEED_ALLOCATED = true>In the future this trait could be simplified when the following features are stabilized:
Required Associated Constants§
Sourceconst MINIMUM_CHUNK_SIZE: usize
const MINIMUM_CHUNK_SIZE: usize
The minimum size for bump allocation chunk.
Provided Associated Constants§
Sourceconst GUARANTEED_ALLOCATED: bool = <Self::GuaranteedAllocated>::VALUE
const GUARANTEED_ALLOCATED: bool = <Self::GuaranteedAllocated>::VALUE
Whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Sourceconst DEALLOCATES: bool = <Self::Deallocates>::VALUE
const DEALLOCATES: bool = <Self::Deallocates>::VALUE
Whether the allocator tries to free allocations.
Required Associated Types§
Sourcetype MinimumAlignment: SupportedMinimumAlignment
type MinimumAlignment: SupportedMinimumAlignment
The minimum alignment.
Sourcetype GuaranteedAllocated: Boolean
type GuaranteedAllocated: Boolean
Whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Sourcetype Deallocates: Boolean
type Deallocates: Boolean
Whether the allocator tries to free allocations.
Sourcetype WithMinimumAlignment<const NEW_MIN_ALIGN: usize>: BumpAllocatorSettings<MinimumAlignment = MinimumAlignment<NEW_MIN_ALIGN>, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
where
MinimumAlignment<NEW_MIN_ALIGN>: SupportedMinimumAlignment
type WithMinimumAlignment<const NEW_MIN_ALIGN: usize>: BumpAllocatorSettings<MinimumAlignment = MinimumAlignment<NEW_MIN_ALIGN>, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks> where MinimumAlignment<NEW_MIN_ALIGN>: SupportedMinimumAlignment
Changes the minimum alignment.
Sourcetype WithUp<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Bool<VALUE>, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
type WithUp<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Bool<VALUE>, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
Changes the bump direction.
Sourcetype WithGuaranteedAllocated<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Bool<VALUE>, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
type WithGuaranteedAllocated<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Bool<VALUE>, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
Changes whether the allocator is guaranteed to have a chunk allocated and thus is allowed to create scopes.
Sourcetype WithClaimable<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Bool<VALUE>, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
type WithClaimable<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Bool<VALUE>, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
Changes whether the allocator can be claimed.
Sourcetype WithDeallocates<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Bool<VALUE>, Shrinks = Self::Shrinks>
type WithDeallocates<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Bool<VALUE>, Shrinks = Self::Shrinks>
Changes whether the allocator tries to free allocations.
Sourcetype WithShrinks<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Bool<VALUE>>
type WithShrinks<const VALUE: bool>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Bool<VALUE>>
Changes whether the allocator tries to shrink allocations.
Sourcetype WithMinimumChunkSize<const VALUE: usize>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
type WithMinimumChunkSize<const VALUE: usize>: BumpAllocatorSettings<MinimumAlignment = Self::MinimumAlignment, Up = Self::Up, GuaranteedAllocated = Self::GuaranteedAllocated, Claimable = Self::Claimable, Deallocates = Self::Deallocates, Shrinks = Self::Shrinks>
Changes the minimum chunk size.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.