1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pub mod root_visitor;
pub use root_visitor::*;

mod has_path;
mod has_root;
mod has_parent;
mod has_value;
mod has_get;
mod knows_visitor;
mod has_visitor_constructor;
mod has_branches;
mod has_relative_access;

#[derive(Clone, Default)]
pub struct Visitor<Parent, Value> {
    parent: Parent,
    value: Value
}

impl<Parent, Value> Visitor<Parent, Value> {
    pub fn new(parent: Parent, value: Value) -> Self {
        Self { parent, value }
    }
}

impl<'a, Parent, Value> From<Visitor<Parent, &'a mut Value>> for Visitor<Parent, &'a Value> {
    fn from(visitor: Visitor<Parent, &'a mut Value>) -> Self {
        Self::new(visitor.parent, visitor.value)
    }
}