Struct salvo_core::http::response::Response[][src]

pub struct Response { /* fields omitted */ }

Represents an HTTP response

Implementations

impl Response[src]

pub fn new() -> Response[src]

Creates a new blank Response.

pub fn from_hyper(req: Response<Body>) -> Response[src]

Create a request from an hyper::Request.

This constructor consumes the hyper::Request.

pub fn headers(&self) -> &HeaderMap[src]

pub fn headers_mut(&mut self) -> &mut HeaderMap[src]

pub fn set_headers(&mut self, headers: HeaderMap)[src]

pub fn version(&self) -> Version[src]

pub fn version_mut(&mut self) -> &mut Version[src]

pub fn body(&self) -> Option<&Body>[src]

pub fn body_mut(&mut self) -> Option<&mut Body>[src]

pub fn set_body(&mut self, body: Option<Body>)[src]

pub fn take_body(&mut self) -> Option<Body>[src]

pub fn cookies(&self) -> &CookieJar[src]

pub fn header_cookies(&self) -> Vec<Cookie<'_>>[src]

pub fn status_code(&mut self) -> Option<StatusCode>[src]

pub fn set_status_code(&mut self, code: StatusCode)[src]

pub fn set_http_error(&mut self, err: HttpError)[src]

pub fn render_json<T: Serialize>(&mut self, data: &T)[src]

pub fn render_json_text(&mut self, data: &str)[src]

pub fn render_html_text(&mut self, data: &str)[src]

pub fn render_plain_text(&mut self, data: &str)[src]

pub fn render_xml_text(&mut self, data: &str)[src]

pub fn render_binary(&mut self, content_type: HeaderValue, data: &[u8])[src]

pub fn write_body_bytes(&mut self, data: &[u8])[src]

pub fn streaming<S, O, E>(&mut self, stream: S) where
    S: Stream<Item = Result<O, E>> + Send + 'static,
    O: Into<Bytes> + 'static,
    E: Into<Box<dyn StdError + Send + Sync>> + 'static, 
[src]

pub fn redirect_temporary<U: AsRef<str>>(&mut self, url: U)[src]

pub fn redirect_found<U: AsRef<str>>(&mut self, url: U)[src]

pub fn redirect_other<U: AsRef<str>>(
    &mut self,
    url: U
) -> Result<(), InvalidHeaderValue>
[src]

pub fn commit(&mut self)[src]

pub fn is_commited(&self) -> bool[src]

Trait Implementations

impl Debug for Response[src]

impl Default for Response[src]

impl Display for Response[src]

Auto Trait Implementations

impl !RefUnwindSafe for Response

impl Send for Response

impl !Sync for Response

impl Unpin for Response

impl !UnwindSafe for Response

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]