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

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

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

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).

The number of bits needed to encode the mode indicator.

Checks whether is version refers to a Micro QR code.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more