[−][src]Struct crdt_tree::clock::Clock
lamport clock + actor
Implementations
impl<A: Actor> Clock<A>
[src]
pub fn new(actor_id: A, counter: Option<u64>) -> Self
[src]
create new Clock instance
typically counter should be None
pub fn inc(&self) -> Self
[src]
returns a new Clock with same actor but counter incremented by 1.
pub fn tick(&mut self) -> Self
[src]
increments clock counter and returns a clone
pub fn actor_id(&self) -> &A
[src]
returns actor_id reference
pub fn counter(&self) -> u64
[src]
returns counter
pub fn merge(&self, other: &Self) -> Self
[src]
returns a new Clock with same actor but counter is max(this_counter, other_counter)
Trait Implementations
impl<A: Actor + Arbitrary> Arbitrary for Clock<A>
[src]
impl<A: Clone + Actor> Clone for Clock<A>
[src]
impl<A: Debug + Actor> Debug for Clock<A>
[src]
impl<'de, A: Actor> Deserialize<'de> for Clock<A> where
A: Deserialize<'de>,
[src]
A: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<A: Actor> Eq for Clock<A>
[src]
impl<A: Actor> Ord for Clock<A>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
compares this Clock with another. if counters are unequal, returns -1 or 1 accordingly. if counters are equal, returns -1, 0, or 1 based on actor_id. (this is arbitrary, but deterministic.)
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<A: Actor> PartialEq<Clock<A>> for Clock<A>
[src]
impl<A: Actor> PartialOrd<Clock<A>> for Clock<A>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: Actor> Serialize for Clock<A> where
A: Serialize,
[src]
A: Serialize,
Auto Trait Implementations
impl<A> RefUnwindSafe for Clock<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Send for Clock<A> where
A: Send,
A: Send,
impl<A> Sync for Clock<A> where
A: Sync,
A: Sync,
impl<A> Unpin for Clock<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for Clock<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<TM> TreeMeta for TM where
TM: Clone,
[src]
TM: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,