Enum rocket::response::Body
[−]
[src]
pub enum Body<T> {
Sized(T, u64),
Chunked(T, u64),
}The body of a response: can be sized or streamed/chunked.
Variants
Sized(T, u64)A fixed-size body.
Chunked(T, u64)A streamed/chunked body, akin to Transfer-Encoding: chunked.
Methods
impl<T> Body<T>[src]
fn as_mut(&mut self) -> Body<&mut T>[src]
Returns a new Body with a mutable borrow to self's inner type.
fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Body<U>[src]
Consumes self. Passes the inner type as a parameter to f and
constructs a new body with the size of self and the return value of
the call to f.
fn into_inner(self) -> T[src]
Consumes self and returns the inner body.
fn is_sized(&self) -> bool[src]
Returns true if self is a Body::Sized.
fn is_chunked(&self) -> bool[src]
Returns true if self is a Body::Chunked.
impl<T: Read> Body<T>[src]
fn into_bytes(self) -> Option<Vec<u8>>[src]
Attepts to read self into a Vec and returns it. If reading fails,
returns None.
fn into_string(self) -> Option<String>[src]
Attepts to read self into a String and returns it. If reading or
conversion fails, returns None.
Trait Implementations
impl<T: PartialEq> PartialEq for Body<T>[src]
fn eq(&self, __arg_0: &Body<T>) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Body<T>) -> bool[src]
This method tests for !=.
impl<T: Clone> Clone for Body<T>[src]
fn clone(&self) -> Body<T>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T: Hash> Hash for Body<T>[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more