pub struct QualityScore {
pub knowledge: Option<f64>,
pub logic: Option<f64>,
pub structure: Option<f64>,
pub last_evaluated: Option<DateTime<Utc>>,
}Expand description
Quality scores for Knowledge/Learning/Synthesis (K/L/S) dimensions.
These scores represent the quality of a document across three dimensions:
- Knowledge: Depth and accuracy of domain knowledge
- Logic: Reasoning quality and clarity
- Structure: Organisation of concepts and insight
All scores are optional and range from 0.0 to 1.0 when present.
Fields§
§knowledge: Option<f64>Knowledge quality score (0.0-1.0)
logic: Option<f64>Logic quality score (0.0-1.0)
structure: Option<f64>Structure quality score (0.0-1.0)
last_evaluated: Option<DateTime<Utc>>Timestamp when the quality was last evaluated
Implementations§
Source§impl QualityScore
impl QualityScore
Sourcepub fn composite(&self) -> f64
pub fn composite(&self) -> f64
Calculate the composite score by averaging all available scores.
Returns 0.0 if no scores are available.
§Examples
use terraphim_types::QualityScore;
let score = QualityScore {
knowledge: Some(0.8),
logic: Some(0.6),
structure: None,
last_evaluated: None,
};
assert_eq!(score.composite(), 0.7); // (0.8 + 0.6) / 2
let empty = QualityScore::default();
assert_eq!(empty.composite(), 0.0);Trait Implementations§
Source§impl Clone for QualityScore
impl Clone for QualityScore
Source§fn clone(&self) -> QualityScore
fn clone(&self) -> QualityScore
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 QualityScore
impl Debug for QualityScore
Source§impl Default for QualityScore
impl Default for QualityScore
Source§fn default() -> QualityScore
fn default() -> QualityScore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for QualityScore
impl<'de> Deserialize<'de> for QualityScore
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<QualityScore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QualityScore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QualityScore
impl PartialEq for QualityScore
Source§fn eq(&self, other: &QualityScore) -> bool
fn eq(&self, other: &QualityScore) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for QualityScore
impl Serialize for QualityScore
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for QualityScore
Auto Trait Implementations§
impl Freeze for QualityScore
impl RefUnwindSafe for QualityScore
impl Send for QualityScore
impl Sync for QualityScore
impl Unpin for QualityScore
impl UnsafeUnpin for QualityScore
impl UnwindSafe for QualityScore
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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