Trait tty_form::control::Control

source ·
pub trait Control {
    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

Whether this control is a focusable input.

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

This control’s descriptive help text, if available.

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

This control’s drawer contents, if available.

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

This control’s dependency which it may react to.

Perform an evaluation against this control’s current state.

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

Implementors