pub struct PooledObject<'a, T: Poolable> { /* private fields */ }Expand description
A pooled object that returns to the pool when dropped
This wrapper ensures that objects are automatically returned to their pool
when they go out of scope. It implements Deref and DerefMut to provide
transparent access to the underlying object.
§Automatic Cleanup
The object is automatically returned to the pool when the PooledObject
is dropped, ensuring proper resource management without manual intervention.
Trait Implementations§
Source§impl<'a, T: Poolable> Deref for PooledObject<'a, T>
impl<'a, T: Poolable> Deref for PooledObject<'a, T>
Source§impl<'a, T: Poolable> DerefMut for PooledObject<'a, T>
impl<'a, T: Poolable> DerefMut for PooledObject<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for PooledObject<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for PooledObject<'a, T>
impl<'a, T> Send for PooledObject<'a, T>
impl<'a, T> Sync for PooledObject<'a, T>where
T: Sync,
impl<'a, T> Unpin for PooledObject<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for PooledObject<'a, 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
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.