#[non_exhaustive]pub enum Error {
Show 13 variants
InvalidTrackingId {
reason: String,
},
IdPolicyMismatch {
reason: String,
},
InvalidIdConfig(String),
Entropy(String),
InsufficientEntropy {
needed: usize,
got: usize,
},
Unencodable {
symbology: &'static str,
reason: String,
},
EmptyPayload,
InvalidRenderOptions(String),
Render(String),
Decode(String),
InvalidImage(String),
NoSymbolFound(String),
Io(Error),
}Expand description
Everything that can go wrong in this crate.
This enum is #[non_exhaustive]: new variants may be added in minor
releases, so always include a _ arm when matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidTrackingId
A string did not have the shape of a tracking ID.
IdPolicyMismatch
A tracking ID was structurally valid but did not match the policy of
the IdGenerator it was checked against.
InvalidIdConfig(String)
IdGenerator::builder was given
contradictory or out-of-range settings.
Entropy(String)
The operating system’s randomness source was unavailable.
InsufficientEntropy
The caller-supplied entropy buffer was too small for the requested number of bits.
Fields
Unencodable
The payload cannot be represented in the requested symbology.
Fields
EmptyPayload
Symbologies in this crate reject empty payloads.
InvalidRenderOptions(String)
RenderOptions were internally inconsistent or
would produce a degenerate image.
Render(String)
The renderer failed while producing output.
Decode(String)
A barcode could not be decoded back into a payload.
InvalidImage(String)
An image could not be interpreted as a pixel buffer.
NoSymbolFound(String)
Scanner found no readable barcode. A barcode
that is present but unreadable is indistinguishable from one that is
absent, so both report this.
Io(Error)
std only.An I/O error from one of the *_to_file helpers.
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()