pub trait KeyValueStore: Store {
// Required methods
fn all(&self) -> HashMap<String, Vec<u8>>;
fn put<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 str,
value: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Operation, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Operation, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Uma store que se comporta como um banco de dados chave-valor distribuído.
Herda todas as funcionalidades da trait Store e adiciona operações
específicas para pares chave-valor com semântica CRDT.
Todas as operações são replicadas automaticamente através da rede e mantêm consistência eventual entre os peers.
Required Methods§
Sourcefn all(&self) -> HashMap<String, Vec<u8>>
fn all(&self) -> HashMap<String, Vec<u8>>
Retorna todos os pares chave-valor da store em um mapa. Esta operação lê o estado atual do índice local.