[][src]Enum cvssrust::CVSS

pub enum CVSS {
    V3(V3Vector),
    V2(V2Vector),
}

Enum type and parser for CVSS of all supported versions.

use cvssrust::CVSS;

let vector = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N";
match CVSS::parse(vector) {
    Ok(CVSS::V3(cvss)) => {
        println!("CVSS v3 vector: {}", cvss.to_string());
    },
    Ok(CVSS::V2(cvss)) => {
        println!("CVSS v2 vector: {}", cvss.to_string());
    },
    _ => println!("Could not parse the CVSS vector"),
}

Variants

Methods

impl CVSS[src]

pub fn parse<S>(cvss_str: S) -> Result<CVSS, ParseError> where
    S: AsRef<str>, 
[src]

Trait Implementations

impl Debug for CVSS[src]

Auto Trait Implementations

impl RefUnwindSafe for CVSS

impl Send for CVSS

impl Sync for CVSS

impl Unpin for CVSS

impl UnwindSafe for CVSS

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.