pub struct AnalysisFact {
pub id: FactId,
pub kind: FactKind,
pub span: AnalysisSourceSpan,
pub subject: u64,
pub object: Option<u64>,
pub payload: BTreeMap<String, String>,
pub provenance: Vec<FactId>,
pub confidence_bps: u16,
pub reason: String,
}Expand description
One normalized analysis fact.
Fields§
§id: FactIdStable fact id.
kind: FactKindFact family.
span: AnalysisSourceSpanSource span for this fact.
subject: u64Primary subject node/symbol/object id.
object: Option<u64>Optional object node/symbol/object id.
payload: BTreeMap<String, String>Deterministic payload map. Keys are sorted by BTreeMap.
provenance: Vec<FactId>Parent facts used to derive this fact.
confidence_bps: u16Confidence in basis points, 0..=10000.
reason: StringRequired reason when confidence is below 10000 or the fact is inferred.
Implementations§
Source§impl AnalysisFact
impl AnalysisFact
Sourcepub fn exact(
id: FactId,
kind: FactKind,
span: AnalysisSourceSpan,
subject: u64,
) -> Self
pub fn exact( id: FactId, kind: FactKind, span: AnalysisSourceSpan, subject: u64, ) -> Self
Build a fact with exact confidence and no parent facts.
Sourcepub fn validate(&self) -> Result<(), AnalysisFactError>
pub fn validate(&self) -> Result<(), AnalysisFactError>
Validate intrinsic fact fields.
§Errors
Returns AnalysisFactError when ids, spans, confidence, payload, or
self-provenance are invalid.
Sourcepub fn analysis_record(&self, producer: &str) -> AnalysisFactRecord
pub fn analysis_record(&self, producer: &str) -> AnalysisFactRecord
Convert this security fact into the structural interchange record.
Trait Implementations§
Source§impl Clone for AnalysisFact
impl Clone for AnalysisFact
Source§fn clone(&self) -> AnalysisFact
fn clone(&self) -> AnalysisFact
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnalysisFact
impl Debug for AnalysisFact
Source§impl<'de> Deserialize<'de> for AnalysisFact
impl<'de> Deserialize<'de> for AnalysisFact
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AnalysisFact
Source§impl PartialEq for AnalysisFact
impl PartialEq for AnalysisFact
Source§impl Serialize for AnalysisFact
impl Serialize for AnalysisFact
impl StructuralPartialEq for AnalysisFact
Auto Trait Implementations§
impl Freeze for AnalysisFact
impl RefUnwindSafe for AnalysisFact
impl Send for AnalysisFact
impl Sync for AnalysisFact
impl Unpin for AnalysisFact
impl UnsafeUnpin for AnalysisFact
impl UnwindSafe for AnalysisFact
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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 more