1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use preserves::value::IOValue; use std::rc::Rc; pub enum Path { Root, Step(IOValue, Rc<Path>), } impl Path { pub fn root() -> Rc<Self> { Rc::new(Path::Root) } pub fn step(self: &Rc<Self>, v: &IOValue) -> Rc<Self> { Rc::new(Path::Step(v.clone(), Rc::clone(self))) } }