Skip to main content

Registry

Struct Registry 

Source
pub struct Registry { /* private fields */ }
Expand description

Everything an editor offers: see the module docs.

Implementations§

Source§

impl Registry

Source

pub fn operation<O: Editable>(self, operation: O) -> GeopResult<Self>

Adds the operation operation, in the order an editor offers its group’s operations. Fails for a second of the same kind.

Source

pub fn drawer<D: Drawer>(self, drawer: D) -> GeopResult<Self>

Adds drawer, drawing after those already there.

Source

pub fn exporter<E: Exporter>(self, exporter: E) -> GeopResult<Self>

Adds exporter, offered after those already there.

Source

pub fn inspector<I: Inspector>(self, inspector: I) -> GeopResult<Self>

Adds inspector, offered after those already there.

Source

pub fn panel<P: Panel>(self, panel: P) -> GeopResult<Self>

Adds panel. Fails for a second of the same key.

Source

pub fn tool<T: Tool + Clone>(self, info: ToolInfo, tool: T) -> GeopResult<Self>

Adds tool, offered as info says: what is taken in hand by its key is a copy of it, as it is now. Fails for a second of the same key, and for a key a pick tool’s could be.

Source

pub fn idle_tool(self, key: &str) -> GeopResult<Self>

Makes the tool key, added before, the one in hand while no other is taken and no step is edited: what a press and a move in the view do by default — drag a placed part, say, where a part is placed. Fails for a key not added, and if there is one already: two would each take the same press their own way.

Source

pub fn settler<Scalar: Settle>(self, settler: Scalar) -> GeopResult<Self>

Makes settler what settles the program’s state. Fails if there is one already: two would move the same state each its own way.

Source

pub fn examples(self, set: ExampleSet) -> GeopResult<Self>

Adds the examples set. Fails for an example of a name already there.

Source

pub fn operations(&self) -> OperationRegistry

The operations, as a program runner runs them.

Source

pub fn editors(&self) -> &Editors

The operations, and how each is edited.

Source

pub fn infos(&self) -> Vec<Listed>

What each operation is, in the order they were added.

Source

pub fn outputs(&self) -> &Outputs

The exporters and inspectors.

Source

pub fn into_outputs(self) -> Outputs

The exporters and inspectors, without the rest.

Source

pub fn draw( &self, reader: &Reader<'_>, drawings: &Drawings, kept_by: Option<&Runner>, ) -> GeopResult<PartView>

The part reader reads, as every drawer draws it, with what its steps annotate it with: what a drawer drew before of what reads the same, as drawings kept it — and, given the runner kept_by of the program whose part it is, what a drawer that keeps its drawings (Drawer::kept) drew of it in an earlier process.

Source

pub fn structure( &self, reader: &Reader<'_>, hidden: &[String], ) -> GeopResult<Vec<StructureItem>>

What the part reader reads has, as every drawer lists it, each drawn item shown unless hidden names it — and whatever its steps list.

Source

pub fn hidden(&self, reader: &Reader<'_>) -> Vec<String>

What the drawers draw of the part reader reads only to be picked (see Drawer::hidden).

Source

pub fn panels(&self) -> impl Iterator<Item = &dyn ErasedPanel>

The panels, in the order they were added.

Source

pub fn get_panel(&self, key: &str) -> GeopResult<&dyn ErasedPanel>

The panel key.

Source

pub fn tools(&self) -> Vec<&ToolInfo>

The tools added, as a toolbar offers them, in the order they were added.

Source

pub fn tool_in_hand(&self, key: &str) -> GeopResult<Box<dyn Tool>>

A new tool key, to take in hand: one added, or, for pick:<inspector>, the pick tool of that inspector.

Source

pub fn idle_in_hand(&self) -> Option<(String, Box<dyn Tool>)>

The key of the tool in hand while none is taken, and a new one of it, if there is one (see Registry::idle_tool).

Source

pub fn get_settler(&self) -> Option<&dyn Settle>

What settles the program’s state, if anything does.

Source

pub fn example_names(&self) -> impl Iterator<Item = &'static str> + '_

The names of the example programs.

Source

pub fn example_programs(&self) -> Vec<Example<Program>> ⓘ

The example programs, each by name with what makes it: listing them builds none.

Source

pub fn workspace_example_names(&self) -> impl Iterator<Item = &'static str> + '_

The names of the examples made of several files.

Source

pub fn example(&self, name: &str) -> GeopResult<Program>

The example program name, made.

Source

pub fn workspace_example(&self, name: &str) -> GeopResult<ExampleFiles>

The files of the example of several files name, made.

Trait Implementations§

Source§

impl Default for Registry

Source§

fn default() -> Registry

Returns the “default value” for a type. 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> 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, 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.