cli_ui/prompt/core/frame.rs
1//! A `Frame` is one screen-worth of prompt output, one entry per terminal row.
2
3/// One screen's worth of prompt output. Each `String` is exactly one
4/// terminal row (newlines are added by the runner). Owning the row split
5/// here means the runner can track line counts without re-parsing strings.
6pub type Frame = Vec<String>;
7
8/// Information the runner hands to `Prompt::render` on every frame.
9pub struct RenderCtx<'a> {
10 /// `Some(msg)` when the previous `handle()` returned [`Reject`]; prompts
11 /// should switch their header glyph to `▲`, color the input bar and
12 /// bottom frame yellow, and place `msg` on the bottom frame line.
13 ///
14 /// [`Reject`]: super::Step::Reject
15 pub error: Option<&'a str>,
16}