[][src]Struct libcvss::v31::CVSS31Vector

pub struct CVSS31Vector {
    pub base: BaseVector,
    pub temporal: Option<TemporalVector>,
    pub environmental: Option<EnvironmentalVector>,
}

A CVSS V3.1 vector.

This structure contains a mandatory base vector, an optional temporal vector and an optional environmental vector.

Fields

base: BaseVector

Mandatory Base vector.

temporal: Option<TemporalVector>

Optional Temporal vector.

environmental: Option<EnvironmentalVector>

Optional Environmental vector.

Methods

impl CVSS31Vector[src]

pub fn parse_strict(cvss_string: &str) -> Result<Self, Vec<&'static str>> where
    Self: Sized
[src]

Attempts to parse a string slice as a CVSS vector, in strict mode.

In strict mode, all fields must be in canonical order as defined by the CVSS specification. They must be present exactly once (for mandatory fields), or zero or one time for optional fields.

If parsing fails a list of of errors will be returned in a human readable format.

pub fn parse_nonstrict(cvss_string: &str) -> Result<Self, Vec<&'static str>> where
    Self: Sized
[src]

Attempts to parse a string slice as a CVSS vector, in non-strict mode.

In non-strict mode, the parser will make the best out of the input. Fields do not have to be in the canonical order, and can be repeated (the last occurence of a field will be used). All mandatory fields (per the CVSS specification) still have to be present in the input.

If parsing fails a list of of errors will be returned in a human readable format.

pub fn score(&self) -> f64[src]

Provides the severity score for the CVSS vector.

This score respects the CVSS 3.1 specification, particularly regarding floating-point roundup.

Trait Implementations

impl Clone for CVSS31Vector[src]

impl Copy for CVSS31Vector[src]

impl Debug for CVSS31Vector[src]

impl<'de> Deserialize<'de> for CVSS31Vector[src]

impl Display for CVSS31Vector[src]

impl PartialEq<CVSS31Vector> for CVSS31Vector[src]

impl Serialize for CVSS31Vector[src]

impl StructuralPartialEq for CVSS31Vector[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.