qrcode-rs 0.5.0

QR code encoder in Rust,Generate QR Code matrices and images in RAW, PNG and SVG formats.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Generate accessible alt text describing a QR code's payload — suitable for
//! an `<img alt="…">` or an inline SVG's `aria-label`.
//!
//! Run: `cargo run --example alt_text`

use qrcode_rs::QrCode;

fn main() {
    let payload = "https://example.com";
    let _code = QrCode::new(payload.as_bytes()).unwrap();
    println!("{}", QrCode::alt_text(payload));
}