Struct snowboard::Response

source ยท
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>

source

pub fn new( version: HttpVersion, status: u16, status_text: &'a str, body: &'a str, headers: Vec<(&'a str, &'a str)> ) -> Self

source

pub fn send(&self, stream: &mut TcpStream)

sourceยง

impl<'a> Response<'a>

source

pub fn continue_( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn switching_protocols( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn processing( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn early_hints( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn ok( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn created( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn accepted( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn non_authoritative_information( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn no_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn reset_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn partial_content( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn multi_status( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn already_reported( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn im_used( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn multiple_choices( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn moved_permanently( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn found( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn see_other( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn not_modified( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn use_proxy( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn temporary_redirect( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn permanent_redirect( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn bad_request( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn unauthorized( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn payment_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn forbidden( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn not_found( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn method_not_allowed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn not_acceptable( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn proxy_authentication_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn request_timeout( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn conflict( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn gone( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn length_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn precondition_failed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn payload_too_large( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn uri_too_long( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn unsupported_media_type( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn range_not_satisfiable( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn expectation_failed( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn im_a_teapot( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn misdirected_request( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn unprocessable_entity( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn locked( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn failed_dependency( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn too_early( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn upgrade_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn precondition_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn too_many_requests( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn request_header_fields_too_large( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn internal_server_error( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn not_implemented( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn bad_gateway( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn service_unavailable( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn gateway_timeout( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn http_version_not_supported( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn variant_also_negotiates( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn insufficient_storage( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn loop_detected( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn not_extended( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

source

pub fn network_authentication_required( body: Option<&'a str>, headers: Option<Vec<(&'a str, &'a str)>>, http_version: Option<HttpVersion> ) -> Self

Trait Implementationsยง

sourceยง

impl<'a> Clone for Response<'a>

sourceยง

fn clone(&self) -> Response<'a>

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl<'a> Debug for Response<'a>

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

impl<'a> Default for Response<'a>

sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl<'a> Display for Response<'a>

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
sourceยง

impl<T> From<T> for T

sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

sourceยง

impl<T> ToOwned for T
where T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

sourceยง

default fn to_string(&self) -> String

Converts the given value to a String. Read more
sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

ยง

type Error = Infallible

The type returned in the event of a conversion error.
sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

ยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.