tui_input/
lib.rs

1//! TUI input library supporting multiple backends.
2//!
3//! # Example: Without any backend
4//!
5//! ```
6//! use tui_input::{Input, InputRequest, StateChanged};
7//!
8//! let mut input: Input = "Hello Worl".into();
9//!
10//! let req = InputRequest::InsertChar('d');
11//! let resp = input.handle(req);
12//!
13//! assert_eq!(resp, Some(StateChanged { value: true, cursor: true }));
14//! assert_eq!(input.cursor(), 11);
15//! assert_eq!(input.to_string(), "Hello World");
16//! ```
17//!
18//! See other examples in the [GitHub repo](https://github.com/sayanarijit/tui-input/tree/main/examples).
19
20mod input;
21
22pub mod backend;
23pub use input::{Input, InputRequest, InputResponse, StateChanged};