Struct tty_form::CompoundStep
source · [−]pub struct CompoundStep { /* private fields */ }Expand description
A single-line step which controls multple controls including static and input elements.
Examples
use tty_form::Form;
let mut form = Form::default();
let mut step = form.add_compound_step();
let text = step.add_static_text();
text.set_text("Branch: ");
let input = step.add_text_input();
input.set_force_lowercase(true);Implementations
sourceimpl CompoundStep
impl CompoundStep
sourcepub fn add_control(&mut self, control: Box<dyn Control>)
pub fn add_control(&mut self, control: Box<dyn Control>)
Append the specified control to this step.
sourcepub fn set_max_line_length(&mut self, max_length: u8)
pub fn set_max_line_length(&mut self, max_length: u8)
Set this step’s maximum total line length.
Trait Implementations
sourceimpl Step for CompoundStep
impl Step for CompoundStep
fn initialize(&mut self)
sourcefn render(&mut self, position: Position, interface: &mut Interface<'_>)
fn render(&mut self, position: Position, interface: &mut Interface<'_>)
Render this step at the specified position.
sourcefn handle_input(&mut self, key_event: KeyEvent) -> Option<InputResult>
fn handle_input(&mut self, key_event: KeyEvent) -> Option<InputResult>
Handle the specified input event, optionally returning an instruction for the form.
fn add_to_form(self, form: &mut Form)
Auto Trait Implementations
impl !RefUnwindSafe for CompoundStep
impl !Send for CompoundStep
impl !Sync for CompoundStep
impl Unpin for CompoundStep
impl !UnwindSafe for CompoundStep
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more