Host

Struct Host 

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

Implementations§

Source§

impl Host

Source

pub fn get(&self, key: String) -> HandlerResult<GetResponse>

Gets a value for a specified key. If the key doesn’t exist, this function will not panic, instead the response type will indicate that it does not exist.

Source

pub fn add(&self, key: String, value: i32) -> HandlerResult<AddResponse>

Add a given numeric value to a key

Source

pub fn set( &self, key: String, value: String, expires: i32, ) -> HandlerResult<SetResponse>

Sets the string value of a key

Source

pub fn del(&self, key: String) -> HandlerResult<DelResponse>

Delete a key

Source

pub fn clear(&self, key: String) -> HandlerResult<DelResponse>

Clear a list of its values. Depending on the provider implementation, this may delete the list entirely

Source

pub fn range( &self, key: String, start: i32, stop: i32, ) -> HandlerResult<ListRangeResponse>

Retrieve a range of values from a list. Depending on the provider implementation, start and stop may or may not be inclusive.

Source

pub fn push(&self, key: String, value: String) -> HandlerResult<ListResponse>

Push a value onto a list

Source

pub fn list_item_delete( &self, key: String, value: String, ) -> HandlerResult<ListResponse>

Delete an item from a list

Source

pub fn set_add( &self, key: String, value: String, ) -> HandlerResult<SetOperationResponse>

Add an item into a set

Source

pub fn set_remove( &self, key: String, value: String, ) -> HandlerResult<SetOperationResponse>

Remove an item from a set

Source

pub fn set_union(&self, keys: Vec<String>) -> HandlerResult<SetQueryResponse>

Perform and return a set union on a given list of keys

Source

pub fn set_intersection( &self, keys: Vec<String>, ) -> HandlerResult<SetQueryResponse>

Perform and return a set intersect on a given list of keys

Source

pub fn set_query(&self, key: String) -> HandlerResult<SetQueryResponse>

Retrieve a list of items stored in a set

Source

pub fn key_exists(&self, key: String) -> HandlerResult<GetResponse>

Indicates if a key exists

Trait Implementations§

Source§

impl Default for Host

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Host

§

impl RefUnwindSafe for Host

§

impl Send for Host

§

impl Sync for Host

§

impl Unpin for Host

§

impl UnwindSafe for Host

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.