Enum rxing::common::CharacterSet
source · pub enum CharacterSet {
Show 33 variants
Cp437,
ISO8859_1,
ISO8859_2,
ISO8859_3,
ISO8859_4,
ISO8859_5,
ISO8859_6,
ISO8859_7,
ISO8859_8,
ISO8859_9,
ISO8859_10,
ISO8859_11,
ISO8859_13,
ISO8859_14,
ISO8859_15,
ISO8859_16,
Shift_JIS,
Cp1250,
Cp1251,
Cp1252,
Cp1256,
UTF16BE,
UTF8,
ASCII,
Big5,
GB2312,
GB18030,
EUC_KR,
UTF16LE,
UTF32BE,
UTF32LE,
Binary,
Unknown,
}Expand description
Encapsulates a Character Set ECI, according to “Extended Channel Interpretations” 5.3.1.1 of ISO 18004.
@author Sean Owen
Variants§
Cp437
ISO8859_1
ISO8859_2
ISO8859_3
ISO8859_4
ISO8859_5
ISO8859_6
ISO8859_7
ISO8859_8
ISO8859_9
ISO8859_10
ISO8859_11
ISO8859_13
ISO8859_14
ISO8859_15
ISO8859_16
Shift_JIS
Cp1250
Cp1251
Cp1252
Cp1256
UTF16BE
UTF8
ASCII
Big5
GB2312
GB18030
EUC_KR
UTF16LE
UTF32BE
UTF32LE
Binary
Unknown
Implementations§
source§impl CharacterSet
impl CharacterSet
pub fn get_charset_name(&self) -> &'static str
sourcepub fn get_character_set_by_name(name: &str) -> Option<CharacterSet>
pub fn get_character_set_by_name(name: &str) -> Option<CharacterSet>
@param name character set ECI encoding name @return CharacterSetECI representing ECI for character encoding, or null if it is legal but unsupported
pub fn encode(&self, input: &str) -> Result<Vec<u8>>
pub fn encode_replace(&self, input: &str) -> Result<Vec<u8>>
pub fn decode(&self, input: &[u8]) -> Result<String>
pub fn decode_replace(&self, input: &[u8]) -> Result<String>
Trait Implementations§
source§impl Clone for CharacterSet
impl Clone for CharacterSet
source§fn clone(&self) -> CharacterSet
fn clone(&self) -> CharacterSet
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 moresource§impl Debug for CharacterSet
impl Debug for CharacterSet
source§impl From<CharacterSet> for Eci
impl From<CharacterSet> for Eci
source§fn from(value: CharacterSet) -> Self
fn from(value: CharacterSet) -> Self
Converts to this type from the input type.
source§impl From<Eci> for CharacterSet
impl From<Eci> for CharacterSet
source§impl PartialEq for CharacterSet
impl PartialEq for CharacterSet
source§fn eq(&self, other: &CharacterSet) -> bool
fn eq(&self, other: &CharacterSet) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for CharacterSet
impl Eq for CharacterSet
impl StructuralEq for CharacterSet
impl StructuralPartialEq for CharacterSet
Auto Trait Implementations§
impl RefUnwindSafe for CharacterSet
impl Send for CharacterSet
impl Sync for CharacterSet
impl Unpin for CharacterSet
impl UnwindSafe for CharacterSet
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.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.