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
See [tiberius::Config::trust_cert]
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
See [tiberius::Config::trust_cert_ca]
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
See [tiberius::Config::application_name]
Sourcepub fn wait_timeout(self, value: Duration) -> Self
pub fn wait_timeout(self, value: Duration) -> Self
Set timeout for when waiting for a connection object to become available.
Sourcepub fn create_timeout(self, value: Duration) -> Self
pub fn create_timeout(self, value: Duration) -> Self
Set timeout for when creating a new connection object.
Sourcepub fn recycle_timeout(self, value: Duration) -> Self
pub fn recycle_timeout(self, value: Duration) -> 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