Skip to main content

TriggerCriterion

Trait TriggerCriterion 

Source
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§

Source

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§

Source

fn install<F>(self, context: &mut Context, on_match: F)
where F: Fn(&mut Context, Self::Observation) + 'static,

Install the criterion’s monitoring logic in context.

Provided Methods§

Source

fn emit_with<Ev, F>(self, make_event: F) -> Trigger<Self, Ev, F>
where Ev: IxaEvent, F: Fn(Self::Observation) -> Ev + 'static,

Bind this criterion to a constructor for a concrete user event.

Source

fn emit_default<Ev>(self) -> Trigger<Self, Ev, impl Fn(Self::Observation) -> Ev>
where Ev: IxaEvent + Default,

Bind this criterion to a default-valued concrete user event.

Source

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.

Implementors§