Trait cernan::filter::Filter[][src]

pub trait Filter {
    fn process(
        &mut self,
        event: Event,
        res: &mut Vec<Event>
    ) -> Result<(), FilterError>; fn run(
        &mut self,
        recv: Receiver<Event>,
        sources: Vec<String>,
        chans: Channel
    ) { ... } }

The Filter trait

All filters take as input a stream of metric::Event and produce as output another metric::Event stream. That's it. The exact method by which each stream works depends on the implementation of the Filter.

Required Methods

Process a single metric::Event

Individual Filters will implementat this function depending on their mechanism. See individaul filters for details.

Provided Methods

Run the Filter

It is not expected that most Filters will re-implement this. If this is done, take care to obey overload signals and interpret errors from Filter::process.

Implementors