Struct rxing::common::ECIEncoderSet
source · pub struct ECIEncoderSet { /* private fields */ }Expand description
Set of CharsetEncoders for a given input string
Invariants:
- The list contains only encoders from CharacterSetECI (list is shorter then the list of encoders available on the platform for which ECI values are defined).
- The list contains encoders at least one encoder for every character in the input.
- The first encoder in the list is always the ISO-8859-1 encoder even of no character in the input can be encoded by it.
- If the input contains a character that is not in ISO-8859-1 then the last two entries in the list will be the UTF-8 encoder and the UTF-16BE encoder.
@author Alex Geller
Implementations§
source§impl ECIEncoderSet
impl ECIEncoderSet
sourcepub fn new(
stringToEncodeMain: &str,
priorityCharset: Option<CharacterSet>,
fnc1: Option<&str>
) -> Self
pub fn new( stringToEncodeMain: &str, priorityCharset: Option<CharacterSet>, fnc1: Option<&str> ) -> Self
Constructs an encoder set
@param stringToEncode the string that needs to be encoded @param priorityCharset The preferred {@link Charset} or null. @param fnc1 fnc1 denotes the character in the input that represents the FNC1 character or -1 for a non-GS1 bar code. When specified, it is considered an error to pass it as argument to the methods canEncode() or encode().
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn getCharsetName(&self, index: usize) -> Option<&'static str>
pub fn getCharset(&self, index: usize) -> Option<CharacterSet>
pub fn get_eci(&self, encoderIndex: usize) -> Eci
pub fn getPriorityEncoderIndex(&self) -> Option<usize>
pub fn canEncode(&self, c: &str, encoderIndex: usize) -> Option<bool>
pub fn encode_char(&self, c: &str, encoderIndex: usize) -> Option<Vec<u8>>
pub fn encode_string(&self, s: &str, encoderIndex: usize) -> Option<Vec<u8>>
Trait Implementations§
source§impl Clone for ECIEncoderSet
impl Clone for ECIEncoderSet
source§fn clone(&self) -> ECIEncoderSet
fn clone(&self) -> ECIEncoderSet
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ECIEncoderSet
impl Send for ECIEncoderSet
impl Sync for ECIEncoderSet
impl Unpin for ECIEncoderSet
impl UnwindSafe for ECIEncoderSet
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.