[−][src]Struct salvo::Response
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 get_cookie<T>(&self, name: T) -> Option<&Cookie<'static>> where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn add_cookie(&mut self, cookie: Cookie<'static>)
[src]
pub fn remove_cookie<T>(&mut self, name: T) where
T: Into<Cow<'static, str>>,
[src]
T: Into<Cow<'static, str>>,
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]
T: AsRef<str>,
pub fn render_file<T>(&mut self, content_type: T, file: &mut File) where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn render_file_from_path<T>(&mut self, path: T) where
T: AsRef<Path>,
[src]
T: AsRef<Path>,
pub fn render<T>(&mut self, content_type: T, writer: impl BodyWriter + 'static) where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn send_binary<T>(&mut self, data: Vec<u8>, file_name: T) where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn send_file<T>(&mut self, file: &mut File, file_name: T) -> Result<()> where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn send_file_from_path<T>(
&mut self,
path: T,
file_name: Option<T>
) -> Result<()> where
T: AsRef<str>,
[src]
&mut self,
path: T,
file_name: Option<T>
) -> Result<()> where
T: AsRef<str>,
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
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]
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,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut I
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,