Struct gauc::client::Client
[−]
[src]
pub struct Client { pub opts: Option<Arc<Mutex<CreateSt>>>, pub instance: Option<Arc<Mutex<Instance>>>, pub uri: Option<String>, }
Fields
opts: Option<Arc<Mutex<CreateSt>>>
instance: Option<Arc<Mutex<Instance>>>
uri: Option<String>
Methods
impl Client
[src]
fn new() -> Client
Constructor
fn connect(&mut self, uri: &str)
fn add<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Will cause the operation to fail if the key already exists in the cluster.
fn add_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn append<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Rather than setting the contents of the entire document, take the value specified in value and append it to the existing bytes in the value.
fn append_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn get<'a, F>(&'a mut self, key: &str, cas: u64, callback: F) -> &Client where
F: Fn(OperationResultGet) + 'static,
F: Fn(OperationResultGet) + 'static,
Get document from database
fn get_sync(&mut self, key: &str, cas: u64) -> OperationResultGet
fn prepend<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Like append, but prepends the new value to the existing value.
fn prepend_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn remove<'a, F>(&'a mut self, key: &str, callback: F) -> &Client where
F: Fn(OperationResultRemove) + 'static,
F: Fn(OperationResultRemove) + 'static,
Remove document from database
fn remove_sync(&mut self, key: &str) -> OperationResultRemove
fn replace<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Will cause the operation to fail unless the key already exists in the cluster.
fn replace_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn set<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Unconditionally store the item in the cluster
fn set_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn store<'a, F>(
&'a mut self,
key: &str,
value: &str,
operation: Operation,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
operation: Operation,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Store document in database
fn store_sync(
&mut self,
key: &str,
value: &str,
operation: Operation,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
operation: Operation,
cas: u64,
exptime: u32
) -> OperationResultStore
fn upsert<'a, F>(
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
&'a mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32,
callback: F
) -> &Client where
F: Fn(OperationResultStore) + 'static,
Behaviorally it is identical to set in that it will make the server unconditionally store the item, whether it exists or not.
fn upsert_sync(
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
&mut self,
key: &str,
value: &str,
cas: u64,
exptime: u32
) -> OperationResultStore
fn view_query<'a, F>(
&'a mut self,
ddoc: &str,
view: &str,
callback: F
) -> &Client where
F: Fn(OperationResultViewQuery) + 'static,
&'a mut self,
ddoc: &str,
view: &str,
callback: F
) -> &Client where
F: Fn(OperationResultViewQuery) + 'static,
Store document in database
fn view_query_sync(
&mut self,
ddoc: &str,
view: &str
) -> OperationResultViewQuery
&mut self,
ddoc: &str,
view: &str
) -> OperationResultViewQuery
Trait Implementations
impl Debug for Client
[src]
impl Clone for Client
[src]
fn clone(&self) -> Client
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more