1use crate::Result; 2use std::path::Path; 3 4/// A trait to create an object from a file. 5pub trait FromFile 6where 7 Self: Sized 8{ 9 /// Create an object from a file. 10 fn from_file<P>(path: P) -> Result<Self> 11 where 12 P: AsRef<Path>; 13}