Struct rmpv::Utf8StringRef [−][src]
A non-owning evil twin of Utf8String. Does exactly the same thing except ownership.
Implementations
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_string(self) -> Option<String>[src]
Consumes this object, yielding the string if the string is valid UTF-8, or else None.
pub fn into_str(self) -> Option<&'a str>[src]
Consumes this object, yielding the string reference 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> Clone for Utf8StringRef<'a>[src]
fn clone(&self) -> Utf8StringRef<'a>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a> Copy for Utf8StringRef<'a>[src]
impl<'a> Debug for Utf8StringRef<'a>[src]
impl<'a> Display for Utf8StringRef<'a>[src]
impl<'a> From<&'a str> for Utf8StringRef<'a>[src]
impl<'a> Into<Utf8String> for Utf8StringRef<'a>[src]
fn into(self) -> Utf8String[src]
impl<'a> PartialEq<Utf8StringRef<'a>> for Utf8StringRef<'a>[src]
fn eq(&self, other: &Utf8StringRef<'a>) -> bool[src]
fn ne(&self, other: &Utf8StringRef<'a>) -> bool[src]
impl<'a> StructuralPartialEq for Utf8StringRef<'a>[src]
impl<'a> TryFrom<ValueRef<'a>> for Utf8StringRef<'a>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Utf8StringRef<'a>[src]
impl<'a> Send for Utf8StringRef<'a>[src]
impl<'a> Sync for Utf8StringRef<'a>[src]
impl<'a> Unpin for Utf8StringRef<'a>[src]
impl<'a> UnwindSafe for Utf8StringRef<'a>[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,