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§
Sourcefn text(&self) -> (Segment, Option<u16>)
fn text(&self) -> (Segment, Option<u16>)
This control’s rendered contents and an optional offset for the cursor.
Sourcefn drawer(&self) -> Option<DrawerContents>
fn drawer(&self) -> Option<DrawerContents>
This control’s drawer contents, if available.
Sourcefn evaluation(&self) -> Option<(DependencyId, Evaluation)>
fn evaluation(&self) -> Option<(DependencyId, Evaluation)>
This control’s dependency evaluation which other controls may react to.
Sourcefn dependency(&self) -> Option<(DependencyId, Action)>
fn dependency(&self) -> Option<(DependencyId, Action)>
This control’s dependency which it may react to.
Sourcefn evaluate(&self, evaluation: &Evaluation) -> bool
fn evaluate(&self, evaluation: &Evaluation) -> bool
Perform an evaluation against this control’s current state.
Sourcefn add_to(self, step: &mut CompoundStep)
fn add_to(self, step: &mut CompoundStep)
Finish configuration and add this control to the specified form step.