[][src]Struct nobility::bin_decode::NbtString

pub struct NbtString<'a> { /* fields omitted */ }

NBT stores strings in Java's modified version of CESU-8 called "Modified UTF-8". This type stores a reference to the raw data in the file, and NbtString::decode can be used to convert it to a string.

Implementations

impl<'a> NbtString<'a>[src]

pub fn decode(&self) -> Result<Cow<'_, str>, Cesu8DecodingError>[src]

Attempts to parse the string into UTF-8 using the cesu8 crate. An error will be returned if this fails, which should only happen if the data contained is invalid CESU-8.

pub fn as_bytes(&self) -> &[u8][src]

Trait Implementations

impl<'a> Clone for NbtString<'a>[src]

impl<'a> Copy for NbtString<'a>[src]

impl<'a> Debug for NbtString<'a>[src]

impl<'a> Deref for NbtString<'a>[src]

type Target = [u8]

The resulting type after dereferencing.

impl<'a> Eq for NbtString<'a>[src]

impl<'a> Hash for NbtString<'a>[src]

impl<'a> PartialEq<NbtString<'a>> for NbtString<'a>[src]

impl<'a, T> PartialEq<T> for NbtString<'a> where
    T: AsRef<str>, 
[src]

impl<'a> StructuralEq for NbtString<'a>[src]

impl<'a> StructuralPartialEq for NbtString<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for NbtString<'a>[src]

impl<'a> Send for NbtString<'a>[src]

impl<'a> Sync for NbtString<'a>[src]

impl<'a> Unpin for NbtString<'a>[src]

impl<'a> UnwindSafe for NbtString<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.