pub enum ErrorCorrectionLevel {
L,
M,
Q,
H,
}Expand description
Represents the error correction levels for QR codes
§Variants
- L: Lowest error correction (approximately 7% of codewords can be restored)
- M: Medium error correction (approximately 15% of codewords can be restored)
- Q: Quartile error correction (approximately 25% of codewords can be restored)
- H: Highest error correction (approximately 30% of codewords can be restored)
§Methods
Provides methods to retrieve various parameters specific to each error correction level:
- get_format_bits: Get the format bits for the error correction level
- get_alpha_numeric_version_size: Get max capacity for alphanumeric encoding
- get_numeric_version_size: Get max capacity for numeric encoding
- get_byte_version_size: Get max capacity for byte encoding
- get_num_codewords: Get number of codewords
§Example
let max_numeric_size = ErrorCorrectionLevel::M.get_numeric_version_size(1); Variants§
L
Lowest error correction (approximately 7% of codewords can be restored)
M
Medium error correction (approximately 15% of codewords can be restored)
Q
Quartile error correction (approximately 25% of codewords can be restored
H
Highest error correction (approximately 30% of codewords can be restored)
Trait Implementations§
Source§impl Debug for ErrorCorrectionLevel
impl Debug for ErrorCorrectionLevel
Source§impl PartialEq for ErrorCorrectionLevel
impl PartialEq for ErrorCorrectionLevel
impl Eq for ErrorCorrectionLevel
impl StructuralPartialEq for ErrorCorrectionLevel
Auto Trait Implementations§
impl Freeze for ErrorCorrectionLevel
impl RefUnwindSafe for ErrorCorrectionLevel
impl Send for ErrorCorrectionLevel
impl Sync for ErrorCorrectionLevel
impl Unpin for ErrorCorrectionLevel
impl UnwindSafe for ErrorCorrectionLevel
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