pub struct PaneInteractionTimeline {
pub baseline: Option<PaneTreeSnapshot>,
pub entries: Vec<PaneInteractionTimelineEntry>,
pub cursor: usize,
pub checkpoints: Vec<PaneInteractionTimelineCheckpoint>,
pub checkpoint_interval: usize,
}Expand description
Persistent interaction timeline with undo/redo cursor.
Fields§
§baseline: Option<PaneTreeSnapshot>Baseline tree before first recorded mutation.
entries: Vec<PaneInteractionTimelineEntry>Full operation history in deterministic order.
cursor: usizeNumber of entries currently applied (<= entries.len()).
checkpoints: Vec<PaneInteractionTimelineCheckpoint>Deterministic replay checkpoints keyed by applied_len.
checkpoint_interval: usizeEntry spacing used when materializing checkpoints.
Implementations§
Source§impl PaneInteractionTimeline
impl PaneInteractionTimeline
Sourcepub fn with_baseline(tree: &PaneTree) -> Self
pub fn with_baseline(tree: &PaneTree) -> Self
Construct a timeline with an explicit baseline snapshot.
Sourcepub const fn applied_len(&self) -> usize
pub const fn applied_len(&self) -> usize
Number of currently-applied entries.
Sourcepub fn replay_diagnostics(&self) -> PaneInteractionTimelineReplayDiagnostics
pub fn replay_diagnostics(&self) -> PaneInteractionTimelineReplayDiagnostics
Replay/checkpoint diagnostics for the current cursor.
Sourcepub fn checkpoint_decision(
snapshot_cost_ns: u128,
replay_step_cost_ns: u128,
) -> PaneInteractionTimelineCheckpointDecision
pub fn checkpoint_decision( snapshot_cost_ns: u128, replay_step_cost_ns: u128, ) -> PaneInteractionTimelineCheckpointDecision
Deterministic checkpoint-spacing decision from measured snapshot and replay costs.
Sourcepub fn apply_and_record(
&mut self,
tree: &mut PaneTree,
sequence: u64,
operation_id: u64,
operation: PaneOperation,
) -> Result<PaneOperationOutcome, PaneOperationError>
pub fn apply_and_record( &mut self, tree: &mut PaneTree, sequence: u64, operation_id: u64, operation: PaneOperation, ) -> Result<PaneOperationOutcome, PaneOperationError>
Append one operation by applying it to the provided tree.
If the cursor is behind the head (after undo), redo entries are dropped before appending the new branch.
Sourcepub fn undo(
&mut self,
tree: &mut PaneTree,
) -> Result<bool, PaneInteractionTimelineError>
pub fn undo( &mut self, tree: &mut PaneTree, ) -> Result<bool, PaneInteractionTimelineError>
Undo the last applied entry by deterministic rebuild from baseline.
Sourcepub fn redo(
&mut self,
tree: &mut PaneTree,
) -> Result<bool, PaneInteractionTimelineError>
pub fn redo( &mut self, tree: &mut PaneTree, ) -> Result<bool, PaneInteractionTimelineError>
Redo one entry by deterministic rebuild from baseline.
Sourcepub fn replay(&self) -> Result<PaneTree, PaneInteractionTimelineError>
pub fn replay(&self) -> Result<PaneTree, PaneInteractionTimelineError>
Rebuild a new tree from baseline and currently-applied entries.
Trait Implementations§
Source§impl Clone for PaneInteractionTimeline
impl Clone for PaneInteractionTimeline
Source§fn clone(&self) -> PaneInteractionTimeline
fn clone(&self) -> PaneInteractionTimeline
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more