#[non_exhaustive]pub enum BcfError {
Io {
path: Option<PathBuf>,
source: Error,
},
NotAnArchive {
detail: String,
},
NoTopics,
LimitExceeded {
limit: &'static str,
allowed: u64,
requested: u64,
},
UnsafeEntry {
name: String,
},
}Expand description
A failure that prevents reading a BCF archive.
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
The file could not be opened or read.
Fields
NotAnArchive
The bytes are not a readable ZIP container.
NoTopics
The archive contains no markup document, so there is no BCF content.
Distinguished from an archive with unreadable topics: that yields diagnostics and whatever parsed, while this means the container held nothing recognisable as BCF at all.
LimitExceeded
A declared limit in Limits was exceeded.
BCF archives arrive from untrusted parties, so decompression is bounded rather than trusted. This is refusal, not corruption.
Fields
UnsafeEntry
An archive entry escapes the extraction root, or is otherwise unsafe.
Kept fatal on purpose: a traversal path is not a tolerable quirk, it is an attempt to write outside the archive.
Trait Implementations§
Source§impl Error for BcfError
impl Error for BcfError
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 BcfError
impl !UnwindSafe for BcfError
impl Freeze for BcfError
impl Send for BcfError
impl Sync for BcfError
impl Unpin for BcfError
impl UnsafeUnpin for BcfError
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