pub trait LocalSecureStorage: Send + Sync {
    // Required methods
    fn insert(&self, key: String, value: String) -> LssResult<Option<String>>;
    fn get(&self, key: String) -> LssResult<Option<String>>;
    fn contains_key(&self, key: String) -> LssResult<bool>;
    fn keys(&self) -> LssResult<Vec<String>>;
    fn keys_starting_with(&self, prefix: String) -> LssResult<Vec<String>>;
    fn remove(&self, key: String) -> LssResult<Option<String>>;
    fn len(&self) -> LssResult<usize>;
    fn is_empty(&self) -> LssResult<bool>;
}

Required Methods§

source

fn insert(&self, key: String, value: String) -> LssResult<Option<String>>

Inserts a key-value pair into the LSS. If the map did not have this key present, None is returned. If the map did have this key present, the value is updated, and the old value is returned.

source

fn get(&self, key: String) -> LssResult<Option<String>>

Returns a copy of the value corresponding to the key.

source

fn contains_key(&self, key: String) -> LssResult<bool>

Returns true if the map contains a value for the specified key.

source

fn keys(&self) -> LssResult<Vec<String>>

Returns all keys in arbitrary order.

source

fn keys_starting_with(&self, prefix: String) -> LssResult<Vec<String>>

Returns all keys starting with the given prefix.

source

fn remove(&self, key: String) -> LssResult<Option<String>>

Removes a key from the map, returning the value at the key if the key was previously in the map.

source

fn len(&self) -> LssResult<usize>

Returns the number of elements in the map.

source

fn is_empty(&self) -> LssResult<bool>

Returns true if the map contains no elements, false otherwise.

Implementors§