Trait skytable::actions::Actions[][src]

pub trait Actions: SyncSocket {
Show 19 methods fn dbsize<'s>(&'s mut self) -> ActionResult<usize> { ... }
fn del<'s>(
        &'s mut self,
        key: impl IntoSkyhashAction + 's
    ) -> ActionResult<usize> { ... }
fn exists<'s>(
        &'s mut self,
        key: impl IntoSkyhashAction + 's
    ) -> ActionResult<usize> { ... }
fn flushdb<'s>(&'s mut self) -> ActionResult<()> { ... }
fn get<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's
    ) -> ActionResult<String> { ... }
fn keylen<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's
    ) -> ActionResult<usize> { ... }
fn lskeys<'s>(&'s mut self, count: usize) -> ActionResult<Vec<FlatElement>> { ... }
fn mget<'s>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> ActionResult<Array> { ... }
fn mksnap<'s>(&'s mut self) -> ActionResult<SnapshotResult> { ... }
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
        &'s mut self,
        keys: impl GetIterator<T> + 's,
        values: impl GetIterator<U> + 's
    ) -> ActionResult<usize> { ... }
fn mupdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
        &'s mut self,
        keys: impl GetIterator<T> + 's,
        values: impl GetIterator<U> + 's
    ) -> ActionResult<usize> { ... }
fn pop<'s>(
        &'s mut self,
        keys: impl IntoSkyhashBytes + 's
    ) -> ActionResult<Str> { ... }
fn mpop<'s>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> ActionResult<Array> { ... }
fn sdel<'s>(
        &'s mut self,
        keys: impl IntoSkyhashAction + 's
    ) -> ActionResult<bool> { ... }
fn set<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's,
        value: impl IntoSkyhashBytes + 's
    ) -> ActionResult<()> { ... }
fn sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
        &'s mut self,
        keys: impl GetIterator<T> + 's,
        values: impl GetIterator<U> + 's
    ) -> ActionResult<bool> { ... }
fn supdate<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
        &'s mut self,
        keys: impl GetIterator<T> + 's,
        values: impl GetIterator<U> + 's
    ) -> ActionResult<bool> { ... }
fn update<'s>(
        &'s mut self,
        key: impl IntoSkyhashBytes + 's,
        value: impl IntoSkyhashBytes + 's
    ) -> ActionResult<()> { ... }
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
        &'s mut self,
        keys: impl GetIterator<T> + 's,
        values: impl GetIterator<U> + 's
    ) -> ActionResult<usize> { ... }
}
This is supported on crate feature sync only.
Expand description

Actions that can be run on a [SyncSocket] connection

Provided methods

Get the number of keys present in the database

Deletes a single or a number of keys

This will return the number of keys that were deleted

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

This will return the number of keys that do exist

Removes all the keys present in the database

Get the value of a key

Get the length of a key

Returns a vector of keys

Do note that the order might be completely meaningless

Get multiple keys

This returns a vector of Elements which either contain the values as strings or contains Not Found (Code: 1) response codes

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

Panics

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

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

Panics

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

Consumes a key if it exists

This should return either the corresponding values of the provided keys or Not Found error codes

Consumes the provided keys if they exist

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

Set the value of a key

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

Panics

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

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

Panics

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

Update the value of a key

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

Panics

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

Implementors