pub struct Error {
pub kind: ErrorKind,
/* private fields */
}
Expand description
The error type for fs_extra operations with files and folder.
Errors mostly originate from the underlying OS, but custom instances of
Error
can be created with crafted error messages and a particular value of
ErrorKind
.
Fields§
§kind: ErrorKind
Type error
Implementations§
Source§impl Error
impl Error
Sourcepub fn new(kind: ErrorKind, message: &str) -> Error
pub fn new(kind: ErrorKind, message: &str) -> Error
Create a new fs_extra error from a kind of error error as well as an arbitrary error payload.
#Examples
ⓘ
extern crate fs_extra;
use fs_extra::error::{Error, ErrorKind};
errors can be created from strings
let custom_error = Error::new(ErrorKind::Other, "Other Error!");
// errors can also be created from other errors
let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Source§impl From<StripPrefixError> for Error
impl From<StripPrefixError> for Error
Source§fn from(err: StripPrefixError) -> Error
fn from(err: StripPrefixError) -> Error
Converts to this type from the input type.
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