pub struct ResponseParts {
pub status: StatusCode,
pub version: Version,
pub headers: HeaderMap<HeaderValue>,
pub extensions: Extensions,
}Expand description
HTTP 响应的头部。
HTTP 响应的头部由状态码、版本、一组标头和扩展组成。
Fields§
§status: StatusCodeHTTP 响应的状态码。
version: VersionHTTP 响应的版本。
headers: HeaderMap<HeaderValue>HTTP 响应的标头集。
extensions: ExtensionsHTTP 响应的扩展。
Trait Implementations§
Source§impl Clone for ResponseParts
impl Clone for ResponseParts
Source§fn clone(&self) -> ResponseParts
fn clone(&self) -> ResponseParts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseParts
impl Debug for ResponseParts
Source§impl Default for ResponseParts
impl Default for ResponseParts
Source§fn default() -> ResponseParts
fn default() -> ResponseParts
Returns the “default value” for a type. Read more
Source§impl IntoResponseParts for ResponseParts
impl IntoResponseParts for ResponseParts
Source§type Error = Infallible
type Error = Infallible
发生错误时返回的类型。
Source§fn into_response_parts(
self,
parts: ResponseParts,
) -> Result<ResponseParts, Self::Error>
fn into_response_parts( self, parts: ResponseParts, ) -> Result<ResponseParts, Self::Error>
向响应添加头部组件。
Auto Trait Implementations§
impl Freeze for ResponseParts
impl !RefUnwindSafe for ResponseParts
impl Send for ResponseParts
impl Sync for ResponseParts
impl Unpin for ResponseParts
impl !UnwindSafe for ResponseParts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<P> IntoResponse for Pwhere
P: IntoResponseParts,
impl<P> IntoResponse for Pwhere
P: IntoResponseParts,
Source§type Error = <P as IntoResponseParts>::Error
type Error = <P as IntoResponseParts>::Error
发生错误时返回的类型。
Source§fn into_response(self) -> Result<Response, <P as IntoResponse>::Error>
fn into_response(self) -> Result<Response, <P as IntoResponse>::Error>
得到一个
Response 实例。