Struct l337::Conn[][src]

pub struct Conn<C> where
    C: ManageConnection,
    C::Connection: Send
{ pub conn: Option<Live<C::Connection>>, pub pool: Option<Pool<C>>, // some fields omitted }
Expand description

A smart wrapper around a connection which stores it back in the pool when it is dropped.

This can be dereferences to the Service instance this pool manages, and also implements Service itself by delegating.

Fields

conn: Option<Live<C::Connection>>

Actual connection. This should never become a None variant under normal operation. This is an option so we can take the connection on drop, and push it back into the pool

pool: Option<Pool<C>>

Underlying pool. A reference is stored here so we can push the connection back into the pool on drop. This should never become a None variant under normal operation. This is an option so we can take the connection on drop, and push it back into the pool

Trait Implementations

impl<C> Deref for Conn<C> where
    C: ManageConnection,
    C::Connection: Send
[src]

type Target = C::Connection

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<C> DerefMut for Conn<C> where
    C: ManageConnection,
    C::Connection: Send
[src]

fn deref_mut(&mut self) -> &mut Self::Target[src]

Mutably dereferences the value.

impl<C> Drop for Conn<C> where
    C: ManageConnection,
    C::Connection: Send
[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<C> !RefUnwindSafe for Conn<C>

impl<C> Send for Conn<C>

impl<C> Sync for Conn<C> where
    <C as ManageConnection>::Connection: Sync

impl<C> Unpin for Conn<C> where
    <C as ManageConnection>::Connection: Unpin

impl<C> !UnwindSafe for Conn<C>

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> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.