[−][src]Struct tide::Response
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]
R: BufRead + Unpin + Send + 'static,
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.
pub fn body_string(self, string: String) -> Self
[src]
pub fn body<R>(self, reader: R) -> Self where
R: BufRead + Unpin + Send + 'static,
[src]
R: BufRead + Unpin + Send + 'static,
pub async fn body_form<T: Serialize>(
__arg0: Self,
form: T
) -> Result<Response, Error>
[src]
__arg0: Self,
form: T
) -> Result<Response, Error>
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]
fn into_response(self) -> Response
[src]
fn with_status(self, status: StatusCode) -> WithStatus<Self>
[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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,