Trait ResponseExt

Source
pub trait ResponseExt<B>
where B: BodyTrait,
{
Show 14 methods // Required methods fn status(&self) -> StatusCode; fn set_status(&mut self, _status: StatusCode) -> &mut Self; fn get_header(&self, _name: impl AsHeaderName) -> Option<&HeaderValue>; fn set_header( &mut self, _name: impl IntoHeaderName, _value: impl Into<HeaderValue>, ) -> &mut Self; fn add_header( &mut self, _name: impl IntoHeaderName, _value: impl Into<HeaderValue>, ) -> &mut Self; fn set_body(&mut self, _body: impl Into<B>) -> &mut Self; // Provided methods fn set_status_200(&mut self) -> &mut Self { ... } fn set_content_type( &mut self, _content_type: impl Into<HeaderValue>, ) -> &mut Self { ... } fn set_header_str_static( &mut self, _name: impl IntoHeaderName, _value: &'static str, ) -> &mut Self { ... } fn set_header_string( &mut self, _name: impl IntoHeaderName, _value: String, ) -> &mut Self { ... } fn add_header_str_static( &mut self, _name: impl IntoHeaderName, _value: &'static str, ) -> &mut Self { ... } fn add_header_string( &mut self, _name: impl IntoHeaderName, _value: String, ) -> &mut Self { ... } fn content_type(&self) -> Option<ContentType> { ... } fn content_type_or_unknown(&self) -> ContentType { ... }
}

Required Methods§

Source

fn status(&self) -> StatusCode

Source

fn set_status(&mut self, _status: StatusCode) -> &mut Self

Source

fn get_header(&self, _name: impl AsHeaderName) -> Option<&HeaderValue>

Source

fn set_header( &mut self, _name: impl IntoHeaderName, _value: impl Into<HeaderValue>, ) -> &mut Self

Source

fn add_header( &mut self, _name: impl IntoHeaderName, _value: impl Into<HeaderValue>, ) -> &mut Self

Source

fn set_body(&mut self, _body: impl Into<B>) -> &mut Self

Provided Methods§

Source

fn set_status_200(&mut self) -> &mut Self

Source

fn set_content_type( &mut self, _content_type: impl Into<HeaderValue>, ) -> &mut Self

Source

fn set_header_str_static( &mut self, _name: impl IntoHeaderName, _value: &'static str, ) -> &mut Self

Source

fn set_header_string( &mut self, _name: impl IntoHeaderName, _value: String, ) -> &mut Self

Source

fn add_header_str_static( &mut self, _name: impl IntoHeaderName, _value: &'static str, ) -> &mut Self

Source

fn add_header_string( &mut self, _name: impl IntoHeaderName, _value: String, ) -> &mut Self

Source

fn content_type(&self) -> Option<ContentType>

Source

fn content_type_or_unknown(&self) -> ContentType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B> ResponseExt<B> for Response<B>
where B: BodyTrait,