Trait taos_query::TBuilder

source ·
pub trait TBuilder: Sized + Send + Sync + 'static {
    type Target: Send + Sync + 'static;

    // Required methods
    fn available_params() -> &'static [&'static str];
    fn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>;
    fn client_version() -> &'static str;
    fn ping(&self, _: &mut Self::Target) -> RawResult<()>;
    fn ready(&self) -> bool;
    fn build(&self) -> RawResult<Self::Target>;
}
Expand description

A struct is Connectable when it can be build from a Dsn.

Required Associated Types§

source

type Target: Send + Sync + 'static

Required Methods§

source

fn available_params() -> &'static [&'static str]

A list of parameters available in DSN.

source

fn from_dsn<D: IntoDsn>(dsn: D) -> RawResult<Self>

Connect with dsn without connection checking.

source

fn client_version() -> &'static str

Get client version.

source

fn ping(&self, _: &mut Self::Target) -> RawResult<()>

Check a connection is still alive.

source

fn ready(&self) -> bool

Check if it’s ready to connect.

In most cases, just return true. r2d2 will use this method to check if it’s valid to create a connection. Just check the address is ready to connect.

source

fn build(&self) -> RawResult<Self::Target>

Create a new connection from this struct.

Object Safety§

This trait is not object safe.

Implementors§