pub struct MapRef<'a> { /* private fields */ }Expand description
Read-only reference to a Map CRDT.
Maps are key-value containers where each key maps to an LWW Register. Values can be primitives or references to nested CRDTs.
Implementations§
Source§impl<'a> MapRef<'a>
impl<'a> MapRef<'a>
Sourcepub fn get(&self, key: &str) -> Option<Value>
pub fn get(&self, key: &str) -> Option<Value>
Get a value by key.
Returns the “winning” value according to LWW semantics.
Use get_conflicted if you need to see concurrent conflicts.
Sourcepub fn get_conflicted(&self, key: &str) -> Option<Conflicted<Value>>
pub fn get_conflicted(&self, key: &str) -> Option<Conflicted<Value>>
Get a value by key with conflict information.
If there are concurrent writes to this key, the conflicts are included.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Check if a key exists.
Sourcepub fn get_register(&self, key: &str) -> Option<RegisterRef<'a>>
pub fn get_register(&self, key: &str) -> Option<RegisterRef<'a>>
Get a nested register CRDT by key.
Sourcepub fn keys_owned(&self) -> Vec<String>
pub fn keys_owned(&self) -> Vec<String>
Collect keys as owned Strings (avoids borrow-checker friction in FFI/WASM).
Sourcepub fn entries_owned(&self) -> Vec<(String, Value)>
pub fn entries_owned(&self) -> Vec<(String, Value)>
Collect entries as owned pairs (avoids borrow-checker friction in FFI/WASM).
Auto Trait Implementations§
impl<'a> Freeze for MapRef<'a>
impl<'a> RefUnwindSafe for MapRef<'a>
impl<'a> Send for MapRef<'a>
impl<'a> Sync for MapRef<'a>
impl<'a> Unpin for MapRef<'a>
impl<'a> UnsafeUnpin for MapRef<'a>
impl<'a> UnwindSafe for MapRef<'a>
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