pub struct Form { /* private fields */ }
Expand description

A TTY-based form with multiple steps and inputs.

Examples

use tty_form::Form;

let mut form = Form::new();

let mut name_step = form.add_compound_step();
let mut prompt_text = name_step.add_static_text();
prompt_text.set_text("Enter name:");
name_step.add_text_input();

let mut description_step = form.add_description_step();
description_step.set_text("Enter information about this person:");

form.add_text_block_step();

let submission = form.execute();

Implementations

Create a new, default terminal form.

Append and return a compound step with multiple component controls.

Execute the provided form and return its WYSIWYG result.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.