pub struct RefGuard<'a, P: PoolAllocator<T>, T> { /* private fields */ }
Expand description
A struct representing a guard over an object in the pool.
This struct ensures that the object is returned to the pool when it is dropped.
Implementations§
source§impl<'a, P: PoolAllocator<T>, T> RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> RefGuard<'a, P, T>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the guard and returns the object, without returning it to the pool.
This method should be used with caution, as it leads to objects not being returned to the pool.
Trait Implementations§
source§impl<'a, P: PoolAllocator<T>, T> AsRef<T> for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> AsRef<T> for RefGuard<'a, P, T>
source§impl<'a, P: PoolAllocator<T>, T> Borrow<T> for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> Borrow<T> for RefGuard<'a, P, T>
source§impl<'a, P: PoolAllocator<T>, T> Deref for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> Deref for RefGuard<'a, P, T>
source§impl<'a, P: PoolAllocator<T>, T> DerefMut for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> DerefMut for RefGuard<'a, P, T>
source§impl<'a, P: PoolAllocator<T>, T> Drop for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> Drop for RefGuard<'a, P, T>
Implementation of the Drop trait for Guard.
This ensures that the object is returned to the pool when the guard is dropped, unless the object fails validation.
source§impl<'a, P: PoolAllocator<T>, T: Ord> Ord for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T: Ord> Ord for RefGuard<'a, P, T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a, P: PoolAllocator<T>, T: PartialEq> PartialEq<RefGuard<'a, P, T>> for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T: PartialEq> PartialEq<RefGuard<'a, P, T>> for RefGuard<'a, P, T>
source§impl<'a, P: PoolAllocator<T>, T: PartialOrd> PartialOrd<RefGuard<'a, P, T>> for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T: PartialOrd> PartialOrd<RefGuard<'a, P, T>> for RefGuard<'a, P, T>
source§fn le(&self, other: &RefGuard<'a, P, T>) -> bool
fn le(&self, other: &RefGuard<'a, P, T>) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a, P: PoolAllocator<T>, T> Pointer for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T> Pointer for RefGuard<'a, P, T>
impl<'a, P: PoolAllocator<T>, T: Eq> Eq for RefGuard<'a, P, T>
Auto Trait Implementations§
impl<'a, P, T> !RefUnwindSafe for RefGuard<'a, P, T>
impl<'a, P, T> Send for RefGuard<'a, P, T>where P: Sync, T: Send,
impl<'a, P, T> Sync for RefGuard<'a, P, T>where P: Sync, T: Send + Sync,
impl<'a, P, T> Unpin for RefGuard<'a, P, T>where T: Unpin,
impl<'a, P, T> !UnwindSafe for RefGuard<'a, P, 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