pub struct DetectorResult {
pub detector_name: String,
pub detector_type: DetectorType,
pub threat_category: ThreatCategory,
pub severity: SecuritySeverity,
pub confidence: f64,
pub raw_output: Option<String>,
pub metadata: HashMap<String, String>,
pub latency_ms: Option<u64>,
}Expand description
Normalised output from a single security detector.
Fields§
§detector_name: String§detector_type: DetectorType§threat_category: ThreatCategory§severity: SecuritySeverity§confidence: f64§raw_output: Option<String>§metadata: HashMap<String, String>§latency_ms: Option<u64>Implementations§
Source§impl DetectorResult
impl DetectorResult
Sourcepub fn new(name: &str, detector_type: DetectorType) -> Self
pub fn new(name: &str, detector_type: DetectorType) -> Self
Start building a result for the given detector.
pub fn with_threat(self, cat: ThreatCategory) -> Self
pub fn with_confidence(self, c: f64) -> Self
pub fn with_severity(self, s: SecuritySeverity) -> Self
pub fn with_raw_output(self, raw: String) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_latency_ms(self, ms: u64) -> Self
Trait Implementations§
Source§impl Clone for DetectorResult
impl Clone for DetectorResult
Source§fn clone(&self) -> DetectorResult
fn clone(&self) -> DetectorResult
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 DetectorResult
impl Debug for DetectorResult
Source§impl<'de> Deserialize<'de> for DetectorResult
impl<'de> Deserialize<'de> for DetectorResult
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 From<&DetectorResult> for SecurityFinding
impl From<&DetectorResult> for SecurityFinding
Source§fn from(dr: &DetectorResult) -> Self
fn from(dr: &DetectorResult) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DetectorResult
impl RefUnwindSafe for DetectorResult
impl Send for DetectorResult
impl Sync for DetectorResult
impl Unpin for DetectorResult
impl UnsafeUnpin for DetectorResult
impl UnwindSafe for DetectorResult
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