#[non_exhaustive]pub struct ColorInfo {
pub support: ColorSupport,
pub inferred_via: Vec<DetectionSource>,
}Expand description
Inferred color support and its evidence, separate from terminal identity evidence.
See Color support for the rules.
§Example
use detect_terminal::{ColorSupport, EnvMap, detect_from_env};
let env = EnvMap::from([
("TERM_PROGRAM".into(), "Apple_Terminal".into()),
("TERM_PROGRAM_VERSION".into(), "455.1".into()),
]);
assert_eq!(detect_from_env(&env).color.support, ColorSupport::Ansi256);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.support: ColorSupportInferred color support.
inferred_via: Vec<DetectionSource>Evidence for the inference, empty when support is unknown.
The raw values are in TerminalInfo, including TerminalInfo::colorterm.
Trait Implementations§
impl Eq for ColorInfo
impl StructuralPartialEq for ColorInfo
Auto Trait Implementations§
impl Forget for ColorInfo
impl Freeze for ColorInfo
impl Move for ColorInfo
impl RefUnwindSafe for ColorInfo
impl Send for ColorInfo
impl Sync for ColorInfo
impl Unpin for ColorInfo
impl UnsafeUnpin for ColorInfo
impl UnwindSafe for ColorInfo
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