[][src]Struct crdt_tree::clock::Clock

pub struct Clock<A: Actor> { /* fields omitted */ }

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]

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.)

impl<A: Actor> PartialEq<Clock<A>> for Clock<A>[src]

impl<A: Actor> PartialOrd<Clock<A>> for Clock<A>[src]

impl<A: Actor> Serialize for Clock<A> where
    A: Serialize
[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for Clock<A> where
    A: RefUnwindSafe

impl<A> Send for Clock<A> where
    A: Send

impl<A> Sync for Clock<A> where
    A: Sync

impl<A> Unpin for Clock<A> where
    A: Unpin

impl<A> UnwindSafe for Clock<A> where
    A: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<TM> TreeMeta for TM where
    TM: Clone
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,