pub struct QueryResult {
pub query_type: QueryType,
pub matches: Option<Vec<PatternMatch>>,
pub statistics: Option<StatisticalAnalysis>,
pub alert: Option<AlertResult>,
pub value: Option<ValueWord>,
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
value: Option<ValueWord>Raw value result
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 with_value(self, value: ValueWord) -> Self
pub fn with_value(self, value: ValueWord) -> Self
Add value result
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 · 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more