[][src]Struct tide::Response

pub struct Response { /* fields omitted */ }

An HTTP response

Methods

impl Response[src]

pub fn new(status: u16) -> Self[src]

Create a new instance.

pub fn with_reader<R>(status: u16, reader: R) -> Self where
    R: BufRead + Unpin + Send + 'static, 
[src]

Create a new instance from a reader.

pub fn status(&self) -> StatusCode[src]

Returns the statuscode.

pub fn set_status(self, status: StatusCode) -> Self[src]

Set the statuscode.

pub fn set_header(self, key: &'static str, value: impl AsRef<str>) -> Self[src]

Insert an HTTP header.

pub fn set_mime(self, mime: Mime) -> Self[src]

Set the request MIME.

Read more on MDN

pub fn body_string(self, string: String) -> Self[src]

Pass a string as the request body.

Mime

The encoding is set to text/plain; charset=utf-8.

pub fn body<R>(self, reader: R) -> Self where
    R: BufRead + Unpin + Send + 'static, 
[src]

Pass a string as the request body.

Mime

The encoding is set to text/plain; charset=utf-8.

pub async fn body_form<T: Serialize>(
    __arg0: Self,
    form: T
) -> Result<Response, Error>
[src]

Encode a struct as a form and set as the response body.

pub fn body_json(self, json: &impl Serialize) -> Result<Self>[src]

Encode a struct as a form and set as the response body.

Trait Implementations

impl IntoResponse for Response[src]

impl From<Response> for Error[src]

impl Debug for Response[src]

Auto Trait Implementations

impl Send for Response

impl !Sync for Response

impl Unpin for Response

impl !UnwindSafe for Response

impl !RefUnwindSafe for Response

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]