use crate::style::{Color, Style};
#[derive(Debug, Clone, Copy)]
pub struct NumberConfig {
pub style: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct UuidConfig {
pub number: Style,
pub letter: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct EmailConfig {
pub local_part: Style,
pub at_sign: Style,
pub domain: Style,
pub dot: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct KeyValueConfig {
pub key: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct DateTimeConfig {
pub date: Style,
pub time: Style,
pub zone: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct IpV4Config {
pub number: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct IpV6Config {
pub number: Style,
pub letter: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct UrlConfig {
pub http: Style,
pub https: Style,
pub host: Style,
pub path: Style,
pub query_params_key: Style,
pub query_params_value: Style,
pub symbols: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct UnixPathConfig {
pub segment: Style,
pub separator: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct PointerConfig {
pub number: Style,
pub letter: Style,
pub x: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct UnixProcessConfig {
pub name: Style,
pub id: Style,
pub bracket: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct JsonConfig {
pub key: Style,
pub quote_token: Style,
pub curly_bracket: Style,
pub square_bracket: Style,
pub comma: Style,
pub colon: Style,
}
#[derive(Debug, Clone, Copy)]
pub struct QuoteConfig {
pub quote_token: u8,
pub style: Style,
}
#[derive(PartialEq, Eq, Ord, PartialOrd, Debug, Clone)]
pub struct KeywordConfig {
pub words: Vec<String>,
pub style: Style,
}
#[derive(PartialEq, Eq, Ord, PartialOrd, Debug, Clone)]
pub struct RegexConfig {
pub regex: String,
pub style: Style,
}
impl Default for NumberConfig {
fn default() -> Self {
NumberConfig {
style: Style::new().fg(Color::Cyan),
}
}
}
impl Default for EmailConfig {
fn default() -> Self {
EmailConfig {
local_part: Style::new().fg(Color::Green).underline(),
at_sign: Style::new().fg(Color::Red),
domain: Style::new().fg(Color::Green).underline(),
dot: Style::new().fg(Color::Red),
}
}
}
impl Default for UuidConfig {
fn default() -> Self {
UuidConfig {
number: Style::new().fg(Color::Blue).italic(),
letter: Style::new().fg(Color::Magenta).italic(),
separator: Style::new().fg(Color::Red),
}
}
}
impl Default for KeyValueConfig {
fn default() -> Self {
KeyValueConfig {
key: Style::new().faint(),
separator: Style::new().fg(Color::White),
}
}
}
impl Default for DateTimeConfig {
fn default() -> Self {
DateTimeConfig {
date: Style::new().fg(Color::Magenta),
time: Style::new().fg(Color::Blue),
zone: Style::new().fg(Color::Red),
separator: Style::new().faint(),
}
}
}
impl Default for IpV4Config {
fn default() -> Self {
IpV4Config {
number: Style::new().fg(Color::Blue).italic(),
separator: Style::new().fg(Color::Red),
}
}
}
impl Default for IpV6Config {
fn default() -> Self {
IpV6Config {
number: Style::new().fg(Color::Blue).italic(),
letter: Style::new().fg(Color::Magenta).italic(),
separator: Style::new().fg(Color::Red),
}
}
}
impl Default for UrlConfig {
fn default() -> Self {
UrlConfig {
http: Style::new().fg(Color::Red).faint(),
https: Style::new().fg(Color::Green).faint(),
host: Style::new().fg(Color::Blue).faint(),
path: Style::new().fg(Color::Blue),
query_params_key: Style::new().fg(Color::Magenta),
query_params_value: Style::new().fg(Color::Cyan),
symbols: Style::new().fg(Color::Red),
}
}
}
impl Default for UnixPathConfig {
fn default() -> Self {
UnixPathConfig {
segment: Style::new().fg(Color::Green),
separator: Style::new().fg(Color::Yellow),
}
}
}
impl Default for PointerConfig {
fn default() -> Self {
PointerConfig {
number: Style::new().fg(Color::Blue).italic(),
letter: Style::new().fg(Color::Magenta).italic(),
x: Style::new().fg(Color::Red),
}
}
}
impl Default for UnixProcessConfig {
fn default() -> Self {
UnixProcessConfig {
name: Style::new().fg(Color::Yellow),
id: Style::new().fg(Color::Cyan),
bracket: Style::new().fg(Color::Red),
}
}
}
impl Default for JsonConfig {
fn default() -> Self {
JsonConfig {
key: Style::new().faint(),
quote_token: Style::new().faint(),
curly_bracket: Style::new().faint(),
square_bracket: Style::new().faint(),
comma: Style::new().faint(),
colon: Style::new().faint(),
}
}
}
impl Default for QuoteConfig {
fn default() -> Self {
QuoteConfig {
quote_token: b'"',
style: Style::new().fg(Color::Yellow),
}
}
}