pub struct State { /* private fields */ }
Available on crate feature
qr_code
only.Expand description
The state of a QRCode
.
It stores the data that will be displayed.
Implementations
sourceimpl State
impl State
sourcepub fn new(data: impl AsRef<[u8]>) -> Result<State, Error>
pub fn new(data: impl AsRef<[u8]>) -> Result<State, Error>
Creates a new State
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<State, Error>
pub fn with_error_correction(
data: impl AsRef<[u8]>,
error_correction: ErrorCorrection
) -> Result<State, Error>
Creates a new State
with the provided ErrorCorrection
.
sourcepub fn with_version(
data: impl AsRef<[u8]>,
version: Version,
error_correction: ErrorCorrection
) -> Result<State, Error>
pub fn with_version(
data: impl AsRef<[u8]>,
version: Version,
error_correction: ErrorCorrection
) -> Result<State, Error>
Creates a new State
with the provided Version
and
ErrorCorrection
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for State
impl Send for State
impl !Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more