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
sourceimpl Utf8Encoding
impl Utf8Encoding
Trait Implementations
sourceimpl Clone for Utf8Encoding
impl Clone for Utf8Encoding
sourcefn clone(&self) -> Utf8Encoding
fn clone(&self) -> Utf8Encoding
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Utf8Encoding
impl Debug for Utf8Encoding
sourceimpl Default for Utf8Encoding
impl Default for Utf8Encoding
sourcefn default() -> Utf8Encoding
fn default() -> Utf8Encoding
Returns the “default value” for a type. Read more
sourceimpl Encoding for Utf8Encoding
impl Encoding for Utf8Encoding
impl Copy for Utf8Encoding
Auto Trait Implementations
impl RefUnwindSafe for Utf8Encoding
impl Send for Utf8Encoding
impl Sync for Utf8Encoding
impl Unpin for Utf8Encoding
impl UnwindSafe for Utf8Encoding
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more