[][src]Struct salvo::Response

pub struct Response { /* fields omitted */ }

The response representation given to Middleware

Methods

impl Response[src]

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

Construct a blank Response

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

pub fn headers_mut(&mut self) -> &mut HeaderMap[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 write_error(&mut self, err: impl HttpError)[src]

pub fn write_content(&mut self, content: impl Content)[src]

pub fn write_body(&mut self, writer: impl BodyWriter + 'static)[src]

pub fn render_cbor<'a, T: Serialize>(&mut self, writer: &'a T)[src]

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

pub fn render_json_text<T: Into<String>>(&mut self, writer: T)[src]

pub fn render_html_text<T: Into<String>>(&mut self, writer: T)[src]

pub fn render_plain_text<T: Into<String>>(&mut self, writer: T)[src]

pub fn render_xml_text<T: Into<String>>(&mut self, writer: T)[src]

pub fn render_binary<T>(&mut self, content_type: T, data: Vec<u8>) where
    T: AsRef<str>, 
[src]

pub fn render_file<T>(&mut self, content_type: T, file: &mut File) where
    T: AsRef<str>, 
[src]

pub fn render_file_from_path<T>(&mut self, path: T) where
    T: AsRef<Path>, 
[src]

pub fn render<T>(&mut self, content_type: T, writer: impl BodyWriter + 'static) where
    T: AsRef<str>, 
[src]

pub fn send_binary<T>(&mut self, data: Vec<u8>, file_name: T) where
    T: AsRef<str>, 
[src]

pub fn send_file<T>(&mut self, file: &mut File, file_name: T) -> Result<()> where
    T: AsRef<str>, 
[src]

pub fn send_file_from_path<T>(
    &mut self,
    path: T,
    file_name: Option<T>
) -> Result<()> where
    T: AsRef<str>, 
[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)[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

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