terminal-colorsaurus 1.0.3

A cross-platform library for determining the terminal's background and foreground color. It answers the question «Is this terminal dark or light?».
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::error::Error;
use std::{fmt, io};

pub(crate) fn read_timed_out() -> io::Error {
    io::Error::new(io::ErrorKind::TimedOut, PollReadTimedOutError)
}

#[derive(Debug)]
struct PollReadTimedOutError;

impl fmt::Display for PollReadTimedOutError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "poll_read timed out")
    }
}

impl Error for PollReadTimedOutError {}