pub trait TriggerCriterion: Sized + 'static {
type Observation: 'static;
// Required method
fn install<F>(self, context: &mut Context, on_match: F)
where F: Fn(&mut Context, Self::Observation) + 'static;
// Provided methods
fn emit_with<Ev, F>(self, make_event: F) -> Trigger<Self, Ev, F>
where Ev: IxaEvent,
F: Fn(Self::Observation) -> Ev + 'static { ... }
fn emit_default<Ev>(
self,
) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>
where Ev: IxaEvent + Default { ... }
fn emit_value<Ev>(
self,
event: Ev,
) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>
where Ev: IxaEvent { ... }
}Expand description
A bare trigger criterion: the condition that can be monitored. This module provides a collection of types that implement this trait.
Required Associated Types§
Sourcetype Observation: 'static
type Observation: 'static
The data that represents what is observed when the criterion is met. This data is passed to the handler installed for this criterion.
Required Methods§
Provided Methods§
Sourcefn emit_with<Ev, F>(self, make_event: F) -> Trigger<Self, Ev, F>
fn emit_with<Ev, F>(self, make_event: F) -> Trigger<Self, Ev, F>
Bind this criterion to a constructor for a concrete user event.
Sourcefn emit_default<Ev>(self) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>
fn emit_default<Ev>(self) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>
Bind this criterion to a default-valued concrete user event.
Sourcefn emit_value<Ev>(
self,
event: Ev,
) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>where
Ev: IxaEvent,
fn emit_value<Ev>(
self,
event: Ev,
) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>where
Ev: IxaEvent,
Bind this criterion to a constant concrete user event value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.