Struct swimmer::PoolBuilder [−][src]
A pool builder, used to configure various pool settings.
Implementations
impl<T> PoolBuilder<T> where
T: Recyclable,
[src]
T: Recyclable,
pub fn with_starting_size(self, starting_size: usize) -> Self
[src]
See Pool::with_size
.
pub fn with_supplier<S>(self, supplier: S) -> Self where
S: Fn() -> T + Send + Sync + 'static,
[src]
S: Fn() -> T + Send + Sync + 'static,
Uses the given closure for initializing new objects in the pool.
pub fn build(self) -> Pool<T>
[src]
Builds a pool using the configured settings.
pub fn build_with(self, items: Vec<T>) -> Pool<T>
[src]
Builds a pool using the configured settings, and fill it with the given items.
Trait Implementations
impl<T> Default for PoolBuilder<T> where
T: Recyclable,
[src]
T: Recyclable,
Auto Trait Implementations
impl<T> !RefUnwindSafe for PoolBuilder<T>
[src]
impl<T> Send for PoolBuilder<T>
[src]
impl<T> Sync for PoolBuilder<T>
[src]
impl<T> Unpin for PoolBuilder<T>
[src]
impl<T> !UnwindSafe for PoolBuilder<T>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,