pub struct Encoder { /* private fields */ }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.
The segments are written as given, so keep a Kanji segment after an explicit Shift JIS ECI segment unless the symbol has no ECI segment at all.