pub struct DecodeHints {Show 13 fields
pub Other: Option<String>,
pub PureBarcode: Option<bool>,
pub PossibleFormats: Option<HashSet<BarcodeFormat>>,
pub TryHarder: Option<bool>,
pub CharacterSet: Option<String>,
pub AllowedLengths: Option<Vec<u32>>,
pub AssumeCode39CheckDigit: Option<bool>,
pub AssumeGs1: Option<bool>,
pub ReturnCodabarStartEnd: Option<bool>,
pub NeedResultPointCallback: Option<PointCallback>,
pub AllowedEanExtensions: Option<Vec<u32>>,
pub AlsoInverted: Option<bool>,
pub TelepenAsNumeric: Option<bool>,
}
Fields§
§Other: Option<String>
Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
PureBarcode: Option<bool>
Image is a pure monochrome image of a barcode. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
PossibleFormats: Option<HashSet<BarcodeFormat>>
Image is known to be of one of a few possible formats. Maps to a {@link List} of {@link BarcodeFormat}s.
TryHarder: Option<bool>
Spend more time to try to find a barcode; optimize for accuracy, not speed. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
CharacterSet: Option<String>
Specifies what character encoding to use when decoding, where applicable (type String)
AllowedLengths: Option<Vec<u32>>
Allowed lengths of encoded data – reject anything else. Maps to an {@code int[]}.
AssumeCode39CheckDigit: Option<bool>
Assume Code 39 codes employ a check digit. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
AssumeGs1: Option<bool>
Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed. For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
ReturnCodabarStartEnd: Option<bool>
If true, return the start and end digits in a Codabar barcode instead of stripping them. They are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them to not be. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
NeedResultPointCallback: Option<PointCallback>
The caller needs to be notified via callback when a possible {@link Point} is found. Maps to a {@link PointCallback}.
AllowedEanExtensions: Option<Vec<u32>>
Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this. Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5]. If it is optional to have an extension, do not set this hint. If this is set, and a UPC or EAN barcode is found but an extension is not, then no result will be returned at all.
AlsoInverted: Option<bool>
If true, also tries to decode as inverted image. All configured decoders are simply called a second time with an inverted image. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.
TelepenAsNumeric: Option<bool>
Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
Implementations§
Source§impl DecodeHints
impl DecodeHints
pub fn with(self, value: DecodeHintValue) -> Self
Trait Implementations§
Source§impl Clone for DecodeHints
impl Clone for DecodeHints
Source§fn clone(&self) -> DecodeHints
fn clone(&self) -> DecodeHints
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for DecodeHints
impl Default for DecodeHints
Source§fn default() -> DecodeHints
fn default() -> DecodeHints
Source§impl<'de> Deserialize<'de> for DecodeHints
impl<'de> Deserialize<'de> for DecodeHints
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<DecodeHints> for DecodingHintDictionary
impl From<DecodeHints> for DecodingHintDictionary
Source§fn from(value: DecodeHints) -> Self
fn from(value: DecodeHints) -> Self
Source§impl From<HashMap<DecodeHintType, DecodeHintValue>> for DecodeHints
impl From<HashMap<DecodeHintType, DecodeHintValue>> for DecodeHints
Source§fn from(value: DecodingHintDictionary) -> Self
fn from(value: DecodingHintDictionary) -> Self
Auto Trait Implementations§
impl Freeze for DecodeHints
impl !RefUnwindSafe for DecodeHints
impl Send for DecodeHints
impl Sync for DecodeHints
impl Unpin for DecodeHints
impl !UnwindSafe for DecodeHints
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.