cli_ui/prompt/core/step.rs
1//! Outcome of a single key press inside a [`Prompt`](super::Prompt).
2
3/// The transition a prompt requests after handling one key.
4#[derive(Debug)]
5pub enum Step<T> {
6 /// State changed but we're not finished — keep reading keys.
7 Continue,
8 /// Done; deliver `T` to the caller.
9 Submit(T),
10 /// User asked to abort (Esc, Ctrl-C, …). Runner converts this into
11 /// [`PromptError::Interrupted`](super::super::error::PromptError::Interrupted).
12 Cancel,
13 /// Block submission and display `msg` under the input line in the
14 /// runner's error style. The next non-Enter key clears the error.
15 Reject(String),
16}