pub trait Tool: Any {
// Required methods
fn handle(
&mut self,
ctx: &mut EditorContext<'_>,
event: &StepEditEvent,
) -> GeopResult<Changed>;
fn presentation(&self) -> Presentation;
// Provided method
fn inspection(
&mut self,
_ctx: &mut EditorContext<'_>,
) -> GeopResult<Option<Inspection>> { ... }
}Expand description
A mode in hand while no step is edited: see the module docs. Taken in
hand by its key, a fresh one each time (see
crate::registry::Registry::tool).
Required Methods§
Sourcefn handle(
&mut self,
ctx: &mut EditorContext<'_>,
event: &StepEditEvent,
) -> GeopResult<Changed>
fn handle( &mut self, ctx: &mut EditorContext<'_>, event: &StepEditEvent, ) -> GeopResult<Changed>
Something the user did in the viewport.
Sourcefn presentation(&self) -> Presentation
fn presentation(&self) -> Presentation
What it shows: what it would take lit, and whether a press grabs.
Provided Methods§
Sourcefn inspection(
&mut self,
_ctx: &mut EditorContext<'_>,
) -> GeopResult<Option<Inspection>>
fn inspection( &mut self, _ctx: &mut EditorContext<'_>, ) -> GeopResult<Option<Inspection>>
What it answers about the part, with every update while it is in hand: nothing, unless it says otherwise.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".