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> { ... }
sync
only.Expand description
Actions that can be run on a [SyncSocket
] connection
Provided methods
fn dbsize<'s>(&'s mut self) -> ActionResult<usize>
fn dbsize<'s>(&'s mut self) -> ActionResult<usize>
Get the number of keys present in the database
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
fn del<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
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 + 's
) -> ActionResult<usize>
fn exists<'s>(
&'s mut self,
key: impl IntoSkyhashAction + 's
) -> ActionResult<usize>
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<()>
fn flushdb<'s>(&'s mut self) -> ActionResult<()>
Removes all the keys present in the database
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<String>
fn get<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<String>
Get the value of a key
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<usize>
fn keylen<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's
) -> ActionResult<usize>
Get the length of a key
fn lskeys<'s>(&'s mut self, count: usize) -> ActionResult<Vec<FlatElement>>
fn lskeys<'s>(&'s mut self, count: usize) -> ActionResult<Vec<FlatElement>>
Returns a vector of keys
Do note that the order might be completely meaningless
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Array>
fn mget<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Array>
Get multiple keys
This returns a vector of Element
s which either contain the values
as strings or contains Not Found (Code: 1)
response codes
fn mksnap<'s>(&'s mut self) -> ActionResult<SnapshotResult>
fn mksnap<'s>(&'s mut self) -> ActionResult<SnapshotResult>
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, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
fn mset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
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, 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>
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 pop<'s>(&'s mut self, keys: impl IntoSkyhashBytes + 's) -> ActionResult<Str>
fn pop<'s>(&'s mut self, keys: impl IntoSkyhashBytes + 's) -> ActionResult<Str>
Consumes a key if it exists
This should return either the corresponding values of the provided keys or Not Found
error codes
fn mpop<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Array>
fn mpop<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<Array>
Consumes the provided keys if they exist
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<bool>
fn sdel<'s>(
&'s mut self,
keys: impl IntoSkyhashAction + 's
) -> ActionResult<bool>
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 + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
fn set<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
Set the value of a key
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 sset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<bool>
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, 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>
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 + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
fn update<'s>(
&'s mut self,
key: impl IntoSkyhashBytes + 's,
value: impl IntoSkyhashBytes + 's
) -> ActionResult<()>
Update the value of a key
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
fn uset<'s, T: IntoSkyhashBytes + 's, U: IntoSkyhashBytes + 's>(
&'s mut self,
keys: impl GetIterator<T> + 's,
values: impl GetIterator<U> + 's
) -> ActionResult<usize>
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