ReputationScore

Struct ReputationScore 

Source
pub struct ReputationScore {
    pub score: f64,
    pub confidence: f64,
    pub level: ConfidenceLevel,
    pub components: ScoreComponents,
    pub is_provisional: bool,
    pub data_points: u32,
    pub algorithm_version: String,
    pub calculated_at: DateTime<Utc>,
}
Expand description

The calculated reputation score for an agent

Contains the final reputation score along with detailed metadata about how it was calculated, component breakdowns, and confidence level.

§Fields

  • score: The final reputation score (0-100)
  • confidence: How confident we are in the score (0-1)
  • level: Categorized confidence level (Low/Medium/High)
  • components: Detailed breakdown of score components
  • is_provisional: Whether score is provisional (confidence < 0.2)
  • data_points: Total data points used (interactions + reviews)
  • algorithm_version: Version of algorithm used
  • calculated_at: When the score was calculated

§Interpretation

§Score Ranges

  • 0-20: Very poor reputation
  • 20-40: Poor reputation
  • 40-60: Average reputation
  • 60-80: Good reputation
  • 80-100: Excellent reputation

§Confidence Levels

  • Low (0-0.2): Limited data, provisional score
  • Medium (0.2-0.7): Moderate confidence
  • High (0.7-1.0): High confidence, substantial data

§Example

use reputation_types::{ReputationScore, ConfidenceLevel, ScoreComponents, PriorBreakdown};
use chrono::Utc;
 
let score = ReputationScore {
    score: 75.5,
    confidence: 0.85,
    level: ConfidenceLevel::High,
    components,
    is_provisional: false,
    data_points: 150,
    algorithm_version: "1.0.0".to_string(),
    calculated_at: Utc::now(),
};
 
if score.is_provisional {
    println!("Provisional score: {:.1} (needs more data)", score.score);
} else {
    println!("{:?} confidence score: {:.1}", score.level, score.score);
}

Fields§

§score: f64

The final reputation score (0-100 scale)

§confidence: f64

Confidence in the score based on data availability (0-1)

§level: ConfidenceLevel

Categorized confidence level

§components: ScoreComponents

Detailed breakdown of score components

§is_provisional: bool

Whether this is a provisional score (confidence < 0.2)

§data_points: u32

Total data points used in calculation

§algorithm_version: String

Version of the algorithm used for calculation

§calculated_at: DateTime<Utc>

Timestamp when the score was calculated

Trait Implementations§

Source§

impl Clone for ReputationScore

Source§

fn clone(&self) -> ReputationScore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReputationScore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ReputationScore

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ReputationScore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for ReputationScore

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,