nettext/src/lib.rs
2022-11-17 17:55:50 +01:00

20 lines
494 B
Rust

pub mod crypto;
pub mod dec;
pub mod enc;
// ---- syntactic elements of the data format ----
pub(crate) const DICT_OPEN: u8 = b'{';
pub(crate) const DICT_CLOSE: u8 = b'}';
pub(crate) const DICT_ASSIGN: u8 = b'=';
pub(crate) const DICT_DELIM: u8 = b',';
pub(crate) const STR_EXTRA_CHARS: &[u8] = b"._-*?";
pub(crate) fn is_string_char(c: u8) -> bool {
c.is_ascii_alphanumeric() || STR_EXTRA_CHARS.contains(&c)
}
pub(crate) fn is_whitespace(c: u8) -> bool {
c.is_ascii_whitespace()
}