Struct chronofold::Chronofold[][src]

pub struct Chronofold<A, T> { /* fields omitted */ }
Expand description

A conflict-free replicated data structure for versioned sequences.

Terminology

A chronofold can be regarded either as a log of changes or as a sequence of elements. These two viewpoints require distinct terminology:

  • A log index is a 0-based index in the log of changes. This indices are stable (i.e. they stay the same after edits), but are subjective for each author.
  • An element is a visible (not yet deleted) value of type T.
  • Log order refers to the chronological order in which changes were added to the log. This order is subjective for each author.
  • Causal order refers to the order of the linked list.

Editing

You can edit a chronofold in two ways: Either by applying Ops, or by creating a Session which has a Vec-like API.

Indexing

Like Vec, the Chronofold type allows to access values by index, because it implements the Index trait. The same rules apply: out-of-bound indexes cause panics, and you can use get to check whether the index exists.

Implementations

Returns the index of the last log entry (in log order).

Returns an iterator over elements and their log indices in causal order.

Returns an iterator over elements and their log indices in causal order.

Returns an iterator over elements in causal order.

Returns an iterator over changes in log order.

Returns an iterator over ops in log order.

Returns a vector clock representing the version of this chronofold.

Returns an iterator over ops newer than the given version in log order.

Constructs a new, empty chronofold.

Returns true if the chronofold contains no elements.

Returns the number of elements in the chronofold.

Returns a reference to a change in the chronofold’s log.

If index is out of bounds, None is returned.

Creates an editing session for a single author.

Applies an op to the chronofold.

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.