Struct rmp_serde::Raw
[−]
[src]
pub struct Raw { /* fields omitted */ }
Helper that allows to decode strings no matter whether they contain valid or invalid UTF-8.
Methods
impl Raw
[src]
fn is_str(&self) -> bool
Returns true
if the raw is valid UTF-8.
fn is_err(&self) -> bool
Returns true
if the raw contains invalid UTF-8 sequence.
fn as_str(&self) -> Option<&str>
Returns the string reference if the raw is valid UTF-8, or else None
.
fn as_err(&self) -> Option<&Utf8Error>
Returns the underlying Utf8Error
if the raw contains invalid UTF-8 sequence, or
else None
.
fn as_bytes(&self) -> &[u8]
Returns a byte slice of this raw's contents.
fn into_str(self) -> Option<String>
Consumes this object, yielding the string if the raw is valid UTF-8, or else None
.
fn into_bytes(self) -> Vec<u8>
Converts a Raw
into a byte vector.
Trait Implementations
impl Clone for Raw
[src]
fn clone(&self) -> Raw
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Raw
[src]
impl PartialEq for Raw
[src]
fn eq(&self, __arg_0: &Raw) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Raw) -> bool
This method tests for !=
.
impl<'de> Deserialize<'de> for Raw
[src]
fn deserialize<D>(de: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more