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]
impl Color
pub fn select<T>(self, dark: T, light: T) -> T
[src]
pub fn select<T>(self, dark: T, light: T) -> T
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 From<Module> for Color
[src]
impl From<Module> for Color
impl Copy for Color
[src]
impl Copy for Color
impl Clone for Color
[src]
impl Clone for Color
fn clone(&self) -> Color
[src]
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Color
[src]
impl PartialEq for Color
fn eq(&self, other: &Color) -> bool
[src]
fn eq(&self, other: &Color) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Eq for Color
[src]
impl Eq for Color
impl Hash for Color
[src]
impl Hash for Color
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Color
[src]
impl Debug for Color
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Not for Color
[src]
impl Not for Color