pub struct ThreatCatalog {
pub version: String,
pub last_updated: String,
pub categories: Vec<ThreatCategory>,
pub trusted_authors: Vec<String>,
pub trusted_domains: Vec<String>,
}Fields§
§version: String§last_updated: String§categories: Vec<ThreatCategory>§trusted_domains: Vec<String>Implementations§
Source§impl ThreatCatalog
impl ThreatCatalog
Sourcepub fn all_rules(&self) -> Vec<&ThreatRule>
pub fn all_rules(&self) -> Vec<&ThreatRule>
Get all rules across all categories
Sourcepub fn find_threat(
&self,
threat_id: &str,
) -> Option<(&ThreatCategory, &ThreatRule)>
pub fn find_threat( &self, threat_id: &str, ) -> Option<(&ThreatCategory, &ThreatRule)>
Find a specific threat by ID
Sourcepub fn show_threat_info(&self, threat_id: &str) -> Result<()>
pub fn show_threat_info(&self, threat_id: &str) -> Result<()>
Show detailed information about a threat
pub fn add_trusted_domain(&mut self, domain: String)
pub fn remove_trusted_domain(&mut self, domain: &str) -> bool
Trait Implementations§
Source§impl Clone for ThreatCatalog
impl Clone for ThreatCatalog
Source§fn clone(&self) -> ThreatCatalog
fn clone(&self) -> ThreatCatalog
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 ThreatCatalog
impl Debug for ThreatCatalog
Source§impl<'de> Deserialize<'de> for ThreatCatalog
impl<'de> Deserialize<'de> for ThreatCatalog
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 ThreatCatalog
impl RefUnwindSafe for ThreatCatalog
impl Send for ThreatCatalog
impl Sync for ThreatCatalog
impl Unpin for ThreatCatalog
impl UnwindSafe for ThreatCatalog
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