pub struct Form { /* private fields */ }Expand description
A blocking, ordered collection of prompt groups.
Implementations§
Source§impl Form
impl Form
Sourcepub fn builder() -> FormBuilder
pub fn builder() -> FormBuilder
Starts building a form.
Sourcepub fn run(self, theme: &Theme) -> Result<FormOutcome, RunError>
pub fn run(self, theme: &Theme) -> Result<FormOutcome, RunError>
Runs this form on the process’s interactive terminal connection.
The supplied theme and detected terminal capabilities are resolved once into the prompt’s styles, and fields build their view from those resolved values; no component role reaches the renderer. This convenience path opens the process’s default interactive terminal. It does not query the terminal background or change the supplied theme.
Sourcepub fn run_with_terminal(
self,
terminal: &mut impl TerminalBackend,
theme: &Theme,
) -> Result<FormOutcome, RunError>
pub fn run_with_terminal( self, terminal: &mut impl TerminalBackend, theme: &Theme, ) -> Result<FormOutcome, RunError>
Runs this form on a caller-owned interactive terminal connection.
The same backend supplies terminal queries, input events, and rendered
output for the complete prompt session. This method queries its size
and rendering capabilities, but never queries its background and never
changes the supplied theme. A caller selecting a theme with
urushi::ThemeMode::Auto should query the background first and then
pass that same backend here.