Struct mtop_client::Memcached

source ·
pub struct Memcached { /* private fields */ }

Implementations§

source§

impl Memcached

source

pub fn new<R, W>(read: R, write: W) -> Selfwhere R: AsyncRead + Send + Sync + Unpin + 'static, W: AsyncWrite + Send + Sync + Unpin + 'static,

source

pub async fn stats(&mut self) -> Result<Stats, MtopError>

Get a Stats object with the current values of the interesting stats for the server.

source

pub async fn slabs(&mut self) -> Result<Slabs, MtopError>

Get a Slabs object with information about each set of Slabs maintained by the Memcached server. You can think of each Slab as a class of objects that are stored together in memory. Note that Slab IDs may not be contiguous based on the size of items actually stored by the server.

source

pub async fn items(&mut self) -> Result<SlabItems, MtopError>

Get a SlabsItems object with information about the SlabItem items stored in each slab class maintained by the Memcached server. The ID of each SlabItem corresponds to a Slab maintained by the server. Note that SlabItem IDs may not be contiguous based on the size of items actually stored by the server.

source

pub async fn metas(&mut self) -> Result<Vec<Meta>, MtopError>

Get a Meta object for every item in the cache which includes its key and expiration time as a UNIX timestamp. Expiration time will be -1 if the item was set with an infinite TTL.

source

pub async fn get( &mut self, keys: &[String] ) -> Result<HashMap<String, Value>, MtopError>

Get a map of the requested keys and their corresponding Value in the cache including the key, flags, and data.

source

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

Send a simple command to verify our connection to the server is working.

source

pub async fn set( &mut self, key: String, flags: u64, ttl: u32, data: Vec<u8> ) -> Result<(), MtopError>

Store the provided item in the cache, regardless of whether it already exists.

source

pub async fn touch(&mut self, key: String, ttl: u32) -> Result<(), MtopError>

Update the TTL of an item in the cache if it exists, return an error otherwise.

source

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

Delete an item in the cache if it exists, return an error otherwise.

Trait Implementations§

source§

impl Debug for Memcached

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more