pub struct ReplicatorActor { /* private fields */ }Expand description
Actor-style replicator handle.
Implementations§
Source§impl ReplicatorActor
impl ReplicatorActor
Sourcepub fn spawn_with(store: Arc<dyn DurableStore>) -> Self
pub fn spawn_with(store: Arc<dyn DurableStore>) -> Self
Spawn a new replicator with a pluggable durable backend.
Sourcepub fn inner(&self) -> &Arc<Replicator>
pub fn inner(&self) -> &Arc<Replicator>
Read-only access to the inner replicator (subscriptions etc).
Sourcepub async fn update<T>(
&self,
key: impl Into<String>,
value: T,
_write: WriteConsistency,
) -> ReplicatorAck
pub async fn update<T>( &self, key: impl Into<String>, value: T, _write: WriteConsistency, ) -> ReplicatorAck
Submit a typed update and wait for the ack.
Sourcepub async fn get<T>(
&self,
key: impl Into<String>,
_read: ReadConsistency,
) -> Option<T>
pub async fn get<T>( &self, key: impl Into<String>, _read: ReadConsistency, ) -> Option<T>
Read a key. Consistency is Local for now (Phase 8.D wires the
quorum exchange once gossip lands).
Sourcepub async fn delete(&self, key: impl Into<String>) -> ReplicatorAck
pub async fn delete(&self, key: impl Into<String>) -> ReplicatorAck
Delete a key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReplicatorActor
impl !RefUnwindSafe for ReplicatorActor
impl Send for ReplicatorActor
impl Sync for ReplicatorActor
impl Unpin for ReplicatorActor
impl UnsafeUnpin for ReplicatorActor
impl !UnwindSafe for ReplicatorActor
Blanket Implementations§
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