Enum rustful::response::Data
[−]
[src]
A unified representation of response data.
Variants
Bytes(Cow<'a, [u8]>)
Data in byte form.
String(Cow<'a, str>)
Data in string form.
Methods
impl<'a> Data<'a>
[src]
impl<'a> Data<'a>
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
Borrow the content as a byte slice.
pub fn into_bytes(self) -> Vec<u8>
[src]
pub fn into_bytes(self) -> Vec<u8>
Turns the content into a byte vector. Slices are copied.
pub fn as_string(&self) -> Result<&str, Utf8Error>
[src]
pub fn as_string(&self) -> Result<&str, Utf8Error>
Borrow the content as a UTF-8 string slice, if possible.
pub fn into_string(self) -> Result<String, FromUtf8Error>
[src]
pub fn into_string(self) -> Result<String, FromUtf8Error>
Turn the content into a UTF-8 string, if possible. Slices are copied.
Trait Implementations
impl<'a> Clone for Data<'a>
[src]
impl<'a> Clone for Data<'a>
fn clone(&self) -> Data<'a>
[src]
fn clone(&self) -> Data<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'a> Into<Data<'a>> for Vec<u8>
[src]
impl<'a> Into<Data<'a>> for Vec<u8>
impl<'a> Into<Data<'a>> for &'a [u8]
[src]
impl<'a> Into<Data<'a>> for &'a [u8]
impl<'a> Into<Data<'a>> for String
[src]
impl<'a> Into<Data<'a>> for String
impl<'a> Into<Data<'a>> for &'a str
[src]
impl<'a> Into<Data<'a>> for &'a str