Struct HistorySource
pub struct HistorySource { /* private fields */ }Expand description
Construct one, hand it an AuthorDirectory so actor ids resolve to
people, and call HistorySource::entries whenever the document changes.
Implementations§
§impl HistorySource
impl HistorySource
pub fn follow(&self, doc: &mut AutoCommit, log: &mut HistoryLog)
pub fn follow(&self, doc: &mut AutoCommit, log: &mut HistoryLog)
Self::entries, reading only the changes log has not read yet.
The rows are the same as Self::entries’ for the same document.
Bring log up to doc’s committed log without listing the rows:
HistoryLog::rows_revision then says whether they moved.
pub fn entries_since( &self, doc: &mut AutoCommit, log: &mut HistoryLog, ) -> Vec<HistoryEntry>
§impl HistorySource
impl HistorySource
pub fn new() -> HistorySource
pub fn new() -> HistorySource
Every actor resolves to an unknown participant until registered.
pub fn passing_over(self, pass_over: fn(&Change) -> bool) -> HistorySource
pub fn passing_over(self, pass_over: fn(&Change) -> bool) -> HistorySource
Pass over the changes pass_over names: they are part of the
document, and of the heads every later row is read at, but they make
no row and take no place in the window. For a document that also
keeps view state, such as which workspace a desktop shows, so that
moving the view neither shows up as history nor pushes what people
did out of the window. Decided from the change alone, so a reader
that reads the log from scratch decides it for every change.
pub fn without_record_genesis(self) -> HistorySource
pub fn without_record_genesis(self) -> HistorySource
Leave out a record’s genesis: the change that created it with its initial content, made by an actor derived from the record’s identity at time zero, carrying the framework’s genesis message (for a package-primary document, which records no identity, the root change that starts it). A document’s own history keeps it as the version to restore to; a feed of what people did has no one to name for it.
pub fn with_artifact_kind(self, kind: ArtifactKind) -> HistorySource
pub fn with_max_entries(self, max: usize) -> HistorySource
So a long-lived producer can learn about a peer that joined after it was constructed.
pub fn entries(&self, doc: &mut AutoCommit) -> Vec<HistoryEntry>
pub fn entries(&self, doc: &mut AutoCommit) -> Vec<HistoryEntry>
Widgets sort for display differently (timeline newest-first, scrubber left-to-right), so this returns the document’s own causal order and lets them decide. Only committed changes are listed; pending edits stay in the live document until the app commits its action.
Trait Implementations§
§impl Default for HistorySource
impl Default for HistorySource
§fn default() -> HistorySource
fn default() -> HistorySource
Auto Trait Implementations§
impl Freeze for HistorySource
impl RefUnwindSafe for HistorySource
impl Send for HistorySource
impl Sync for HistorySource
impl Unpin for HistorySource
impl UnsafeUnpin for HistorySource
impl UnwindSafe for HistorySource
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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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