pub struct GuardianDBDocumentStore { /* private fields */ }Expand description
Estrutura principal da DocumentStore.
Implementations§
Source§impl GuardianDBDocumentStore
impl GuardianDBDocumentStore
pub async fn new( ipfs: Arc<IpfsClient>, identity: Arc<Identity>, addr: Arc<dyn Address>, options: NewStoreOptions, ) -> Result<Self>
pub async fn get( &self, key: &str, opts: Option<DocumentStoreGetOptions>, ) -> Result<Vec<Document>>
pub async fn put(&mut self, document: Document) -> Result<Operation>
pub async fn delete(&mut self, document_id: &str) -> Result<Operation>
pub async fn put_batch( &mut self, documents: Vec<Document>, ) -> Result<Vec<Operation>>
pub async fn put_all(&mut self, documents: Vec<Document>) -> Result<Operation>
pub fn query<F>(&self, filter: F) -> Result<Vec<Document>>
pub fn store_type(&self) -> &'static str
Trait Implementations§
Source§impl Store for GuardianDBDocumentStore
impl Store for GuardianDBDocumentStore
type Error = GuardianError
Source§fn events(&self) -> &dyn EmitterInterface
fn events(&self) -> &dyn EmitterInterface
👎Deprecated: use event_bus() instead
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 index(&self) -> Box<dyn StoreIndex<Error = GuardianError> + Send + Sync>
fn index(&self) -> Box<dyn StoreIndex<Error = GuardianError> + 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 store_type(&self) -> &str
fn store_type(&self) -> &str
Retorna o tipo da store como uma string (ex: “eventlog”, “kvstore”).
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 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 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<Sender<Entry>>,
) -> 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<Sender<Entry>>,
) -> 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 GuardianDBDocumentStore
impl !RefUnwindSafe for GuardianDBDocumentStore
impl Send for GuardianDBDocumentStore
impl Sync for GuardianDBDocumentStore
impl Unpin for GuardianDBDocumentStore
impl !UnwindSafe for GuardianDBDocumentStore
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