Macro mini_functions::qr::set_encoding_format
source · macro_rules! set_encoding_format { ($qr_code:expr, $format:expr) => { ... }; }
Expand description
Re-exported main qrc
module from qrc for QR code generation.
Sets the encoding format for the data in a QR code.
QR codes can encode data in several formats, such as numeric, alphanumeric, or binary. This macro allows setting the preferred encoding format for the data.
Parameters
$qr_code:expr
: An instance ofQRCode
.$format:expr
: The encoding format for the QR code data.
Example
use qrc::{QRCode, set_encoding_format}; // Import QRCode and the macro
let qr_code = QRCode::new("some data".as_bytes().to_vec()); // Create a QRCode instance
let qr_with_format = set_encoding_format!(qr_code, "utf-8"); // Use the macro to set the encoding format