pub struct CodePage {
pub name: &'static str,
/* private fields */
}Expand description
A code page’s upper half: the character each byte 0x80-0xFF is.
Fields§
§name: &'static strImplementations§
Source§impl CodePage
impl CodePage
Sourcepub fn decode(&self, b: u8) -> char
pub fn decode(&self, b: u8) -> char
A byte as Unicode (control bytes below 0x20 aren’t characters here).
Sourcepub fn encode(&self, c: char) -> Option<u8>
pub fn encode(&self, c: char) -> Option<u8>
A character as a byte of this code page, if it has one.
Sourcepub fn screen_codes(&self) -> bool
pub fn screen_codes(&self) -> bool
Whether every byte is its own character (screen codes), not ASCII below 0x80.
pub fn encode_str(&self, s: &str) -> Vec<u8> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodePage
impl RefUnwindSafe for CodePage
impl Send for CodePage
impl Sync for CodePage
impl Unpin for CodePage
impl UnsafeUnpin for CodePage
impl UnwindSafe for CodePage
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