pub struct PaneInteractionTimeline {
pub baseline: Option<PaneTreeSnapshot>,
pub entries: Vec<PaneInteractionTimelineEntry>,
pub cursor: usize,
pub checkpoints: Vec<PaneInteractionTimelineCheckpoint>,
pub checkpoint_interval: usize,
pub max_entries: 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.
max_entries: usizeMaximum retained history entries. A value of 0 disables pruning.
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 fn with_max_entries(self, max_entries: usize) -> Self
pub fn with_max_entries(self, max_entries: usize) -> Self
Return a copy of this timeline configured with a retained-entry cap.
Sourcepub const fn applied_len(&self) -> usize
pub const fn applied_len(&self) -> usize
Number of currently-applied entries.
Sourcepub fn next_operation_id(&self) -> u64
pub fn next_operation_id(&self) -> u64
Next operation id above every retained history entry.
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 apply_and_record_coalesced_resize_delta(
&mut self,
tree: &mut PaneTree,
sequence: u64,
operation_id: u64,
operation: PaneOperation,
coalesce_after_operation_id: u64,
) -> Result<PaneOperationOutcome, PaneOperationError>
pub fn apply_and_record_coalesced_resize_delta( &mut self, tree: &mut PaneTree, sequence: u64, operation_id: u64, operation: PaneOperation, coalesce_after_operation_id: u64, ) -> Result<PaneOperationOutcome, PaneOperationError>
Apply one operation and merge adjacent resize deltas for the same split.
The first delta keeps its pre-gesture hash so undo still restores the state before the drag began, while replay uses the most recent ratio. Coalescing is limited to entries whose operation id is above the gesture-start boundary, so separate drags on the same split remain separate undo steps.
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