[][src]Struct salvo::Response

pub struct Response { /* fields omitted */ }

The response representation given to Middleware

Implementations

impl Response[src]

pub fn new(conf: Arc<ServerConfig>) -> Response[src]

Construct a blank Response

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

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

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

pub fn header_cookies(&self) -> Vec<Cookie<'_>, Global>[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>(&mut self, data: &'a T) where
    T: Serialize
[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: &str, data: &[u8])[src]

pub fn render(&mut self, content_type: &str, data: &[u8])[src]

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

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

pub fn send_binary(&mut self, data: &[u8], file_name: &str)[src]

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

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

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

pub fn set_content_disposition(&mut self, value: &str)[src]

pub fn set_content_encoding(&mut self, value: &str)[src]

pub fn set_content_length(&mut self, value: u64)[src]

pub fn set_content_range(&mut self, value: &str)[src]

pub fn set_content_type(&mut self, value: &str)[src]

pub fn set_accept_range(&mut self, value: &str)[src]

pub fn set_last_modified(&mut self, value: HttpDate)[src]

pub fn set_etag(&mut self, value: &str)[src]

pub fn commit(&mut self)[src]

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

pub fn not_found(&mut self)[src]

pub fn unauthorized(&mut self)[src]

pub fn forbidden(&mut self)[src]

pub fn unsupported_media_type(&mut self)[src]

Trait Implementations

impl Debug for Response[src]

impl Display for Response[src]

Auto Trait Implementations

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> 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]