pub struct LeasePool<T: Default + Reclaim> { /* private fields */ }Expand description
Pool of reusable values with single-cell items that are not cloneable.
Items stay in the pool while checked out; Self::acquire hands back a
LeaseHandle pointing at one and flags it leased. Dropping the handle reclaims the
value and frees the slot, so allocations are reused across acquires instead of allocating anew.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LeasePool<T>
impl<T> Freeze for LeasePool<T>
impl<T> Send for LeasePool<T>
impl<T> Sync for LeasePool<T>
impl<T> Unpin for LeasePool<T>
impl<T> UnsafeUnpin for LeasePool<T>
impl<T> UnwindSafe for LeasePool<T>where
T: 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