pub struct KeyValueStoreAdapter { /* private fields */ }Expand description
Adapter que converte Store genérico para KeyValueStore específico
Implementations§
Source§impl KeyValueStoreAdapter
impl KeyValueStoreAdapter
pub fn new(store: Arc<dyn Store<Error = GuardianError>>) -> Self
Trait Implementations§
Source§impl KeyValueStore for KeyValueStoreAdapter
impl KeyValueStore for KeyValueStoreAdapter
Source§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 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,
Define um valor para uma chave específica.
Cria uma nova operação PUT no log distribuído que será replicada. Read more
Source§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,
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,
Obtém o valor associado a uma chave.
Consulta o índice local para o estado mais recente. Read more
Source§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 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,
Remove uma chave e seu valor associado.
Cria uma nova operação DEL no log distribuído que será replicada. Read more
Source§impl Store for KeyValueStoreAdapter
impl Store for KeyValueStoreAdapter
type Error = GuardianError
Source§fn store_type(&self) -> &str
fn store_type(&self) -> &str
Retorna o tipo da store como uma string (ex: “eventlog”, “kvstore”).
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fecha a store e libera seus recursos.
Modificado para aceitar &self em vez de &mut self para compatibilidade com Arc
Source§fn drop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove todo o conteúdo local da store.
Source§fn events(&self) -> &dyn EmitterInterface
fn events(&self) -> &dyn EmitterInterface
👎Deprecated: use event_bus() instead
Source§fn index(&self) -> Box<dyn StoreIndex<Error = Self::Error> + Send + Sync>
fn index(&self) -> Box<dyn StoreIndex<Error = Self::Error> + Send + Sync>
Retorna o índice da store, que mantém o estado atual dos dados.
Retorna Box para evitar problemas de lifetime com RwLock
Source§fn replication_status(&self) -> ReplicationInfo
fn replication_status(&self) -> ReplicationInfo
Retorna o status atual da replicação.
Source§fn replicator(&self) -> Option<Arc<Replicator>>
fn replicator(&self) -> Option<Arc<Replicator>>
Retorna o replicador responsável pela sincronização de dados.
Source§fn load<'life0, 'async_trait>(
&'life0 mut self,
amount: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 mut self,
amount: usize,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Carrega as
amount entradas mais recentes da rede.Source§fn sync<'life0, 'async_trait>(
&'life0 mut self,
heads: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync<'life0, 'async_trait>(
&'life0 mut self,
heads: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sincroniza a store com uma lista de
heads (entradas mais recentes) de outro par.Source§fn load_more_from<'life0, 'async_trait>(
&'life0 mut self,
amount: u64,
entries: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_more_from<'life0, 'async_trait>(
&'life0 mut self,
amount: u64,
entries: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Carrega mais entradas a partir de um conjunto de CIDs conhecidos.
Source§fn load_from_snapshot<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_from_snapshot<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Carrega o conteúdo da store a partir de um snapshot.
Source§fn op_log(&self) -> Arc<RwLock<Log>> ⓘ
fn op_log(&self) -> Arc<RwLock<Log>> ⓘ
Retorna o log de operações (OpLog) subjacente.
Modificado para retornar Arc para evitar problemas de lifetime
Source§fn ipfs(&self) -> Arc<IpfsClient>
fn ipfs(&self) -> Arc<IpfsClient>
Retorna a instância da API do IPFS.
Source§fn access_controller(&self) -> &dyn AccessController
fn access_controller(&self) -> &dyn AccessController
Retorna o controlador de acesso da store.
Source§fn add_operation<'life0, 'async_trait>(
&'life0 mut self,
op: Operation,
on_progress_callback: Option<ProgressCallback>,
) -> Pin<Box<dyn Future<Output = Result<Entry, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_operation<'life0, 'async_trait>(
&'life0 mut self,
op: Operation,
on_progress_callback: Option<ProgressCallback>,
) -> Pin<Box<dyn Future<Output = Result<Entry, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adiciona uma nova operação à store.
Source§fn span(&self) -> Arc<Span>
fn span(&self) -> Arc<Span>
Retorna o span.
Modificado para retornar Arc para evitar problemas de lifetime
Source§fn tracer(&self) -> Arc<TracerWrapper>
fn tracer(&self) -> Arc<TracerWrapper>
Retorna o tracer para telemetria.
Auto Trait Implementations§
impl Freeze for KeyValueStoreAdapter
impl !RefUnwindSafe for KeyValueStoreAdapter
impl Send for KeyValueStoreAdapter
impl Sync for KeyValueStoreAdapter
impl Unpin for KeyValueStoreAdapter
impl !UnwindSafe for KeyValueStoreAdapter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more