pub struct SizedPool<T: SizedAllocatable + DynamicReset> { /* private fields */ }Implementations§
Source§impl<T: SizedAllocatable + DynamicReset> SizedPool<T>
impl<T: SizedAllocatable + DynamicReset> SizedPool<T>
Sourcepub fn new(
cap: usize,
pool_size_power_of_two: u32,
max_pool_size: usize,
) -> Self
pub fn new( cap: usize, pool_size_power_of_two: u32, max_pool_size: usize, ) -> Self
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<DynamicPoolItem<T>, SizedPoolError>
Auto Trait Implementations§
impl<T> Freeze for SizedPool<T>
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>
impl<T> !UnwindSafe for SizedPool<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