Struct sized_object_pool::SizedPool[][src]

pub struct SizedPool<T: SizedAllocatable> { /* fields omitted */ }

Implementations

impl<T: SizedAllocatable> SizedPool<T>[src]

pub fn new(cap: usize, pool_size_power_of_two: u32) -> Self[src]

cap is the capacity of each subpool, pool_size_power_of_two is the number of subpools, init_fn takes the pool_size (the power of two) as input and outputs the reusable resource

pub fn try_pull(
    &self,
    size: usize
) -> Result<Option<Reusable<'_, T>>, SizedPoolError>
[src]

pub fn pull<F: Fn() -> T>(
    &self,
    size: usize
) -> Result<Reusable<'_, T>, SizedPoolError>
[src]

pub fn attach(&self, t: T) -> Result<(), SizedPoolError>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for SizedPool<T>

impl<T> Send for SizedPool<T> where
    T: Send

impl<T> Sync for SizedPool<T> where
    T: Send

impl<T> Unpin for SizedPool<T> where
    T: Unpin

impl<T> UnwindSafe for SizedPool<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.