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>
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>
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
Consumes self and returns the inner body.
fn is_sized(&self) -> bool
Returns true if self is a Body::Sized.
fn is_chunked(&self) -> bool
Returns true if self is a Body::Chunked.
impl<T: Read> Body<T>[src]
fn into_bytes(self) -> Option<Vec<u8>>
Attepts to read self into a Vec and returns it. If reading fails,
returns None.
fn into_string(self) -> Option<String>
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
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
This method tests for !=.
impl<T: Clone> Clone for Body<T>[src]
fn clone(&self) -> Body<T>
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<T: Hash> Hash for Body<T>[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.