Struct skytable::ConnectionBuilder
source · [−]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
sourceimpl ConnectionBuilder
impl ConnectionBuilder
sourcepub fn set_entity(self, entity: String) -> Self
pub fn set_entity(self, entity: String) -> Self
Set the entity (defaults to default:default)
sourcepub fn get_connection(&self) -> SkyResult<Connection>
Available on crate feature sync only.
pub fn get_connection(&self) -> SkyResult<Connection>
sync only.Get a sync connection to the database
sourcepub fn get_tls_connection(&self, sslcert: String) -> SkyResult<TlsConnection>
Available on crate feature sync and (crate features ssl or sslv) only.
pub fn get_tls_connection(&self, sslcert: String) -> SkyResult<TlsConnection>
sync and (crate features ssl or sslv) only.Get a sync TLS connection to the database
sourcepub async fn get_async_connection(&self) -> SkyResult<Connection>
Available on crate feature aio only.
pub async fn get_async_connection(&self) -> SkyResult<Connection>
aio only.Get an async connection to the database
sourcepub async fn get_async_tls_connection(
&self,
sslcert: String
) -> SkyResult<TlsConnection>
Available on crate feature aio and (crate features aio-ssl or aio-sslv) only.
pub async fn get_async_tls_connection(
&self,
sslcert: String
) -> SkyResult<TlsConnection>
aio and (crate features aio-ssl or aio-sslv) only.Get an async TLS connection to the database
Trait Implementations
sourceimpl Clone for ConnectionBuilder
impl Clone for ConnectionBuilder
sourcefn clone(&self) -> ConnectionBuilder
fn clone(&self) -> ConnectionBuilder
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
sourceimpl 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
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more