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§
Provided Methods§
Sourcefn rev(&self, scope: &ScopeId) -> u64
fn rev(&self, scope: &ScopeId) -> u64
A scope’s revision, read every pass (cheaper than its line).
Sourcefn tips(&self, scope: &ScopeId) -> Option<Line>
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.
Sourcefn group(&mut self, _origin: &Origin, _label: &Label) -> Option<u64>
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.
Sourcefn close(&mut self, _group: u64, _keep: bool)
fn close(&mut self, _group: u64, _keep: bool)
Closes a group: kept as one step, or (keep false) put back.
Sourcefn in_progress(&self, _scope: &ScopeId) -> Option<Label>
fn in_progress(&self, _scope: &ScopeId) -> Option<Label>
A gesture still going in the scope: undo, redo and jump wait for it.
Sourcefn features(&self, _scope: &ScopeId) -> Features
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.
Sourcefn snapshot(
&mut self,
request: &Request,
_name: &str,
_origin: &Origin,
) -> Result<Snapshot, Refusal>
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.
Sourcefn restore(
&mut self,
request: &Request,
_snapshot: u64,
_origin: &Origin,
) -> Answer
fn restore( &mut self, request: &Request, _snapshot: u64, _origin: &Origin, ) -> Answer
Brings the scope back to a snapshot’s state, as a new step.
Sourcefn forget(&mut self, request: &Request, _snapshot: u64) -> Result<(), Refusal>
fn forget(&mut self, request: &Request, _snapshot: u64) -> Result<(), Refusal>
Deletes a snapshot.
Sourcefn undo_step(
&mut self,
request: &Request,
_step: u64,
_origin: &Origin,
) -> Answer
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.
Sourcefn replaced(&self, _scope: &ScopeId) -> Vec<Replaced>
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.
Sourcefn preview(&mut self, _scope: &ScopeId, _at: Option<At>) -> Option<Preview>
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.