pub struct EventsRuleFilter {
pub scope: ScopeSpec,
pub target: Option<String>,
pub min_level: Option<Level>,
pub field_filters: Vec<FieldPredicate>,
}Expand description
Parsed predicate from an events:<expr> (or task-events:<expr>) rule check.
Extends TaskEventsRuleFilter with an optional ScopeSpec.
task-events: is a permanent alias that desugars to
scope: ScopeSpec::CurrentTaskRun — identical semantics, backward-compatible.
§Grammar
check := ("events:" | "task-events:") expr
expr := [scope-clause] [target] (WS field-pred)*
scope-clause := "scope=taskrun(" uuid ")"
| "scope=service(" mesh-ident ")"
target := word-without-'=' e.g. "cargo::rustc"
field-pred := key '=' scalar-value
key := "level" | "min_level" special: parsed as Level
| dotted-path e.g. "error.code", "file.path"scope=taskrun(...) desugars to CurrentTaskRun (the explicit UUID is
filled in at evaluate time — static rule files never contain literal run IDs).
§Examples
"events:cargo::rustc level=error"
→ scope: CurrentTaskRun, target: cargo::rustc, min_level: Error
"events:scope=service(noisetable-api.pdx) level=error"
→ scope: Service("noisetable-api.pdx"), min_level: Error
"task-events:cargo::rustc error.code=E0308"
→ scope: CurrentTaskRun (alias), target: cargo::rustc, field: error.code=="E0308"Fields§
§scope: ScopeSpecWhich store to query. Default is CurrentTaskRun.
target: Option<String>Event target prefix, e.g. "cargo::rustc". None means any target.
min_level: Option<Level>Minimum severity. None defaults to warn at the call site.
field_filters: Vec<FieldPredicate>Field equality predicates — all must match (AND-ed).
Implementations§
Source§impl EventsRuleFilter
impl EventsRuleFilter
Sourcepub fn matches_fields(&self, fields: &Value) -> bool
pub fn matches_fields(&self, fields: &Value) -> bool
Returns true when all field predicates match the given event fields object.
Sourcepub fn parse_check_field(check: &str) -> Result<Self, ParseError>
pub fn parse_check_field(check: &str) -> Result<Self, ParseError>
Parse both events:<expr> and task-events:<expr> check strings.
task-events: is a permanent alias for events: with scope: CurrentTaskRun.
Trait Implementations§
Source§impl Clone for EventsRuleFilter
impl Clone for EventsRuleFilter
Source§fn clone(&self) -> EventsRuleFilter
fn clone(&self) -> EventsRuleFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventsRuleFilter
impl Debug for EventsRuleFilter
Source§impl<'de> Deserialize<'de> for EventsRuleFilter
impl<'de> Deserialize<'de> for EventsRuleFilter
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>,
Source§impl PartialEq for EventsRuleFilter
impl PartialEq for EventsRuleFilter
Source§impl Serialize for EventsRuleFilter
impl Serialize for EventsRuleFilter
impl StructuralPartialEq for EventsRuleFilter
Auto Trait Implementations§
impl Freeze for EventsRuleFilter
impl RefUnwindSafe for EventsRuleFilter
impl Send for EventsRuleFilter
impl Sync for EventsRuleFilter
impl Unpin for EventsRuleFilter
impl UnsafeUnpin for EventsRuleFilter
impl UnwindSafe for EventsRuleFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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