Enum matrix_qrcode::qrcode::types::Version
[−]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
impl Version
impl Version
pub fn width(self) -> i16
pub fn width(self) -> i16
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]]) -> Result<T, QrError> where
T: PartialEq<T> + Default + Copy,
pub fn fetch<T>(self, ec_level: EcLevel, table: &[[T; 4]]) -> Result<T, QrError> where
T: PartialEq<T> + Default + Copy,
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
pub fn mode_bits_count(self) -> usize
The number of bits needed to encode the mode indicator.
Trait Implementations
impl Copy for Version
impl Eq for Version
impl StructuralEq for Version
impl StructuralPartialEq for Version
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
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
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more