Struct deadpool::managed::Object[][src]

pub struct Object<M: Manager> { /* fields omitted */ }
Expand description

A wrapper around the actual pooled object which implements the traits Deref, DerefMut and Drop. Use this object just as if it was of type T and upon leaving scope the drop function will take care of returning it to the pool.

Implementations

impl<M: Manager> Object<M>[src]

pub fn take(this: Self) -> M::Type[src]

Take this object from the pool permanently. This reduces the size of the pool.

Trait Implementations

impl<M: Manager> AsMut<<M as Manager>::Type> for Object<M>[src]

fn as_mut(&mut self) -> &mut M::Type[src]

Performs the conversion.

impl<M: Manager> AsRef<<M as Manager>::Type> for Object<M>[src]

fn as_ref(&self) -> &M::Type[src]

Performs the conversion.

impl<M: Manager> Deref for Object<M>[src]

type Target = M::Type

The resulting type after dereferencing.

fn deref(&self) -> &M::Type[src]

Dereferences the value.

impl<M: Manager> DerefMut for Object<M>[src]

fn deref_mut(&mut self) -> &mut M::Type[src]

Mutably dereferences the value.

impl<M: Manager> Drop for Object<M>[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<M> !RefUnwindSafe for Object<M>

impl<M> Send for Object<M> where
    M: Send + Sync,
    <M as Manager>::Type: Send

impl<M> Sync for Object<M> where
    M: Send + Sync,
    <M as Manager>::Type: Send + Sync

impl<M> Unpin for Object<M> where
    <M as Manager>::Type: Unpin

impl<M> !UnwindSafe for Object<M>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.