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§
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
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.