pub struct ScoredCandidate {
pub name: String,
pub score: ReliabilityScore,
}Expand description
A (name, score) candidate for ScoreWeightedSelector.
name is an arbitrary caller-supplied label (typically the chain entry
name or the candidate’s URL). score is the ReliabilityScore
produced by the candidate’s extraction.
§Example
use stygian_plugin::reliability::{ReliabilityScore, ScoredCandidate};
let candidate = ScoredCandidate {
name: "primary".to_string(),
score: ReliabilityScore::from_overall(0.7),
};Fields§
§name: StringCaller-supplied label (typically chain entry name).
score: ReliabilityScoreReliability score produced by the candidate’s extraction.
Implementations§
Source§impl ScoredCandidate
impl ScoredCandidate
Sourcepub fn new(name: impl Into<String>, score: ReliabilityScore) -> Self
pub fn new(name: impl Into<String>, score: ReliabilityScore) -> Self
Construct a new candidate with the supplied name and score.
§Example
use stygian_plugin::reliability::{ReliabilityScore, ScoredCandidate};
let candidate = ScoredCandidate::new("primary", ReliabilityScore::from_overall(0.9));
assert_eq!(candidate.name, "primary");Trait Implementations§
Source§impl Clone for ScoredCandidate
impl Clone for ScoredCandidate
Source§fn clone(&self) -> ScoredCandidate
fn clone(&self) -> ScoredCandidate
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 ScoredCandidate
impl Debug for ScoredCandidate
Source§impl<'de> Deserialize<'de> for ScoredCandidate
impl<'de> Deserialize<'de> for ScoredCandidate
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 ScoredCandidate
impl RefUnwindSafe for ScoredCandidate
impl Send for ScoredCandidate
impl Sync for ScoredCandidate
impl Unpin for ScoredCandidate
impl UnsafeUnpin for ScoredCandidate
impl UnwindSafe for ScoredCandidate
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