pub struct Data { /* private fields */ }Available on crate feature
qr_code only.Expand description
The data of a QRCode.
It stores the contents that will be displayed.
Implementations§
Source§impl Data
impl Data
Sourcepub fn new(data: impl AsRef<[u8]>) -> Result<Self, Error>
pub fn new(data: impl AsRef<[u8]>) -> Result<Self, Error>
Creates a new Data with the provided data.
This method uses an ErrorCorrection::Medium and chooses the smallest
size to display the data.
Sourcepub fn with_error_correction(
data: impl AsRef<[u8]>,
error_correction: ErrorCorrection,
) -> Result<Self, Error>
pub fn with_error_correction( data: impl AsRef<[u8]>, error_correction: ErrorCorrection, ) -> Result<Self, Error>
Creates a new Data with the provided ErrorCorrection.
Sourcepub fn with_version(
data: impl AsRef<[u8]>,
version: Version,
error_correction: ErrorCorrection,
) -> Result<Self, Error>
pub fn with_version( data: impl AsRef<[u8]>, version: Version, error_correction: ErrorCorrection, ) -> Result<Self, Error>
Creates a new Data with the provided Version and
ErrorCorrection.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Data
impl !RefUnwindSafe for Data
impl Send for Data
impl !Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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