pub struct Segment { /* private fields */ }Expand description
An explicitly constructed QR Code data or control segment.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn numeric(data: impl AsRef<str>) -> Result<Self, EncodeError>
pub fn numeric(data: impl AsRef<str>) -> Result<Self, EncodeError>
Creates a Numeric segment from ASCII digits.
Sourcepub fn alphanumeric(data: impl AsRef<str>) -> Result<Self, EncodeError>
pub fn alphanumeric(data: impl AsRef<str>) -> Result<Self, EncodeError>
Creates an Alphanumeric segment from the standard 45-character set.
Sourcepub fn bytes(data: impl AsRef<[u8]>) -> Self
pub fn bytes(data: impl AsRef<[u8]>) -> Self
Creates a Byte segment without adding an ECI header.
Sourcepub fn eci(assignment: EciAssignment) -> Self
Available on crate features qr or rmqr only.
pub fn eci(assignment: EciAssignment) -> Self
qr or rmqr only.Creates an ECI control segment.
Sourcepub fn kanji(data: impl AsRef<str>) -> Result<Self, EncodeError>
Available on crate feature kanji only.
pub fn kanji(data: impl AsRef<str>) -> Result<Self, EncodeError>
kanji only.Creates a Kanji segment from characters in the supported Shift JIS ranges.
Sourcepub const fn character_count(&self) -> usize
pub const fn character_count(&self) -> usize
Returns the character count stored in this segment.
Trait Implementations§
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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