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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.