Struct loro_internal::handler::MapHandler
source · pub struct MapHandler { /* private fields */ }
Implementations§
source§impl MapHandler
impl MapHandler
sourcepub fn new_detached() -> Self
pub fn new_detached() -> Self
Create a new container that is detached from the document. The edits on a detached container will not be persisted. To attach the container to the document, please insert it into an attached container.
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<T: HandlerTrait>( &self, key: &str, handler: T ) -> LoroResult<T>
pub fn insert_container_with_txn<H: HandlerTrait>( &self, txn: &mut Transaction, key: &str, child: H ) -> LoroResult<H>
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)
pub fn get_child_handler(&self, key: &str) -> LoroResult<Handler>
pub fn get_deep_value_with_id(&self) -> LoroResult<LoroValue>
pub fn get(&self, key: &str) -> Option<LoroValue>
sourcepub fn get_(&self, key: &str) -> Option<ValueOrHandler>
pub fn get_(&self, key: &str) -> Option<ValueOrHandler>
Get the value at given key, if value is a container, return a handler to the container
pub fn get_or_create_container<C: HandlerTrait>( &self, key: &str, child: C ) -> LoroResult<C>
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 moresource§impl Debug for MapHandler
impl Debug for MapHandler
source§impl HandlerTrait for MapHandler
impl HandlerTrait for MapHandler
fn is_attached(&self) -> bool
fn attached_handler(&self) -> Option<&BasicHandler>
fn get_value(&self) -> LoroValue
fn get_deep_value(&self) -> LoroValue
fn kind(&self) -> ContainerType
fn to_handler(&self) -> Handler
source§fn attach(
&self,
txn: &mut Transaction,
parent: &BasicHandler,
self_id: ContainerID
) -> LoroResult<Self>
fn attach( &self, txn: &mut Transaction, parent: &BasicHandler, self_id: ContainerID ) -> LoroResult<Self>
This method returns an attached handler.
source§fn get_attached(&self) -> Option<Self>
fn get_attached(&self) -> Option<Self>
If a detached container is attached, this method will return its corresponding attached handler.
fn from_handler(h: Handler) -> Option<Self>
fn parent(&self) -> Option<Handler>
fn idx(&self) -> ContainerIdx
fn id(&self) -> ContainerID
fn with_state<R>( &self, f: impl FnOnce(&mut State) -> LoroResult<R> ) -> LoroResult<R>
Auto Trait Implementations§
impl Freeze for MapHandler
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