#[non_exhaustive]pub enum EncodeError {
DataTooLong {
required_bits: Option<usize>,
capacity_bits: usize,
},
InvalidData {
mode: &'static str,
byte_offset: usize,
},
TextNotRepresentable {
byte_offset: usize,
family: &'static str,
},
InvalidEciAssignment(u32),
InvalidApplicationIndicator,
InvalidVersionRange,
UnsupportedMode {
mode: &'static str,
family: &'static str,
},
UnsupportedErrorCorrection {
version: SymbolVersion,
error_correction: SymbolErrorCorrection,
},
InvalidMask,
InvalidStructuredAppendPartCount {
count: usize,
},
}Expand description
Errors returned while encoding a QR Code symbol.
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 encoded bit stream exceeds the selected symbol capacity.
Fields
InvalidData
The input contains a byte that is not valid for the requested mode.
TextNotRepresentable
Available on crate feature
micro-qr only.The input cannot be represented by the selected symbol family.
InvalidEciAssignment(u32)
Available on crate features
qr or rmqr only.The ECI assignment is outside the range supported by QR Code.
InvalidApplicationIndicator
Available on crate features
qr or rmqr only.The FNC1 second-position application indicator is invalid.
InvalidVersionRange
The selected version range is empty or invalid.
UnsupportedMode
Available on crate feature
micro-qr only.The selected symbol family does not support a requested mode.
UnsupportedErrorCorrection
Available on crate feature
micro-qr only.The selected version does not support the requested error correction level.
InvalidMask
The requested mask number is outside the supported range.
InvalidStructuredAppendPartCount
Available on crate feature
qr only.A Structured Append sequence has fewer than one or more than 16 parts.
Trait Implementations§
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
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()
Auto Trait Implementations§
impl Freeze for EncodeError
impl RefUnwindSafe for EncodeError
impl Send for EncodeError
impl Sync for EncodeError
impl Unpin for EncodeError
impl UnsafeUnpin for EncodeError
impl UnwindSafe for EncodeError
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