Struct salvo::Response [−][src]
pub struct Response { /* fields omitted */ }
Expand description
Represents an HTTP response
Implementations
Create a request from an hyper::Request.
This constructor consumes the hyper::Request.
pub async fn take_text_with_charset(
&'_ mut self,
default_charset: &'_ str
) -> Result<String, Error>
pub fn streaming<S, O, E>(&mut self, stream: S) where
S: 'static + Stream<Item = Result<O, E>> + Send,
O: 'static + Into<Bytes>,
E: 'static + Into<Box<dyn Error + Send + Sync + 'static, Global>>,
pub fn redirect_other<U>(&mut self, url: U) -> Result<(), InvalidHeaderValue> where
U: AsRef<str>,
Salvo executes before handler and path handler in sequence, when the response is in a committed state, subsequent handlers will not be executed, and then all after handlers will be executed.
This is a sign that the http request is completed, which can be used to process early return verification logic, such as permission verification, etc.