pub struct OperationInfo {
pub label: &'static str,
pub doc: &'static str,
pub group: OperationGroup,
pub tier: OperationTier,
pub experimental: bool,
pub picks_built: bool,
pub picks_whole: bool,
pub reads: &'static [&'static str],
pub icon: Option<&'static str>,
pub shortcut: Option<&'static str>,
pub kept_on_escape: bool,
}Expand description
What an operation is to an editor: its short name and what it does — what an editor offers it by — and where and how prominently the editor offers it.
Fields§
§label: &'static str§doc: &'static str§group: OperationGroup§tier: OperationTier§experimental: boolNot yet robust enough to offer by default: an editor’s reduced mode leaves it out.
picks_built: boolWhether its reference fields pick in the part as the step builds it, rather than as it was before: a placed part’s mates pick elements of the part it places.
picks_whole: boolWhether its reference fields pick in the part as the whole program builds it, the steps after its own too — and its step is edited with them built. For a step that says something of the finished part and reads none of it, wherever in the program it stands: the properties’ colours of faces, usually the first step, of faces later steps make.
reads: &'static [&'static str]The extensions of the files its steps read that are no programs — data a program keeps beside it, a STEP file: what a front end keeps in a workspace with the programs, and sends the editor.
icon: Option<&'static str>What it is shown as: SVG on a 20 × 20 grid, drawn in the current
colour — strokes currentColor, unfilled unless it says otherwise —
that a front end puts in an <svg> of its own. None to show its
label.
shortcut: Option<&'static str>The key that starts a new step of it while none is edited — a
letter, Shift+ one for the less used — as every front end offers
and shows it: E, Shift+F. Unique among the operations offered;
F and Home are the view’s (framing it), ? lists the keys.
kept_on_escape: boolWhether Escape, with nothing in progress in a step of it, puts the
step into the program as OK does, rather than cancelling it: a
sketch is drawing its user expects kept, as every CAD program keeps
a sketch left by Escape (see crate::editor::Editor::handle).
Implementations§
Source§impl OperationInfo
impl OperationInfo
Sourcepub const fn new(
label: &'static str,
doc: &'static str,
group: OperationGroup,
tier: OperationTier,
) -> Self
pub const fn new( label: &'static str, doc: &'static str, group: OperationGroup, tier: OperationTier, ) -> Self
An operation offered by default, whose reference fields pick in the part as it was before the step.
Sourcepub const fn experimental(self) -> Self
pub const fn experimental(self) -> Self
The same, but left out of an editor’s reduced mode.
Sourcepub const fn picks_built(self) -> Self
pub const fn picks_built(self) -> Self
The same, but picking in the part as the step builds it.
Sourcepub const fn picks_whole(self) -> Self
pub const fn picks_whole(self) -> Self
The same, but picking in the part as the whole program builds it.
Sourcepub const fn reads(self, reads: &'static [&'static str]) -> Self
pub const fn reads(self, reads: &'static [&'static str]) -> Self
The same, its steps reading files of the extensions reads.
Sourcepub const fn shortcut(self, shortcut: &'static str) -> Self
pub const fn shortcut(self, shortcut: &'static str) -> Self
The same, started by the key shortcut (see
OperationInfo::shortcut).
Sourcepub const fn kept_on_escape(self) -> Self
pub const fn kept_on_escape(self) -> Self
The same, kept when Escape leaves a step of it (see
OperationInfo::kept_on_escape).
Sourcepub const fn icon(self, icon: &'static str) -> Self
pub const fn icon(self, icon: &'static str) -> Self
The same, shown as icon (see OperationInfo::icon).
Trait Implementations§
Source§impl Clone for OperationInfo
impl Clone for OperationInfo
Source§fn clone(&self) -> OperationInfo
fn clone(&self) -> OperationInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more