pub enum Error {
DataTooLarge,
InvalidImage(&'static str),
Corrupted(&'static str),
Unsupported(&'static str),
}Expand description
Errors produced by roka-qr.
All fallible operations in this crate return Result<T, Error>. Variants
are intentionally coarse — most callers only need to distinguish “the input
was malformed” from “the QR was readable but couldn’t be recovered”.
Variants§
DataTooLarge
Payload is larger than what fits in QR version 40 at the chosen EC level.
InvalidImage(&'static str)
Image bytes are not a valid PNG / PBM / supported format.
Corrupted(&'static str)
The QR code was found in the image, but its data could not be recovered (too many errors, or unsupported encoding mode).
Unsupported(&'static str)
The QR uses a feature this crate does not implement (e.g. kanji mode).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
impl Eq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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