Trait to map [std::io::Error] into [Error]
| 139 | |
| 140 | /// Trait to map [std::io::Error] into [Error] |
| 141 | pub trait IOErrorToError<T> { |
| 142 | /// Map a [std::io::Error] to [Error] with a [std::path::Path] attached |
| 143 | fn attach_path_err<P: AsRef<Path>>(self, path: P) -> Result<T>; |
| 144 | |
| 145 | /// Map a [std::io::Error] to [Error] with a [std::path::Path] and message attached |
| 146 | fn attach_path_msg<P: AsRef<Path>, M: AsRef<str>>(self, path: P, msg: M) -> Result<T>; |
| 147 | } |
| 148 | |
| 149 | impl<T> IOErrorToError<T> for std::result::Result<T, std::io::Error> { |
| 150 | fn attach_path_err<P: AsRef<Path>>(self, path: P) -> Result<T> { |
nothing calls this directly
no outgoing calls
no test coverage detected