Struct skytable::AsyncConnection[][src]

pub struct AsyncConnection { /* fields omitted */ }
This is supported on crate feature async only.
Expand description

An async connection object that wraps around aTcpStream and a read buffer

Implementations

impl Connection[src]

pub async fn new(host: &str, port: u16) -> IoResult<Self>[src]

Create a new connection to a Skytable instance hosted on host and running on port

pub async fn run_simple_query(&mut self, query: &Query) -> IoResult<Response>[src]

This function will write a Query to the stream and read the response from the server. It will then determine if the returned response is complete or incomplete or invalid and return an appropriate variant of Response wrapped in IoResult for any I/O errors that may occur

Panics

This method will panic if the Query supplied is empty (i.e has no arguments)

Trait Implementations

impl Debug for Connection[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> AsyncActions for T where
    T: AsyncSocket, 
[src]

fn dbsize<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<usize>>[src]

This is supported on crate feature async only.

Get the number of keys present in the database

fn del<'s>(
    &'s mut self,
    key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Deletes a single or a number of keys Read more

fn exists<'s>(
    &'s mut self,
    key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Checks if a key (or keys) exist(s) Read more

fn flushdb<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<()>>[src]

This is supported on crate feature async only.

Removes all the keys present in the database

fn get<'s>(
    &'s mut self,
    key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, ActionResult<String>>
[src]

This is supported on crate feature async only.

Get the value of a key

fn keylen<'s>(
    &'s mut self,
    key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Get the length of a key

fn lskeys<'s>(
    &'s mut self,
    count: usize
) -> AsyncResult<'_, ActionResult<Vec<String>>>
[src]

This is supported on crate feature async only.

Returns a vector of keys Read more

fn mget<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, ActionResult<Vec<Element>>>
[src]

This is supported on crate feature async only.

Get multiple keys Read more

fn mksnap<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<SnapshotResult>>[src]

This is supported on crate feature async only.

Creates a snapshot Read more

fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
    &'s mut self,
    keys: impl GetIterator<T> + 's,
    values: impl GetIterator<U> + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Sets the value of multiple keys and values and returns the number of keys that were set Read more

fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
    &'s mut self,
    keys: impl GetIterator<T> + 's,
    values: impl GetIterator<U> + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Updates the value of multiple keys and values and returns the number of keys that were updated Read more

fn sdel<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, ActionResult<bool>>
[src]

This is supported on crate feature async only.

Deletes all the provided keys if they exist or doesn’t do anything at all. This method will return true if all the provided keys were deleted, else it will return false Read more

fn set<'s>(
    &'s mut self,
    key: impl IntoSkyhashBytes + 's,
    value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, ActionResult<()>>
[src]

This is supported on crate feature async only.

Set the value of a key

fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
    &'s mut self,
    keys: impl GetIterator<T> + 's,
    values: impl GetIterator<U> + 's
) -> AsyncResult<'_, ActionResult<bool>>
[src]

This is supported on crate feature async only.

Sets the value of all the provided keys or does nothing. This method will return true if all the keys were set or will return false if none were set Read more

fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
    &'s mut self,
    keys: impl GetIterator<T> + 's,
    values: impl GetIterator<U> + 's
) -> AsyncResult<'_, ActionResult<bool>>
[src]

This is supported on crate feature async only.

Updates the value of all the provided keys or does nothing. This method will return true if all the keys were updated or will return false if none were updated Read more

fn update<'s>(
    &'s mut self,
    key: impl IntoSkyhashBytes + 's,
    value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, ActionResult<()>>
[src]

This is supported on crate feature async only.

Update the value of a key

fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
    &'s mut self,
    keys: impl GetIterator<T> + 's,
    values: impl GetIterator<U> + 's
) -> AsyncResult<'_, ActionResult<usize>>
[src]

This is supported on crate feature async only.

Updates or sets all the provided keys and returns the number of keys that were set Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.