pub struct QueryResult {
pub query_type: QueryType,
pub matches: Option<Vec<PatternMatch>>,
pub statistics: Option<StatisticalAnalysis>,
pub alert: Option<AlertResult>,
pub summary: Option<SummaryMetrics>,
pub data: Option<QueryData>,
pub metadata: QueryMetadata,
}Expand description
Comprehensive query result that can contain multiple types of output
Fields§
§query_type: QueryTypeType of query that was executed
matches: Option<Vec<PatternMatch>>Pattern matches if this was a find/scan query
statistics: Option<StatisticalAnalysis>Statistical analysis results
alert: Option<AlertResult>Alert results
summary: Option<SummaryMetrics>Combined summary metrics
data: Option<QueryData>Raw data for custom visualization
metadata: QueryMetadataExecution metadata
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn new(query_type: QueryType, id: String, timeframe: String) -> Self
pub fn new(query_type: QueryType, id: String, timeframe: String) -> Self
Create a new empty result
Sourcepub fn with_statistics(self, stats: StatisticalAnalysis) -> Self
pub fn with_statistics(self, stats: StatisticalAnalysis) -> Self
Add statistical analysis results
Sourcepub fn with_alert(self, alert: AlertResult) -> Self
pub fn with_alert(self, alert: AlertResult) -> Self
Add alert results
Sourcepub fn calculate_summary(&mut self)
pub fn calculate_summary(&mut self)
Calculate and add summary metrics
Sourcepub fn format_summary(&self) -> String
pub fn format_summary(&self) -> String
Format summary as a human-readable string
Trait Implementations§
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin for QueryResult
impl UnwindSafe for QueryResult
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