pub enum CallbackError<E> {
Callback(E),
Archive(ArchiveError),
}Expand description
Why extract_reader_to_callback failed.
The first error the callback returned is kept as E, so the caller keeps
its own error type instead of recovering it from a side slot.
Closed by design: a failure is either the caller’s own or the archive’s, so
a match over both variants needs no wildcard arm and the compiler flags
any variant a future change adds.
§Examples
use std::error::Error as _;
use exarch_core::CallbackError;
let err = CallbackError::Callback(std::io::Error::other("stop"));
assert_eq!(err.to_string(), "entry callback failed");
assert_eq!(
err.source().map(ToString::to_string).as_deref(),
Some("stop")
);Variants§
Callback(E)
The callback returned this error for an entry, which ended the extraction. It takes precedence over the archive error the aborted extraction reports.
Archive(ArchiveError)
The archive was refused or could not be read.
Trait Implementations§
Source§impl<E: Debug> Debug for CallbackError<E>
impl<E: Debug> Debug for CallbackError<E>
Source§impl<E> Display for CallbackError<E>
Callback names the failure and chains to the callback’s error through
source(); Archive is transparent, so an error chain shows each message
once.
impl<E> Display for CallbackError<E>
Callback names the failure and chains to the callback’s error through
source(); Archive is transparent, so an error chain shows each message
once.
Source§impl<E: Error + 'static> Error for CallbackError<E>
impl<E: Error + 'static> Error for CallbackError<E>
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()
Source§impl<E> From<ArchiveError> for CallbackError<E>
impl<E> From<ArchiveError> for CallbackError<E>
Source§fn from(err: ArchiveError) -> Self
fn from(err: ArchiveError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for CallbackError<E>
impl<E> !UnwindSafe for CallbackError<E>
impl<E> Freeze for CallbackError<E>where
E: Freeze,
impl<E> Send for CallbackError<E>where
E: Send,
impl<E> Sync for CallbackError<E>where
E: Sync,
impl<E> Unpin for CallbackError<E>where
E: Unpin,
impl<E> UnsafeUnpin for CallbackError<E>where
E: UnsafeUnpin,
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