pub struct Cp437Dialect { /* private fields */ }
Expand description
Specifier for the specific kind of cp437.
Dialects are instances of this type, aggregating data necessary to perform conversions.
Implementations§
Source§impl Cp437Dialect
impl Cp437Dialect
Sourcepub fn overlap_unicode(&self, unicode: char) -> bool
pub fn overlap_unicode(&self, unicode: char) -> bool
Check, whether the specified Unicode codepoint overlaps with a cp437 one.
Sourcepub fn overlap_cp437(&self, cp437: u8) -> bool
pub fn overlap_cp437(&self, cp437: u8) -> bool
Check, whether the specified cp437 codepoint overlaps with a Unicode one.
Sourcepub fn encode(&self, unicode: char) -> Option<u8>
pub fn encode(&self, unicode: char) -> Option<u8>
Try to encode a single Unicode codepoint as a cp437 one.
Sourcepub fn remap(&mut self, cp437: u8, unicode: char) -> &mut Cp437Dialect
pub fn remap(&mut self, cp437: u8, unicode: char) -> &mut Cp437Dialect
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§
Source§impl Clone for Cp437Dialect
impl Clone for Cp437Dialect
Source§fn clone(&self) -> Cp437Dialect
fn clone(&self) -> Cp437Dialect
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 Cp437Dialect
impl Debug for Cp437Dialect
Source§impl Hash for Cp437Dialect
impl Hash for Cp437Dialect
Source§impl Ord for Cp437Dialect
impl Ord for Cp437Dialect
Source§fn cmp(&self, other: &Cp437Dialect) -> Ordering
fn cmp(&self, other: &Cp437Dialect) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Cp437Dialect
impl PartialEq for Cp437Dialect
Source§impl PartialOrd for Cp437Dialect
impl PartialOrd for Cp437Dialect
impl Eq for Cp437Dialect
Auto Trait Implementations§
impl Freeze for Cp437Dialect
impl RefUnwindSafe for Cp437Dialect
impl Send for Cp437Dialect
impl Sync for Cp437Dialect
impl Unpin for Cp437Dialect
impl UnwindSafe for Cp437Dialect
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
Mutably borrows from an owned value. Read more