pub enum ConversionError {
Io(Error),
UnknownFormat {
hint: String,
},
UnsupportedFormat(InputFormat),
Parse(String),
Streaming(String),
Browser(String),
WithSource {
context: String,
source: Box<dyn Error + Send + Sync>,
},
}Expand description
Anything that can go wrong while loading or converting a source document.
Variants§
Io(Error)
Reading the input from disk failed.
UnknownFormat
The file extension (or content) did not map to a known format.
UnsupportedFormat(InputFormat)
The format is known but no backend is wired up for it yet.
Parse(String)
The backend recognized the format but failed to parse the content.
Streaming(String)
The requested streaming conversion is not supported (e.g. JSON, or the referenced image mode, which both need the whole document up front).
Browser(String)
The headless-browser pre-render (--use-web-browser) failed, or the crate
was built without the web-browser feature.
WithSource
A dependency failed during conversion. Unlike ConversionError::Parse
the underlying error is kept alive (not flattened into a string), so
callers can walk std::error::Error::source and downcast to the
original type — e.g. to tell a truncated archive from malformed XML.
Implementations§
Source§impl ConversionError
impl ConversionError
Sourcepub fn with_source(
context: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn with_source( context: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Wrap a dependency error, keeping it reachable via
std::error::Error::source instead of stringifying it.
Trait Implementations§
Source§impl Debug for ConversionError
impl Debug for ConversionError
Source§impl Display for ConversionError
impl Display for ConversionError
Source§impl Error for ConversionError
impl Error for ConversionError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for ConversionError
impl !UnwindSafe for ConversionError
impl Freeze for ConversionError
impl Send for ConversionError
impl Sync for ConversionError
impl Unpin for ConversionError
impl UnsafeUnpin for ConversionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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 more