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
mod has_root;
mod has_parent;
mod has_value;
mod has_path;
mod has_get;
mod has_branches;
mod has_relative_access;

#[derive(Clone, Copy, Default)]
pub struct RootVisitor<Value> {
    pub value: Value
}

impl<Value> RootVisitor<Value> {
    pub fn new(value: Value) -> Self {
        Self { value }
    }
}

impl<'a, T> From<RootVisitor<&'a mut T>> for RootVisitor<&'a T> {
    fn from(visitor: RootVisitor<&'a mut T>) -> Self {
        Self::new(visitor.value)
    }
}

impl<T> From<T> for RootVisitor<T> {
    fn from(value: T) -> Self {
        Self::new(value)
    }
}