pub struct RiskState {Show 14 fields
pub status: Status,
pub title: String,
pub severity: Severity,
pub impact: u8,
pub likelihood: u8,
pub owner: Option<String>,
pub due_at: Option<NaiveDate>,
pub sla_days: Option<u32>,
pub affected_systems: Vec<String>,
pub finding_refs: Vec<FindingRef>,
pub external: Vec<ExternalLink>,
pub external_status: BTreeMap<String, String>,
pub resolved_at: Option<DateTime<Utc>>,
pub exception_expires_at: Option<NaiveDate>,
}Expand description
The current state of a risk, produced by folding its events in seq
order. Nothing here is stored on disk — it is always recomputed from the
log. See crate::risks::fold::fold.
Fields§
§status: StatusCurrent lifecycle status.
title: String§severity: Severity§impact: u8§likelihood: u8§owner: Option<String>§due_at: Option<NaiveDate>SLA due date — defaulted from opened, overridable by sla-set and
recomputed on score-changed when an sla_days basis is in effect.
sla_days: Option<u32>SLA window in days, carried from opened; used to recompute due_at
when the score changes.
affected_systems: Vec<String>§finding_refs: Vec<FindingRef>Every finding ref bound to the risk, in append order. The first is the originating finding; later ones mark re-observation (persisting).
external: Vec<ExternalLink>Tracker mirrors created by sync-out.
external_status: BTreeMap<String, String>Latest advisory status per external system. Never authoritative.
resolved_at: Option<DateTime<Utc>>When the risk reached remediated, if it has.
exception_expires_at: Option<NaiveDate>When an accepted-exception expires, if one is in effect.
Implementations§
Source§impl RiskState
impl RiskState
Sourcepub fn fingerprint(&self) -> Option<String>
pub fn fingerprint(&self) -> Option<String>
<control_id>:<finding_id> of the originating finding — the risk’s
stable cross-run identity. None only for a degenerate empty log.
Sourcepub fn source_control(&self) -> Option<&str>
pub fn source_control(&self) -> Option<&str>
The control id that produced the risk (from the first finding ref).
Sourcepub fn first_run_id(&self) -> Option<&str>
pub fn first_run_id(&self) -> Option<&str>
The run id the risk was first observed in (from the first finding ref).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RiskState
impl<'de> Deserialize<'de> for RiskState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RiskState
impl StructuralPartialEq for RiskState
Auto Trait Implementations§
impl Freeze for RiskState
impl RefUnwindSafe for RiskState
impl Send for RiskState
impl Sync for RiskState
impl Unpin for RiskState
impl UnsafeUnpin for RiskState
impl UnwindSafe for RiskState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.