Struct skytable::aio::Connection
source · [−]pub struct Connection { /* private fields */ }aio only.Expand description
An asynchronous database connection over Skyhash/TCP
Implementations
sourceimpl Connection
impl Connection
sourceimpl Connection
impl Connection
sourcepub async fn run_query<T: FromSkyhashBytes, Q: AsRef<Query>>(
&mut self,
query: Q
) -> SkyResult<T>
pub async fn run_query<T: FromSkyhashBytes, Q: AsRef<Query>>(
&mut self,
query: Q
) -> SkyResult<T>
Runs a query using Self::run_query_raw and attempts to return a type provided by the user
sourcepub async fn run_query_raw<Q: AsRef<Query>>(
&mut self,
query: Q
) -> SkyResult<Element>
pub async fn run_query_raw<Q: AsRef<Query>>(
&mut self,
query: Q
) -> SkyResult<Element>
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 Error 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)
pub async fn run_simple_query(&mut self, query: &Query) -> SkyQueryResult
this will be removed in a future release. consider using run_query_raw instead
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
sourceimpl<T> AsyncActions for T where
T: AsyncSocket,
impl<T> AsyncActions for T where
T: AsyncSocket,
sourcefn dbsize<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<u64>>
fn dbsize<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<u64>>
aio only.Get the number of keys present in the database
sourcefn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Deletes a single or a number of keys Read more
sourcefn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Checks if a key (or keys) exist(s) Read more
sourcefn flushdb<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<()>>
fn flushdb<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<()>>
aio only.Removes all the keys present in the database
sourcefn get<'s, T: FromSkyhashBytes>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<T>>
fn get<'s, T: FromSkyhashBytes>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<T>>
aio only.Get the value of a key Read more
sourcefn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Get the length of a key Read more
sourcefn lskeys<'s, T: FromSkyhashBytes>(
&'s mut self,
count: u64
) -> AsyncResult<'_, SkyResult<T>>
fn lskeys<'s, T: FromSkyhashBytes>(
&'s mut self,
count: u64
) -> AsyncResult<'_, SkyResult<T>>
aio only.Returns a vector of keys Read more
sourcefn mget<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<T>>
fn mget<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<T>>
aio only.Get multiple keys Read more
sourcefn mksnap<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<SnapshotResult>>
fn mksnap<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<SnapshotResult>>
aio only.Creates a snapshot Read more
sourcefn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Sets the value of multiple keys and values and returns the number of keys that were set Read more
sourcefn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Updates the value of multiple keys and values and returns the number of keys that were updated Read more
sourcefn pop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<T>>
fn pop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<T>>
aio only.Consumes a key if it exists Read more
sourcefn mpop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<T>>
fn mpop<'s, T: FromSkyhashBytes>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<T>>
aio only.Consumes the provided keys if they exist Read more
sourcefn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio 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
sourcefn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio only.Set the value of a key Read more
sourcefn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio 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
sourcefn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio 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
sourcefn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<()>>
fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<()>>
aio only.Update the value of a key Read more
sourcefn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> AsyncResult<'_, SkyResult<u64>>
aio only.Updates or sets all the provided keys and returns the number of keys that were set Read more
sourceimpl<T> AsyncDdl for T where
T: AsyncSocket,
impl<T> AsyncDdl for T where
T: AsyncSocket,
sourcefn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> AsyncResult<'_, SkyResult<()>>
fn switch<'s, T: IntoSkyhashBytes + 's>(
&'s mut self,
entity: T
) -> AsyncResult<'_, SkyResult<()>>
aio only.This function switches to the provided entity. Read more
sourcefn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn create_keyspace<'s>(
&'s mut self,
ks: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio only.Create the provided keyspace Read more
sourcefn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> AsyncResult<'_, SkyResult<()>>
fn create_table<'s>(
&'s mut self,
table: impl CreateTableIntoQuery + 's
) -> AsyncResult<'_, SkyResult<()>>
aio only.Create a table from the provided configuration
sourcefn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
fn drop_table<'s>(
&'s mut self,
table: impl IntoSkyhashBytes + 's
) -> AsyncResult<'_, SkyResult<bool>>
aio only.Drop the provided table Read more
sourcefn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> AsyncResult<'_, SkyResult<()>>
fn drop_keyspace<'s>(
&'s mut self,
keyspace: impl IntoSkyhashBytes + 's,
force: bool
) -> AsyncResult<'_, SkyResult<()>>
aio only.Drop the provided keyspace Read more
sourcefn whereami<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<WhereAmI>>
fn whereami<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<WhereAmI>>
aio only.Check what keyspace this connection is currently connected to
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