Struct StepIndex
pub struct StepIndex { /* private fields */ }Expand description
A document’s history read once and kept up to date: its changes in causal order and what each one was to the steps of its author. A change’s kind never changes, so it is read once; new changes are read as they arrive.
Implementations§
§impl StepIndex
impl StepIndex
pub fn refresh(&mut self, doc: &AutoCommit)
pub fn refresh(&mut self, doc: &AutoCommit)
Bring the index up to doc’s committed heads.
pub fn hash(&self, position: usize) -> Option<ChangeHash>
pub fn hash(&self, position: usize) -> Option<ChangeHash>
The hash of the change at position in causal order.
pub fn full(&self, doc: &AutoCommit, position: usize) -> Option<Version>
pub fn full(&self, doc: &AutoCommit, position: usize) -> Option<Version>
The change at position with everything its entry records, read
again from doc.
pub fn brought_back(
&mut self,
doc: &AutoCommit,
version: &Version,
) -> Vec<String>
pub fn brought_back( &mut self, doc: &AutoCommit, version: &Version, ) -> Vec<String>
What the redo change version brought back, by full hash; empty
for any other change (brought_back, kept per change).
pub fn position(&self, hash: &ChangeHash) -> Option<usize>
pub fn position(&self, hash: &ChangeHash) -> Option<usize>
Where a change sits in causal order.
pub fn steps(
&mut self,
doc: &AutoCommit,
owns: &dyn Fn(&Version) -> bool,
step_of: &dyn Fn(&Version) -> Option<String>,
limit: usize,
) -> Vec<Vec<Version>>
pub fn steps( &mut self, doc: &AutoCommit, owns: &dyn Fn(&Version) -> bool, step_of: &dyn Fn(&Version) -> Option<String>, limit: usize, ) -> Vec<Vec<Version>>
The steps in effect that owns claims, newest first, at most
limit: each step the consecutive changes step_of puts together
(one gesture), newest first. A step undone, or superseded by a redo
that stands for it, is not in effect. What one engine undoes,
whoever asks (Ctrl+Z, an agent’s or a script’s undo).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StepIndex
impl !RefUnwindSafe for StepIndex
impl !Send for StepIndex
impl !Sync for StepIndex
impl Unpin for StepIndex
impl UnsafeUnpin for StepIndex
impl UnwindSafe for StepIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more