pub struct PoolGuard<'a, T> { /* private fields */ }Expand description
RAII guard that returns an object to the pool when dropped
This ensures objects are automatically returned to the pool even if an error occurs or early return happens.
The guard uses ManuallyDrop internally to avoid double-drop issues
when converting to the inner value.
Implementations§
Source§impl<'a, T> PoolGuard<'a, T>
impl<'a, T> PoolGuard<'a, T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the guard and returns the inner object without returning to pool
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for PoolGuard<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for PoolGuard<'a, T>
impl<'a, T> !Send for PoolGuard<'a, T>
impl<'a, T> !Sync for PoolGuard<'a, T>
impl<'a, T> Unpin for PoolGuard<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for PoolGuard<'a, T>where
T: UnsafeUnpin,
impl<'a, T> !UnwindSafe for PoolGuard<'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