Skip to main content

urushi_prompt/
lib.rs

1//! Blocking, inline terminal prompt runtime styled with [`urushi`].
2//!
3//! [`Form::run`] opens and owns a short-lived default terminal session, while
4//! [`Form::run_with_terminal`] runs on a caller-owned connection after an
5//! explicit theme has been selected. Both block until the form is submitted,
6//! cancelled, or terminal I/O fails. Neither queries the terminal background
7//! or changes the supplied theme. The crate exposes the form runtime ([`Form`],
8//! [`FormBuilder`], [`PromptStart`], [`InlineResizePolicy`], [`Group`],
9//! [`FormOutcome`], [`RunError`]) together with the [`Input`], [`Select`], and
10//! [`Confirm`] field controls, and re-exports [`urushi`] for styling.
11
12pub use urushi;
13
14mod confirm;
15mod input;
16pub(crate) mod runtime;
17mod select;
18
19#[cfg(test)]
20mod runtime_extension_test;
21
22pub use confirm::{Confirm, ConfirmAnswer, ConfirmSource};
23pub use input::{Input, ValidationError, Validator};
24pub use runtime::{
25    Field, FieldConfigError, FieldKey, Form, FormBuildError, FormBuilder, FormOutcome, FormValues,
26    Group, GroupBuildError, GroupBuilder, InlineResizePolicy, IoOperation, PromptStart, RunError,
27};
28pub use select::{Select, SelectOption};