Struct deadpool_tiberius::Manager
source · pub struct Manager { /* private fields */ }
Expand description
Connection pool Manager served as Builder. Call create_pool
after filling out your configs.
Implementations§
source§impl Manager
impl Manager
sourcepub fn from_ado_string(conn_str: &str) -> SqlServerResult<Self>
pub fn from_ado_string(conn_str: &str) -> SqlServerResult<Self>
Create a new ConnectionPool Manager and fills connection configs from ado string.
For more details about ADO_String pleas refer to tiberius::Config::from_ado_string
and Connection Strings in ADO.NET
.
sourcepub fn from_jdbc_string(conn_str: &str) -> SqlServerResult<Self>
pub fn from_jdbc_string(conn_str: &str) -> SqlServerResult<Self>
Create new ConnectionPool Manager and fills connection config from jdbc string.
For more details about jdbc_string pls refer to Building JDBC connection URL
.
sourcepub fn create_pool(self) -> Result<Pool, SqlServerError>
pub fn create_pool(self) -> Result<Pool, SqlServerError>
Consume self, builds a pool.
sourcepub fn basic_authentication(
self,
username: impl ToString,
password: impl ToString
) -> Self
pub fn basic_authentication( self, username: impl ToString, password: impl ToString ) -> Self
Simplified authentication for those using username
and password
as login method.
sourcepub fn authentication(self, authentication: AuthMethod) -> Self
pub fn authentication(self, authentication: AuthMethod) -> Self
Set tiberius::AuthMethod
as authentication method.
sourcepub fn trust_cert(self) -> Self
pub fn trust_cert(self) -> Self
sourcepub fn encryption(self, encryption: EncryptionLevel) -> Self
pub fn encryption(self, encryption: EncryptionLevel) -> Self
Set tiberius::EncryptionLevel
as enctryption method.
sourcepub fn trust_cert_ca(self, path: impl ToString) -> Self
pub fn trust_cert_ca(self, path: impl ToString) -> Self
sourcepub fn instance_name(self, name: impl ToString) -> Self
pub fn instance_name(self, name: impl ToString) -> Self
Instance name defined in Sql Browser
, defaults to None.
sourcepub fn application_name(self, name: impl ToString) -> Self
pub fn application_name(self, name: impl ToString) -> Self
sourcepub fn wait_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
pub fn wait_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
Set timeout for when waiting for a connection object to become available.
sourcepub fn create_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
pub fn create_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
Set timeout for when creating a new connection object.
sourcepub fn recycle_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
pub fn recycle_timeout<T: Into<f64> + Copy>(self, value: T) -> Self
Set timeout for when recycling a connection object.
sourcepub fn pre_recycle_sync<T>(self, hook: T) -> Self
pub fn pre_recycle_sync<T>(self, hook: T) -> Self
Attach a sync fn
as hook to connection pool.
The hook will be called each time before a connection deadpool::managed::Object
is recycled.
sourcepub fn pre_recycle_async<T>(self, hook: T) -> Self
pub fn pre_recycle_async<T>(self, hook: T) -> Self
Attach an async fn
as hook to connection pool.
The hook will be called each time before a connection deadpool::managed::Object
is recycled.
sourcepub fn post_recycle_sync<T>(self, hook: T) -> Self
pub fn post_recycle_sync<T>(self, hook: T) -> Self
Attach a sync fn
as hook to connection pool.
The hook will be called each time af after a connection deadpool::managed::Object
is recycled.
sourcepub fn post_recycle_async<T>(self, hook: T) -> Self
pub fn post_recycle_async<T>(self, hook: T) -> Self
Attach an async fn
as hook to connection pool.
The hook will be called each time after a connection deadpool::managed::Object
is recycled.
sourcepub fn post_create_sync<T>(self, hook: T) -> Self
pub fn post_create_sync<T>(self, hook: T) -> Self
Attach a sync fn
as hook to connection pool.
The hook will be called each time after a connection deadpool::managed::Object
is created.
sourcepub fn post_create_async<T>(self, hook: T) -> Self
pub fn post_create_async<T>(self, hook: T) -> Self
Attach an async fn
as hook to connection pool.
The hook will be called each time after a connection deadpool::managed::Object
is created.
Trait Implementations§
source§impl Manager for Manager
impl Manager for Manager
source§fn create<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Client, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Client, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Manager::Type
.source§fn recycle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
obj: &'life1 mut Self::Type,
_metrics: &'life2 Metrics
) -> Pin<Box<dyn Future<Output = RecycleResult<Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn recycle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
obj: &'life1 mut Self::Type,
_metrics: &'life2 Metrics
) -> Pin<Box<dyn Future<Output = RecycleResult<Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Manager::Type
. Read more