pub struct ScoreValue { /* private fields */ }Expand description
Validated score value and optional evaluator rationale.
Implementations§
Source§impl ScoreValue
impl ScoreValue
Sourcepub fn new(value: f64) -> Result<Self, EvaluationError>
pub fn new(value: f64) -> Result<Self, EvaluationError>
Creates a finite score between zero and one.
§Errors
Returns EvaluationError::InvalidRatio for an invalid value.
Sourcepub fn with_rationale(self, rationale: impl Into<String>) -> Self
pub fn with_rationale(self, rationale: impl Into<String>) -> Self
Adds an evaluator rationale.
Trait Implementations§
Source§impl Clone for ScoreValue
impl Clone for ScoreValue
Source§fn clone(&self) -> ScoreValue
fn clone(&self) -> ScoreValue
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 moreAuto Trait Implementations§
impl Freeze for ScoreValue
impl RefUnwindSafe for ScoreValue
impl Send for ScoreValue
impl Sync for ScoreValue
impl Unpin for ScoreValue
impl UnsafeUnpin for ScoreValue
impl UnwindSafe for ScoreValue
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