Trait actix_http::httpmessage::HttpMessage [−][src]
pub trait HttpMessage: Sized {
type Stream;
fn headers(&self) -> &HeaderMap;
fn take_payload(&mut self) -> Payload<Self::Stream>;
fn extensions(&self) -> Ref<'_, Extensions>;
fn extensions_mut(&self) -> RefMut<'_, Extensions>;
fn content_type(&self) -> &str { ... }
fn encoding(&self) -> Result<&'static Encoding, ContentTypeError> { ... }
fn mime_type(&self) -> Result<Option<Mime>, ContentTypeError> { ... }
fn chunked(&self) -> Result<bool, ParseError> { ... }
fn cookies(&self) -> Result<Ref<'_, Vec<Cookie<'static>>>, CookieParseError> { ... }
fn cookie(&self, name: &str) -> Option<Cookie<'static>> { ... }
}
Expand description
Trait that implements general purpose operations on http messages
Associated Types
Required methods
fn take_payload(&mut self) -> Payload<Self::Stream>
fn take_payload(&mut self) -> Payload<Self::Stream>
Message payload stream
fn extensions(&self) -> Ref<'_, Extensions>
fn extensions(&self) -> Ref<'_, Extensions>
Request’s extensions container
fn extensions_mut(&self) -> RefMut<'_, Extensions>
fn extensions_mut(&self) -> RefMut<'_, Extensions>
Mutable reference to a the request’s extensions container
Provided methods
fn content_type(&self) -> &str
fn content_type(&self) -> &str
Read the request content type. If request does not contain Content-Type header, empty str get returned.
fn encoding(&self) -> Result<&'static Encoding, ContentTypeError>
fn encoding(&self) -> Result<&'static Encoding, ContentTypeError>
Get content type encoding
UTF-8 is used by default, If request charset is not set.
Convert the request content type to a known mime type.
fn chunked(&self) -> Result<bool, ParseError>
fn chunked(&self) -> Result<bool, ParseError>
Check if request has chunked transfer encoding
Load request cookies.
Return request cookie.
Implementations on Foreign Types
Message payload stream
Request’s extensions container
Mutable reference to a the request’s extensions container