[−][src]Enum qr_code::types::Mode
The mode indicator, which specifies the character set of the encoded data.
Variants
The data contains only characters 0 to 9.
The data contains only uppercase letters (A–Z), numbers (0–9) and a few
punctuations marks (space, $
, %
, *
, +
, -
, .
, /
, :
).
The data contains arbitrary binary data.
The data contains Shift-JIS-encoded double-byte text.
Implementations
impl Mode
[src]
pub fn length_bits_count(self, version: Version) -> usize
[src]
Computes the number of bits needed to encode the data length.
use qr_code::types::{Version, Mode}; assert_eq!(Mode::Numeric.length_bits_count(Version::Normal(1)), 10);
This method will return Err(QrError::UnsupportedCharacterSet)
if the
mode is not supported in the given version.
pub fn data_bits_count(self, raw_data_len: usize) -> usize
[src]
Computes the number of bits needed to some data of a given raw length.
use qr_code::types::Mode; assert_eq!(Mode::Numeric.data_bits_count(7), 24);
Note that in Kanji mode, the raw_data_len
is the number of Kanjis,
i.e. half the total size of bytes.
pub fn max(self, other: Self) -> Self
[src]
Find the lowest common mode which both modes are compatible with.
use qr_code::types::Mode; let a = Mode::Numeric; let b = Mode::Kanji; let c = a.max(b); assert!(a <= c); assert!(b <= c);
Trait Implementations
impl Clone for Mode
[src]
impl Copy for Mode
[src]
impl Debug for Mode
[src]
impl Eq for Mode
[src]
impl PartialEq<Mode> for Mode
[src]
impl PartialOrd<Mode> for Mode
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
Defines a partial ordering between modes. If a <= b
, then b
contains
a superset of all characters supported by a
.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Mode
[src]
impl StructuralPartialEq for Mode
[src]
Auto Trait Implementations
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,