Struct tarantool::net_box::ConnOptions
source · [−]pub struct ConnOptions {
pub user: String,
pub password: String,
pub reconnect_after: Duration,
pub connect_timeout: Duration,
pub send_buffer_flush_interval: Duration,
pub send_buffer_limit: usize,
pub send_buffer_size: usize,
pub recv_buffer_size: usize,
}
Expand description
Connection options; see Conn::new()
Fields
user: String
Authentication user name. If left empty, then the session user is 'guest'
(the 'guest'
user does not need a password).
Example:
use tarantool::net_box::{Conn, ConnOptions};
Conn::new(
"localhost:3301",
ConnOptions {
user: "username".to_string(),
password: "userpassword".to_string(),
..ConnOptions::default()
},
None
);
password: String
Authentication password.
reconnect_after: Duration
If reconnect_after
is greater than zero, then a Conn instance will try to reconnect if a
connection is broken or if a connection attempt fails.
This makes transient network failures become transparent to the application. Reconnect happens automatically in the background, so requests that initially fail due to connectivity loss are transparently retried. The number of retries is unlimited, connection attempts are made after each specified interval When a connection is explicitly closed, or when connection object is dropped, then reconnect attempts stop.
connect_timeout: Duration
Duration to wait before returning “error: Connection timed out”.
send_buffer_flush_interval: Duration
Send buffer flush interval enforced in case of intensive requests stream.
Guarantied to be maximum while requests are going. Default: 10ms
send_buffer_limit: usize
Send buffer soft limit. If limit is reached, fiber will block before buffer flush.
Note: This mechanism will prevent buffer overflow in most cases (not at all). In case overflow, buffer reallocation will occurred, which may cause performance issues. Default: 64000
send_buffer_size: usize
Reallocated capacity of send buffer
Default: 65536
recv_buffer_size: usize
Reallocated capacity of receive buffer
Default: 65536
Trait Implementations
sourceimpl Clone for ConnOptions
impl Clone for ConnOptions
sourcefn clone(&self) -> ConnOptions
fn clone(&self) -> ConnOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ConnOptions
impl Send for ConnOptions
impl Sync for ConnOptions
impl Unpin for ConnOptions
impl UnwindSafe for ConnOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more