pub struct Petscii(/* private fields */);
Expand description
Commodore’s 8-bit computers used an unusual variant of ASCII commonly known as “PETSCII”.
A PETSCII string can be represented by this Petscii
struct, and its functions help handle
PETSCII strings and perform lossy conversions between PETSCII and Unicode.
Implementations§
Source§impl Petscii
impl Petscii
pub fn from_bytes(bytes: &[u8]) -> Petscii
pub fn from_padded_bytes(bytes: &[u8], pad_byte: u8) -> Petscii
Sourcepub fn from_str(string: &str) -> Petscii
pub fn from_str(string: &str) -> Petscii
We only translate Unicode code points that happen to be present in our PETSCII mapping. This includes letters, numbers, punctuation, and a handful of block graphic code points.
pub fn as_bytes<'a>(&'a self) -> &'a [u8] ⓘ
pub fn len(&self) -> usize
pub fn to_string(&self) -> String
pub fn write_bytes_with_padding( &self, bytes: &mut [u8], pad_byte: u8, ) -> Result<(), ()>
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Petscii
impl<'a> IntoIterator for &'a Petscii
Source§impl IntoIterator for Petscii
impl IntoIterator for Petscii
impl StructuralPartialEq for Petscii
Auto Trait Implementations§
impl Freeze for Petscii
impl RefUnwindSafe for Petscii
impl Send for Petscii
impl Sync for Petscii
impl Unpin for Petscii
impl UnwindSafe for Petscii
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