Enum qrcode::types::Color
[−]
[src]
pub enum Color { Light, Dark, }
The color of a module.
Variants
Light
The module is light colored.
Dark
The module is dark colored.
Methods
impl Color
[src]
pub fn select<T>(self, dark: T, light: T) -> T
[src]
Selects a value according to color of the module. Equivalent to
if self != Color::Light { dark } else { light }
.
Examples
assert_eq!(Color::Light.select(1, 0), 0); assert_eq!(Color::Dark.select("black", "white"), "black");
Trait Implementations
impl Copy for Color
[src]
impl Clone for Color
[src]
fn clone(&self) -> Color
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Color
[src]
fn eq(&self, __arg_0: &Color) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for Color
[src]
impl Hash for Color
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Color
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Not for Color
[src]
type Output = Self
The resulting type after applying the !
operator.
fn not(self) -> Self
[src]
Performs the unary !
operation.