Struct loro_internal::handler::MapHandler
source · pub struct MapHandler { /* private fields */ }
Implementations§
source§impl MapHandler
impl MapHandler
pub fn new( txn: Weak<Mutex<Option<Transaction>>>, idx: ContainerIdx, state: Weak<Mutex<DocState>> ) -> Self
pub fn insert(&self, key: &str, value: impl Into<LoroValue>) -> LoroResult<()>
pub fn insert_with_txn( &self, txn: &mut Transaction, key: &str, value: LoroValue ) -> LoroResult<()>
pub fn insert_container( &self, key: &str, c_type: ContainerType ) -> LoroResult<Handler>
pub fn insert_container_with_txn( &self, txn: &mut Transaction, key: &str, c_type: ContainerType ) -> LoroResult<Handler>
pub fn delete(&self, key: &str) -> LoroResult<()>
pub fn delete_with_txn( &self, txn: &mut Transaction, key: &str ) -> LoroResult<()>
pub fn for_each<I>(&self, f: I)where I: FnMut(&str, ValueOrContainer),
pub fn get_value(&self) -> LoroValue
pub fn get_child_handler(&self, key: &str) -> Handler
pub fn get_deep_value(&self) -> LoroValue
pub fn get_deep_value_with_id(&self) -> LoroValue
pub fn get(&self, key: &str) -> Option<LoroValue>
sourcepub fn get_(&self, key: &str) -> Option<ValueOrContainer>
pub fn get_(&self, key: &str) -> Option<ValueOrContainer>
Get the value at given key, if value is a container, return a handler to the container
pub fn id(&self) -> ContainerID
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl Clone for MapHandler
impl Clone for MapHandler
source§fn clone(&self) -> MapHandler
fn clone(&self) -> MapHandler
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for MapHandler
impl Send for MapHandler
impl Sync for MapHandler
impl Unpin for MapHandler
impl UnwindSafe for MapHandler
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