[−][src]Struct lazy_async_pool::PoolGuard
Guard around an item checked out from the pool. Will return the item to the pool when dropped.
Implementations
impl<T, F, U, E> PoolGuard<T, F, U, E> where
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
[src]
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
pub fn mark_dirty(&mut self)
[src]
Marks a resource as being in a dirty state. If it is dropped while in a dirty state, it will be destroyed instead of returned to the pool.
pub fn mark_clean(&mut self)
[src]
Marks a resource as no longer being dirty.
pub fn detach(self) -> T
[src]
Detaches the item from the pool so it is not returned. If the pool is bounded, will allow the pool to generate a new object to replace it.
pub fn destroy(self)
[src]
Destroys the item instead of returning it to the pool.
Trait Implementations
impl<T, F, U, E> Deref for PoolGuard<T, F, U, E> where
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
[src]
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
impl<T, F, U, E> DerefMut for PoolGuard<T, F, U, E> where
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
[src]
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
impl<T, F, U, E> Drop for PoolGuard<T, F, U, E> where
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
[src]
F: Fn() -> U,
U: Future<Output = Result<T, E>> + Unpin,
Auto Trait Implementations
impl<T, F, U, E> RefUnwindSafe for PoolGuard<T, F, U, E> where
F: RefUnwindSafe,
T: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F, U, E> Send for PoolGuard<T, F, U, E> where
F: Send + Sync,
T: Send,
F: Send + Sync,
T: Send,
impl<T, F, U, E> Sync for PoolGuard<T, F, U, E> where
F: Send + Sync,
T: Send + Sync,
F: Send + Sync,
T: Send + Sync,
impl<T, F, U, E> Unpin for PoolGuard<T, F, U, E> where
T: Unpin,
T: Unpin,
impl<T, F, U, E> UnwindSafe for PoolGuard<T, F, U, E> where
F: RefUnwindSafe,
T: UnwindSafe,
F: RefUnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,