Skip to main content

runnerd_core/api/
tone.rs

1//! What a figure or label means for the reader, as every client colours it: core decides the meaning, clients only
2//! pick the colour (a CSS class, an ANSI code, a ratatui style).
3
4/// What a shown fact means for the reader.
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6pub enum Tone {
7    /// All is well, or a change for the better.
8    Good,
9    /// Worth a look: something waits, or nears a limit.
10    Warn,
11    /// Something failed or is wrong.
12    Bad,
13    /// A plain fact.
14    Neutral,
15    /// A fact in the background, such as an idle slot or a note.
16    Quiet,
17}
18
19/// Text and what it means, for a client to colour.
20#[derive(Debug, Clone, PartialEq, Eq)]
21pub struct Toned {
22    /// What it says.
23    pub text: String,
24    /// What it means.
25    pub tone: Tone,
26}