MCPcopy Create free account
hub / github.com/Wulf/dsync / IOErrorToError

Interface IOErrorToError

src/error.rs:141–147  ·  view source on GitHub ↗

Trait to map [std::io::Error] into [Error]

Source from the content-addressed store, hash-verified

139
140/// Trait to map [std::io::Error] into [Error]
141pub 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
149impl<T> IOErrorToError<T> for std::result::Result<T, std::io::Error> {
150 fn attach_path_err<P: AsRef<Path>>(self, path: P) -> Result<T> {

Callers

nothing calls this directly

Implementers 1

error.rssrc/error.rs

Calls

no outgoing calls

Tested by

no test coverage detected