Struct zenoh_sync::object_pool::RecyclingObjectPool
source · pub struct RecyclingObjectPool<T, F>where
F: Fn() -> T,{ /* private fields */ }Expand description
Provides a pool of pre-allocated objects that are automaticlaly reinserted into the pool when dropped.
Implementations§
source§impl<T, F: Fn() -> T> RecyclingObjectPool<T, F>
impl<T, F: Fn() -> T> RecyclingObjectPool<T, F>
pub fn new(num: usize, f: F) -> RecyclingObjectPool<T, F>
pub fn alloc(&self) -> RecyclingObject<T>
pub fn try_take(&self) -> Option<RecyclingObject<T>>
pub fn take(&self) -> RecyclingObject<T>
Auto Trait Implementations§
impl<T, F> Freeze for RecyclingObjectPool<T, F>where
F: Freeze,
impl<T, F> RefUnwindSafe for RecyclingObjectPool<T, F>where
F: RefUnwindSafe,
impl<T, F> Send for RecyclingObjectPool<T, F>
impl<T, F> Sync for RecyclingObjectPool<T, F>
impl<T, F> Unpin for RecyclingObjectPool<T, F>where
F: Unpin,
impl<T, F> UnwindSafe for RecyclingObjectPool<T, F>where
F: UnwindSafe,
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