pub struct Painter { /* private fields */ }Expand description
Paints text for one output stream: with escape codes when color is on for it, as the text unchanged when color is off.
Implementations§
Source§impl Painter
impl Painter
Sourcepub const fn new(enabled: bool) -> Self
pub const fn new(enabled: bool) -> Self
A painter that paints when enabled is true. Use it when the
caller already holds the color decision.
Sourcepub fn stdout() -> Self
pub fn stdout() -> Self
A painter for stdout, following color_enabled.
Sourcepub fn stderr() -> Self
pub fn stderr() -> Self
A painter for stderr, following color_enabled_stderr.
Sourcepub fn paint_strong(self, role: Role, text: &str) -> String
pub fn paint_strong(self, role: Role, text: &str) -> String
text in the strong (bold) form of role.
Sourcepub fn paint_tone(self, tone: Tone, text: &str) -> String
pub fn paint_tone(self, tone: Tone, text: &str) -> String
text in tone, for tones that do not come from a role (the
monitor schemes).
Trait Implementations§
impl Copy for Painter
impl Eq for Painter
impl StructuralPartialEq for Painter
Auto Trait Implementations§
impl Forget for Painter
impl Freeze for Painter
impl RefUnwindSafe for Painter
impl Send for Painter
impl Sync for Painter
impl Unpin for Painter
impl UnsafeUnpin for Painter
impl UnwindSafe for Painter
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.