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)>
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.