pub struct Code { /* private fields */ }Expand description
An encoded or decoded QR code.
Holds the full module matrix plus metadata (version, EC level, mask number).
Convert to a renderable image with Code::render.
payload is populated by Reader; for codes returned from Encoder
the input bytes are not retained — refer to the original value instead.
Implementations§
Source§impl Code
impl Code
Sourcepub fn mask(&self) -> u8
pub fn mask(&self) -> u8
Mask pattern (0–7) selected by the encoder or recovered from format info.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Side length of the module matrix in modules. Equals 17 + 4 * version.0.
Sourcepub fn payload(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
Recovered payload bytes (only meaningful for decoded codes).
For codes returned by Encoder::build this is empty — the encoder does
not retain the input.
Sourcepub fn render(&self) -> RenderBuilder<'_>
pub fn render(&self) -> RenderBuilder<'_>
Start building a Bitmap from this code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnsafeUnpin for Code
impl UnwindSafe for Code
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more