mod parser { pub trait Parser { fn apply(self) -> Self; } pub struct XmlParser { pub xml: String, } impl Default for XmlParser { fn default() -> XmlParser { return XmlParser { xml: String::from( r#" TEST Test 2 "#, ), }; } } impl Parser for XmlParser { fn apply(self) -> Self { println!("{}", self.xml); return self; } } } use parser::Parser; use parser::XmlParser; fn main() { let p = XmlParser { ..Default::default() }; p.apply().apply().apply(); }