Struct jomini::Utf8Encoding
source · pub struct Utf8Encoding;
Expand description
Decodes bytes according to the utf8 standard
use jomini::{Utf8Encoding, Encoding};
let encoding = Utf8Encoding::new();
assert_eq!(encoding.decode(b"Common Sense"), "Common Sense");
assert_eq!(encoding.decode(br#"Captain \"Joe\" Rogers"#), r#"Captain "Joe" Rogers"#);
assert_eq!(encoding.decode(b"1444.11.11\n"), "1444.11.11");
assert_eq!(encoding.decode(b"J\xc3\xa5hk\xc3\xa5m\xc3\xa5hkke"), "Jåhkåmåhkke");
assert_eq!(encoding.decode("Jåhkåmåhkke".as_bytes()), "Jåhkåmåhkke");
Implementations§
Trait Implementations§
source§impl Clone for Utf8Encoding
impl Clone for Utf8Encoding
source§fn clone(&self) -> Utf8Encoding
fn clone(&self) -> Utf8Encoding
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 Utf8Encoding
impl Debug for Utf8Encoding
source§impl Default for Utf8Encoding
impl Default for Utf8Encoding
source§fn default() -> Utf8Encoding
fn default() -> Utf8Encoding
Returns the “default value” for a type. Read more
source§impl Encoding for Utf8Encoding
impl Encoding for Utf8Encoding
impl Copy for Utf8Encoding
Auto Trait Implementations§
impl Freeze for Utf8Encoding
impl RefUnwindSafe for Utf8Encoding
impl Send for Utf8Encoding
impl Sync for Utf8Encoding
impl Unpin for Utf8Encoding
impl UnwindSafe for Utf8Encoding
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