pub struct Registry { /* private fields */ }Expand description
Everything an editor offers: see the module docs.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn operation<O: Editable>(self, operation: O) -> GeopResult<Self>
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.
Sourcepub fn drawer<D: Drawer>(self, drawer: D) -> GeopResult<Self>
pub fn drawer<D: Drawer>(self, drawer: D) -> GeopResult<Self>
Adds drawer, drawing after those already there.
Sourcepub fn exporter<E: Exporter>(self, exporter: E) -> GeopResult<Self>
pub fn exporter<E: Exporter>(self, exporter: E) -> GeopResult<Self>
Adds exporter, offered after those already there.
Sourcepub fn inspector<I: Inspector>(self, inspector: I) -> GeopResult<Self>
pub fn inspector<I: Inspector>(self, inspector: I) -> GeopResult<Self>
Adds inspector, offered after those already there.
Sourcepub fn panel<P: Panel>(self, panel: P) -> GeopResult<Self>
pub fn panel<P: Panel>(self, panel: P) -> GeopResult<Self>
Adds panel. Fails for a second of the same key.
Sourcepub fn tool<T: Tool + Clone>(self, info: ToolInfo, tool: T) -> GeopResult<Self>
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.
Sourcepub fn idle_tool(self, key: &str) -> GeopResult<Self>
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.
Sourcepub fn settler<Scalar: Settle>(self, settler: Scalar) -> GeopResult<Self>
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.
Sourcepub fn examples(self, set: ExampleSet) -> GeopResult<Self>
pub fn examples(self, set: ExampleSet) -> GeopResult<Self>
Adds the examples set. Fails for an example of a name already
there.
Sourcepub fn operations(&self) -> OperationRegistry
pub fn operations(&self) -> OperationRegistry
The operations, as a program runner runs them.
Sourcepub fn into_outputs(self) -> Outputs
pub fn into_outputs(self) -> Outputs
The exporters and inspectors, without the rest.
Sourcepub fn draw(
&self,
reader: &Reader<'_>,
drawings: &Drawings,
kept_by: Option<&Runner>,
) -> GeopResult<PartView>
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.
Sourcepub fn structure(
&self,
reader: &Reader<'_>,
hidden: &[String],
) -> GeopResult<Vec<StructureItem>>
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.
What the drawers draw of the part reader reads only to be picked
(see Drawer::hidden).
Sourcepub fn panels(&self) -> impl Iterator<Item = &dyn ErasedPanel>
pub fn panels(&self) -> impl Iterator<Item = &dyn ErasedPanel>
The panels, in the order they were added.
Sourcepub fn get_panel(&self, key: &str) -> GeopResult<&dyn ErasedPanel>
pub fn get_panel(&self, key: &str) -> GeopResult<&dyn ErasedPanel>
The panel key.
Sourcepub fn tools(&self) -> Vec<&ToolInfo>
pub fn tools(&self) -> Vec<&ToolInfo>
The tools added, as a toolbar offers them, in the order they were added.
Sourcepub fn tool_in_hand(&self, key: &str) -> GeopResult<Box<dyn Tool>>
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.
Sourcepub fn idle_in_hand(&self) -> Option<(String, Box<dyn Tool>)>
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).
Sourcepub fn get_settler(&self) -> Option<&dyn Settle>
pub fn get_settler(&self) -> Option<&dyn Settle>
What settles the program’s state, if anything does.
Sourcepub fn example_names(&self) -> impl Iterator<Item = &'static str> + '_
pub fn example_names(&self) -> impl Iterator<Item = &'static str> + '_
The names of the example programs.
Sourcepub fn example_programs(&self) -> Vec<Example<Program>> ⓘ
pub fn example_programs(&self) -> Vec<Example<Program>> ⓘ
The example programs, each by name with what makes it: listing them builds none.
Sourcepub fn workspace_example_names(&self) -> impl Iterator<Item = &'static str> + '_
pub fn workspace_example_names(&self) -> impl Iterator<Item = &'static str> + '_
The names of the examples made of several files.
Sourcepub fn example(&self, name: &str) -> GeopResult<Program>
pub fn example(&self, name: &str) -> GeopResult<Program>
The example program name, made.
Sourcepub fn workspace_example(&self, name: &str) -> GeopResult<ExampleFiles>
pub fn workspace_example(&self, name: &str) -> GeopResult<ExampleFiles>
The files of the example of several files name, made.