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§
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.