pub struct DataBarEncoder;Expand description
GS1 DataBar encoder.
Implementations§
Source§impl DataBarEncoder
impl DataBarEncoder
Sourcepub fn build_omni(&self, gtin: &[u8]) -> Result<Symbol>
pub fn build_omni(&self, gtin: &[u8]) -> Result<Symbol>
Build a GS1 DataBar Omnidirectional symbol from a GTIN (13 or 14 digits).
A 13-digit body has its GS1 check digit appended; a 14-digit GTIN is validated against its check digit. The stored symbol carries the canonical 14-digit GTIN as a single numeric segment.
Sourcepub fn build_limited(&self, gtin: &[u8]) -> Result<Symbol>
pub fn build_limited(&self, gtin: &[u8]) -> Result<Symbol>
Build a GS1 DataBar Limited symbol from a GTIN (13 or 14 digits).
Limited only encodes GTINs whose indicator (leading) digit is 0 or 1.
Sourcepub fn build_stacked(&self, gtin: &[u8]) -> Result<Symbol>
pub fn build_stacked(&self, gtin: &[u8]) -> Result<Symbol>
Build a GS1 DataBar Stacked symbol (the two-row form of DataBar-14) from a GTIN (13 or 14 digits). The payload is the canonical 14-digit GTIN.
Sourcepub fn build_stacked_omni(&self, gtin: &[u8]) -> Result<Symbol>
pub fn build_stacked_omni(&self, gtin: &[u8]) -> Result<Symbol>
Build a GS1 DataBar Stacked Omnidirectional symbol from a GTIN (13 or 14 digits). The payload is the canonical 14-digit GTIN.
Sourcepub fn build_expanded_stacked(
&self,
gs1: &[u8],
columns_per_row: usize,
) -> Result<Symbol>
pub fn build_expanded_stacked( &self, gs1: &[u8], columns_per_row: usize, ) -> Result<Symbol>
Build a GS1 DataBar Expanded Stacked symbol from a reduced GS1 element string,
placing columns_per_row column pairs (codeblocks) on each stacked row.
columns_per_row must be in 1..=11 (ISO/IEC 24724:2011 §7.2.8); the common
default is 2. See DataBarEncoder::build_expanded for the payload format.
Sourcepub fn build_expanded(&self, gs1: &[u8]) -> Result<Symbol>
pub fn build_expanded(&self, gs1: &[u8]) -> Result<Symbol>
Build a GS1 DataBar Expanded symbol from a reduced GS1 element string.
gs1 is the Application Identifier data in reduced form: AI numbers and
their values concatenated, with a GS1 separator (FNC1, byte 0x1D) after a
variable-length AI’s value when another AI follows. The bytes are validated
by running the encodation and stored verbatim as a single Segment::byte.
Trait Implementations§
Source§impl Clone for DataBarEncoder
impl Clone for DataBarEncoder
Source§fn clone(&self) -> DataBarEncoder
fn clone(&self) -> DataBarEncoder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more