pub struct Response<'a> {
pub version: HttpVersion,
pub status: u16,
pub status_text: &'a str,
pub body: &'a str,
pub headers: Vec<(&'a str, &'a str)>,
}Expand description
Response struct. Contains the response data and converts it to text if needed.
Fieldsยง
ยงversion: HttpVersionยงstatus: u16ยงstatus_text: &'a strยงbody: &'a strยงheaders: Vec<(&'a str, &'a str)>Implementationsยง
sourceยงimpl<'a> Response<'a>
impl<'a> Response<'a>
pub fn continue_( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn switching_protocols( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn processing( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn early_hints( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn ok( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn created( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn accepted( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn no_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn reset_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn partial_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn multi_status( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn already_reported( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn im_used( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn multiple_choices( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn moved_permanently( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn found( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn see_other( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn not_modified( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn use_proxy( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn temporary_redirect( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn permanent_redirect( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn bad_request( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn payment_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn forbidden( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn not_found( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn method_not_allowed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn not_acceptable( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn proxy_authentication_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn request_timeout( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn conflict( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn gone( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn length_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn precondition_failed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn payload_too_large( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn uri_too_long( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn unsupported_media_type( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn range_not_satisfiable( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn expectation_failed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn im_a_teapot( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn misdirected_request( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn unprocessable_entity( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn locked( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn failed_dependency( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn too_early( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn upgrade_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn precondition_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn too_many_requests( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn request_header_fields_too_large( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn internal_server_error( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn not_implemented( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn bad_gateway( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn gateway_timeout( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn http_version_not_supported( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn variant_also_negotiates( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn insufficient_storage( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn loop_detected( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn not_extended( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
pub fn network_authentication_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self
Trait Implementationsยง
Auto Trait Implementationsยง
impl<'a> RefUnwindSafe for Response<'a>
impl<'a> Send for Response<'a>
impl<'a> Sync for Response<'a>
impl<'a> Unpin for Response<'a>
impl<'a> UnwindSafe for Response<'a>
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