Crate tui_input

Source
Expand description

TUI input library supporting multiple backends.

§Example: Without any backend

use tui_input::{Input, InputRequest, StateChanged};

let mut input: Input = "Hello Worl".into();

let req = InputRequest::InsertChar('d');
let resp = input.handle(req);

assert_eq!(resp, Some(StateChanged { value: true, cursor: true }));
assert_eq!(input.cursor(), 11);
assert_eq!(input.to_string(), "Hello World");

See other examples in the GitHub repo.

Modules§

backend

Structs§

Input
The input buffer with cursor support.
StateChanged

Enums§

InputRequest
Input requests are used to change the input state.

Type Aliases§

InputResponse