#[non_exhaustive]pub struct FindingVulnerabilityBuilder { /* private fields */ }Expand description
A builder for FindingVulnerability.
Implementations§
Source§impl FindingVulnerabilityBuilder
impl FindingVulnerabilityBuilder
Sourcepub fn title(self, input: impl Into<String>) -> Self
pub fn title(self, input: impl Into<String>) -> Self
The title of a finding, from the producer’s own title – OCSF finding_info.title, or the scanner’s finding title. Length matches the OCSF title constraint.
Sourcepub fn set_title(self, input: Option<String>) -> Self
pub fn set_title(self, input: Option<String>) -> Self
The title of a finding, from the producer’s own title – OCSF finding_info.title, or the scanner’s finding title. Length matches the OCSF title constraint.
Sourcepub fn get_title(&self) -> &Option<String>
pub fn get_title(&self) -> &Option<String>
The title of a finding, from the producer’s own title – OCSF finding_info.title, or the scanner’s finding title. Length matches the OCSF title constraint.
Sourcepub fn description(self, input: impl Into<String>) -> Self
pub fn description(self, input: impl Into<String>) -> Self
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn set_description(self, input: Option<String>) -> Self
pub fn set_description(self, input: Option<String>) -> Self
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn get_description(&self) -> &Option<String>
pub fn get_description(&self) -> &Option<String>
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn cwe_id(self, input: impl Into<String>) -> Self
pub fn cwe_id(self, input: impl Into<String>) -> Self
Primary CWE for this vulnerability, e.g. “CWE-89”.
Sourcepub fn set_cwe_id(self, input: Option<String>) -> Self
pub fn set_cwe_id(self, input: Option<String>) -> Self
Primary CWE for this vulnerability, e.g. “CWE-89”.
Sourcepub fn get_cwe_id(&self) -> &Option<String>
pub fn get_cwe_id(&self) -> &Option<String>
Primary CWE for this vulnerability, e.g. “CWE-89”.
Sourcepub fn cwe_caption(self, input: impl Into<String>) -> Self
pub fn cwe_caption(self, input: impl Into<String>) -> Self
The producer’s human-readable caption for cweId.
Sourcepub fn set_cwe_caption(self, input: Option<String>) -> Self
pub fn set_cwe_caption(self, input: Option<String>) -> Self
The producer’s human-readable caption for cweId.
Sourcepub fn get_cwe_caption(&self) -> &Option<String>
pub fn get_cwe_caption(&self) -> &Option<String>
The producer’s human-readable caption for cweId.
Sourcepub fn additional_cwe_ids(self, input: impl Into<String>) -> Self
pub fn additional_cwe_ids(self, input: impl Into<String>) -> Self
Appends an item to additional_cwe_ids.
To override the contents of this collection use set_additional_cwe_ids.
Further CWEs the producer attributed to this same vulnerability.
Sourcepub fn set_additional_cwe_ids(self, input: Option<Vec<String>>) -> Self
pub fn set_additional_cwe_ids(self, input: Option<Vec<String>>) -> Self
Further CWEs the producer attributed to this same vulnerability.
Sourcepub fn get_additional_cwe_ids(&self) -> &Option<Vec<String>>
pub fn get_additional_cwe_ids(&self) -> &Option<Vec<String>>
Further CWEs the producer attributed to this same vulnerability.
Sourcepub fn set_cve_id(self, input: Option<String>) -> Self
pub fn set_cve_id(self, input: Option<String>) -> Self
A CVE identifier, e.g. “CVE-2020-8203”.
Sourcepub fn get_cve_id(&self) -> &Option<String>
pub fn get_cve_id(&self) -> &Option<String>
A CVE identifier, e.g. “CVE-2020-8203”.
Sourcepub fn cvss_base_score(self, input: f64) -> Self
pub fn cvss_base_score(self, input: f64) -> Self
The CVSS base score for cveId, when the producer supplies one, from 0.0 to 10.0.
Sourcepub fn set_cvss_base_score(self, input: Option<f64>) -> Self
pub fn set_cvss_base_score(self, input: Option<f64>) -> Self
The CVSS base score for cveId, when the producer supplies one, from 0.0 to 10.0.
Sourcepub fn get_cvss_base_score(&self) -> &Option<f64>
pub fn get_cvss_base_score(&self) -> &Option<f64>
The CVSS base score for cveId, when the producer supplies one, from 0.0 to 10.0.
Sourcepub fn fix_coverage(self, input: impl Into<String>) -> Self
pub fn fix_coverage(self, input: impl Into<String>) -> Self
The producer’s description of how completely a fix is available.
Sourcepub fn set_fix_coverage(self, input: Option<String>) -> Self
pub fn set_fix_coverage(self, input: Option<String>) -> Self
The producer’s description of how completely a fix is available.
Sourcepub fn get_fix_coverage(&self) -> &Option<String>
pub fn get_fix_coverage(&self) -> &Option<String>
The producer’s description of how completely a fix is available.
Sourcepub fn fix_coverage_id(self, input: i32) -> Self
pub fn fix_coverage_id(self, input: i32) -> Self
The producer’s enum value behind fixCoverage.
Sourcepub fn set_fix_coverage_id(self, input: Option<i32>) -> Self
pub fn set_fix_coverage_id(self, input: Option<i32>) -> Self
The producer’s enum value behind fixCoverage.
Sourcepub fn get_fix_coverage_id(&self) -> &Option<i32>
pub fn get_fix_coverage_id(&self) -> &Option<i32>
The producer’s enum value behind fixCoverage.
Sourcepub fn locations(self, input: FindingLocation) -> Self
pub fn locations(self, input: FindingLocation) -> Self
Appends an item to locations.
To override the contents of this collection use set_locations.
Every location this vulnerability was reported at.
Sourcepub fn set_locations(self, input: Option<Vec<FindingLocation>>) -> Self
pub fn set_locations(self, input: Option<Vec<FindingLocation>>) -> Self
Every location this vulnerability was reported at.
Sourcepub fn get_locations(&self) -> &Option<Vec<FindingLocation>>
pub fn get_locations(&self) -> &Option<Vec<FindingLocation>>
Every location this vulnerability was reported at.
Sourcepub fn remediation(self, input: impl Into<String>) -> Self
pub fn remediation(self, input: impl Into<String>) -> Self
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn set_remediation(self, input: Option<String>) -> Self
pub fn set_remediation(self, input: Option<String>) -> Self
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn get_remediation(&self) -> &Option<String>
pub fn get_remediation(&self) -> &Option<String>
Free-form prose about a finding (summary, detailed analysis, rationale, remediation guidance). Capped well below the finding document’s own 256 KB limit, since several of these can appear on one finding.
Sourcepub fn remediation_references(self, input: impl Into<String>) -> Self
pub fn remediation_references(self, input: impl Into<String>) -> Self
Appends an item to remediation_references.
To override the contents of this collection use set_remediation_references.
A free-form list of strings carried verbatim from a producer.
Sourcepub fn set_remediation_references(self, input: Option<Vec<String>>) -> Self
pub fn set_remediation_references(self, input: Option<Vec<String>>) -> Self
A free-form list of strings carried verbatim from a producer.
Sourcepub fn get_remediation_references(&self) -> &Option<Vec<String>>
pub fn get_remediation_references(&self) -> &Option<Vec<String>>
A free-form list of strings carried verbatim from a producer.
Sourcepub fn code(self, input: impl Into<String>) -> Self
pub fn code(self, input: impl Into<String>) -> Self
The vulnerable fragment, when the producer supplied one.
Sourcepub fn set_code(self, input: Option<String>) -> Self
pub fn set_code(self, input: Option<String>) -> Self
The vulnerable fragment, when the producer supplied one.
Sourcepub fn get_code(&self) -> &Option<String>
pub fn get_code(&self) -> &Option<String>
The vulnerable fragment, when the producer supplied one.
Sourcepub fn details(self, input: impl Into<String>) -> Self
pub fn details(self, input: impl Into<String>) -> Self
The producer’s extended analysis for this vulnerability.
Sourcepub fn set_details(self, input: Option<String>) -> Self
pub fn set_details(self, input: Option<String>) -> Self
The producer’s extended analysis for this vulnerability.
Sourcepub fn get_details(&self) -> &Option<String>
pub fn get_details(&self) -> &Option<String>
The producer’s extended analysis for this vulnerability.
Sourcepub fn affected_packages(self, input: AffectedPackage) -> Self
pub fn affected_packages(self, input: AffectedPackage) -> Self
Appends an item to affected_packages.
To override the contents of this collection use set_affected_packages.
Software packages implicated by a finding.
Sourcepub fn set_affected_packages(self, input: Option<Vec<AffectedPackage>>) -> Self
pub fn set_affected_packages(self, input: Option<Vec<AffectedPackage>>) -> Self
Software packages implicated by a finding.
Sourcepub fn get_affected_packages(&self) -> &Option<Vec<AffectedPackage>>
pub fn get_affected_packages(&self) -> &Option<Vec<AffectedPackage>>
Software packages implicated by a finding.
Sourcepub fn build(self) -> FindingVulnerability
pub fn build(self) -> FindingVulnerability
Consumes the builder and constructs a FindingVulnerability.
Trait Implementations§
Source§impl Clone for FindingVulnerabilityBuilder
impl Clone for FindingVulnerabilityBuilder
Source§impl Debug for FindingVulnerabilityBuilder
impl Debug for FindingVulnerabilityBuilder
impl StructuralPartialEq for FindingVulnerabilityBuilder
Auto Trait Implementations§
impl Freeze for FindingVulnerabilityBuilder
impl RefUnwindSafe for FindingVulnerabilityBuilder
impl Send for FindingVulnerabilityBuilder
impl Sync for FindingVulnerabilityBuilder
impl Unpin for FindingVulnerabilityBuilder
impl UnsafeUnpin for FindingVulnerabilityBuilder
impl UnwindSafe for FindingVulnerabilityBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);