pub struct VendorSignal {
pub pattern: String,
pub source: EvidenceSource,
pub weight: u32,
}Expand description
One signal row from a vendor definition’s [[signals]] table.
A signal is the smallest unit the classifier matches against the input strings (cookies, headers, challenge URLs, body markers, scripts). Patterns are matched case-insensitively — the loader lower-cases them at load time so the per-request classification hot path never has to.
§Example
use stygian_charon::vendor_classifier::{EvidenceSource, VendorSignal};
let s = VendorSignal {
pattern: "x-datadome".to_string(),
source: EvidenceSource::Header,
weight: 5,
};
assert_eq!(s.weight, 5);Fields§
§pattern: StringLiteral pattern to search for (case-insensitive).
source: EvidenceSourceWhich input channel the pattern is matched against.
weight: u32Weight contributed to the vendor score on a hit.
Trait Implementations§
Source§impl Clone for VendorSignal
impl Clone for VendorSignal
Source§fn clone(&self) -> VendorSignal
fn clone(&self) -> VendorSignal
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 VendorSignal
impl Debug for VendorSignal
Source§impl<'de> Deserialize<'de> for VendorSignal
impl<'de> Deserialize<'de> for VendorSignal
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 VendorSignal
impl PartialEq for VendorSignal
Source§impl Serialize for VendorSignal
impl Serialize for VendorSignal
impl Eq for VendorSignal
impl StructuralPartialEq for VendorSignal
Auto Trait Implementations§
impl Freeze for VendorSignal
impl RefUnwindSafe for VendorSignal
impl Send for VendorSignal
impl Sync for VendorSignal
impl Unpin for VendorSignal
impl UnsafeUnpin for VendorSignal
impl UnwindSafe for VendorSignal
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.