pub trait OptionalColor: Seal {
type Color: WriteColor;
// Required method
fn get(self) -> Option<Self::Color>;
// Provided method
fn color_kind(self) -> ColorKind { ... }
}Expand description
An optional color type. This is used to abstract over WriteColor and Option<W> where W: WriteColor
Required Associated Types§
Sourcetype Color: WriteColor
type Color: WriteColor
The color type
Required Methods§
Provided Methods§
Sourcefn color_kind(self) -> ColorKind
fn color_kind(self) -> ColorKind
Get the color kind, this is used to check if
formatting this color is supported on the current terminal when
the supports-color feature is enabled
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.