pub struct ScoringWeights {
pub schema: f32,
pub transformation: f32,
pub retry: f32,
}Expand description
Weight applied to each sub-score when computing the ReliabilityScore.
Defaults are tuned for production scraping where missing data is worse than occasional retries: schema completeness dominates, transformations matter but are less impactful than missing fields, and retries only subtract.
§Example
use stygian_plugin::reliability::ScoringWeights;
let weights = ScoringWeights {
schema: 0.5,
transformation: 0.3,
retry: 0.2,
};
assert!(weights.validate().is_ok());
// Out-of-range weights are rejected.
let bad = ScoringWeights { schema: 1.5, transformation: 0.0, retry: 0.0 };
assert!(bad.validate().is_err());Fields§
§schema: f32Weight for schema_completeness (must be in [0.0, 1.0]).
transformation: f32Weight for transformation_success (must be in [0.0, 1.0]).
retry: f32Weight for retry_penalty (subtracted; must be in [0.0, 1.0]).
Implementations§
Trait Implementations§
Source§impl Clone for ScoringWeights
impl Clone for ScoringWeights
Source§fn clone(&self) -> ScoringWeights
fn clone(&self) -> ScoringWeights
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 moreimpl Copy for ScoringWeights
Source§impl Debug for ScoringWeights
impl Debug for ScoringWeights
Source§impl Default for ScoringWeights
impl Default for ScoringWeights
Source§impl<'de> Deserialize<'de> for ScoringWeights
impl<'de> Deserialize<'de> for ScoringWeights
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 ScoringWeights
impl RefUnwindSafe for ScoringWeights
impl Send for ScoringWeights
impl Sync for ScoringWeights
impl Unpin for ScoringWeights
impl UnsafeUnpin for ScoringWeights
impl UnwindSafe for ScoringWeights
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