pub trait IoResultExt<T> {
// Required method
fn with_path(self, path: impl Into<PathBuf>) -> Result<T>;
}Expand description
Extension trait for ergonomic conversion of io::Result<T> into
the crate’s path-bearing Result<T>. Reads at call sites as
std::fs::read_to_string(&path).with_path(&path)? — one extra
token compared to .map_err(Error::Io)?, with much better
diagnostics on failure.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.