Enum qrcode::canvas::Module[][src]

pub enum Module {
    Empty,
    Masked(Color),
    Unmasked(Color),
}

The color of a module (pixel) in the QR code.

Variants

The module is empty.

The module is of functional patterns which cannot be masked, or pixels which have been masked.

The module is of data and error correction bits before masking.

Methods

impl Module
[src]

Checks whether a module is dark.

Apply a mask to the unmasked modules.

use qrcode::canvas::Module;
use qrcode::types::Color;

assert_eq!(Module::Unmasked(Color::Light).mask(true), Module::Masked(Color::Dark));
assert_eq!(Module::Unmasked(Color::Dark).mask(true), Module::Masked(Color::Light));
assert_eq!(Module::Unmasked(Color::Light).mask(false), Module::Masked(Color::Light));
assert_eq!(Module::Masked(Color::Dark).mask(true), Module::Masked(Color::Dark));
assert_eq!(Module::Masked(Color::Dark).mask(false), Module::Masked(Color::Dark));

Trait Implementations

impl PartialEq for Module
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Module
[src]

impl Clone for Module
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Module
[src]

impl Debug for Module
[src]

Formats the value using the given formatter. Read more

impl From<Module> for Color
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Module

impl Sync for Module