pub struct Replicator { /* private fields */ }Implementations§
Source§impl Replicator
impl Replicator
pub fn new() -> Arc<Self>
pub fn update<T>(&self, key: &str, value: T)
Sourcepub fn subscribe<F>(
self: &Arc<Self>,
key: impl Into<String>,
notifier: F,
) -> SubscriptionToken
pub fn subscribe<F>( self: &Arc<Self>, key: impl Into<String>, notifier: F, ) -> SubscriptionToken
Register notifier to fire on every successful
update(key, _) or delete(key). Returns a
SubscriptionToken whose Drop removes the subscription.
Phase 8.E.
Sourcepub fn notify(&self, key: &str)
pub fn notify(&self, key: &str)
Internal: deliver notifications. Public so the cluster adapter can re-fire after a remote merge.
Sourcepub fn subscriber_count(&self, key: &str) -> usize
pub fn subscriber_count(&self, key: &str) -> usize
Number of subscribers for a key (debug / telemetry).
pub fn get<T>(&self, key: &str) -> Option<T>
pub fn delete(&self, key: &str)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Replicator
impl !RefUnwindSafe for Replicator
impl Send for Replicator
impl Sync for Replicator
impl Unpin for Replicator
impl UnsafeUnpin for Replicator
impl !UnwindSafe for Replicator
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