pub enum QueryNode {
MatchAllDocs,
MatchNoDocs,
AttributeExists {
attr: String,
},
AttributeMissing {
attr: String,
},
AttributeRange {
attr: String,
lower: ComparisonValue,
lower_inclusive: bool,
upper: ComparisonValue,
upper_inclusive: bool,
},
AttributeComparison {
attr: String,
comparator: Comparison,
value: ComparisonValue,
},
AttributeTerm {
attr: String,
value: String,
},
QuotedAttribute {
attr: String,
phrase: String,
},
AttributePrefix {
attr: String,
prefix: String,
},
AttributeWildcard {
attr: String,
wildcard: String,
},
NegatedNode {
node: Box<QueryNode>,
},
Boolean {
oper: BooleanType,
nodes: Vec<QueryNode>,
},
}Expand description
QueryNodes represent specific search criteria to be enforced.
Variants§
MatchAllDocs
Match all documents.
MatchNoDocs
Match no documents.
AttributeExists
Validate existence of an attribute within a document.
AttributeMissing
Validate lack of an attribute within a document.
AttributeRange
Match an attribute against a specific range of values.
AttributeComparison
Compare an attribute against a single value (greater/less than operations).
AttributeTerm
Search for an attribute that matches a specific term.
QuotedAttribute
Search for an attribute that matches a specific quoted phrase.
AttributePrefix
Search for an attribute whose value matches against a specific prefix.
AttributeWildcard
Search for an attribute that matches a wildcard or glob string.
NegatedNode
Container node denoting negation of the QueryNode within.
Boolean
Container node for compound Boolean operations.
Implementations§
Source§impl QueryNode
impl QueryNode
Sourcepub fn build_matcher<V, F>(
&self,
filter: &F,
) -> Result<Box<dyn Matcher<V>>, PathParseError>
pub fn build_matcher<V, F>( &self, filter: &F, ) -> Result<Box<dyn Matcher<V>>, PathParseError>
Build a filter by parsing a Datadog Search Syntax QueryNode, and invoking the appropriate
method on a Filter + Resolver implementation to determine the matching logic. Each method
returns a Matcher<V> which is intended to be invoked at runtime. F should implement both
Fielder + Filter in order to applying any required caching which may affect the operation
of a filter method. This function is intended to be used at boot-time and NOT in a hot path!
§Errors
Will return Err if the query contains an invalid path.
Source§impl QueryNode
impl QueryNode
Sourcepub fn to_lucene(&self) -> String
pub fn to_lucene(&self) -> String
Returns a string representing this node in Lucene query formatting.
pub fn lucene_escape(input: &str) -> String
Sourcepub fn new_boolean(conjunction: BooleanType, nodes: Vec<QueryNode>) -> QueryNode
pub fn new_boolean(conjunction: BooleanType, nodes: Vec<QueryNode>) -> QueryNode
Group a list of nodes into a single node, using the given conjunction. If the group has only one node, return a clone of that node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for QueryNode
impl<'de> Deserialize<'de> for QueryNode
Source§fn deserialize<D>(deserializer: D) -> Result<QueryNode, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<QueryNode, D::Error>where
D: Deserializer<'de>,
impl StructuralPartialEq for QueryNode
Auto Trait Implementations§
impl Freeze for QueryNode
impl RefUnwindSafe for QueryNode
impl Send for QueryNode
impl Sync for QueryNode
impl Unpin for QueryNode
impl UnwindSafe for QueryNode
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more