Skip to main content

ProgramState

Struct ProgramState 

Source
pub struct ProgramState {
Show 16 fields pub program: Program, pub path: Option<String>, pub steps: Vec<StepInfo>, pub marker: usize, pub can_undo: bool, pub can_redo: bool, pub tool: Option<String>, pub tools: Vec<ToolInfo>, pub operations: Vec<Listed>, pub exporters: Vec<&'static ExporterInfo>, pub inspectors: Vec<&'static InspectorInfo>, pub examples: Vec<&'static str>, pub workspace_examples: Vec<&'static str>, pub panels: BTreeMap<String, Value>, pub details: BTreeMap<String, String>, pub keys: &'static [AppKey],
}
Expand description

The program, as shown.

Fields§

§program: Program

The program itself, to save.

§path: Option<String>

The file it is in, once the editor has been told.

§steps: Vec<StepInfo>§marker: usize

How many steps run: new steps go there.

§can_undo: bool§can_redo: bool§tool: Option<String>

The key of the tool in hand, if one is (Command::Tool).

§tools: Vec<ToolInfo>

The tools to take in hand, offered beside the inspectors — none of them is an operation; the pick tools are the inspectors’.

§operations: Vec<Listed>

Every operation a step can be, as the toolbar offers them: group by group, in crate::editable::OperationGroup’s order, and within a group by crate::editable::OperationTier, the most used first, then in the order they were registered.

§exporters: Vec<&'static ExporterInfo>

What can be written of the part (Command::Export).

§inspectors: Vec<&'static InspectorInfo>

What can be asked about it (Command::Inspect), or picked in it to ask about (the tool pick:<inspector>).

§examples: Vec<&'static str>

The names of the example programs Command::LoadExample loads.

§workspace_examples: Vec<&'static str>

The names of the examples of several files Command::LoadWorkspaceExample loads.

§panels: BTreeMap<String, Value>

What each panel shows of the program, by its key (see crate::registry::Panel).

§details: BTreeMap<String, String>

What the part’s structure says beside its items, by their names, from what the panels show (see crate::registry::Panel::details): how free a placed part is.

§keys: &'static [AppKey]

The keys of what every front end offers besides the operations (see crate::keys).

Trait Implementations§

Source§

impl Clone for ProgramState

Source§

fn clone(&self) -> ProgramState

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 ProgramState

Source§

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

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

impl Serialize for ProgramState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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.