1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::*;

pub trait KnowsVisitor<'a> {
    type Visitor: IsVisitor<'a>;
}

pub trait HasVisitor: Sized {
    fn visitor(self) -> RootVisitor<Self>;
}

impl<T> HasVisitor for &T {
    fn visitor(self) -> RootVisitor<Self> {
        RootVisitor::new(self)
    }
}

impl<T> HasVisitor for &mut T {
    fn visitor(self) -> RootVisitor<Self> {
        RootVisitor::new(self)
    }
}