use std::fmt::Display;
pub struct Crossterm;
impl<'crossterm> Crossterm {
pub fn new() -> Crossterm {
Crossterm
}
#[cfg(feature = "cursor")]
pub fn cursor(&self) -> crossterm_cursor::TerminalCursor {
crossterm_cursor::TerminalCursor::new()
}
#[cfg(feature = "input")]
pub fn input(&self) -> crossterm_input::TerminalInput {
crossterm_input::TerminalInput::new()
}
#[cfg(feature = "terminal")]
pub fn terminal(&self) -> crossterm_terminal::Terminal {
crossterm_terminal::Terminal::new()
}
#[cfg(feature = "style")]
pub fn color(&self) -> crossterm_style::TerminalColor {
crossterm_style::TerminalColor::new()
}
#[cfg(feature = "style")]
pub fn style<D>(&self, val: D) -> crossterm_style::StyledObject<D>
where
D: Display,
{
crossterm_style::ObjectStyle::new().apply_to(val)
}
}