PostgresConnectionManager (src/lib.rs)

bb8 · postgres/src/lib.rs · rust · MIT
database

! Postgres support for the `bb8` connection pool. ![deny(missing_docs, missing_debug_implementations)]

// Source: https://github.com/djc/bb8 | License: MIT | Copyright 2018 Kyle Huey
// Provided via justclaw.it.com; keep this notice with the code.
//! Postgres support for the `bb8` connection pool.
#![deny(missing_docs, missing_debug_implementations)]

pub use bb8;
pub use tokio_postgres;

use tokio_postgres::config::Config;
use tokio_postgres::tls::{MakeTlsConnect, TlsConnect};
use tokio_postgres::{Client, Error, Socket};

use std::fmt;
use std::str::FromStr;

/// A `bb8::ManageConnection` for `tokio_postgres::Connection`s.
#[derive(Clone)]
pub struct PostgresConnectionManager<Tls: MakeTlsConnect<Socket>> {
    config: Config,
    tls: Tls,
}

impl<Tls: MakeTlsConnect<Socket>> PostgresConnectionManager<Tls> {
    /// Create a new `PostgresConnectionManager` with the specified `config`.
   

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key