Step

Trait Step 

Source
pub trait Step {
    // Required methods
    fn initialize(
        &mut self,
        dependency_state: &mut DependencyState,
        index: usize,
    );
    fn render(
        &self,
        interface: &mut Interface<'_>,
        dependency_state: &DependencyState,
        position: Position,
        is_focused: bool,
    ) -> u16;
    fn update(
        &mut self,
        dependency_state: &mut DependencyState,
        input: KeyEvent,
    ) -> Option<InputResult>;
    fn help(&self) -> Segment;
    fn drawer(&self) -> Option<DrawerContents>;
    fn result(&self, dependency_state: &DependencyState) -> String;
    fn add_to(self, form: &mut Form);
}
Expand description

A distinct, vertically-separated phase of the form.

Required Methods§

Source

fn initialize(&mut self, dependency_state: &mut DependencyState, index: usize)

Perform any post-configuration initialization actions for this step.

Source

fn render( &self, interface: &mut Interface<'_>, dependency_state: &DependencyState, position: Position, is_focused: bool, ) -> u16

Render this step at the specified position and return the height of the rendered content.

Source

fn update( &mut self, dependency_state: &mut DependencyState, input: KeyEvent, ) -> Option<InputResult>

Handle the specified input event, optionally returning an instruction for the form.

Source

fn help(&self) -> Segment

Retrieve this step’s current help text.

Source

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

Retrieve this step’s current drawer contents, if applicable.

Source

fn result(&self, dependency_state: &DependencyState) -> String

Retrieves this step’s final WYSIWYG result.

Source

fn add_to(self, form: &mut Form)

Complete configuration and add this step to the form.

Implementors§