Skip to main content

Inspector

Trait Inspector 

Source
pub trait Inspector: 'static {
    type Options: DeserializeOwned + Default;
    type Report: Serialize;

    const INFO: InspectorInfo;

    // Required method
    fn inspect(
        output: &mut Output<'_>,
        picked: &[PickedElement],
        options: Self::Options,
    ) -> GeopResult<(Self::Report, Vec<Visual>)>;

    // Provided method
    fn show(report: &Self::Report) -> Answer { ... }
}
Expand description

A question asked of what a program built. An inspector is a unit struct; what it is told beyond the part is its Inspector::Options.

Required Associated Constants§

Required Associated Types§

Source

type Options: DeserializeOwned + Default

What it is told besides the part, as a front end sends it (JSON); the defaults where it sends none.

Source

type Report: Serialize

Its answer, as a front end is sent it.

Required Methods§

Source

fn inspect( output: &mut Output<'_>, picked: &[PickedElement], options: Self::Options, ) -> GeopResult<(Self::Report, Vec<Visual>)>

The answer about output — of the elements picked, for one that picks (InspectorInfo::picks) — and what to draw of it in the viewport: the points a distance is measured between.

Provided Methods§

Source

fn show(report: &Self::Report) -> Answer

report as a front end shows it: what lets every front end show every inspector’s answer alike. Nothing, by default: the report is shown as it is.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§