pub struct PoolBuilder<T: Recyclable> { /* private fields */ }
Expand description
A pool builder, used to configure various pool settings.
Implementations§
Source§impl<T> PoolBuilder<T>where
T: Recyclable,
impl<T> PoolBuilder<T>where
T: Recyclable,
Sourcepub fn with_starting_size(self, starting_size: usize) -> Self
pub fn with_starting_size(self, starting_size: usize) -> Self
See Pool::with_size
.
Sourcepub fn with_supplier<S>(self, supplier: S) -> Self
pub fn with_supplier<S>(self, supplier: S) -> Self
Uses the given closure for initializing new objects in the pool.
Sourcepub fn build_with(self, items: Vec<T>) -> Pool<T>
pub fn build_with(self, items: Vec<T>) -> Pool<T>
Builds a pool using the configured settings, and fill it with the given items.
Trait Implementations§
Source§impl<T> Default for PoolBuilder<T>where
T: Recyclable,
impl<T> Default for PoolBuilder<T>where
T: Recyclable,
Auto Trait Implementations§
impl<T> Freeze for PoolBuilder<T>
impl<T> !RefUnwindSafe for PoolBuilder<T>
impl<T> Send for PoolBuilder<T>
impl<T> Sync for PoolBuilder<T>
impl<T> Unpin for PoolBuilder<T>
impl<T> !UnwindSafe for PoolBuilder<T>
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