Struct tty_form::TextBlockStep
source · [−]pub struct TextBlockStep { /* private fields */ }Expand description
A multi-line text input step.
Examples
use tty_form::{Form, Step, TextBlockStep};
let mut form = Form::new();
let mut step = TextBlockStep::new("Enter your story:");
step.set_max_line_length(100);
step.add_to_form(&mut form);Implementations
sourceimpl TextBlockStep
impl TextBlockStep
Trait Implementations
sourceimpl Step for TextBlockStep
impl Step for TextBlockStep
sourcefn initialize(&mut self)
fn initialize(&mut self)
Perform any post-configuration initialization actions for this step.
sourcefn render(
&mut self,
position: Position,
interface: &mut Interface<'_>,
is_focused: bool
)
fn render(
&mut self,
position: Position,
interface: &mut Interface<'_>,
is_focused: bool
)
Render this step at the specified position.
sourcefn handle_input(&mut self, event: KeyEvent) -> Option<InputResult>
fn handle_input(&mut self, event: KeyEvent) -> Option<InputResult>
Handle the specified input event, optionally returning an instruction for the form.
sourcefn add_to_form(self, form: &mut Form)
fn add_to_form(self, form: &mut Form)
Complete configuration and add this step to the form.
sourcefn get_result(&self) -> String
fn get_result(&self) -> String
Retrieves this step’s final WYSIWYG result.
Auto Trait Implementations
impl RefUnwindSafe for TextBlockStep
impl Send for TextBlockStep
impl Sync for TextBlockStep
impl Unpin for TextBlockStep
impl UnwindSafe for TextBlockStep
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