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

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more