Struct tarantool_rs::ConnectionBuilder
source · pub struct ConnectionBuilder { /* private fields */ }Expand description
Build connection to Tarantool.
Implementations§
source§impl ConnectionBuilder
impl ConnectionBuilder
sourcepub async fn build<A>(&self, addr: A) -> Result<Connection, Error>where
A: ToSocketAddrs + Display + Clone + Send + Sync + 'static,
pub async fn build<A>(&self, addr: A) -> Result<Connection, Error>where A: ToSocketAddrs + Display + Clone + Send + Sync + 'static,
Create connection to Tarantool using provided address.
sourcepub fn auth<'a>(
&mut self,
user: &str,
password: impl Into<Option<&'a str>>
) -> &mut Self
pub fn auth<'a>( &mut self, user: &str, password: impl Into<Option<&'a str>> ) -> &mut Self
Sets user login and, optionally, password, used for this connection.
AUTH message sent upon connecting to server.
sourcepub fn timeout(&mut self, timeout: impl Into<Option<Duration>>) -> &mut Self
pub fn timeout(&mut self, timeout: impl Into<Option<Duration>>) -> &mut Self
Sets timeout for requests.
By default disabled.
sourcepub fn transaction_timeout(
&mut self,
transaction_timeout: impl Into<Option<Duration>>
) -> &mut Self
pub fn transaction_timeout( &mut self, transaction_timeout: impl Into<Option<Duration>> ) -> &mut Self
Sets default timeout for transactions.
By default disabled.
sourcepub fn transaction_isolation_level(
&mut self,
transaction_isolation_level: TransactionIsolationLevel
) -> &mut Self
pub fn transaction_isolation_level( &mut self, transaction_isolation_level: TransactionIsolationLevel ) -> &mut Self
Sets default transaction isolation level.
By default TransactionIsolationLevel::Default (i.e. use box.cfg default value).
sourcepub fn connect_timeout(
&mut self,
connect_timeout: impl Into<Option<Duration>>
) -> &mut Self
pub fn connect_timeout( &mut self, connect_timeout: impl Into<Option<Duration>> ) -> &mut Self
Sets timeout for connect.
By default disabled.
sourcepub fn reconnect_interval(
&mut self,
reconnect_interval: impl Into<Option<ReconnectInterval>>
) -> &mut Self
pub fn reconnect_interval( &mut self, reconnect_interval: impl Into<Option<ReconnectInterval>> ) -> &mut Self
Sets interval between reconnection attempts.
If disabled, next attempt wil lbe started as soon as last one finished.
By default set to ReconnectInterval::exponential_backoff(Duration::from_millis(1), Duration::from_secs(1), 0.5, 5.0).
sourcepub fn sql_statement_cache_capacity(&mut self, capacity: usize) -> &mut Self
pub fn sql_statement_cache_capacity(&mut self, capacity: usize) -> &mut Self
Sets capacity of SQL statment cache.
Setting 0 disables cache. By default set to 100.