pub enum ErrorKind {
Input,
Io,
Unsupported,
Limit,
Security,
Usage,
State,
Cancelled,
Internal,
}Expand description
What kind of failure a code is: what the caller can do about it (ADR 0026 §2).
A closed set: bindings and the CLI match on it exhaustively, so adding a kind amends
ADR 0026 and is a breaking change. That is why, unlike the error enums, it is not
#[non_exhaustive].
Added in 0.2.0.
Variants§
Input
The input (PDF bytes, an op log, JSON) is malformed beyond what tolerance repairs.
Io
The host failed to supply or take bytes (a ByteSource read, a sink write).
Unsupported
Valid input that Lamina PDF doesn’t implement.
Limit
A Limits value or another resource bound was hit.
Security
Encryption, permissions or signatures block the call, or look tampered with.
Usage
The caller misused the API: an unknown option, an argument out of range, an unknown ID.
State
The call isn’t valid in the object’s current state; it may succeed after a change.
Cancelled
A cancel token stopped the work.
Internal
A bug in Lamina PDF or a broken invariant.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub const fn is_skippable(self) -> bool
pub const fn is_skippable(self) -> bool
Whether an error of this kind says only that one part of the input is malformed or uses
something unsupported (input, unsupported): what a pass over many parts, such as
every page or every revision, skips. Any other kind (a password, a limit, data not yet
fetched, cancellation) stops the pass, since the part it couldn’t read might matter.
Added in 0.2.0.