pub struct BumpBuilder { /* private fields */ }Expand description
Builder for configuring a Bump allocator.
Implementations§
Source§impl BumpBuilder
impl BumpBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new BumpBuilder with default configuration.
Sourcepub fn threads_capacity(self, capacity: usize) -> Self
pub fn threads_capacity(self, capacity: usize) -> Self
Sets the initial capacity hint for the number of threads that will access this allocator.
This can reduce allocations in the underlying ThreadLocal storage when you know
how many threads will use the allocator.
Sourcepub fn bump_allocation_limit(self, limit: usize) -> Self
pub fn bump_allocation_limit(self, limit: usize) -> Self
Sets the allocation limit for each per-thread bump allocator.
Once the limit is reached, further allocations will fail.
Sourcepub fn bump_capacity(self, capacity: usize) -> Self
pub fn bump_capacity(self, capacity: usize) -> Self
Sets the initial capacity for each per-thread bump allocator.
This pre-allocates memory for each thread’s allocator, which can improve performance if you know approximately how much memory each thread will need.
Trait Implementations§
Source§impl Default for BumpBuilder
impl Default for BumpBuilder
Source§fn default() -> BumpBuilder
fn default() -> BumpBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BumpBuilder
impl RefUnwindSafe for BumpBuilder
impl Send for BumpBuilder
impl Sync for BumpBuilder
impl Unpin for BumpBuilder
impl UnwindSafe for BumpBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more