Struct loro_internal::version::ImVersionVector
source · pub struct ImVersionVector(/* private fields */);Expand description
Immutable version vector
It has O(1) clone time and O(logN) insert/delete/lookup time.
It’s more memory efficient than VersionVector when the version vector can be created from cloning and modifying other similar version vectors.
Implementations§
source§impl ImVersionVector
impl ImVersionVector
pub fn clear(&mut self)
pub fn get(&self, key: &PeerID) -> Option<&Counter>
pub fn insert(&mut self, k: PeerID, v: Counter)
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, PeerID, Counter>
pub fn remove(&mut self, k: &PeerID) -> Option<Counter>
pub fn len(&self) -> usize
pub fn contains_key(&self, k: &PeerID) -> bool
Trait Implementations§
source§impl Clone for ImVersionVector
impl Clone for ImVersionVector
source§fn clone(&self) -> ImVersionVector
fn clone(&self) -> ImVersionVector
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 ImVersionVector
impl Debug for ImVersionVector
source§impl Default for ImVersionVector
impl Default for ImVersionVector
source§fn default() -> ImVersionVector
fn default() -> ImVersionVector
Returns the “default value” for a type. Read more
source§impl PartialEq for ImVersionVector
impl PartialEq for ImVersionVector
source§impl PartialOrd for ImVersionVector
impl PartialOrd for ImVersionVector
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 Eq for ImVersionVector
Auto Trait Implementations§
impl RefUnwindSafe for ImVersionVector
impl Send for ImVersionVector
impl Sync for ImVersionVector
impl Unpin for ImVersionVector
impl UnwindSafe for ImVersionVector
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