pub struct ReplicatedStoreHandle<S>where
S: Storage,{ /* private fields */ }Expand description
A cheaply cloneable handle to control the data store.
Implementations§
Source§impl<S> ReplicatedStoreHandle<S>where
S: Storage,
impl<S> ReplicatedStoreHandle<S>where
S: Storage,
Sourcepub fn statistics(&self) -> &SystemStatistics
pub fn statistics(&self) -> &SystemStatistics
Gets the live cluster statistics.
Sourcepub fn with_keyspace(
&self,
keyspace: impl Into<String>,
) -> ReplicatorKeyspaceHandle<S>
pub fn with_keyspace( &self, keyspace: impl Into<String>, ) -> ReplicatorKeyspaceHandle<S>
Creates a new handle to the underlying storage system with a preset keyspace.
Changes applied to the handle are distributed across the cluster.
Sourcepub async fn get(
&self,
keyspace: &str,
doc_id: Key,
) -> Result<Option<Document>, S::Error>
pub async fn get( &self, keyspace: &str, doc_id: Key, ) -> Result<Option<Document>, S::Error>
Retrieves a document from the underlying storage.
Sourcepub async fn get_many<I, T>(
&self,
keyspace: &str,
doc_ids: I,
) -> Result<S::DocsIter, S::Error>
pub async fn get_many<I, T>( &self, keyspace: &str, doc_ids: I, ) -> Result<S::DocsIter, S::Error>
Retrieves a set of documents from the underlying storage.
If a document does not exist with the given ID, it is simply not part of the returned iterator.
Sourcepub async fn put<D>(
&self,
keyspace: &str,
doc_id: Key,
data: D,
consistency: Consistency,
) -> Result<(), StoreError<S::Error>>
pub async fn put<D>( &self, keyspace: &str, doc_id: Key, data: D, consistency: Consistency, ) -> Result<(), StoreError<S::Error>>
Insert or update a single document into the datastore.
Sourcepub async fn put_many<I, T, D>(
&self,
keyspace: &str,
documents: I,
consistency: Consistency,
) -> Result<(), StoreError<S::Error>>
pub async fn put_many<I, T, D>( &self, keyspace: &str, documents: I, consistency: Consistency, ) -> Result<(), StoreError<S::Error>>
Insert or update multiple documents into the datastore at once.
Sourcepub async fn del(
&self,
keyspace: &str,
doc_id: Key,
consistency: Consistency,
) -> Result<(), StoreError<S::Error>>
pub async fn del( &self, keyspace: &str, doc_id: Key, consistency: Consistency, ) -> Result<(), StoreError<S::Error>>
Delete a document from the datastore with a given doc ID.
Sourcepub async fn del_many<I, T>(
&self,
keyspace: &str,
doc_ids: I,
consistency: Consistency,
) -> Result<(), StoreError<S::Error>>
pub async fn del_many<I, T>( &self, keyspace: &str, doc_ids: I, consistency: Consistency, ) -> Result<(), StoreError<S::Error>>
Delete multiple documents from the datastore from the set of doc IDs.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for ReplicatedStoreHandle<S>
impl<S> !RefUnwindSafe for ReplicatedStoreHandle<S>
impl<S> Send for ReplicatedStoreHandle<S>
impl<S> Sync for ReplicatedStoreHandle<S>
impl<S> Unpin for ReplicatedStoreHandle<S>
impl<S> !UnwindSafe for ReplicatedStoreHandle<S>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.