Skip to main content

DocumentHistory

Trait DocumentHistory 

pub trait DocumentHistory {
    // Provided methods
    fn history_registration(
        &self,
    ) -> Result<Option<HistoryRegistration>, HistoryRegistrationError> { ... }
    fn history_restore_readiness(&self, _scope: &str) -> Result<(), String> { ... }
    fn document_history_definition(&self) -> Option<&'static HistoryDefinition> { ... }
    fn physical_text_policy(
        &self,
        _previous: Option<&EncodedAction>,
        _next: &EncodedAction,
    ) -> (bool, bool) { ... }
    fn document_action_applied(
        &mut self,
        _action: &EncodedAction,
        _before: &[ChangeHash],
        _doc: &AutoCommit,
        _path: &ExId,
    ) { ... }
}
Expand description

A widget that owns a document’s History: its registration, restore readiness and presentation.

Provided Methods§

fn history_registration( &self, ) -> Result<Option<HistoryRegistration>, HistoryRegistrationError>

Explicit root-owned History custody, including selected external resources. Runners consume this bundle; preview renderers never receive the root.

§Errors

Returns a registration error when the root cannot provide valid History custody.

fn history_restore_readiness(&self, _scope: &str) -> Result<(), String>

Additional read-only veto for uncommitted app-local drafts in this scope. This does not confer authority or recursively consult independent owners.

fn document_history_definition(&self) -> Option<&'static HistoryDefinition>

Presentation declaration for the record this widget’s owner checks out. Grants no authority; the owner resolves custody.

fn physical_text_policy( &self, _previous: Option<&EncodedAction>, _next: &EncodedAction, ) -> (bool, bool)

Pure policy for physical text emitted by this owner. The host alone decides whether the exact author, instance and frontier may continue. Programmatic and agent document actions never consult this policy.

fn document_action_applied( &mut self, _action: &EncodedAction, _before: &[ChangeHash], _doc: &AutoCommit, _path: &ExId, )

A successful, locally applied resource Document action on this exact owner. Immutable document access permits cache reconciliation only. Not called for submissions, failed execution, replay, remote merge, or History restore.

Implementors§