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 entries_since(
&self,
doc: &mut AutoCommit,
log: &mut HistoryLog,
) -> Vec<HistoryEntry>
pub fn entries_since( &self, doc: &mut AutoCommit, log: &mut HistoryLog, ) -> Vec<HistoryEntry>
Self::entries, reading only the changes log has not read yet.
The rows are the same as Self::entries’ for the same document.
§impl HistorySource
impl HistorySource
pub fn new() -> HistorySource
pub fn new() -> HistorySource
Every actor resolves to an unknown participant until registered.
pub fn without_field_paths(self) -> HistorySource
pub fn without_field_paths(self) -> HistorySource
Describe a change that edited a document’s fields by how many it edited, never by their paths. A document’s own history names the fields for whoever inspects it; a feed read by people shows no storage keys.
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 (for a package-primary document, which records no identity, the root change that stamps its store’s schema). 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> 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