pub struct AutoEncoder { /* private fields */ }Available on crate features
micro-qr and qr only.Expand description
Tries a configured Micro QR Code encoder before a configured Model 2 QR Code encoder.
Implementations§
Source§impl AutoEncoder
impl AutoEncoder
Sourcepub const fn new(qr: QrEncoder, micro: MicroEncoder) -> Self
pub const fn new(qr: QrEncoder, micro: MicroEncoder) -> Self
Creates an encoder from independently configured Model 2 and Micro QR Code encoders.
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 using the smallest eligible symbol family.
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 using the smallest eligible symbol family.
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 once.
Sourcepub fn encode_segments(
&self,
segments: &[Segment],
) -> Result<Symbol, EncodeError>
pub fn encode_segments( &self, segments: &[Segment], ) -> Result<Symbol, EncodeError>
Encodes explicit segments using the smallest eligible symbol family.
Trait Implementations§
Source§impl Clone for AutoEncoder
impl Clone for AutoEncoder
Source§fn clone(&self) -> AutoEncoder
fn clone(&self) -> AutoEncoder
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 AutoEncoder
impl RefUnwindSafe for AutoEncoder
impl Send for AutoEncoder
impl Sync for AutoEncoder
impl Unpin for AutoEncoder
impl UnsafeUnpin for AutoEncoder
impl UnwindSafe for AutoEncoder
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