pub struct State { /* private fields */ }Expand description
One state a StatusMatrix cell can be in: a name, a symbol, an ASCII
symbol and a style.
The built-in states:
| State | Symbol | ASCII | Theme key |
|---|---|---|---|
pass | ✓ | + | chart.state.pass |
fail | ✗ | X | chart.state.fail |
skip | ○ | - | chart.state.skip |
flaky | ≈ | ~ | chart.state.flaky |
use rich_ext::chart::State;
let blocked = State::new("blocked", '⊘', '#', "bold magenta");
assert_eq!(blocked.symbol(false), '⊘');
assert_eq!(blocked.symbol(true), '#');Implementations§
Source§impl State
impl State
Sourcepub fn new(
name: impl Into<String>,
symbol: char,
ascii: char,
style: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, symbol: char, ascii: char, style: impl Into<String>, ) -> Self
A state called name, drawn as symbol (ascii on an ASCII
console) in style, a theme key or a definition.
A symbol must take one cell: a wide or zero-width symbol is
replaced by ascii, and an ascii above U+007F by ?.
Trait Implementations§
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.