Trait rust_ipfs::repo::DataStore

source ·
pub trait DataStore: PinStore + Debug + Send + Sync + 'static {
    fn new(path: PathBuf) -> Self;
    fn init<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn open<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn contains<'life0, 'life1, 'async_trait>(
        &'life0 self,
        col: Column,
        key: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        col: Column,
        key: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn put<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        col: Column,
        key: &'life1 [u8],
        value: &'life2 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        col: Column,
        key: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn wipe<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; }
Expand description

Generic layer of abstraction for a key-value data store.

Required Methods§

Checks if a key is present in the datastore.

Returns the value associated with a key from the datastore.

Puts the value under the key in the datastore.

Removes a key-value pair from the datastore.

Wipes the datastore.

Implementors§

The column operations are all unimplemented pending at least downscoping of the DataStore trait itself.