appcui 0.4.8

A feature-rich and cross-platform TUI/CUI framework for Rust, enabling modern terminal-based applications on Windows, Linux, and macOS. Includes built-in UI components like buttons, menus, list views, tree views, checkboxes, and more. Perfect for building fast and interactive CLI tools and text-based interfaces.
Documentation
#[derive(Copy,Clone,Eq,PartialEq,Debug)]
pub(crate) enum CharClass {
    Word,
    Operator,
    Bracket,
    String,
    Space,
    Other,
}
impl From<char> for CharClass {
    fn from(value: char) -> Self {
        match value {
            'A'..='Z' | 'a'..='z' | '0'..='9' | '_' => CharClass::Word,
            ' ' | '\t' | '\n' | '\r' => CharClass::Space,
            '(' | ')' | '[' | ']' | '{' | '}' => CharClass::Bracket,
            '+' | '-' | '*' | '.' | '/' | '\\' | '!' | '=' | '&' | '|' | ':' | '@' | '%' | '^' | '~' | '<' | '>' | '?' | ',' | ';' | '#' | '$' => {
                CharClass::Operator
            }
            '"' | '\'' | '`' => CharClass::String,
            '\u{0080}'..=char::MAX => CharClass::Word,
            _ => CharClass::Other,
        }
    }
}