#[cfg(feature = "crossterm_backend")]
mod crossterm_backend;
mod style;
use super::layout::Rect;
#[cfg(feature = "crossterm_backend")]
pub use crossterm_backend::{background_rgb, parse_raw_rgb, pull_color, serialize_rgb, CrossTerm};
use std::{
fmt::{Debug, Display},
io::{Result, Write},
};
pub use style::StyleExt;
pub const ERR_MSG: &str = "Rendering (Stdout) Err:";
pub trait Backend: Write + Sized + Debug + PartialEq + Default {
type Style: Sized + PartialEq + Debug + Clone;
type Color: Sized + PartialEq + Debug + Clone;
fn init() -> Self;
fn exit() -> std::io::Result<()>;
fn screen() -> Result<Rect>;
fn freeze(&mut self);
fn unfreeze(&mut self);
fn flush_buf(&mut self);
fn clear_to_eol(&mut self);
fn clear_line(&mut self);
fn clear_all(&mut self);
fn save_cursor(&mut self);
fn restore_cursor(&mut self);
fn set_style(&mut self, style: Self::Style);
fn get_style(&mut self) -> Self::Style;
fn to_set_style(&mut self);
fn update_style(&mut self, style: Self::Style);
fn set_fg(&mut self, color: Option<Self::Color>);
fn set_bg(&mut self, color: Option<Self::Color>);
fn reset_style(&mut self);
fn go_to(&mut self, row: u16, col: u16);
fn render_cursor_at(&mut self, row: u16, col: u16);
fn show_cursor(&mut self);
fn hide_cursor(&mut self);
fn print<D: Display>(&mut self, text: D);
fn print_at<D: Display>(&mut self, row: u16, col: u16, text: D);
fn print_styled<D: Display>(&mut self, text: D, style: Self::Style);
fn print_styled_at<D: Display>(&mut self, row: u16, col: u16, text: D, style: Self::Style);
fn pad(&mut self, width: usize);
fn pad_styled(&mut self, width: usize, style: Self::Style);
fn merge_style(left: Self::Style, right: Self::Style) -> Self::Style;
fn reversed_style() -> Self::Style;
fn bold_style() -> Self::Style;
fn ital_style() -> Self::Style;
fn slow_blink_style() -> Self::Style;
fn underline_style(color: Option<Self::Color>) -> Self::Style;
fn undercurle_style(color: Option<Self::Color>) -> Self::Style;
fn fg_style(color: Self::Color) -> Self::Style;
fn bg_style(color: Self::Color) -> Self::Style;
}
#[cfg(test)]
mod test;
#[cfg(test)]
pub use test::{MockedBackend, MockedStyle};