use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Tone {
Plain,
Info,
Success,
Warn,
Failure,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ScreenLine {
pub tone: Tone,
pub text: String,
}
impl ScreenLine {
pub fn plain(text: impl Into<String>) -> Self {
Self {
tone: Tone::Plain,
text: text.into(),
}
}
pub fn with(tone: Tone, text: impl Into<String>) -> Self {
Self {
tone,
text: text.into(),
}
}
}