pub struct QRCode {
pub data: [Module; 31329],
pub size: usize,
pub version: Option<Version>,
pub ecl: Option<ECL>,
pub mask: Option<Mask>,
pub mode: Option<Mode>,
}
Expand description
A QRCode
can be created using QRBuilder
. Simple API for simple usage.
If you need to use QRCode
directly, please file an issue on
github explaining your use case.
Contains all needed information about the QRCode
.
This is the main struct of the crate.
It contains the matrix of the QRCode
, stored as a one-dimensional array.
Fields§
§data: [Module; 31329]
This array length is of size 177 x 177
. It is using a fixed size
array simply because of performance.
§Other data type possible:
- Templated Matrix was faster but crate size was huge.
- Vector using
with_capacity
, really bad.
size: usize
Width & Height of QRCode. If manually set, should be version * 4 + 17
, version
going
from 1 to 40 both included.
version: Option<Version>
Version of the QRCode
, impacts the size.
None
will optimize Version according to ECL and Mode
ecl: Option<ECL>
Defines how powerful QRCode
redundancy should be or how much percent of a QRCode can be
recovered.
ECL::L
: 7%ECL::M
: 15%ECL::Q
: 25%ELC::H
: 30%
None
will set ECL to Quartile (ELC::Q
)
mask: Option<Mask>
Changes the final pattern used.
None will find the best suited mask.
mode: Option<Mode>
Mode defines which data is being parsed, between Numeric, AlphaNumeric & Byte.
None
will optimize Mode according to user input.
§Note
Kanji mode is not supported (yet).