pub struct ConstVersion<const N: i16>;Expand description
A compile-time checked normal QR version.
N must be in the normal QR version range 1..=40. The range is checked
when ConstVersion::new or ConstVersion::VALUE is evaluated, so an
invalid fixed-version path fails at compile time instead of reaching the
encoder.
use qrcode_core::{ConstVersion, Version};
const V5: Version = ConstVersion::<5>::VALUE;
assert_eq!(V5, Version::Normal(5));ⓘ
use qrcode_core::ConstVersion;
const INVALID: qrcode_core::Version = ConstVersion::<41>::VALUE;Implementations§
Source§impl<const N: i16> ConstVersion<N>
impl<const N: i16> ConstVersion<N>
Trait Implementations§
Source§impl<const N: i16> Clone for ConstVersion<N>
impl<const N: i16> Clone for ConstVersion<N>
Source§fn clone(&self) -> ConstVersion<N>
fn clone(&self) -> ConstVersion<N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const N: i16> Copy for ConstVersion<N>
Source§impl<const N: i16> Debug for ConstVersion<N>
impl<const N: i16> Debug for ConstVersion<N>
Source§impl<const N: i16> Default for ConstVersion<N>
impl<const N: i16> Default for ConstVersion<N>
Source§fn default() -> ConstVersion<N>
fn default() -> ConstVersion<N>
Returns the “default value” for a type. Read more
impl<const N: i16> Eq for ConstVersion<N>
Source§impl<const N: i16> Ord for ConstVersion<N>
impl<const N: i16> Ord for ConstVersion<N>
Source§fn cmp(&self, other: &ConstVersion<N>) -> Ordering
fn cmp(&self, other: &ConstVersion<N>) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const N: i16> PartialEq for ConstVersion<N>
impl<const N: i16> PartialEq for ConstVersion<N>
Source§impl<const N: i16> PartialOrd for ConstVersion<N>
impl<const N: i16> PartialOrd for ConstVersion<N>
Source§impl<const N: i16> StaticVersion for ConstVersion<N>
impl<const N: i16> StaticVersion for ConstVersion<N>
impl<const N: i16> StructuralPartialEq for ConstVersion<N>
Auto Trait Implementations§
impl<const N: i16> Freeze for ConstVersion<N>
impl<const N: i16> RefUnwindSafe for ConstVersion<N>
impl<const N: i16> Send for ConstVersion<N>
impl<const N: i16> Sync for ConstVersion<N>
impl<const N: i16> Unpin for ConstVersion<N>
impl<const N: i16> UnsafeUnpin for ConstVersion<N>
impl<const N: i16> UnwindSafe for ConstVersion<N>
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