pub struct Error { /* private fields */ }
Expand description
A file or folder operation error.
Implementations§
Source§impl Error
Construction
impl Error
Construction
Sourcepub fn new<P>(path: P, operation: Operation, reason: Reason) -> Selfwhere
P: Into<StoragePath>,
pub fn new<P>(path: P, operation: Operation, reason: Reason) -> Selfwhere
P: Into<StoragePath>,
Creates an error from the reason
.
The source
will be None
.
Sourcepub fn from_source<P, E>(path: P, operation: Operation, source: E) -> Self
pub fn from_source<P, E>(path: P, operation: Operation, source: E) -> Self
Creates an error from the source
.
The reason
will be Other
.
Sourcepub fn from_message<P, S>(path: P, operation: Operation, message: S) -> Self
pub fn from_message<P, S>(path: P, operation: Operation, message: S) -> Self
Creates an error from the message
.
The source
will be a std::io::Error
with the message
.
The reason
will be Other
.
Source§impl Error
Common IO Errors
impl Error
Common IO Errors
Sourcepub fn unknown_file_system(path: &str) -> Error
pub fn unknown_file_system(path: &str) -> Error
Gets the unknown file system
error.
Sourcepub fn path_not_utf8(path: &Path) -> Error
pub fn path_not_utf8(path: &Path) -> Error
Gets the path not utf-8
error.
Source§impl Error
Properties
impl Error
Properties
Sourcepub fn path(&self) -> &StoragePath
pub fn path(&self) -> &StoragePath
Gets the path.
Sourcepub fn export_path(self) -> StoragePath
pub fn export_path(self) -> StoragePath
Exports the storage path.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more