pub struct VendorScore {
pub vendor: VendorId,
pub score: u32,
pub matched_sources: BTreeMap<EvidenceSource, usize>,
}Expand description
Per-vendor scorecard returned by the classifier.
A VendorScore records the total weighted signal count for
a single vendor along with the evidence that contributed. The
scores are returned in rank order (top first).
§Example
use stygian_charon::vendor_classifier::{EvidenceSource, VendorId, VendorScore};
let score = VendorScore {
vendor: VendorId::Cloudflare,
score: 10,
matched_sources: vec![(EvidenceSource::Header, 2), (EvidenceSource::Cookie, 1)]
.into_iter()
.collect(),
};
assert_eq!(score.vendor, VendorId::Cloudflare);
assert_eq!(score.score, 10);Fields§
§vendor: VendorIdVendor this score belongs to.
score: u32Sum of the matched signal weights.
matched_sources: BTreeMap<EvidenceSource, usize>Per-source count of matched signals (BTreeMap keeps the
output deterministic).
Implementations§
Trait Implementations§
Source§impl Clone for VendorScore
impl Clone for VendorScore
Source§fn clone(&self) -> VendorScore
fn clone(&self) -> VendorScore
Returns a duplicate of the value. Read more
1.0.0 · 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 VendorScore
impl Debug for VendorScore
Source§impl<'de> Deserialize<'de> for VendorScore
impl<'de> Deserialize<'de> for VendorScore
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
Source§impl PartialEq for VendorScore
impl PartialEq for VendorScore
Source§impl Serialize for VendorScore
impl Serialize for VendorScore
impl Eq for VendorScore
impl StructuralPartialEq for VendorScore
Auto Trait Implementations§
impl Freeze for VendorScore
impl RefUnwindSafe for VendorScore
impl Send for VendorScore
impl Sync for VendorScore
impl Unpin for VendorScore
impl UnsafeUnpin for VendorScore
impl UnwindSafe for VendorScore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.