Skip to main content

Crate urushi_prompt

Crate urushi_prompt 

Source
Expand description

Blocking, inline terminal prompt runtime styled with urushi.

Form::run opens and owns a short-lived default terminal session, while Form::run_with_terminal runs on a caller-owned connection after an explicit theme has been selected. Both block until the form is submitted, cancelled, or terminal I/O fails. Neither queries the terminal background or changes the supplied theme. The crate exposes the form runtime (Form, FormBuilder, PromptStart, InlineResizePolicy, Group, FormOutcome, RunError) together with the Input, Select, and Confirm field controls, and re-exports urushi for styling.

Re-exports§

pub use urushi;

Structs§

Confirm
A yes-or-no field with an optional default answer.
ConfirmAnswer
A submitted confirmation value and how it was chosen.
FieldKey
Form
A blocking, ordered collection of prompt groups.
FormBuilder
A builder for a blocking prompt form.
FormValues
Values made available only after a form is submitted.
Group
A group of fields executed in builder insertion order.
GroupBuilder
A builder for a non-empty prompt group.
Input
A one-line text input field.
Select
A field that selects one value from a non-empty list of options.
SelectOption
A labelled value offered by Select.
ValidationError
An error reported by a synchronous input validator.

Enums§

ConfirmSource
The provenance of a submitted confirmation value.
FieldConfigError
A field-specific configuration error reserved for concrete field controls.
FormBuildError
An invalid top-level form configuration.
FormOutcome
The terminal-visible outcome of a completed form run.
GroupBuildError
An invalid group configuration.
InlineResizePolicy
What an inline prompt does when its terminal viewport is resized.
IoOperation
The I/O boundary at which a prompt run failed.
PromptStart
Where a prompt establishes the left edge of its owned region.
RunError
An error that prevents a form from completing normally.

Traits§

Field
A crate-provided prompt field.

Type Aliases§

Validator
A synchronous validation rule for a prompt value.