EncodeHints

Struct EncodeHints 

Source
pub struct EncodeHints {
Show 20 fields pub ErrorCorrection: Option<String>, pub CharacterSet: Option<String>, pub DataMatrixShape: Option<SymbolShapeHint>, pub DataMatrixCompact: Option<bool>, pub MinSize: Option<Dimension>, pub MaxSize: Option<Dimension>, pub Margin: Option<String>, pub Pdf417Compact: Option<String>, pub Pdf417Compaction: Option<String>, pub Pdf417Dimensions: Option<Dimensions>, pub Pdf417AutoEci: Option<String>, pub AztecLayers: Option<i32>, pub QrVersion: Option<String>, pub QrMaskPattern: Option<String>, pub QrCompact: Option<String>, pub Gs1Format: Option<bool>, pub ForceCodeSet: Option<String>, pub ForceC40: Option<bool>, pub Code128Compact: Option<bool>, pub TelepenAsNumeric: Option<bool>,
}

Fields§

§ErrorCorrection: Option<String>

Specifies what degree of error correction to use, for example in QR Codes. Type depends on the encoder. For example for QR codes it’s type {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}. For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words. For PDF417 it is of type {@link Integer}, valid values being 0 to 8. In all cases, it can also be a {@link String} representation of the desired value as well. Note: an Aztec symbol should have a minimum of 25% EC words.

§CharacterSet: Option<String>

Specifies what character encoding to use where applicable (type {@link String})

§DataMatrixShape: Option<SymbolShapeHint>

Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})

§DataMatrixCompact: Option<bool>

Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or “true” or “false” {@link String } value). The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1 character set via ECIs. Please note that in that case, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint. Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords for the purpose of delimiting AIs. This option and {@link #FORCE_C40} are mutually exclusive.

§MinSize: Option<Dimension>
👎Deprecated

Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.

@deprecated use width/height params in {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}

§MaxSize: Option<Dimension>
👎Deprecated

Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.

@deprecated without replacement

§Margin: Option<String>

Specifies margin, in pixels, to use when generating the barcode. The meaning can vary by format; for example it controls margin before and after the barcode horizontally for most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).

§Pdf417Compact: Option<String>

Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or “true” or “false” {@link String} value).

§Pdf417Compaction: Option<String>

Specifies what compaction mode to use for PDF417 (type {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its enum values).

§Pdf417Dimensions: Option<Dimensions>

Specifies the minimum and maximum number of rows and columns for PDF417 (type {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).

§Pdf417AutoEci: Option<String>

Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or “true” or “false” {@link String} value). Please note that in that case, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.

§AztecLayers: Option<i32>

Specifies the required number of layers for an Aztec code. A negative number (-1, -2, -3, -4) specifies a compact Aztec code. 0 indicates to use the minimum number of layers (the default). A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code. (Type {@link Integer}, or {@link String} representation of the integer value).

§QrVersion: Option<String>

Specifies the exact version of QR code to be encoded. (Type {@link Integer}, or {@link String} representation of the integer value).

§QrMaskPattern: Option<String>

Specifies the QR code mask pattern to be used. Allowed values are 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select the optimal mask pattern.

  • (Type {@link Integer}, or {@link String} representation of the integer value).
§QrCompact: Option<String>

Specifies whether to use compact mode for QR code (type {@link Boolean}, or “true” or “false” {@link String } value). Please note that when compaction is performed, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.

§Gs1Format: Option<bool>

Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or “true” or “false” {@link String } value).

§ForceCodeSet: Option<String>

Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}). Valid values are “A”, “B”, “C”. This option and {@link #CODE128_COMPACT} are mutually exclusive.

§ForceC40: Option<bool>

Forces C40 encoding for data-matrix (type {@link Boolean}, or “true” or “false”) {@link String } value). This option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.

§Code128Compact: Option<bool>

Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or “true” or “false” {@link String } value). This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually exclusive.

§TelepenAsNumeric: Option<bool>

Translate the numeric values received by the Telepen reader into the Telepen Alphaumeric form; use {@link Boolean#TRUE}.

Implementations§

Source§

impl EncodeHints

Source

pub fn with(self, hint: EncodeHintValue) -> Self

Trait Implementations§

Source§

impl Clone for EncodeHints

Source§

fn clone(&self) -> EncodeHints

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodeHints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EncodeHints

Source§

fn default() -> EncodeHints

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for EncodeHints

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<HashMap<EncodeHintType, EncodeHintValue>> for EncodeHints

Source§

fn from(value: EncodingHintDictionary) -> Self

Converts to this type from the input type.
Source§

impl Serialize for EncodeHints

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,