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
fn process(
&mut self,
event: Event,
res: &mut Vec<Event>
) -> Result<(), FilterError>
&mut self,
event: Event,
res: &mut Vec<Event>
) -> Result<(), FilterError>
Process a single metric::Event
Individual Filters will implementat this function depending on their mechanism. See individaul filters for details.
Provided Methods
fn run(&mut self, recv: Receiver<Event>, sources: Vec<String>, chans: Channel)
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
impl Filter for ProgrammableFilter
impl Filter for DelayFilter
impl Filter for FlushBoundaryFilter
impl Filter for JSONEncodeFilter