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. On the wire in kebab-case, as an attention item carries it.
5#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6#[serde(rename_all = "kebab-case")]
7pub enum Tone {
8    /// All is well, or a change for the better.
9    Good,
10    /// Worth a look: something waits, or nears a limit.
11    Warn,
12    /// Something failed or is wrong.
13    Bad,
14    /// A plain fact.
15    Neutral,
16    /// A fact in the background, such as an idle slot or a note.
17    Quiet,
18}
19
20/// Text and what it means, for a client to colour.
21#[derive(Debug, Clone, PartialEq, Eq)]
22pub struct Toned {
23    /// What it says.
24    pub text: String,
25    /// What it means.
26    pub tone: Tone,
27}