Struct highnoon::response::Response [−][src]
Implementations
impl Response
[src]
pub fn ok() -> Self
[src]
Create an empty response with status code OK (200)
pub fn status(s: StatusCode) -> Self
[src]
Create an empty response with the given status code
pub fn set_status(&mut self, s: StatusCode)
[src]
Set the status code of a response
pub fn get_status(&self) -> StatusCode
[src]
Get the status code of a response
pub fn body(mut self: Self, body: impl Into<Body>) -> Self
[src]
Set the body of the response
pub fn reader(mut self: Self, r: impl AsyncRead + Send + 'static) -> Self
[src]
Set the body to an AsyncRead object
pub async fn path(self, path: impl AsRef<Path>) -> Result<Self>
[src]
Set the body to the content of a file given by a Path Also sets a content type by guessing the mime type from the path name
pub fn json(mut self: Self, body: impl Serialize) -> Result<Self>
[src]
Set the body of the response to a JSON payload
pub fn form(mut self: Self, body: impl Serialize) -> Result<Self>
[src]
Set the body of the response to form data
pub fn header<H: Header>(mut self: Self, h: H) -> Self
[src]
Set a header (from the headers
crate)
pub fn set_header<H: Header>(&mut self, h: H)
[src]
Set a header (without consuming self - useful outside of method chains)
pub fn raw_header(
mut self: Self,
name: impl Into<HeaderName>,
key: impl Into<HeaderValue>
) -> Self
[src]
mut self: Self,
name: impl Into<HeaderName>,
key: impl Into<HeaderValue>
) -> Self
Set a raw header (from the http
crate)
pub fn into_inner(self) -> Response<Body>
[src]
Consume this response and return the inner hyper::Response
Trait Implementations
impl Debug for Response
[src]
impl From<Response<Body>> for Response
[src]
impl Responder for Response
[src]
Identity implementation
fn into_response(self) -> Result<Response>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Response
[src]
impl Send for Response
[src]
impl Sync for Response
[src]
impl Unpin for Response
[src]
impl !UnwindSafe for Response
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,