pub trait IVisit {
// Required method
fn visit(&mut self, f: &mut dyn FnMut(&mut dyn INode));
}Expand description
Node visitor.
The visitor pattern is used to discover child nodes in custom types.
This trait is most commonly required to be implemented by users of this crate.
struct Foo {
data: i32,
}
impl cvar::IVisit for Foo {
fn visit(&mut self, f: &mut dyn FnMut(&mut dyn cvar::INode)) {
// Pass type-erased properties, lists and actions to the closure
f(&mut cvar::Property("data", &mut self.data, &42));
}
}