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

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

Actions that can be run on a [SyncSocket] connection

Provided methods

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

Get the number of keys present in the database

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

Deletes a single or a number of keys

This will return the number of keys that were deleted

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

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

This will return the number of keys that do exist

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

Removes all the keys present in the database

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

Get the value of a key

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

Get the length of a key

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

Returns a vector of keys

Do note that the order might be completely meaningless

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

Get multiple keys

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

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

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

fn mset<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction,
    values: impl IntoSkyhashAction
) -> ActionResult<usize>
[src]

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

fn mupdate<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction,
    values: impl IntoSkyhashAction
) -> ActionResult<usize>
[src]

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

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

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

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

Set the value of a key

fn sset<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction,
    values: impl IntoSkyhashAction
) -> ActionResult<bool>
[src]

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

fn supdate<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction,
    values: impl IntoSkyhashAction
) -> ActionResult<bool>
[src]

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

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

Update the value of a key

fn uset<'s>(
    &'s mut self,
    keys: impl IntoSkyhashAction,
    values: impl IntoSkyhashAction
) -> ActionResult<usize>
[src]

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

impl<T> Actions for T where
    T: SyncSocket, 
[src]