pub struct Host { /* private fields */ }
Implementations§
Source§impl Host
impl Host
Sourcepub fn get(&self, key: String) -> HandlerResult<GetResponse>
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.
Sourcepub fn add(&self, key: String, value: i32) -> HandlerResult<AddResponse>
pub fn add(&self, key: String, value: i32) -> HandlerResult<AddResponse>
Add a given numeric value to a key
Sourcepub fn set(
&self,
key: String,
value: String,
expires: i32,
) -> HandlerResult<SetResponse>
pub fn set( &self, key: String, value: String, expires: i32, ) -> HandlerResult<SetResponse>
Sets the string value of a key
Sourcepub fn del(&self, key: String) -> HandlerResult<DelResponse>
pub fn del(&self, key: String) -> HandlerResult<DelResponse>
Delete a key
Sourcepub fn clear(&self, key: String) -> HandlerResult<DelResponse>
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
Sourcepub fn range(
&self,
key: String,
start: i32,
stop: i32,
) -> HandlerResult<ListRangeResponse>
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.
Sourcepub fn push(&self, key: String, value: String) -> HandlerResult<ListResponse>
pub fn push(&self, key: String, value: String) -> HandlerResult<ListResponse>
Push a value onto a list
Sourcepub fn list_item_delete(
&self,
key: String,
value: String,
) -> HandlerResult<ListResponse>
pub fn list_item_delete( &self, key: String, value: String, ) -> HandlerResult<ListResponse>
Delete an item from a list
Sourcepub fn set_add(
&self,
key: String,
value: String,
) -> HandlerResult<SetOperationResponse>
pub fn set_add( &self, key: String, value: String, ) -> HandlerResult<SetOperationResponse>
Add an item into a set
Sourcepub fn set_remove(
&self,
key: String,
value: String,
) -> HandlerResult<SetOperationResponse>
pub fn set_remove( &self, key: String, value: String, ) -> HandlerResult<SetOperationResponse>
Remove an item from a set
Sourcepub fn set_union(&self, keys: Vec<String>) -> HandlerResult<SetQueryResponse>
pub fn set_union(&self, keys: Vec<String>) -> HandlerResult<SetQueryResponse>
Perform and return a set union on a given list of keys
Sourcepub fn set_intersection(
&self,
keys: Vec<String>,
) -> HandlerResult<SetQueryResponse>
pub fn set_intersection( &self, keys: Vec<String>, ) -> HandlerResult<SetQueryResponse>
Perform and return a set intersect on a given list of keys
Sourcepub fn set_query(&self, key: String) -> HandlerResult<SetQueryResponse>
pub fn set_query(&self, key: String) -> HandlerResult<SetQueryResponse>
Retrieve a list of items stored in a set
Sourcepub fn key_exists(&self, key: String) -> HandlerResult<GetResponse>
pub fn key_exists(&self, key: String) -> HandlerResult<GetResponse>
Indicates if a key exists
Trait Implementations§
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> 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