pub trait Datastore: Send + Sync {
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<bool, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Bytes>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Key-value datastore interface
Required Methods§
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a value by key
Sourcefn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
value: Bytes,
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Put a key-value pair
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a key