[][src]Struct lazy_async_pool::PoolGuard

pub struct PoolGuard<T: Send + 'static, F: Fn() -> U, U: Future<Output = Result<T, E>> + Unpin, E> { /* fields omitted */ }

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
    T: Send,
    F: Fn() -> U,
    U: Future<Output = Result<T, E>> + Unpin
[src]

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
    T: Send,
    F: Fn() -> U,
    U: Future<Output = Result<T, E>> + Unpin
[src]

type Target = T

The resulting type after dereferencing.

impl<T, F, U, E> DerefMut for PoolGuard<T, F, U, E> where
    T: Send,
    F: Fn() -> U,
    U: Future<Output = Result<T, E>> + Unpin
[src]

impl<T, F, U, E> Drop for PoolGuard<T, F, U, E> where
    T: Send,
    F: Fn() -> U,
    U: Future<Output = Result<T, E>> + Unpin
[src]

Auto Trait Implementations

impl<T, F, U, E> RefUnwindSafe for PoolGuard<T, F, U, E> where
    F: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, F, U, E> Send for PoolGuard<T, F, U, E> where
    F: Send + Sync

impl<T, F, U, E> Sync for PoolGuard<T, F, U, E> where
    F: Send + Sync,
    T: Sync

impl<T, F, U, E> Unpin for PoolGuard<T, F, U, E> where
    T: Unpin

impl<T, F, U, E> UnwindSafe for PoolGuard<T, F, U, E> where
    F: RefUnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.