pub struct CommandInput { /* private fields */ }
Expand description
The command input widget itself
Implementations§
Source§impl CommandInput
impl CommandInput
Sourcepub fn prompt(&mut self, prompt: &str)
pub fn prompt(&mut self, prompt: &str)
Examples found in repository?
examples/command/main.rs (line 19)
10fn main() -> Result<(), io::Error> {
11 let yaml = load_yaml!("cli.yaml");
12 let app = App::from(yaml);
13
14 let stdout = io::stdout();
15 let backend = CrosstermBackend::new(stdout);
16 let mut terminal = Terminal::new(backend)?;
17
18 let mut tui = TuiClap::from_app(app);
19 tui.input_widget().prompt("prompt > ");
20
21 terminal.clear().expect("Could not clear terminal");
22
23 let events = Events::default();
24
25 loop {
26 draw(&mut terminal, &mut tui)?;
27 handle_input(&mut tui, &events)
28 }
29}
Trait Implementations§
Source§impl Clone for CommandInput
impl Clone for CommandInput
Source§fn clone(&self) -> CommandInput
fn clone(&self) -> CommandInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for CommandInput
impl Default for CommandInput
Source§fn default() -> CommandInput
fn default() -> CommandInput
Returns the “default value” for a type. Read more
Source§impl StatefulWidget for CommandInput
impl StatefulWidget for CommandInput
Auto Trait Implementations§
impl Freeze for CommandInput
impl RefUnwindSafe for CommandInput
impl Send for CommandInput
impl Sync for CommandInput
impl Unpin for CommandInput
impl UnwindSafe for CommandInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more