Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 29 variants Show, New { kind: String, }, NewIn { kind: String, placed: String, }, Open { id: String, placed: Option<String>, }, Event { event: StepEditEvent, }, Commit, Cancel, Preview { preview: bool, }, Remove { id: String, }, Move { id: String, index: usize, }, Copy { id: String, }, Paste { text: String, }, Seek { marker: Option<usize>, }, Load { program: Program, path: Option<String>, }, Files { files: BTreeMap<String, Option<String>>, }, LoadExample { name: String, }, LoadWorkspaceExample { name: String, folder: Option<String>, }, Undo, Redo, Panel { key: String, payload: Value, }, Visibility { name: String, visible: bool, }, Appearance { name: String, color: Option<String>, }, Isolate { names: Vec<String>, }, Tool { key: Option<String>, }, Inspect { inspector: String, options: Value, picked: Vec<PickedElement>, }, Export { exporter: String, format: Option<String>, options: Value, date: String, }, Light { elements: Vec<PickedElement>, }, Report, Crash,
}
Expand description

Something the user did.

Variants§

§

Show

Nothing: only what to show, all of it — how an editor starts.

§

New

Start a new step of the operation kind, where the program runs to.

Fields

§kind: String
§

NewIn

Start a new step of the operation kind after the steps of the part placed at placed — neck, or neck/head for one placed in a placed part, however deep — edited where it is placed: built against the parts placed beside it, which it reads in context (see geop_core_program::placed::OUTSIDE). Committed, it is written to that part’s file.

Fields

§kind: String
§placed: String
§

Open

Start editing the step id — of the program, or, given placed, of the part placed at that path, however deep, where it is placed (see StepInfo::placed).

Fields

§placed: Option<String>
§

Event

Something the user did to the step being edited — or, with none, with the tool in hand.

Fields

§

Commit

Put the step being edited into the program — refused, unless it builds.

§

Cancel

Stop editing the step, leaving the program as it was.

§

Preview

Whether the step being edited is shown as it builds, or the part before it.

Fields

§preview: bool
§

Remove

Fields

§

Move

Move the step id to index among the other steps.

Fields

§index: usize
§

Copy

The step id as text to paste (Program::excerpt), in the update’s export.

Fields

§

Paste

Insert the steps of the program text — what Command::Copy gave, in this program or another — where new steps go (Program::paste).

Fields

§text: String
§

Seek

Run only the first marker steps — all of them, if None — and put new steps there.

Fields

§marker: Option<usize>
§

Load

Replace the program, e.g. with one read from a file — path, if given, which the files it places are named relative to.

Fields

§program: Program
§

Files

The other program files are now these, by path: each set to its program’s text, or — None — gone. What the program places from them is built anew.

Fields

§

LoadExample

Load the example program name (see crate::registry::ExampleSet).

Fields

§name: String
§

LoadWorkspaceExample

Add the files of the example of several files name — put in folder, if given — replacing any of the same path, and edit the first of them. The update says what they are (Update::files): the front end keeps them.

Fields

§name: String
§folder: Option<String>
§

Undo

Go back one edit — while a step is edited, one edit of the step — or forward again.

§

Redo

§

Panel

Something the user did in the panel key (see crate::registry::Panel), which the panel reads payload as.

Fields

§payload: Value
§

Visibility

Show the datum, sketch, solid or placed part name of the part drawn, or hide it — whatever the editor would do by itself: a display setting, saved with the program (geop_core_program::program::Display), not a step.

Fields

§name: String
§visible: bool
§

Appearance

Draw the placed part name — bolt, asm/bolt — in the colour color, #rrggbb, over its own, or — None — in its own again: a display setting, saved with the program, not a step.

Fields

§name: String
§

Isolate

Show only the placed parts names — with the parts placed in them and those they are placed in — of the parts placed, or every one again for none: a display setting, saved with the program.

Fields

§names: Vec<String>
§

Tool

Take the tool key in hand (see crate::tools::Tool), or — None — put the one in hand down. With no step being edited, the events of the viewport are the tool’s. pick:<inspector> is the pick tool of an inspector that picks (see crate::tools::pick::PickTool): every update carries its answer about the picks (Update::inspection).

Fields

§

Inspect

Ask the inspector inspector about the part as drawn — of the elements picked, for one that picks — told options (its own, see crate::output::Inspector::Options): answered once, in Update::inspection. Changes nothing.

Fields

§inspector: String
§options: Value
§

Export

Write what the program builds — as far as it runs, the parts it places included — with the exporter exporter, in format (its first, if not given), told options (its own, see crate::output::Exporter::Options) and dated date (YYYY-MM-DD): the update’s Update::export. Changes nothing.

Fields

§exporter: String
§format: Option<String>
§options: Value
§date: String
§

Light

Light elements too, beside what the step or the tool lights — what an item of the structure or a row of an answer points at, while the pointer is on it — until lit otherwise: none, once it leaves. Changes nothing else (see Update::lit).

Fields

§elements: Vec<PickedElement>
§

Report

What a bug report attaches of the session: the program, the step being edited as it stands and the kernel’s version, in the update’s Update::report. Changes nothing.

§

Crash

Panic, on purpose: how the front ends’ recovery from a kernel that crashed is checked (web/e2e/). A panic anywhere else is a bug; this one stands in for it.

Implementations§

Source§

impl Command

Source

pub fn panel<P: Panel>(command: &P::Command) -> GeopResult<Self>
where P::Command: Serialize,

The command sending the panel P its command command: what a front end in Rust sends.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Command

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.