[][src]Trait bb8::ManageConnection

pub trait ManageConnection: Send + Sync + 'static {
    type Connection: Send + 'static;
    type Error: Send + 'static;
    fn connect(
        &self
    ) -> Box<dyn Future<Item = Self::Connection, Error = Self::Error> + Send>;
fn is_valid(
        &self,
        conn: Self::Connection
    ) -> Box<dyn Future<Item = Self::Connection, Error = (Self::Error, Self::Connection)> + Send>;
fn has_broken(&self, conn: &mut Self::Connection) -> bool; }

A trait which provides connection-specific functionality.

Associated Types

type Connection: Send + 'static

The connection type this manager deals with.

type Error: Send + 'static

The error type returned by Connections.

Loading content...

Required methods

fn connect(
    &self
) -> Box<dyn Future<Item = Self::Connection, Error = Self::Error> + Send>

Attempts to create a new connection.

fn is_valid(
    &self,
    conn: Self::Connection
) -> Box<dyn Future<Item = Self::Connection, Error = (Self::Error, Self::Connection)> + Send>

Determines if the connection is still connected to the database.

fn has_broken(&self, conn: &mut Self::Connection) -> bool

Synchronously determine if the connection is no longer usable, if possible.

Loading content...

Implementors

Loading content...