[][src]Struct rmpv::Utf8StringRef

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

A non-owning evil twin of Utf8String. Does exactly the same thing except ownership.


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

pub fn is_str(&self) -> bool[src]

Returns true if the string is valid UTF-8.

pub fn is_err(&self) -> bool[src]

Returns true if the string contains invalid UTF-8 sequence.

pub fn as_str(&self) -> Option<&str>[src]

Returns the string reference if the string is valid UTF-8, or else None.

pub fn as_err(&self) -> Option<&Utf8Error>[src]

Returns the underlying Utf8Error if the string contains invalud UTF-8 sequence, or else None.

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

Returns a byte slice of this string contents no matter whether it's valid or not UTF-8.

pub fn into_str(self) -> Option<String>[src]

Consumes this object, yielding the string if the string is valid UTF-8, or else None.

pub fn into_bytes(self) -> Vec<u8>[src]

Converts a Utf8StringRef into a byte vector.

Trait Implementations

impl<'a> Into<Utf8String> for Utf8StringRef<'a>[src]

impl<'a> From<&'a str> for Utf8StringRef<'a>[src]

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

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

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

impl<'a> Display for Utf8StringRef<'a>[src]

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

Auto Trait Implementations

impl<'a> Send for Utf8StringRef<'a>

impl<'a> Sync for Utf8StringRef<'a>

impl<'a> Unpin for Utf8StringRef<'a>

impl<'a> UnwindSafe for Utf8StringRef<'a>

impl<'a> RefUnwindSafe for Utf8StringRef<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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