Struct crdts::glist::GList[][src]

pub struct GList<T: Ord> { /* fields omitted */ }

The GList is a grow-only list, that is, it allows inserts but not deletes. Elements in the list are paths through an ordered tree, the tree grows deeper when we try to insert between two elements who were inserted concurrently and whose paths happen to have the same prefix.

Implementations

impl<T: Ord + Clone> GList<T>[src]

pub fn new() -> Self[src]

Create an empty GList

pub fn read<'a, C: FromIterator<&'a T>>(&'a self) -> C[src]

Read the elements of the list into a user defined container

pub fn read_into<C: FromIterator<T>>(self) -> C[src]

Read the elements of the list into a user defined container, consuming the list in the process.

pub fn iter(&self) -> Iter<'_, Identifier<T>>[src]

Iterate over the elements of the list

pub fn get(&self, idx: usize) -> Option<&Identifier<T>>[src]

Return the element and it’s marker at the specified index

pub fn insert_before(
    &self,
    high_id_opt: Option<&Identifier<T>>,
    elem: T
) -> Op<T>
[src]

Generate an Op to insert the given element before the given marker

pub fn insert_after(&self, low_id_opt: Option<&Identifier<T>>, elem: T) -> Op<T>[src]

Generate an insert op to insert the given element after the given marker

pub fn len(&self) -> usize[src]

Get the length of the list.

pub fn is_empty(&self) -> bool[src]

Check if the list is empty.

pub fn first(&self) -> Option<&Identifier<T>>[src]

Get first element of the sequence represented by the list.

pub fn last(&self) -> Option<&Identifier<T>>[src]

Get last element of the sequence represented by the list.

Trait Implementations

impl<T: Clone + Ord> Clone for GList<T>[src]

impl<T: Ord> CmRDT for GList<T>[src]

type Op = Op<T>

Op defines a mutation to the CRDT. As long as Op’s from one actor are replayed in exactly the same order they were generated by that actor, the CRDT will converge. In other words, we must have a total ordering on each actors operations, while requiring only a partial order over all ops. E.g. Read more

type Validation = Infallible

The validation error returned by validate_op.

impl<T: Ord> CvRDT for GList<T>[src]

type Validation = Infallible

The validation error returned by validate_merge.

impl<T: Debug + Ord> Debug for GList<T>[src]

impl<T: Ord> Default for GList<T>[src]

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

impl<T: Display + Ord> Display for GList<T>[src]

impl<T: Eq + Ord> Eq for GList<T>[src]

impl<T: Hash + Ord> Hash for GList<T>[src]

impl<T: PartialEq + Ord> PartialEq<GList<T>> for GList<T>[src]

impl<T: Ord> Serialize for GList<T> where
    T: Serialize
[src]

impl<T: Ord> StructuralEq for GList<T>[src]

impl<T: Ord> StructuralPartialEq for GList<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for GList<T> where
    T: RefUnwindSafe

impl<T> Send for GList<T> where
    T: Send

impl<T> Sync for GList<T> where
    T: Sync

impl<T> Unpin for GList<T>

impl<T> UnwindSafe for GList<T> where
    T: RefUnwindSafe

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<T> ToString for T where
    T: Display + ?Sized
[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>,