[][src]Trait ritekv::storage::Store

pub trait Store: Display + Send + Sync {
    pub fn get(&self, key: impl AsRef<[u8]>) -> Result<Option<Vec<u8>>>;
pub fn set(
        &mut self,
        key: impl AsRef<[u8]>,
        value: impl AsRef<[u8]>
    ) -> Result<()>;
pub fn remove(&mut self, key: impl AsRef<[u8]>) -> Result<()>;
pub fn contains(&mut self, key: impl AsRef<[u8]>) -> Result<bool>; }

A key/value store trait for basic ops.

Required methods

pub fn get(&self, key: impl AsRef<[u8]>) -> Result<Option<Vec<u8>>>[src]

Gets a value for a key, if it exists.

pub fn set(
    &mut self,
    key: impl AsRef<[u8]>,
    value: impl AsRef<[u8]>
) -> Result<()>
[src]

Sets a value for a key, replacing the existing value if any.

pub fn remove(&mut self, key: impl AsRef<[u8]>) -> Result<()>[src]

Removes a key, or does nothing if it does not exist.

pub fn contains(&mut self, key: impl AsRef<[u8]>) -> Result<bool>[src]

Loading content...

Implementors

impl Store for MemStore[src]

Loading content...