pub struct FsError {
pub kind: FsErrorKind,
pub operation: FsOperation,
pub path: Option<Box<FsPath>>,
pub target: Option<Box<FsPath>>,
pub provider: Option<Box<str>>,
pub message: Box<str>,
pub source: Option<Box<dyn Error + Send + Sync + 'static>>,
}Expand description
Provider-neutral filesystem error with operation and path context.
Fields§
§kind: FsErrorKindError category.
operation: FsOperationOperation that produced the error.
path: Option<Box<FsPath>>Primary path involved in the operation.
target: Option<Box<FsPath>>Secondary path involved in the operation.
provider: Option<Box<str>>Provider id or alias involved in the operation.
message: Box<str>Human-readable error message.
source: Option<Box<dyn Error + Send + Sync + 'static>>Lower-level source error.
Implementations§
Source§impl FsError
impl FsError
Sourcepub fn new(kind: FsErrorKind, operation: FsOperation, message: &str) -> Self
pub fn new(kind: FsErrorKind, operation: FsOperation, message: &str) -> Self
Sourcepub fn with_source<E>(
kind: FsErrorKind,
operation: FsOperation,
message: &str,
source: E,
) -> Self
pub fn with_source<E>( kind: FsErrorKind, operation: FsOperation, message: &str, source: E, ) -> Self
Sourcepub fn with_target(self, target: FsPath) -> Self
pub fn with_target(self, target: FsPath) -> Self
Sourcepub fn with_provider(self, provider: &str) -> Self
pub fn with_provider(self, provider: &str) -> Self
Sourcepub fn invalid_path(operation: FsOperation, message: &str) -> Self
pub fn invalid_path(operation: FsOperation, message: &str) -> Self
Sourcepub fn kind(&self) -> FsErrorKind
pub fn kind(&self) -> FsErrorKind
Trait Implementations§
Source§impl Error for FsError
impl Error for FsError
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 FsError
impl !RefUnwindSafe for FsError
impl Send for FsError
impl Sync for FsError
impl Unpin for FsError
impl UnsafeUnpin for FsError
impl !UnwindSafe for FsError
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
Source§impl<T> IntoValueDefault<T> for T
impl<T> IntoValueDefault<T> for T
Source§fn into_value_default(self) -> T
fn into_value_default(self) -> T
Converts this argument into the default value.