1 2 3 4 5 6 7 8 9 10 11
#[cfg(test)] mod test; pub trait Visitor{ type Error; fn visit(&mut self, data: u32) -> Result<(), Self::Error>; } pub trait Visit{ fn visit<V: Visitor>(&self, f: &mut V) -> Result<(),V::Error>; }
1 2 3 4 5 6 7 8 9 10 11
#[cfg(test)] mod test; pub trait Visitor{ type Error; fn visit(&mut self, data: u32) -> Result<(), Self::Error>; } pub trait Visit{ fn visit<V: Visitor>(&self, f: &mut V) -> Result<(),V::Error>; }