Struct rtv::simple::SimpleResponse
source · pub struct SimpleResponse<B> {
pub head: ResponseHead,
pub body: B,
}
Expand description
A simple response.
Use the alternate debug formatter {:#?}
to print out verbose information
including all headers and more.
The body
may be a Vec<u8>
, or a BodyReader
.
Fields§
§head: ResponseHead
§body: B
Implementations§
source§impl SimpleResponse<Vec<u8>>
impl SimpleResponse<Vec<u8>>
sourcepub fn into_string(self) -> Result<String, FromUtf8Error>
pub fn into_string(self) -> Result<String, FromUtf8Error>
Convert the request body into a String
.
Note that the data is assumed to be valid utf8. Text encodings
are not handeled by this crate.
Trait Implementations§
source§impl<B: Clone> Clone for SimpleResponse<B>
impl<B: Clone> Clone for SimpleResponse<B>
source§fn clone(&self) -> SimpleResponse<B>
fn clone(&self) -> SimpleResponse<B>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<B> RefUnwindSafe for SimpleResponse<B>where
B: RefUnwindSafe,
impl<B> Send for SimpleResponse<B>where
B: Send,
impl<B> Sync for SimpleResponse<B>where
B: Sync,
impl<B> Unpin for SimpleResponse<B>where
B: Unpin,
impl<B> UnwindSafe for SimpleResponse<B>where
B: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more