pub struct FileOperationError {
pub operation: FileOperation,
pub file_path: PathBuf,
pub purpose: String,
pub caller: String,
pub source: Error,
pub related_paths: Vec<PathBuf>,
}Expand description
Enhanced file operation error with full context
Fields§
§operation: FileOperationThe type of operation that failed
file_path: PathBufThe file path that was being accessed
purpose: StringWhy the file was being accessed
caller: StringWhat code initiated the operation
source: ErrorThe underlying IO error
Related paths for additional context
Implementations§
Source§impl FileOperationError
impl FileOperationError
Sourcepub fn new(context: FileOperationContext, source: Error) -> Self
pub fn new(context: FileOperationContext, source: Error) -> Self
Create a new file operation error from context and IO error
Sourcepub fn user_message(&self) -> String
pub fn user_message(&self) -> String
Get a user-friendly error message with context
Trait Implementations§
Source§impl Debug for FileOperationError
impl Debug for FileOperationError
Source§impl Display for FileOperationError
impl Display for FileOperationError
Source§impl Error for FileOperationError
impl Error for FileOperationError
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 FileOperationError
impl !RefUnwindSafe for FileOperationError
impl Send for FileOperationError
impl Sync for FileOperationError
impl Unpin for FileOperationError
impl !UnwindSafe for FileOperationError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.