[][src]Enum qr_code::types::Version

pub enum Version {
    Normal(i16),
    Micro(i16),
}

In QR code terminology, Version means the size of the generated image. Larger version means the size of code is larger, and therefore can carry more information.

The smallest version is Version::Normal(1) of size 21×21, and the largest is Version::Normal(40) of size 177×177.

Variants

Normal(i16)

A normal QR code version. The parameter should be between 1 and 40.

Micro(i16)

A Micro QR code version. The parameter should be between 1 and 4.

Implementations

impl Version[src]

pub fn width(self) -> i16[src]

Get the number of "modules" on each size of the QR code, i.e. the width and height of the code.

pub fn fetch<T>(self, ec_level: EcLevel, table: &[[T; 4]]) -> QrResult<T> where
    T: PartialEq + Default + Copy
[src]

Obtains an object from a hard-coded table.

The table must be a 44×4 array. The outer array represents the content for each version. The first 40 entry corresponds to QR code versions 1 to 40, and the last 4 corresponds to Micro QR code version 1 to 4. The inner array represents the content in each error correction level, in the order [L, M, Q, H].

Errors

If the entry compares equal to the default value of T, this method returns Err(QrError::InvalidVersion).

pub fn mode_bits_count(self) -> usize[src]

The number of bits needed to encode the mode indicator.

pub fn is_micro(self) -> bool[src]

Checks whether is version refers to a Micro QR code.

Trait Implementations

impl Clone for Version[src]

impl Copy for Version[src]

impl Debug for Version[src]

impl Eq for Version[src]

impl PartialEq<Version> for Version[src]

impl StructuralEq for Version[src]

impl StructuralPartialEq for Version[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.