1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub struct Config { pub debug: bool, pub name: String, } pub trait Configurable { fn configure(&self, config: &Config); } pub fn default_config() -> Config { Config { debug: false, name: String::new(), } }