#[non_exhaustive]pub enum Error {
Io(Error),
UserCanceled,
Callback(Box<dyn Error + Send + Sync>),
InvalidFormat(String),
UnsupportedFormat,
UnsupportedFeature(&'static str),
UnsupportedItem(ItemKind),
InvalidSegment {
offset: u64,
reason: String,
},
NotFound {
what: &'static str,
},
Ambiguous {
what: &'static str,
count: usize,
},
LimitExceeded {
what: &'static str,
limit: u64,
},
Xml(Error),
}Expand description
Errors that can occur while reading or writing a container
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
I/O error
UserCanceled
A caller-supplied callback (for example a Sink)
stopped the operation, such as on user cancel.
Callback(Box<dyn Error + Send + Sync>)
A caller-supplied callback (for example a Sink) failed
with its own error, returned unchanged so the caller can recover it by
downcasting.
InvalidFormat(String)
Invalid file format
UnsupportedFormat
Unsupported file format
UnsupportedFeature(&'static str)
A recognized format uses a feature or operation this reader cannot support.
UnsupportedItem(ItemKind)
The container cannot hold, or this handler cannot write, an item of
this kind. A write plan reports it for an
Updates value it cannot place, before anything is
written.
InvalidSegment
Invalid segment
NotFound
A required item is absent.
Ambiguous
More than one candidate where exactly one is required.
LimitExceeded
A resource limit was exceeded.
Xml(Error)
xmp only.XML parsing error (from quick-xml)
Implementations§
Source§impl Error
impl Error
Sourcepub fn callback(error: impl Into<Box<dyn Error + Send + Sync>>) -> Self
pub fn callback(error: impl Into<Box<dyn Error + Send + Sync>>) -> Self
Error::Callback holding error, for a callback to return its own error
through asset-io.
Sourcepub fn invalid_segment(offset: u64, reason: impl Into<String>) -> Self
pub fn invalid_segment(offset: u64, reason: impl Into<String>) -> Self
Error::InvalidSegment: the data at offset is not a valid element of the
container, for the given reason.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()