Skip to main content

History

Trait History 

Source
pub trait History {
Show 18 methods // Required methods fn scopes(&self) -> Vec<ScopeInfo>; fn line(&self, scope: &ScopeId) -> Option<Line>; fn undo(&mut self, request: &Request, origin: &Origin) -> Answer; fn redo(&mut self, request: &Request, origin: &Origin) -> Answer; fn jump(&mut self, request: &Request, to: u64, origin: &Origin) -> Answer; // Provided methods fn rev(&self, scope: &ScopeId) -> u64 { ... } fn tips(&self, scope: &ScopeId) -> Option<Line> { ... } fn group(&mut self, _origin: &Origin, _label: &Label) -> Option<u64> { ... } fn close(&mut self, _group: u64, _keep: bool) { ... } fn in_progress(&self, _scope: &ScopeId) -> Option<Label> { ... } fn features(&self, _scope: &ScopeId) -> Features { ... } fn snapshots(&self, _scope: &ScopeId) -> Vec<Snapshot> { ... } fn snapshot( &mut self, request: &Request, _name: &str, _origin: &Origin, ) -> Result<Snapshot, Refusal> { ... } fn restore( &mut self, request: &Request, _snapshot: u64, _origin: &Origin, ) -> Answer { ... } fn forget( &mut self, request: &Request, _snapshot: u64, ) -> Result<(), Refusal> { ... } fn undo_step( &mut self, request: &Request, _step: u64, _origin: &Origin, ) -> Answer { ... } fn replaced(&self, _scope: &ScopeId) -> Vec<Replaced> { ... } fn preview(&mut self, _scope: &ScopeId, _at: Option<At>) -> Option<Preview> { ... }
}
Expand description

The owner of the application’s histories, as the interface reaches it.

Required Methods§

Source

fn scopes(&self) -> Vec<ScopeInfo>

The scopes there are.

Source

fn line(&self, scope: &ScopeId) -> Option<Line>

A scope’s steps; None: no such scope.

Source

fn undo(&mut self, request: &Request, origin: &Origin) -> Answer

Undoes the scope’s head.

Source

fn redo(&mut self, request: &Request, origin: &Origin) -> Answer

Redoes the scope’s next step.

Source

fn jump(&mut self, request: &Request, to: u64, origin: &Origin) -> Answer

Brings the scope to step to (0: the start), all or nothing.

Provided Methods§

Source

fn rev(&self, scope: &ScopeId) -> u64

A scope’s revision, read every pass (cheaper than its line).

Source

fn tips(&self, scope: &ScopeId) -> Option<Line>

A scope’s line cut to its head and its next step: what the routing and the menus read, several times a pass.

Source

fn group(&mut self, _origin: &Origin, _label: &Label) -> Option<u64>

Opens a group: what origin does until History::close is one step labelled label. None: the owner groups nothing.

Source

fn close(&mut self, _group: u64, _keep: bool)

Closes a group: kept as one step, or (keep false) put back.

Source

fn in_progress(&self, _scope: &ScopeId) -> Option<Label>

A gesture still going in the scope: undo, redo and jump wait for it.

Source

fn features(&self, _scope: &ScopeId) -> Features

What the owner supports in a scope beyond undo, redo and jump: the history panel offers only that. None by default.

Source

fn snapshots(&self, _scope: &ScopeId) -> Vec<Snapshot>

A scope’s snapshots, oldest first.

Source

fn snapshot( &mut self, request: &Request, _name: &str, _origin: &Origin, ) -> Result<Snapshot, Refusal>

Pins the scope’s current state under name (request.dry_run: the snapshot it would take, nothing kept). Refused as unsupported by default.

Source

fn restore( &mut self, request: &Request, _snapshot: u64, _origin: &Origin, ) -> Answer

Brings the scope back to a snapshot’s state, as a new step.

Source

fn forget(&mut self, request: &Request, _snapshot: u64) -> Result<(), Refusal>

Deletes a snapshot.

Source

fn undo_step( &mut self, request: &Request, _step: u64, _origin: &Origin, ) -> Answer

Undoes one step out of order (the panel’s “Undo this step”), or refuses with the reason (a later step changed the same values: VS Code’s rule). Refused as unsupported by default.

Source

fn replaced(&self, _scope: &ScopeId) -> Vec<Replaced>

The steps new steps dropped from the redo list, when the owner keeps them: the panel shows them as “replaced” rows behind a toggle, and History::jump reaches them. None by default.

Source

fn preview(&mut self, _scope: &ScopeId, _at: Option<At>) -> Option<Preview>

The pointer is on a point of the history panel (at), or left it (None): the owner may show the state there in its own views without committing anything, and say what differs. None: no preview (the default), the panel shows nothing.

Implementors§