[−][src]Struct codepage_437::Cp437Dialect
Specifier for the specific kind of cp437.
Dialects are instances of this type, aggregating data necessary to perform conversions.
Methods
impl Cp437Dialect[src]
impl Cp437Dialectpub fn overlap_unicode(&self, unicode: char) -> bool[src]
pub fn overlap_unicode(&self, unicode: char) -> boolCheck, whether the specified Unicode codepoint overlaps with a cp437 one.
pub fn overlap_cp437(&self, cp437: u8) -> bool[src]
pub fn overlap_cp437(&self, cp437: u8) -> boolCheck, whether the specified cp437 codepoint overlaps with a Unicode one.
pub fn decode(&self, cp437: u8) -> char[src]
pub fn decode(&self, cp437: u8) -> charDecode a single cp437 codepoint into a Unicode one.
pub fn encode(&self, unicode: char) -> Option<u8>[src]
pub fn encode(&self, unicode: char) -> Option<u8>Try to encode a single Unicode codepoint as a cp437 one.
pub fn remap(&mut self, cp437: u8, unicode: char) -> &mut Cp437Dialect[src]
pub fn remap(&mut self, cp437: u8, unicode: char) -> &mut Cp437DialectMap 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]
impl Clone for Cp437Dialectfn clone(&self) -> Cp437Dialect[src]
fn clone(&self) -> Cp437DialectReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Eq for Cp437Dialect[src]
impl Eq for Cp437Dialectimpl PartialOrd<Cp437Dialect> for Cp437Dialect[src]
impl PartialOrd<Cp437Dialect> for Cp437Dialectfn partial_cmp(&self, other: &Cp437Dialect) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Cp437Dialect) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl PartialEq<Cp437Dialect> for Cp437Dialect[src]
impl PartialEq<Cp437Dialect> for Cp437Dialectfn eq(&self, other: &Cp437Dialect) -> bool[src]
fn eq(&self, other: &Cp437Dialect) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Ord for Cp437Dialect[src]
impl Ord for Cp437Dialectfn cmp(&self, other: &Cp437Dialect) -> Ordering[src]
fn cmp(&self, other: &Cp437Dialect) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Hash for Cp437Dialect[src]
impl Hash for Cp437Dialectfn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for Cp437Dialect[src]
impl Debug for Cp437DialectAuto Trait Implementations
impl Send for Cp437Dialect
impl Send for Cp437Dialectimpl Sync for Cp437Dialect
impl Sync for Cp437DialectBlanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more