Client

Struct Client 

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

Implementations§

Source§

impl Client

Source

pub async fn connect<A: ToSocketAddrs>(addr: A) -> Result<Self>

Source

pub async fn ping(&mut self) -> Result<()>

Source

pub async fn get<In, Out>(&mut self, key: In) -> Result<Option<Out>>
where In: Into<Vec<u8>>, Out: From<Vec<u8>>,

Source

pub async fn set<In0, In1>( &mut self, key: In0, value: In1, option: SetOption, ) -> Result<bool>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>,

Source

pub async fn get_set<In0, In1, Out>( &mut self, key: In0, value: In1, option: SetOption, ) -> Result<Option<Out>>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>, Out: From<Vec<u8>>,

Source

pub async fn flush_all(&mut self, sync: bool) -> Result<()>

Source

pub async fn del<In>(&mut self, keys: Vec<In>) -> Result<u64>
where In: Into<Vec<u8>>,

Source

pub async fn exists<In>(&mut self, keys: Vec<In>) -> Result<u64>
where In: Into<Vec<u8>>,

Source

pub async fn mset<In0, In1>(&mut self, kvs: Vec<(In0, In1)>) -> Result<()>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>,

Source

pub async fn msetnx<In0, In1>(&mut self, kvs: Vec<(In0, In1)>) -> Result<bool>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>,

Source

pub async fn mget<In, Out>(&mut self, keys: Vec<In>) -> Result<Vec<Option<Out>>>
where In: Into<Vec<u8>>, Out: From<Vec<u8>>,

Source

pub async fn strlen<In>(&mut self, key: In) -> Result<u64>
where In: Into<Vec<u8>>,

Source

pub async fn get_range<In, Out>( &mut self, key: In, start: i64, end: i64, ) -> Result<Out>
where In: Into<Vec<u8>>, Out: From<Vec<u8>>,

Source

pub async fn set_range<In0, In1>( &mut self, key: In0, index: i64, substitute: In1, ) -> Result<u64>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>,

Source

pub async fn append<In0, In1>(&mut self, key: In0, suffix: In1) -> Result<u64>
where In0: Into<Vec<u8>>, In1: Into<Vec<u8>>,

Source

pub async fn incr<In>(&mut self, key: In) -> Result<i64>
where In: Into<Vec<u8>>,

Source

pub async fn incr_by<In>(&mut self, key: In, increment: i64) -> Result<i64>
where In: Into<Vec<u8>>,

Source

pub async fn incr_by_float<In, Out>( &mut self, key: In, increment: f64, ) -> Result<f64>
where In: Into<Vec<u8>>,

Source

pub async fn decr<In>(&mut self, key: In) -> Result<i64>
where In: Into<Vec<u8>>,

Source

pub async fn decr_by<In>(&mut self, key: In, decrement: i64) -> Result<i64>
where In: Into<Vec<u8>>,

Auto Trait Implementations§

§

impl !Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

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.