pub enum Version {
Show 40 variants
V01,
V02,
V03,
V04,
V05,
V06,
V07,
V08,
V09,
V10,
V11,
V12,
V13,
V14,
V15,
V16,
V17,
V18,
V19,
V20,
V21,
V22,
V23,
V24,
V25,
V26,
V27,
V28,
V29,
V30,
V31,
V32,
V33,
V34,
V35,
V36,
V37,
V38,
V39,
V40,
}
Expand description
Enum containing all possible QRCode versions
Variants
V01
Version n°01
V02
Version n°02
V03
Version n°03
V04
Version n°04
V05
Version n°05
V06
Version n°06
V07
Version n°07
V08
Version n°08
V09
Version n°09
V10
Version n°10
V11
Version n°11
V12
Version n°12
V13
Version n°13
V14
Version n°14
V15
Version n°15
V16
Version n°16
V17
Version n°17
V18
Version n°18
V19
Version n°19
V20
Version n°20
V21
Version n°21
V22
Version n°22
V23
Version n°23
V24
Version n°24
V25
Version n°25
V26
Version n°26
V27
Version n°27
V28
Version n°28
V29
Version n°29
V30
Version n°30
V31
Version n°31
V32
Version n°32
V33
Version n°33
V34
Version n°34
V35
Version n°35
V36
Version n°36
V37
Version n°37
V38
Version n°38
V39
Version n°39
V40
Version n°40
Implementations
sourceimpl Version
impl Version
sourcepub const fn get(mode: Mode, ecl: ECL, len: usize) -> Option<Self>
pub const fn get(mode: Mode, ecl: ECL, len: usize) -> Option<Self>
Computes the best version according to mode
, ecl
and `len``
Example
let input = b"Hello, world!";
let ecl = ecl::ECL::H;
let mode = encode::best_encoding(input);
let version = match version::Version::get(mode, ecl, input.len()) {
Some(version) => version,
None => return (),
};
sourcepub const fn missing_bits(&self) -> usize
pub const fn missing_bits(&self) -> usize
Returns QRCode’s missing padding bits count at the very end
sourcepub const fn max_bytes(&self) -> usize
pub const fn max_bytes(&self) -> usize
Returns the max bytes that can contain a QRCode for a specified version
sourcepub const fn information(&self) -> u32
pub const fn information(&self) -> u32
Returns the version information we need to put for QRCodes larger or equal to version 7
sourcepub const fn alignment_patterns_grid(&self) -> &'static [usize]
pub const fn alignment_patterns_grid(&self) -> &'static [usize]
Returns alignments positions
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more