pub trait ToFile: Sized { fn serialize(&self) -> Result<Vec<u8>, Error>; fn to_file(&self, path: &Path) -> Result<(), Failure> { ... } }