Struct deadpool_postgres::Manager[][src]

pub struct Manager {
    pub statement_caches: StatementCaches,
    // some fields omitted
}
Expand description

The manager for creating and recyling postgresql connections

Fields

statement_caches: StatementCaches

This field provides access to the statement caches of clients handed out by the pool.

Implementations

impl Manager[src]

pub fn new<T>(pg_config: Config, tls: T) -> Manager where
    T: MakeTlsConnect<Socket> + Clone + Sync + Send + 'static,
    T::Stream: Sync + Send,
    T::TlsConnect: Sync + Send,
    <T::TlsConnect as TlsConnect<Socket>>::Future: Send
[src]

Create manager using a tokio_postgres::Config and a TlsConnector.

pub fn from_config<T>(
    pg_config: Config,
    tls: T,
    config: ManagerConfig
) -> Manager where
    T: MakeTlsConnect<Socket> + Clone + Sync + Send + 'static,
    T::Stream: Sync + Send,
    T::TlsConnect: Sync + Send,
    <T::TlsConnect as TlsConnect<Socket>>::Future: Send
[src]

Create manager using a tokio_postgres::Config and a TlsConnector and deadpool_postgres::ManagerConfig.

Trait Implementations

impl Manager for Manager[src]

type Type = ClientWrapper

Type that the manager creates and recycles.

type Error = Error

The error that the manager can return when creating and recycling objects. Read more

fn create<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<ClientWrapper, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Create a new instance of Type

fn recycle<'life0, 'life1, 'async_trait>(
    &'life0 self,
    client: &'life1 mut ClientWrapper
) -> Pin<Box<dyn Future<Output = RecycleResult<Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Try to recycle an instance of Type returning an Error if the object could not be recycled. Read more

fn detach(&self, object: &mut ClientWrapper)[src]

Detach an instance of Type from this manager. This method is called when using the Object::take function for removing an object from the pool. If the manager doesn’t hold any references to the handed out objects the default implementation can be used which does nothing. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Manager

impl Send for Manager

impl Sync for Manager

impl Unpin for Manager

impl !UnwindSafe for Manager

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V