pub trait Step {
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
sourcefn initialize(&mut self, dependency_state: &mut DependencyState, index: usize)
fn initialize(&mut self, dependency_state: &mut DependencyState, index: usize)
Perform any post-configuration initialization actions for this step.
sourcefn render(
&self,
interface: &mut Interface<'_>,
dependency_state: &DependencyState,
position: Position,
is_focused: bool
) -> u16
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.
sourcefn update(
&mut self,
dependency_state: &mut DependencyState,
input: KeyEvent
) -> Option<InputResult>
fn update(
&mut self,
dependency_state: &mut DependencyState,
input: KeyEvent
) -> Option<InputResult>
Handle the specified input event, optionally returning an instruction for the form.
sourcefn drawer(&self) -> Option<DrawerContents>
fn drawer(&self) -> Option<DrawerContents>
Retrieve this step’s current drawer contents, if applicable.
sourcefn result(&self, dependency_state: &DependencyState) -> String
fn result(&self, dependency_state: &DependencyState) -> String
Retrieves this step’s final WYSIWYG result.