pub struct LWWMap { /* private fields */ }Expand description
Last-Write-Wins CRDT map using BTreeMap (no_std compatible). Tie-breaking: timestamp > writer_id (lexicographic), matching Python’s LWWMap.
Implementations§
Source§impl LWWMap
impl LWWMap
Sourcepub fn set(
&mut self,
key: &str,
value: Value,
timestamp_ms: i64,
writer_id: &str,
)
pub fn set( &mut self, key: &str, value: Value, timestamp_ms: i64, writer_id: &str, )
Writes a value with the given timestamp and writer ID. No-op if a newer value exists. Equal timestamps are broken by writer_id (higher wins).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LWWMap
impl RefUnwindSafe for LWWMap
impl Send for LWWMap
impl Sync for LWWMap
impl Unpin for LWWMap
impl UnsafeUnpin for LWWMap
impl UnwindSafe for LWWMap
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