Skip to main content

AsClient

Trait AsClient 

Source
pub trait AsClient {
    // Required methods
    fn as_client(&self) -> &Client;
    fn as_client_mut(&mut self) -> &mut Client;
}
Expand description

The clients a Client can wrap: tokio-postgres’s own, and with the deadpool-postgres feature, a client taken from a deadpool pool.

Required Methods§

Source

fn as_client(&self) -> &Client

tokio-postgres’s client.

Source

fn as_client_mut(&mut self) -> &mut Client

tokio-postgres’s client, mutably, for starting transactions.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsClient for Client

Source§

fn as_client(&self) -> &Client

Source§

fn as_client_mut(&mut self) -> &mut Client

Source§

impl AsClient for Object

Source§

fn as_client(&self) -> &Client

Source§

fn as_client_mut(&mut self) -> &mut Client

Implementors§