Struct loro_common::TreeID 
source · pub struct TreeID {
    pub peer: PeerID,
    pub counter: Counter,
}Expand description
Each node of movable tree has a unique TreeID generated by Loro.
To further represent the metadata (a MapContainer) associated with each node,
we also use TreeID as ID portion of ContainerID.
This not only allows for convenient association of metadata with each node,
but also ensures the uniqueness of the MapContainer.
Special ID:
- DELETED_TREE_ROOT: the root of all deleted nodes. To get it by- TreeID::delete_root()
Fields§
§peer: PeerID§counter: CounterImplementations§
source§impl TreeID
 
impl TreeID
pub fn new(peer: PeerID, counter: Counter) -> Self
sourcepub const fn delete_root() -> Self
 
pub const fn delete_root() -> Self
return DELETED_TREE_ROOT
sourcepub fn is_deleted_root(target: &TreeID) -> bool
 
pub fn is_deleted_root(target: &TreeID) -> bool
return true if the TreeID is deleted root
pub fn from_id(id: ID) -> Self
pub fn id(&self) -> ID
pub fn associated_meta_container(&self) -> ContainerID
Trait Implementations§
source§impl<'de> Deserialize<'de> for TreeID
 
impl<'de> Deserialize<'de> for TreeID
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for TreeID
 
impl Ord for TreeID
source§impl PartialEq for TreeID
 
impl PartialEq for TreeID
source§impl PartialOrd for TreeID
 
impl PartialOrd for TreeID
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for 
self and other) and is used by the <=
operator. Read moreimpl Copy for TreeID
impl Eq for TreeID
impl StructuralPartialEq for TreeID
Auto Trait Implementations§
impl Freeze for TreeID
impl RefUnwindSafe for TreeID
impl Send for TreeID
impl Sync for TreeID
impl Unpin for TreeID
impl UnwindSafe for TreeID
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
source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more