Skip to main content

Editable

Trait Editable 

Source
pub trait Editable: Operation {
    type EditingState: Default + 'static;

    const INFO: OperationInfo;

    // Required methods
    fn new_args(context: &Context<'_>) -> Self::Args;
    fn presentation(
        context: &Context<'_>,
        args: &Self::Args,
        editing: &Self::EditingState,
    ) -> Form;
    fn process_user_event(
        context: &Context<'_>,
        args: &Self::Args,
        editing: &Self::EditingState,
        event: Event,
    ) -> (Self::Args, Self::EditingState);
}
Expand description

An Operation an editor offers: everything it keeps while a step is edited is its editing state, and everything it shows the step’s form.

Required Associated Constants§

Required Associated Types§

Source

type EditingState: Default + 'static

What the editor keeps about a step while it is edited, beyond its arguments, starting from the default whenever a step is opened.

Required Methods§

Source

fn new_args(context: &Context<'_>) -> Self::Args

The arguments of a new step: sensible defaults, taking the part it is inserted into into account.

Source

fn presentation( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, ) -> Form

What the editor shows while the step is edited. Never fails: an editor needs the form most exactly when the arguments do not build, so whatever is wrong is said in it.

Source

fn process_user_event( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, event: Event, ) -> (Self::Args, Self::EditingState)

The step’s arguments and editing state after event.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§