cve-id 0.1.0

Typesafe Common Vulnerabilities and Exposures (CVE) Identifier
Documentation
  • Coverage
  • 0%
    0 out of 10 items documented0 out of 7 items with examples
  • Size
  • Source code size: 10.04 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 247.84 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • robo9k/cveid-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • robo9k

Typesafe Common Vulnerabilities and Exposures (CVE) Identifier

use cve_id::CveId;

fn cveid_example() -> Result<(), Box<dyn std::error::Error>> {
    let cve_id = CveId::from_str("CVE-1999-0001")?;

    assert_eq!(cve_id.year(), 1999);
    assert_eq!(cve_id.number(), 1);
    assert_eq!(cve_id.to_string(), "CVE-1999-0001");

    const TEST_CVE_ID: CveId = CveId::new(1900, 424242);
    assert!(TEST_CVE_ID.is_example_or_test());

    Ok(())
}