Usually, the "load" API should give a signature like fn <R: Read>(reader: R) -> Result<T, E>.
Current API with signature like fn (filename: &str) -> Result<T, E> can be preserved.
Also, load by filename should have a more generic signature like fn <P: AsRef<Path>>(path: P) -> Result<T, E>.
Usually, the "load" API should give a signature like
fn <R: Read>(reader: R) -> Result<T, E>.Current API with signature like
fn (filename: &str) -> Result<T, E>can be preserved.Also, load by filename should have a more generic signature like
fn <P: AsRef<Path>>(path: P) -> Result<T, E>.