Struct HistoryController
pub struct HistoryController { /* private fields */ }Implementations§
§impl HistoryController
impl HistoryController
pub fn new(
resource: HistoryResource,
live: &AutoCommit,
) -> Result<HistoryController, HistoryError>
pub fn new( resource: HistoryResource, live: &AutoCommit, ) -> Result<HistoryController, HistoryError>
Build a controller with the default factual history source.
§Errors
Returns a projection error if the committed history cannot be read.
pub fn with_source(
resource: HistoryResource,
source: HistorySource,
live: &AutoCommit,
) -> Result<HistoryController, HistoryError>
pub fn with_source( resource: HistoryResource, source: HistorySource, live: &AutoCommit, ) -> Result<HistoryController, HistoryError>
Build a controller with a caller-configured source, for example one carrying the host’s author directory and artifact kind.
§Errors
Returns a projection error if the committed history cannot be read.
pub fn has_earlier(&self) -> bool
pub fn has_earlier(&self) -> bool
Whether changes older than the listed ones exist.
pub fn show_earlier(&mut self, live: &AutoCommit) -> Result<(), HistoryError>
pub fn show_earlier(&mut self, live: &AutoCommit) -> Result<(), HistoryError>
List another page of older changes.
§Errors
Returns a projection error if the committed history cannot be read.
pub fn resource(&self) -> &HistoryResource
pub fn entries(&self) -> &[HistoryEntry]
pub fn groups(&self) -> &[HistoryGroup]
pub fn refresh(&mut self, live: &AutoCommit) -> Result<(), HistoryError>
pub fn refresh(&mut self, live: &AutoCommit) -> Result<(), HistoryError>
Reproject factual activity from committed graph state. An existing preview stays pinned to its exact bytes and heads.
§Errors
Returns a projection error if the committed history cannot be read.
pub fn select(
&mut self,
live: &AutoCommit,
entries: &[HistoryEntryId],
) -> Result<(), HistoryError>
pub fn select( &mut self, live: &AutoCommit, entries: &[HistoryEntryId], ) -> Result<(), HistoryError>
Pin the exact before and after causal frontiers of one change or group. Failed selection leaves the previous valid preview untouched.
§Errors
Returns HistoryError::EmptySelection or
HistoryError::UnknownEntry for an invalid selection, and
HistoryError::Materialize when Automerge cannot build its states.
pub fn select_compare_side(
&mut self,
side: PreviewSide,
) -> Result<(), HistoryError>
pub fn select_compare_side( &mut self, side: PreviewSide, ) -> Result<(), HistoryError>
Switch between the selected comparison’s exact states.
§Errors
Returns HistoryError::NoPreview when no history is selected.
pub fn snapshot(&self) -> Option<&HistorySnapshot>
pub fn has_live_updates(&self) -> bool
pub fn has_live_updates(&self) -> bool
Whether the observed committed live frontier differs from the pinned selected after-frontier.
pub fn back_to_live(&mut self)
pub fn review_restore(&self) -> Result<RestoreReview, HistoryError>
pub fn review_restore(&self) -> Result<RestoreReview, HistoryError>
Bind the selected state to the latest observed committed live frontier.
§Errors
Returns HistoryError::NoPreview when no history is selected and
HistoryError::EffectOnlySelection for an external effect receipt.
pub fn validate_restore(
&self,
review: &RestoreReview,
live: &AutoCommit,
) -> Result<(), HistoryError>
pub fn validate_restore( &self, review: &RestoreReview, live: &AutoCommit, ) -> Result<(), HistoryError>
Validate a review token without changing the document. The host owns the separate authority check and the eventual canonical restore write.
§Errors
Returns a HistoryError when live work is uncommitted, the resource
or selection changed, the live frontier is stale, or the selection is
an external effect receipt rather than restorable content.
Auto Trait Implementations§
impl Freeze for HistoryController
impl RefUnwindSafe for HistoryController
impl Send for HistoryController
impl Sync for HistoryController
impl Unpin for HistoryController
impl UnsafeUnpin for HistoryController
impl UnwindSafe for HistoryController
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