mail-chars 0.2.1

provids lookup table based char classification for mail related grammars
Documentation
  • Coverage
  • 80%
    20 out of 25 items documented3 out of 13 items with examples
  • Size
  • Source code size: 32.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • rustonaut/mail-chars
    4 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rustonaut

mail-chars Crates.io mail-chars License Build Status

Provides lookup table based char classification for mail related grammar parts/charset, i.e. if a given char is valid in atext, ctext, dtext, token etc.

Note that this just covers grammar parts defining sets of chars (like atext, ctext, ...) but not contextual parts like e.g. quoted-pairs.

extern crate mail_chars;
use mail_chars::{Charset, rfc5322, rfc2045, CharMatchExt};

fn main() {
    assert!(Charset::AText.contains('d'));
    assert!('d'.is(Charset::AText));
    assert!('d'.is(rfc5322::AText));
    
    // `rfc*::*` are just re-exports grouped by RFC.
    assert_eq!(Charset::Token, rfc2045::Token);
    
    // If we want to test for more than on char set we can use lookup.
    let res = Charset::lookup('.');

    // This has the benefit that there is an `is_ascii` method.
    assert!(res.is_ascii());
    assert!(res.is(rfc2045::Token));
    assert!(res.is(rfc5322::CTextWs));
    assert!(!res.is(rfc5322::AText));
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.