pub trait Filter {
// Required method
fn filter(&mut self, msg: &Message) -> Result<()>;
}Expand description
Filter is used by Network implementor to filter messages before re-routing them. It’s like the middleware in HTTP pipeline.
To avoid delaying other messages handling, the execution of any filter should be fast as it is performed in the message handler .