pub struct KnowledgeFact {Show 20 fields
pub category: String,
pub key: String,
pub value: String,
pub source_session: String,
pub confidence: f32,
pub created_at: DateTime<Utc>,
pub last_confirmed: DateTime<Utc>,
pub retrieval_count: u32,
pub last_retrieved: Option<DateTime<Utc>>,
pub valid_from: Option<DateTime<Utc>>,
pub valid_until: Option<DateTime<Utc>>,
pub supersedes: Option<String>,
pub confirmation_count: u32,
pub feedback_up: u32,
pub feedback_down: u32,
pub last_feedback: Option<DateTime<Utc>>,
pub privacy: FactPrivacy,
pub imported_from: Option<String>,
pub archetype: KnowledgeArchetype,
pub fidelity: Option<FidelityScore>,
}Fields§
§category: String§key: String§value: String§source_session: String§confidence: f32§created_at: DateTime<Utc>§last_confirmed: DateTime<Utc>§retrieval_count: u32§last_retrieved: Option<DateTime<Utc>>§valid_from: Option<DateTime<Utc>>§valid_until: Option<DateTime<Utc>>§supersedes: Option<String>§confirmation_count: u32§feedback_up: u32§feedback_down: u32§last_feedback: Option<DateTime<Utc>>§privacy: FactPrivacy§imported_from: Option<String>§archetype: KnowledgeArchetype§fidelity: Option<FidelityScore>Implementations§
Source§impl KnowledgeFact
impl KnowledgeFact
pub fn is_current(&self) -> bool
Sourcepub fn quality_score(&self) -> f32
pub fn quality_score(&self) -> f32
Stable, intrinsic quality metric (0.0..1.0).
Based only on confidence, confirmation count, and feedback balance.
Deliberately excludes volatile signals (retrieval count, recency) to
keep recall output deterministic. For display ordering use
salience_score() which adds recency and category weighting.
pub fn was_valid_at(&self, at: DateTime<Utc>) -> bool
Sourcepub fn compute_structural_fidelity(&self) -> f64
pub fn compute_structural_fidelity(&self) -> f64
Compute structural fidelity score (0.0 - 1.0). Based on: has source, confirmations, confidence, freshness, feedback.
pub fn update_fidelity(&mut self)
Trait Implementations§
Source§impl Clone for KnowledgeFact
impl Clone for KnowledgeFact
Source§fn clone(&self) -> KnowledgeFact
fn clone(&self) -> KnowledgeFact
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 KnowledgeFact
impl Debug for KnowledgeFact
Source§impl<'de> Deserialize<'de> for KnowledgeFact
impl<'de> Deserialize<'de> for KnowledgeFact
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
Auto Trait Implementations§
impl Freeze for KnowledgeFact
impl RefUnwindSafe for KnowledgeFact
impl Send for KnowledgeFact
impl Sync for KnowledgeFact
impl Unpin for KnowledgeFact
impl UnsafeUnpin for KnowledgeFact
impl UnwindSafe for KnowledgeFact
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,
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