pub struct ConnectionBuilder { /* private fields */ }
Expand description

A connection builder for easily building connections

Example (sync)

use skytable::ConnectionBuilder;
let con =
    ConnectionBuilder::new()
    .set_host("127.0.0.1".to_string())
    .set_port(2003)
    .set_entity("mykeyspace:mytable".to_string())
    .get_connection()
    .unwrap();

Example (async)

use skytable::ConnectionBuilder;
async fn run() {
    let con =
        ConnectionBuilder::new()
        .set_host("127.0.0.1".to_string())
        .set_port(2003)
        .set_entity("mykeyspace:mytable".to_string())
        .get_async_connection()
        .await
        .unwrap();
}

Implementations

Create an empty connection builder

Set the port (defaults to 2003)

Set the host (defaults to localhost)

Set the entity (defaults to default:default)

This is supported on crate feature sync only.

Get a sync connection to the database

This is supported on crate feature sync and (crate features ssl or sslv) only.

Get a sync TLS connection to the database

This is supported on crate feature aio only.

Get an async connection to the database

This is supported on crate feature aio and (crate features aio-ssl or aio-sslv) only.

Get an async TLS connection to the database

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.