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 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)
.
Trait Implementations§
source§impl Debug for ConnectionBuilder
impl Debug for ConnectionBuilder
Auto Trait Implementations§
impl RefUnwindSafe for ConnectionBuilder
impl Send for ConnectionBuilder
impl Sync for ConnectionBuilder
impl Unpin for ConnectionBuilder
impl UnwindSafe for ConnectionBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more