[][src]Struct wascc_actor::keyvalue::KeyValueStoreHostBinding

pub struct KeyValueStoreHostBinding { /* fields omitted */ }

An abstraction around a host runtime capability for a key-value store

Implementations

impl KeyValueStoreHostBinding[src]

pub fn get(&self, key: &str) -> HandlerResult<Option<String>>[src]

Obtains a single value from the store

pub fn set(
    &self,
    key: &str,
    value: &str,
    expires: Option<u32>
) -> HandlerResult<()>
[src]

Sets a value in the store

pub fn atomic_add(&self, key: &str, value: i32) -> HandlerResult<i32>[src]

Performs an atomic increment operation

pub fn list_add(&self, key: &str, item: &str) -> HandlerResult<usize>[src]

Adds an item to a list at the given key

pub fn list_del_item(&self, key: &str, item: &str) -> HandlerResult<usize>[src]

Removes an item from the list at the given key

pub fn del_key(&self, key: &str) -> HandlerResult<()>[src]

Removes the data associated with a given key, which can include lists or sets

pub fn list_range(
    &self,
    key: &str,
    start: isize,
    stop_inclusive: isize
) -> HandlerResult<Vec<String>>
[src]

Queries a given list-type key for a range of values

pub fn list_clear(&self, key: &str) -> HandlerResult<()>[src]

Clears a list while leaving the key intact

pub fn set_add(&self, key: &str, value: &str) -> HandlerResult<usize>[src]

Adds a value to a set at the given key

pub fn set_remove(&self, key: &str, value: &str) -> HandlerResult<usize>[src]

Removes a value from the given set

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

Performs a union of sets specified by the list of keys

pub fn set_intersect(&self, keys: Vec<String>) -> HandlerResult<Vec<String>>[src]

Performs the intersection of sets specified by the given keys

pub fn set_members(&self, key: &str) -> HandlerResult<Vec<String>>[src]

Returns a list of members belonging to a given set

pub fn exists(&self, key: &str) -> HandlerResult<bool>[src]

Indicates whether a key exists (not that empty lists/sets may return true for their existence if they were cleared instead of deleted)

Trait Implementations

impl Default for KeyValueStoreHostBinding[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.