pub struct Error { /* private fields */ }Expand description
A storage path 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
These return io::Error instead of Error because they are used in contexts where a
StoragePath has not yet been constructed (e.g., during parsing).
Sourcepub fn unknown_file_system(path: &str) -> Error
pub fn unknown_file_system(path: &str) -> Error
Creates the unknown file system error.
Sourcepub fn path_not_utf8(path: &Path) -> Error
pub fn path_not_utf8(path: &Path) -> Error
Creates 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 path.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
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 moreCreates a shared type from an unshared type.