Struct loro_common::ID
source · pub struct ID {
pub peer: PeerID,
pub counter: Counter,
}
Fields§
§peer: PeerID
§counter: Counter
Implementations§
source§impl ID
impl ID
pub fn new(peer: PeerID, counter: Counter) -> Self
pub fn new_root() -> Self
pub fn is_null(&self) -> bool
pub fn to_span(&self, len: usize) -> IdSpan
pub fn unknown(counter: Counter) -> Self
pub fn is_unknown(&self) -> bool
pub fn inc(&self, inc: i32) -> Self
pub fn contains(&self, len: Counter, target: ID) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for ID
impl<'de> Deserialize<'de> for ID
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 ID
impl Ord for ID
source§impl PartialOrd for ID
impl PartialOrd for ID
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 ID
impl Eq for ID
impl StructuralEq for ID
impl StructuralPartialEq for ID
Auto Trait Implementations§
impl RefUnwindSafe for ID
impl Send for ID
impl Sync for ID
impl Unpin for ID
impl UnwindSafe for ID
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