Function derive_visitor::visitor_fn

source ·
pub fn visitor_fn<T, F: FnMut(&T, Event)>(fun: F) -> FnVisitor<T, F>
Expand description

Create a visitor that only visits items of some specific type from a function or a closure.

§Example

use derive_visitor::{visitor_fn, Drive};
File.drive(&mut visitor_fn(|file: &File, event| {
    // ...your logic here
}));