Struct loro_internal::handler::TreeHandler
source · pub struct TreeHandler { /* private fields */ }
Expand description
Implementations§
source§impl TreeHandler
impl TreeHandler
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/synced. To attach the container to the document, please insert it into an attached container.
pub fn delete(&self, target: TreeID) -> LoroResult<()>
pub fn delete_with_txn( &self, txn: &mut Transaction, target: TreeID ) -> LoroResult<()>
pub fn create<T: Into<Option<TreeID>>>(&self, parent: T) -> LoroResult<TreeID>
pub fn create_with_txn<T: Into<Option<TreeID>>>( &self, txn: &mut Transaction, parent: T ) -> LoroResult<TreeID>
pub fn mov<T: Into<Option<TreeID>>>( &self, target: TreeID, parent: T ) -> LoroResult<()>
pub fn mov_with_txn<T: Into<Option<TreeID>>>( &self, txn: &mut Transaction, target: TreeID, parent: T ) -> LoroResult<()>
pub fn get_meta(&self, target: TreeID) -> LoroResult<MapHandler>
sourcepub fn get_node_parent(&self, target: TreeID) -> Option<Option<TreeID>>
pub fn get_node_parent(&self, target: TreeID) -> Option<Option<TreeID>>
Get the parent of the node, if the node is deleted or does not exist, return None
pub fn children(&self, target: TreeID) -> Vec<TreeID>
pub fn contains(&self, target: TreeID) -> bool
pub fn nodes(&self) -> Vec<TreeID>
pub fn __internal__next_tree_id(&self) -> TreeID
Trait Implementations§
source§impl Clone for TreeHandler
impl Clone for TreeHandler
source§fn clone(&self) -> TreeHandler
fn clone(&self) -> TreeHandler
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 TreeHandler
impl Debug for TreeHandler
source§impl HandlerTrait for TreeHandler
impl HandlerTrait for TreeHandler
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.
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
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 TreeHandler
impl RefUnwindSafe for TreeHandler
impl Send for TreeHandler
impl Sync for TreeHandler
impl Unpin for TreeHandler
impl UnwindSafe for TreeHandler
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