Struct MemcacheClient

Source
pub struct MemcacheClient { /* private fields */ }

Implementations§

Source§

impl MemcacheClient

Source

pub async fn connect(addr: &str) -> Self

Source

pub async fn set( &self, key: &str, value: &[u8], flags: u32, exptime: u32, ) -> Result<(), String>

Source

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).

Source

pub async fn set_multi<'a, I>( &self, items: I, flags: u32, exptime: u32, ) -> Result<(), String>
where I: IntoIterator<Item = (&'a str, &'a [u8])>,

Source

pub async fn set_multi_quietly<'a, I>(&self, items: I) -> Result<(), String>
where I: IntoIterator<Item = (&'a str, &'a [u8])>,

Batch set using SETQ for all but the last key, and SET for the last key (waits for one response).

Source

pub async fn get(&self, key: &str) -> Result<Option<Vec<u8>>, String>

Source

pub async fn get_multi<'a, I>( &self, keys: I, ) -> Result<Vec<(String, Option<Vec<u8>>)>, String>
where I: IntoIterator<Item = &'a str>,

Source

pub async fn delete(&self, key: &str) -> Result<(), String>

Delete a single key, waits for response.

Source

pub async fn delete_quietly(&self, key: &str) -> Result<(), String>

Delete a single key, quietly (no response).

Source

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.

Source

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).

Source

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.

Source

pub async fn decr( &self, key: &str, delta: u64, initial: u64, exptime: u32, ) -> Result<Option<u64>, String>

Decrement a key by delta. Returns the new value or None if not found.

Source

pub async fn noop(&self) -> Result<(), String>

Send a NOOP command (useful for pipelining).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.