pub trait AsyncActions: AsyncSocket {
Show 19 methods fn dbsize<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<u64>> { ... }
fn del<'s>(
        &'s mut self,
        key: impl IntoSkyhashAction + 's
    ) -> AsyncResult<'_, SkyResult<u64>> { ... }
fn exists<'s>(
        &'s mut self,
        key: impl IntoSkyhashAction + 's
    ) -> AsyncResult<'_, SkyResult<u64>> { ... }
fn flushdb<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<()>> { ... }
fn get<'s, T: FromSkyhashBytes>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's
    ) -> AsyncResult<'_, SkyResult<T>> { ... }
fn keylen<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's
    ) -> AsyncResult<'_, SkyResult<u64>> { ... }
fn lskeys<'s, T: FromSkyhashBytes>(
        &'s mut self,
        count: u64
    ) -> AsyncResult<'_, SkyResult<T>> { ... }
fn mget<'s, T: FromSkyhashBytes>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> AsyncResult<'_, SkyResult<T>> { ... }
fn mksnap<'s>(&'s mut self) -> AsyncResult<'_, SkyResult<SnapshotResult>> { ... }
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>> { ... }
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>> { ... }
fn pop<'s, T: FromSkyhashBytes>(
        &'s mut self,
        keys: impl IntoSkyhashBytes + 's
    ) -> AsyncResult<'_, SkyResult<T>> { ... }
fn mpop<'s, T: FromSkyhashBytes>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> AsyncResult<'_, SkyResult<T>> { ... }
fn sdel<'s>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> AsyncResult<'_, SkyResult<bool>> { ... }
fn set<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's,
        value: impl IntoSkyhashBytes + '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>> { ... }
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>> { ... }
fn update<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's,
        value: impl IntoSkyhashBytes + 's
    ) -> AsyncResult<'_, SkyResult<()>> { ... }
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>> { ... }
}
This is supported on crate feature aio only.
Expand description

Actions that can be run on an [AsyncSocket] connection

Provided methods

Get the number of keys present in the database

Deletes a single or a number of keys

This is equivalent to:

DEL <k1> <k2> <k3> ...

This will return the number of keys that were deleted

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

This is equivalent to:

EXISTS <k1> <k2> <k3> ...

This will return the number of keys that do exist

Removes all the keys present in the database

Get the value of a key

This is equivalent to:

GET <key>

Get the length of a key

This is equivalent to:

KEYLEN <key>

Returns a vector of keys

This is equivalent to:

LSKEYS <count>

Do note that the order might be completely meaningless

Get multiple keys

This is equivalent to:

MGET <k1> <k2> ...

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

Creates a snapshot

This returns a SnapshotResult containing the result. The reason SnapshotResult is not an error is because mksnap might fail simply because an existing snapshot process was in progress which is normal behavior and not an inherent error

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

This is equivalent to:

MSET <k1> <v1> <k2> <v2> ...

with the only difference that you have to pass in the keys and values as separate objects

Panics

This method will panic if the number of keys and values are not equal

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

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

This is equivalent to:

MUPDATE <k1> <v1> <k2> <v2> ...

with the only difference that you have to pass in the keys and values as separate objects

Panics

This method will panic if the number of keys and values are not equal

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

Consumes a key if it exists

This will return the corresponding values of the provided key depending on the type for that table

This is equivalent to:

POP <key>

Consumes the provided keys if they exist

This is equivalent to:

MPOP <k1> <k2> <k3>

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

This is equivalent to:

SDEL <k1> <v1> <k2> <v2>

with the only difference that you have to pass in the keys and values as separate objects

Set the value of a key

This is equivalent to:

SET <k> <v>

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

This is equivalent to:

SSET <k1> <v1> <k2> <v2> ...

with the only difference that you have to pass in the keys and values as separate objects

Panics

This method will panic if the number of keys and values are not equal

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

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.

This is equivalent to:

SUPDATE <key1> <value1> <key2> <value2> ...

with the only difference that you have to pass in the keys and values as separate objects

Panics

This method will panic if the number of keys and values are not equal

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

Update the value of a key

This is equivalent to:

UPDATE <key> <value>

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

This is equivalent to:

USET <key1> <value1> <key2> <value2> ...

with the only difference that you have to pass in the keys and values as separate objects

Panics

This method will panic if the number of keys is not equal to the number of values

This method expects either: [T; N], &[T; N] or anything that derefs to &[T]

Implementors