Struct skytable::AsyncConnection [−][src]
pub struct AsyncConnection { /* fields omitted */ }
Expand description
An async connection object that wraps around aTcpStream
and a read buffer
Implementations
impl Connection
[src]
impl Connection
[src]pub async fn new(host: &str, port: u16) -> IoResult<Self>
[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]
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
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
Blanket Implementations
impl<T> AsyncActions for T where
T: AsyncSocket,
[src]
impl<T> AsyncActions for T where
T: AsyncSocket,
[src]fn dbsize<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn dbsize<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Get the number of keys present in the database
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Deletes a single or a number of keys Read more
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Checks if a key (or keys) exist(s) Read more
fn flushdb<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<()>>
[src]
fn flushdb<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<()>>
[src]async
only.Removes all the keys present in the database
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<String>>
[src]
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<String>>
[src]async
only.Get the value of a key
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Get the length of a key
fn lskeys<'s>(
&'s mut self,
count: usize
) -> AsyncResult<'_, ActionResult<Vec<String>>>
[src]
fn lskeys<'s>(
&'s mut self,
count: usize
) -> AsyncResult<'_, ActionResult<Vec<String>>>
[src]async
only.Returns a vector of keys Read more
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<Vec<Element>>>
[src]
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<Vec<Element>>>
[src]async
only.Get multiple keys Read more
fn mksnap<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<SnapshotResult>>
[src]
fn mksnap<'s>(&'s mut self) -> AsyncResult<'_, ActionResult<SnapshotResult>>
[src]async
only.Creates a snapshot Read more
fn mset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn mset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Sets the value of multiple keys and values and returns the number of keys that were set Read more
fn mupdate<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn mupdate<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]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
) -> AsyncResult<'_, ActionResult<bool>>
[src]
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<bool>>
[src]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,
value: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<()>>
[src]
fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes,
value: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<()>>
[src]async
only.Set the value of a key
fn sset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<bool>>
[src]
fn sset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<bool>>
[src]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>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<bool>>
[src]
fn supdate<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<bool>>
[src]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,
value: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<()>>
[src]
fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes,
value: impl IntoSkyhashBytes
) -> AsyncResult<'_, ActionResult<()>>
[src]async
only.Update the value of a key
fn uset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]
fn uset<'s>(
&'s mut self,
keys: impl IntoSkyhashAction,
values: impl IntoSkyhashAction
) -> AsyncResult<'_, ActionResult<usize>>
[src]async
only.Updates or sets all the provided keys and returns the number of keys that were set Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more