Skip to main content

Editors

Struct Editors 

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

The operations an editor offers, by name, in the order they were added: the order an editor offers them in within a group and tier. The runner its programs run on is given the same operations by the crate::registry::Registry that holds them.

Implementations§

Source§

impl Editors

Source

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

Adds operation. Fails if an operation of its name is already there.

Source

pub fn operations(&self) -> GeopResult<OperationRegistry>

The operations, as a program runner runs them.

Source

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

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

Source

pub fn info(&self, kind: &str) -> Option<Listed>

What the operation kind is, if it is offered.

Source

pub fn new_step<'a>( &self, runner: &Runner, part: impl Into<Against<'a>>, program: &Program, kind: &str, id: &str, before: Option<&str>, ) -> GeopResult<ProgramStep>

A new step of the operation kind, id, to insert into program before its step before, or after its last.

Source

pub fn initial_editing( &self, program: &Program, step: &str, ) -> GeopResult<Box<dyn Any>>

The editing state the step step starts with.

Source

pub fn presentation<'a>( &self, runner: &Runner, part: impl Into<Against<'a>>, program: &Program, step: &str, editing: &dyn Any, ) -> GeopResult<Form>

What the editor shows while the step step is edited.

Source

pub fn listed<'a>( &self, runner: &Runner, part: impl Into<Against<'a>>, program: &Program, step: &str, ) -> GeopResult<Form>

What a list of steps shows of the step step: its form, as a step just opened shows it, against the part before it — and never what it built, so that a list of every step asks nothing of what each built. Counted (forms_listed).

Source

pub fn process_user_event<'a>( &self, runner: &Runner, part: impl Into<Against<'a>>, program: &Program, step: &str, editing: &dyn Any, event: Event, scene: Option<&dyn Scene>, ) -> GeopResult<Edited>

The arguments and editing state of the step step after event, with what the pointer is over found in scene, if one is given.

Trait Implementations§

Source§

impl Default for Editors

Source§

fn default() -> Editors

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.