pub enum EcLevel {
L = 0,
M = 1,
Q = 2,
H = 3,
}Expand description
The error correction level. It allows the original information be recovered even if parts of the code is damaged.
Variants§
L = 0
Low error correction. Allows up to 7% of wrong blocks.
M = 1
Medium error correction (default). Allows up to 15% of wrong blocks.
Q = 2
“Quartile” error correction. Allows up to 25% of wrong blocks.
H = 3
High error correction. Allows up to 30% of wrong blocks.
Trait Implementations§
impl Copy for EcLevel
Source§impl<'de> Deserialize<'de> for EcLevel
impl<'de> Deserialize<'de> for EcLevel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EcLevel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EcLevel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EcLevel
Source§impl FromStr for EcLevel
impl FromStr for EcLevel
Source§fn from_str(s: &str) -> Result<EcLevel, <EcLevel as FromStr>::Err>
fn from_str(s: &str) -> Result<EcLevel, <EcLevel as FromStr>::Err>
Parses a case-insensitive single letter: L, M, Q or H.
§Examples
use core::str::FromStr;
use qrcode_core::types::EcLevel;
assert_eq!(EcLevel::from_str("H"), Ok(EcLevel::H));
assert_eq!(EcLevel::from_str("m"), Ok(EcLevel::M));
assert!(EcLevel::from_str("X").is_err());Source§type Err = EnumParseError
type Err = EnumParseError
The associated error which can be returned from parsing.
Source§impl Ord for EcLevel
impl Ord for EcLevel
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 PartialOrd for EcLevel
impl PartialOrd for EcLevel
Source§impl Serialize for EcLevel
impl Serialize for EcLevel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for EcLevel
Auto Trait Implementations§
impl Freeze for EcLevel
impl RefUnwindSafe for EcLevel
impl Send for EcLevel
impl Sync for EcLevel
impl Unpin for EcLevel
impl UnsafeUnpin for EcLevel
impl UnwindSafe for EcLevel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.