#[non_exhaustive]pub enum BundleError {
Io {
kind: ErrorKind,
message: String,
},
NotADirectory(PathBuf),
Document {
path: PathBuf,
error: DocumentError,
},
}Expand description
Errors raised when loading or operating on a bundle on disk.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io
An I/O error occurred while reading the bundle.
The original std::io::Error is not Clone, so the kind and the
rendered message are stored instead. The std::error::Error::source
chain is therefore unavailable for this variant; use
BundleError::io_kind to inspect the failure category.
Fields
NotADirectory(PathBuf)
The bundle root does not exist or is not a directory.
Document
A concept document failed to parse.
Implementations§
Source§impl BundleError
impl BundleError
Sourcepub const fn io_kind(&self) -> Option<ErrorKind>
pub const fn io_kind(&self) -> Option<ErrorKind>
The std::io::ErrorKind for an BundleError::Io variant, or None
for any other variant. Convenient for matching on the failure category
without downcasting.
Trait Implementations§
Source§impl Clone for BundleError
impl Clone for BundleError
Source§fn clone(&self) -> BundleError
fn clone(&self) -> BundleError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BundleError
impl Debug for BundleError
Source§impl Display for BundleError
impl Display for BundleError
Source§impl Error for BundleError
impl Error for BundleError
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 BundleError
impl RefUnwindSafe for BundleError
impl Send for BundleError
impl Sync for BundleError
impl Unpin for BundleError
impl UnsafeUnpin for BundleError
impl UnwindSafe for BundleError
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