pub struct MemcacheClient { /* private fields */ }Implementations§
Source§impl MemcacheClient
impl MemcacheClient
pub async fn connect(addr: &str) -> Self
pub async fn set( &self, key: &str, value: &[u8], flags: u32, exptime: u32, ) -> Result<(), String>
Sourcepub async fn set_quietly(&self, key: &str, value: &[u8]) -> Result<(), String>
pub async fn set_quietly(&self, key: &str, value: &[u8]) -> Result<(), String>
Set a key without waiting for a reply (hot path, fire-and-forget).
pub async fn set_multi<'a, I>( &self, items: I, flags: u32, exptime: u32, ) -> Result<(), String>
Sourcepub async fn set_multi_quietly<'a, I>(&self, items: I) -> Result<(), String>
pub async fn set_multi_quietly<'a, I>(&self, items: I) -> Result<(), String>
Batch set using SETQ for all but the last key, and SET for the last key (waits for one response).
pub async fn get(&self, key: &str) -> Result<Option<Vec<u8>>, String>
pub async fn get_multi<'a, I>(
&self,
keys: I,
) -> Result<Vec<(String, Option<Vec<u8>>)>, String>where
I: IntoIterator<Item = &'a str>,
Sourcepub async fn delete(&self, key: &str) -> Result<(), String>
pub async fn delete(&self, key: &str) -> Result<(), String>
Delete a single key, waits for response.
Sourcepub async fn delete_quietly(&self, key: &str) -> Result<(), String>
pub async fn delete_quietly(&self, key: &str) -> Result<(), String>
Delete a single key, quietly (no response).
Sourcepub async fn delete_multi<'a, I>(&self, keys: I) -> Result<(), String>where
I: IntoIterator<Item = &'a str>,
pub async fn delete_multi<'a, I>(&self, keys: I) -> Result<(), String>where
I: IntoIterator<Item = &'a str>,
Delete multiple keys, waits for response for each.
Sourcepub async fn delete_multi_quietly<'a, I>(&self, keys: I) -> Result<(), String>where
I: IntoIterator<Item = &'a str>,
pub async fn delete_multi_quietly<'a, I>(&self, keys: I) -> Result<(), String>where
I: IntoIterator<Item = &'a str>,
Delete multiple keys, quietly (all but last as DELQ, last as DEL).
Sourcepub async fn incr(
&self,
key: &str,
delta: u64,
initial: u64,
exptime: u32,
) -> Result<Option<u64>, String>
pub async fn incr( &self, key: &str, delta: u64, initial: u64, exptime: u32, ) -> Result<Option<u64>, String>
Increment a key by delta. Returns the new value or None if not found.
Auto Trait Implementations§
impl Freeze for MemcacheClient
impl !RefUnwindSafe for MemcacheClient
impl Send for MemcacheClient
impl Sync for MemcacheClient
impl Unpin for MemcacheClient
impl !UnwindSafe for MemcacheClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more