pub struct Store { /* private fields */ }Expand description
Manages the replicas and authors for an instance.
Trait Implementations§
source§impl Store for Store
impl Store for Store
source§fn content_hashes(&self) -> Result<Self::ContentHashesIter<'_>>
fn content_hashes(&self) -> Result<Self::ContentHashesIter<'_>>
Get all content hashes of all replicas in the store.
§type Instance = ReplicaStoreInstance
type Instance = ReplicaStoreInstance
The specialized instance scoped to a
Namespace.§type GetIter<'a> = RangeIterator<'a>
type GetIter<'a> = RangeIterator<'a>
Iterator over entries in the store, returned from
Self::get_many§type ContentHashesIter<'a> = ContentHashesIterator<'a>
type ContentHashesIter<'a> = ContentHashesIterator<'a>
Iterator over all content hashes in the store, returned from
Self::content_hashes§type AuthorsIter<'a> = IntoIter<Result<Author, Error>>
type AuthorsIter<'a> = IntoIter<Result<Author, Error>>
Iterator over authors in the store, returned from
Self::list_authors§type NamespaceIter<'a> = IntoIter<Result<NamespaceId, Error>>
type NamespaceIter<'a> = IntoIter<Result<NamespaceId, Error>>
Iterator over replica namespaces in the store, returned from
Self::list_namespaces§type PeersIter<'a> = IntoIter<[u8; 32]>
type PeersIter<'a> = IntoIter<[u8; 32]>
Iterator over peers in the store for a document, returned from
Self::get_sync_peers.source§fn open_replica(
&self,
namespace: &NamespaceId
) -> Result<Option<Replica<Self::Instance>>>
fn open_replica( &self, namespace: &NamespaceId ) -> Result<Option<Replica<Self::Instance>>>
Open a replica from this store. Read more
source§fn close_replica(&self, namespace_id: &NamespaceId)
fn close_replica(&self, namespace_id: &NamespaceId)
Close a replica. Read more
source§fn list_namespaces(&self) -> Result<Self::NamespaceIter<'_>>
fn list_namespaces(&self) -> Result<Self::NamespaceIter<'_>>
List all replica namespaces in this store.
Get an author key from the store.
Import an author key pair.
List all author keys in this store.
source§fn new_replica(
&self,
namespace: Namespace
) -> Result<Replica<ReplicaStoreInstance>>
fn new_replica( &self, namespace: Namespace ) -> Result<Replica<ReplicaStoreInstance>>
Create a new replica for
namespace and persist in this store.source§fn remove_replica(&self, namespace: &NamespaceId) -> Result<()>
fn remove_replica(&self, namespace: &NamespaceId) -> Result<()>
Remove a replica. Read more
source§fn get_many(
&self,
namespace: NamespaceId,
filter: GetFilter
) -> Result<Self::GetIter<'_>>
fn get_many( &self, namespace: NamespaceId, filter: GetFilter ) -> Result<Self::GetIter<'_>>
Get an iterator over entries of a replica. Read more
source§fn get_one(
&self,
namespace: NamespaceId,
author: AuthorId,
key: impl AsRef<[u8]>
) -> Result<Option<SignedEntry>>
fn get_one( &self, namespace: NamespaceId, author: AuthorId, key: impl AsRef<[u8]> ) -> Result<Option<SignedEntry>>
Get an entry by key and author.
source§fn register_useful_peer(
&self,
namespace: NamespaceId,
peer: PeerIdBytes
) -> Result<()>
fn register_useful_peer( &self, namespace: NamespaceId, peer: PeerIdBytes ) -> Result<()>
Register a peer that has been useful to sync a document.
source§fn get_sync_peers(
&self,
namespace: &NamespaceId
) -> Result<Option<Self::PeersIter<'_>>>
fn get_sync_peers( &self, namespace: &NamespaceId ) -> Result<Option<Self::PeersIter<'_>>>
Get peers to use for syncing a document.
Create a new author key and persist it in the store.
Auto Trait Implementations§
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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