Struct chronofold::Session[][src]

pub struct Session<'a, A, T> { /* fields omitted */ }
Expand description

An editing session tied to one author.

Session provides a lot of functions you might know from Vec or VecDeque. Under the hood, Session will append changes to the chronofolds log.

Note that Session has a mutable (exclusive) borrow of a chronofold. So Rust’s ownership rules enforce that there is always just one Session per chronofold.

Implementations

Creates an editing session for a single author.

Clears the chronofold, removing all elements.

Appends an element to the back of the chronofold and returns the new element’s log index.

Prepends an element to the chronofold and returns the new element’s log index.

Inserts an element after the element with log index index and returns the new element’s log index.

If index == None, the element will be inserted at the beginning.

Removes the element with log index index from the chronofold.

Note that this just marks the element as deleted, not actually modify the log apart from appending a Change::Delete.

Extends the chronofold with the contents of iter, returns the log index of the last inserted element, if any.

Replaces the specified range in the chronofold with the given replace_with iterator and returns the log index of the last inserted element, if any.

Returns an iterator over ops in log order, that where created in this session.

Trait Implementations

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter. Read more

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