Crate qrcode [−] [src]
QRCode encoder
This crate provides a QR code and Micro QR code encoder for binary data.
use qrcode::QrCode; let code = QrCode::new(b"Some content here."); match code { Err(err) => panic!("Failed to encode the QR code: {:?}", err), Ok(code) => { for y in 0 .. code.width() { for x in 0 .. code.width() { let color = if code[(x, y)] { "black" } else { "white" }; // render color at position (x, y) } } } }
Reexports
pub use types::{QrResult, EcLevel, Version}; |
Modules
bits |
The |
canvas |
The |
ec |
The |
optimize |
Find the optimal data mode sequence to encode a piece of data. |
types |
Structs
QrCode |
The encoded QR code symbol. |