pub struct Encoder { /* private fields */ }Available on crate feature
rmqr only.Expand description
Configures and encodes Rectangular Micro QR Code symbols.
Implementations§
Source§impl RmqrEncoder
impl RmqrEncoder
Sourcepub const fn new(error_correction: RmqrErrorCorrection) -> Self
pub const fn new(error_correction: RmqrErrorCorrection) -> Self
Creates an encoder that considers every rMQR version.
Sourcepub const fn version(self, version: RmqrVersion) -> Self
pub const fn version(self, version: RmqrVersion) -> Self
Selects one exact rMQR version.
Sourcepub const fn version_range(self, versions: RangeInclusive<RmqrVersion>) -> Self
pub const fn version_range(self, versions: RangeInclusive<RmqrVersion>) -> Self
Selects an inclusive range in rMQR format indicator order.
Sourcepub const fn boost_error_correction(self, boost: bool) -> Self
pub const fn boost_error_correction(self, boost: bool) -> Self
Enables or disables upgrading Medium error correction to High when the selected version has room.
Sourcepub const fn fnc1(self, fnc1: Option<Fnc1>) -> Self
pub const fn fnc1(self, fnc1: Option<Fnc1>) -> Self
Sets the FNC1 interpretation applied to the complete symbol.
Sourcepub fn encode_bytes(
&self,
data: impl AsRef<[u8]>,
) -> Result<Symbol, EncodeError>
pub fn encode_bytes( &self, data: impl AsRef<[u8]>, ) -> Result<Symbol, EncodeError>
Encodes raw bytes with globally optimized Numeric, Alphanumeric and Byte segments.
Sourcepub fn encode_text(&self, text: impl AsRef<str>) -> Result<Symbol, EncodeError>
pub fn encode_text(&self, text: impl AsRef<str>) -> Result<Symbol, EncodeError>
Encodes text with globally optimized character modes and ECI transitions.
Sourcepub fn encode_to_qr_text<T: ToQRText + ?Sized>(
&self,
value: &T,
) -> Result<Symbol, EncodeError>
pub fn encode_to_qr_text<T: ToQRText + ?Sized>( &self, value: &T, ) -> Result<Symbol, EncodeError>
Encodes a value after converting it to its QR Code text representation.
Sourcepub fn encode_segments(
&self,
segments: &[Segment],
) -> Result<Symbol, EncodeError>
pub fn encode_segments( &self, segments: &[Segment], ) -> Result<Symbol, EncodeError>
Encodes explicit segments without changing their boundaries.
Trait Implementations§
Source§impl Clone for RmqrEncoder
impl Clone for RmqrEncoder
Source§fn clone(&self) -> RmqrEncoder
fn clone(&self) -> RmqrEncoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RmqrEncoder
impl RefUnwindSafe for RmqrEncoder
impl Send for RmqrEncoder
impl Sync for RmqrEncoder
impl Unpin for RmqrEncoder
impl UnsafeUnpin for RmqrEncoder
impl UnwindSafe for RmqrEncoder
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