#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct RowMark {
icon: Option<String>,
tone: Option<String>,
faint: bool,
}
impl RowMark {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn sign(mut self, icon: impl Into<String>, tone: impl Into<String>) -> Self {
self.icon = Some(icon.into());
self.tone = Some(tone.into());
self
}
#[must_use]
pub fn plain_sign(mut self, icon: impl Into<String>) -> Self {
self.icon = Some(icon.into());
self.tone = None;
self
}
#[must_use]
pub fn faint(mut self, faint: bool) -> Self {
self.faint = faint;
self
}
#[must_use]
pub fn icon(&self) -> Option<&str> {
self.icon.as_deref()
}
#[must_use]
pub fn tone(&self) -> Option<&str> {
self.tone.as_deref()
}
#[must_use]
pub fn is_faint(&self) -> bool {
self.faint
}
#[must_use]
pub fn is_empty(&self) -> bool {
self.icon.is_none() && self.tone.is_none() && !self.faint
}
}