#[non_exhaustive]pub enum QrError {
DataTooLong,
InvalidVersion {
version: Version,
ec_level: EcLevel,
},
UnsupportedCharacterSet,
InvalidEciDesignator {
value: u32,
},
InvalidCharacter {
position: usize,
byte: u8,
},
}Expand description
QrError encodes the error encountered when generating a QR code.
This enum is #[non_exhaustive]: future versions may add variants, so
external callers should match with a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
DataTooLong
The data is too long to encode into a QR code for the given version.
InvalidVersion
The provided version / error correction level combination is invalid.
Carries the offending Version and EcLevel.
UnsupportedCharacterSet
Some characters in the data cannot be supported by the provided QR code version.
InvalidEciDesignator
The provided ECI designator is invalid. Carries the offending value;
a valid designator must be between 0 and 999999.
InvalidCharacter
A character not belonging to the character set is found. Carries the
byte position (offset into the input) and the offending byte value.
Trait Implementations§
impl Copy for QrError
impl Eq for QrError
Source§impl Error for QrError
impl Error for QrError
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 StructuralPartialEq for QrError
Auto Trait Implementations§
impl Freeze for QrError
impl RefUnwindSafe for QrError
impl Send for QrError
impl Sync for QrError
impl Unpin for QrError
impl UnsafeUnpin for QrError
impl UnwindSafe for QrError
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