pub struct VendorDefinition {
pub id: VendorId,
pub display_name: String,
pub description: String,
pub tier: u8,
pub signals: Vec<VendorSignal>,
}Expand description
One vendor’s signal catalogue. Multiple vendors can ship
definitions; the crate::vendor_classifier::VendorClassifier
consumes them all and ranks the matches.
Definitions are loaded from TOML at compile time via
include_str!. The schema is
serde::Deserialize so the same TOML files double as the
operator-facing configuration surface.
§Example
use stygian_charon::vendor_classifier::{VendorDefinition, VendorId, VendorSignal, EvidenceSource};
let def = VendorDefinition {
id: VendorId::DataDome,
display_name: "DataDome".to_string(),
description: "baseline".to_string(),
tier: 1,
signals: vec![VendorSignal {
pattern: "x-datadome".to_string(),
source: EvidenceSource::Header,
weight: 5,
}],
};
assert!(def.validate().is_ok());Fields§
§id: VendorIdVendor identifier from the VendorId enum.
display_name: StringHuman-readable display name (used in operator logs).
description: StringShort description of the vendor stack.
tier: u8Tier (1 = always shipped, 2 = taxonomy-only).
signals: Vec<VendorSignal>Signal catalogue.
Implementations§
Source§impl VendorDefinition
impl VendorDefinition
Sourcepub fn validate(&self) -> Result<(), VendorError>
pub fn validate(&self) -> Result<(), VendorError>
Validate the definition’s internal consistency.
§Errors
Returns VendorError on the first inconsistency. The
error embeds the field path and the bad value so operators
can locate the offending TOML line without re-running the
loader.
Sourcepub fn signals_by_source(&self) -> BTreeMap<EvidenceSource, Vec<&VendorSignal>>
pub fn signals_by_source(&self) -> BTreeMap<EvidenceSource, Vec<&VendorSignal>>
Return the signals, indexed by EvidenceSource for fast
classification.
Trait Implementations§
Source§impl Clone for VendorDefinition
impl Clone for VendorDefinition
Source§fn clone(&self) -> VendorDefinition
fn clone(&self) -> VendorDefinition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VendorDefinition
impl Debug for VendorDefinition
Source§impl<'de> Deserialize<'de> for VendorDefinition
impl<'de> Deserialize<'de> for VendorDefinition
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>,
Source§impl PartialEq for VendorDefinition
impl PartialEq for VendorDefinition
Source§impl Serialize for VendorDefinition
impl Serialize for VendorDefinition
impl Eq for VendorDefinition
impl StructuralPartialEq for VendorDefinition
Auto Trait Implementations§
impl Freeze for VendorDefinition
impl RefUnwindSafe for VendorDefinition
impl Send for VendorDefinition
impl Sync for VendorDefinition
impl Unpin for VendorDefinition
impl UnsafeUnpin for VendorDefinition
impl UnwindSafe for VendorDefinition
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
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
key and return true if they are equal.