Struct codepage_437::Cp437Dialect
[−]
[src]
pub struct Cp437Dialect { /* fields omitted */ }
Specifier for the specific kind of cp437.
Dialects are instances of this type, aggregating data necessary to perform conversions.
Methods
impl Cp437Dialect
[src]
pub fn overlap_unicode(&self, unicode: char) -> bool
[src]
Check, whether the specified Unicode codepoint overlaps with a cp437 one.
pub fn overlap_cp437(&self, cp437: u8) -> bool
[src]
Check, whether the specified cp437 codepoint overlaps with a Unicode one.
pub fn decode(&self, cp437: u8) -> char
[src]
Decode a single cp437 codepoint into a Unicode one.
pub fn encode(&self, unicode: char) -> Option<u8>
[src]
Try to encode a single Unicode codepoint as a cp437 one.
pub fn remap(&mut self, cp437: u8, unicode: char) -> &mut Cp437Dialect
[src]
Map the specified cp437 codepoint mapped to the specified unicode character instead.
Examples
Remap √
to ✓
:
let square_root_or_checkmark = CP437_WINGDINGS.encode('√').unwrap(); let mut mapping = CP437_WINGDINGS.clone(); mapping.remap(square_root_or_checkmark, '✓'); assert_eq!(mapping.decode(square_root_or_checkmark), '✓');
Trait Implementations
impl Clone for Cp437Dialect
[src]
fn clone(&self) -> Cp437Dialect
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Cp437Dialect
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Hash for Cp437Dialect
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for Cp437Dialect
[src]
impl PartialEq for Cp437Dialect
[src]
fn eq(&self, other: &Cp437Dialect) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Ord for Cp437Dialect
[src]
fn cmp(&self, other: &Cp437Dialect) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for Cp437Dialect
[src]
fn partial_cmp(&self, other: &Cp437Dialect) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more