Struct mini_functions::qrcode::QRCode
source · Expand description
The QRCode struct represents a QR code image.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data: Vec<u8>The data field holds the data to be encoded in the QR code.
Implementations§
source§impl QRCode
impl QRCode
sourcepub fn new(data: Vec<u8>) -> Self
pub fn new(data: Vec<u8>) -> Self
The new method creates a new instance of the QRCode struct
with the given data.
sourcepub fn from_string(data: String) -> Self
pub fn from_string(data: String) -> Self
The from_string method creates a new instance of the QRCode
struct by converting the given string data into a vector of
bytes
sourcepub fn from_bytes(data: Vec<u8>) -> Self
pub fn from_bytes(data: Vec<u8>) -> Self
The from_bytes method creates a new instance of the QRCode
struct with the given vector of bytes
sourcepub fn to_qrcode(&self) -> QrCode
pub fn to_qrcode(&self) -> QrCode
The to_qrcode method creates a new QrCode value using the data
stored in the QRCode struct.
sourcepub fn to_png(&self) -> ImageBuffer<Rgb<u8>, Vec<u8>>
pub fn to_png(&self) -> ImageBuffer<Rgb<u8>, Vec<u8>>
The to_png method creates a new PNG image of the QR code using
the data stored in the QRCode
sourcepub fn to_svg(&self) -> String
pub fn to_svg(&self) -> String
The to_svg method creates a new SVG image of the QR code using
the data stored in the QRCode
Trait Implementations§
source§impl PartialEq<QRCode> for QRCode
impl PartialEq<QRCode> for QRCode
impl StructuralPartialEq for QRCode
Auto Trait Implementations§
impl RefUnwindSafe for QRCode
impl Send for QRCode
impl Sync for QRCode
impl Unpin for QRCode
impl UnwindSafe for QRCode
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().