#[non_exhaustive]
pub struct QRCode { pub data: Vec<u8>, }
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§

The new method creates a new instance of the QRCode struct with the given data.

The from_string method creates a new instance of the QRCode struct by converting the given string data into a vector of bytes

The from_bytes method creates a new instance of the QRCode struct with the given vector of bytes

The to_qrcode method creates a new QrCode value using the data stored in the QRCode struct.

The to_png method creates a new PNG image of the QR code using the data stored in the QRCode

The to_svg method creates a new SVG image of the QR code using the data stored in the QRCode

The colorize method creates a new PNG image of the QR code using the data stored in the QRCode and the given color value to colorize the QR code.

The resize method creates a new PNG image of the QR code using the data stored in the QRCode and the given width and height values to resize the QR code.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.