pub struct SymbolList { /* private fields */ }
Expand description

Set of symbol sizes the encoder is allowed to use.

Specifies a list of symbol sizes the encoder will pick from. The smallest symbol which can hold the data is chosen.

By default all standard sizes defined in ISO 16022 are used. The selection can be restricted to square or rectangular symbols, symbols within a size range, or by giving an explicit list.

Examples

To get all rectangles with maximum height 20, including the rectangle extensions you can write

let code = DataMatrix::encode(
    b"Hello, World!",
    SymbolList::with_extended_rectangles()
        .enforce_rectangular()
        .enforce_height_in(..=20),
);

Because SymbolSize and [SymbolSize; N] implement Into<SymbolList> you can write

// a) use one specific symbol size
let code = DataMatrix::encode(b"content to encode", SymbolSize::Square22);

// b) custom list of allowed symbol sizes
let code = DataMatrix::encode(
    b"content to encode",
    [SymbolSize::Square22, SymbolSize::Square26],
);

Implementations

Get standard symbol sizes extended by all DMRE rectangles.

In ISO 21471 additional rectangular sizes are defined. Be aware that your decoder might not recognize these.

DMRE stands for Data Matrix Rectangular Extensions.

Remove all non-square symbols from the current selection.

Remove all square symbols from the current selection.

Only keep symbols with width in the given range.

Only keep symbols with height in the given range.

Create a symbol list containing only the given symbols.

The list does not need to be sorted.

Panics

The call panics if the slice contains more elements than symbol sizes exist.

Get a list with all supported symbol sizes.

Check if a symbol size is in this symbol list.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Create a symbol list with all but the DMRE symbol sizes.

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.