Control

Trait Control 

Source
pub trait Control {
    // Required methods
    fn focusable(&self) -> bool;
    fn update(&mut self, input: KeyEvent);
    fn help(&self) -> Option<Segment>;
    fn text(&self) -> (Segment, Option<u16>);
    fn drawer(&self) -> Option<DrawerContents>;
    fn evaluation(&self) -> Option<(DependencyId, Evaluation)>;
    fn dependency(&self) -> Option<(DependencyId, Action)>;
    fn evaluate(&self, evaluation: &Evaluation) -> bool;
    fn add_to(self, step: &mut CompoundStep);
}
Expand description

An element of a CompoundStep which may be a focusable input.

Required Methods§

Source

fn focusable(&self) -> bool

Whether this control is a focusable input.

Source

fn update(&mut self, input: KeyEvent)

Updates the control’s state from the given input event.

Source

fn help(&self) -> Option<Segment>

This control’s descriptive help text, if available.

Source

fn text(&self) -> (Segment, Option<u16>)

This control’s rendered contents and an optional offset for the cursor.

Source

fn drawer(&self) -> Option<DrawerContents>

This control’s drawer contents, if available.

Source

fn evaluation(&self) -> Option<(DependencyId, Evaluation)>

This control’s dependency evaluation which other controls may react to.

Source

fn dependency(&self) -> Option<(DependencyId, Action)>

This control’s dependency which it may react to.

Source

fn evaluate(&self, evaluation: &Evaluation) -> bool

Perform an evaluation against this control’s current state.

Source

fn add_to(self, step: &mut CompoundStep)

Finish configuration and add this control to the specified form step.

Implementors§