pub struct Palette { /* private fields */ }Expand description
A resolved, semantic color palette.
When disabled every style is the identity function, so callers render the
same way regardless of terminal capability. Construct it from a resolved
boolean via Palette::new, or resolve a ColorChoice against a stream
with Palette::for_stream.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn for_stream(choice: ColorChoice, stream: &impl IsTerminal) -> Self
pub fn for_stream(choice: ColorChoice, stream: &impl IsTerminal) -> Self
Resolve a palette for a specific output stream (e.g. &std::io::stderr()).
Folds NO_COLOR, the choice, and the stream’s TTY status via
resolve_color.
Trait Implementations§
impl Copy for Palette
impl Eq for Palette
impl StructuralPartialEq for Palette
Auto Trait Implementations§
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnsafeUnpin for Palette
impl UnwindSafe for Palette
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.