Struct sled_web::client::Client [−][src]
pub struct Client { /* fields omitted */ }A hyper Client wrapper that simplifies communication with the sled Tree server.
Methods
impl Client[src]
impl Clientpub fn new(uri: Uri) -> Self[src]
pub fn new(uri: Uri) -> SelfCreate a new Client pointing towards the given Uri.
The Uri should contain the Scheme and Authority parts of the URI but not the
following path. This following path will be created as necessary within each of the request
calls.
pub fn get(
&self,
key: Key
) -> impl Future<Item = Option<Value>, Error = Error>[src]
pub fn get(
&self,
key: Key
) -> impl Future<Item = Option<Value>, Error = Error>A method for performing the Get request.
Given the key for an entry in the sled::Tree, produce a Future with the value.
pub fn del(
&self,
key: Key
) -> impl Future<Item = Option<Value>, Error = Error>[src]
pub fn del(
&self,
key: Key
) -> impl Future<Item = Option<Value>, Error = Error>A method for performing the Del request.
Given the key for an entry in the sled::Tree, delete the entry and return a Future with
the removed value.
pub fn set(
&self,
key: Key,
value: Value
) -> impl Future<Item = (), Error = Error>[src]
pub fn set(
&self,
key: Key,
value: Value
) -> impl Future<Item = (), Error = Error>A method for performing the Set request.
Send the given key and value to the database for insertion into the sled::Tree.
pub fn cas(
&self,
key: Key,
old: Option<Value>,
new: Option<Value>
) -> impl Future<Item = Result<(), Option<Value>>, Error = Error>[src]
pub fn cas(
&self,
key: Key,
old: Option<Value>,
new: Option<Value>
) -> impl Future<Item = Result<(), Option<Value>>, Error = Error>A method for performing the Cas request.
Compare and swap. Capable of unique creation, conditional modification, or deletion.
If old is None, this will only set the value if it doesn't exist yet. If new is None, will delete the value if old is correct. If both old and new are Some, will modify the value if old is correct.
If Tree is read-only, will do nothing.
pub fn merge(
&self,
key: Key,
value: Value
) -> impl Future<Item = (), Error = Error>[src]
pub fn merge(
&self,
key: Key,
value: Value
) -> impl Future<Item = (), Error = Error>A method for performing the Merge request.
Merge a new value into the total state for a key.
pub fn flush(
&self
) -> impl Future<Item = (), Error = Error>[src]
pub fn flush(
&self
) -> impl Future<Item = (), Error = Error>A method for performing the Flush request.
Flushes any pending IO buffers to disk to ensure durability.
pub fn iter(
&self
) -> impl Stream<Item = Entry, Error = Error>[src]
pub fn iter(
&self
) -> impl Stream<Item = Entry, Error = Error>A method for performing the Iter request.
The result is a Stream of ordered key value pairs.
pub fn scan(
&self,
key: Key
) -> impl Stream<Item = Entry, Error = Error>[src]
pub fn scan(
&self,
key: Key
) -> impl Stream<Item = Entry, Error = Error>A method for performing the Scan request.
The result is a Stream of ordered key value pairs, starting from the given key.
pub fn scan_range(
&self,
start: Key,
end: Key
) -> impl Stream<Item = Entry, Error = Error>[src]
pub fn scan_range(
&self,
start: Key,
end: Key
) -> impl Stream<Item = Entry, Error = Error>A method for performing the Scan request.
The result is a Stream of all ordered key value pairs within the given key range.
pub fn max(
&self
) -> impl Future<Item = Option<Entry>, Error = Error>[src]
pub fn max(
&self
) -> impl Future<Item = Option<Entry>, Error = Error>A method for perfomring the Max request.
The result is a Future yielding the greatest entry in the sled::Tree.
Returns None if there are no entries within the tree.
pub fn pred(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>[src]
pub fn pred(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>A method for performing the Pred request.
Given the key for an entry in the sled::Tree, produce a Future with the preceding
entry.
pub fn pred_incl(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>[src]
pub fn pred_incl(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>A method for performing the PredIncl request.
Given the key for an entry in the sled::Tree, produce a Future with the preceding
entry or the entry associated with the key if there is one.
pub fn succ(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>[src]
pub fn succ(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>A method for performing the Succ request.
Given the key for an entry in the sled::Tree, produce a Future with the following
entry.
pub fn succ_incl(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>[src]
pub fn succ_incl(
&self,
key: Key
) -> impl Future<Item = Option<Entry>, Error = Error>A method for performing the SuccIncl request.
Given the key for an entry in the sled::Tree, produce a Future with the following
entry or the entry associated with the key if there is one.
Trait Implementations
impl Clone for Client[src]
impl Clone for Clientfn clone(&self) -> Client[src]
fn clone(&self) -> ClientReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Client[src]
impl Debug for Client