pub trait RuntimeTransform {
    // Required method
    fn hook_process<F>(&mut self, event: Event, emit_fn: F)
       where F: FnMut(Event);

    // Provided methods
    fn hook_init<F>(&mut self, _emit_fn: F)
       where F: FnMut(Event) { ... }
    fn hook_shutdown<F>(&mut self, _emit_fn: F)
       where F: FnMut(Event) { ... }
    fn timer_handler<F>(&mut self, _timer: Timer, _emit_fn: F)
       where F: FnMut(Event) { ... }
    fn timers(&self) -> Vec<Timer> { ... }
    fn transform(&mut self, output: &mut OutputBuffer, event: Event) { ... }
}
Expand description

A trait representing a runtime running user-defined code.

Required Methods§

source

fn hook_process<F>(&mut self, event: Event, emit_fn: F)
where F: FnMut(Event),

Call user-defined “process” hook.

Provided Methods§

source

fn hook_init<F>(&mut self, _emit_fn: F)
where F: FnMut(Event),

Call user-defined “init” hook.

source

fn hook_shutdown<F>(&mut self, _emit_fn: F)
where F: FnMut(Event),

Call user-defined “shutdown” hook.

source

fn timer_handler<F>(&mut self, _timer: Timer, _emit_fn: F)
where F: FnMut(Event),

Call user-defined timer handler.

source

fn timers(&self) -> Vec<Timer>

Return (static) list of user-defined timers.

source

fn transform(&mut self, output: &mut OutputBuffer, event: Event)

Object Safety§

This trait is not object safe.

Implementors§