pub struct Transaction<'a> { /* private fields */ }Expand description
Actix-Web compatible wrapper on Tranaction
Implementations§
Source§impl<'a> Transaction<'a>
impl<'a> Transaction<'a>
Sourcepub fn process_connection(&mut self, req: &HttpRequest) -> Result<(), Error>
pub fn process_connection(&mut self, req: &HttpRequest) -> Result<(), Error>
Performs analysis on the connection.
This should be called at the very beginning of a request process.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub fn process_uri(&mut self, req: &HttpRequest) -> Result<(), Error>
pub fn process_uri(&mut self, req: &HttpRequest) -> Result<(), Error>
Perform the analysis on the URI and all the query string variables.
This should be called at the very beginning of a request process.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub fn process_request_headers(
&mut self,
req: &HttpRequest,
) -> Result<(), Error>
pub fn process_request_headers( &mut self, req: &HttpRequest, ) -> Result<(), Error>
Processes rules in the request headers phase for this transaction.
This should be called at the very beginning of a request process.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub async fn process_request_body(
&mut self,
payload: Payload,
) -> Result<Payload, Error>
pub async fn process_request_body( &mut self, payload: Payload, ) -> Result<Payload, Error>
Processes rules in the request body phase for this transaction.
This should be called at the very beginning of a request process.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub async fn process_request(
&mut self,
req: &mut ServiceRequest,
) -> Result<(), Error>
pub async fn process_request( &mut self, req: &mut ServiceRequest, ) -> Result<(), Error>
Processes ALL rules in the request phase for this transaction.
This should be called at the very beginning of a request process. Use this instead of any of the following:
Transaction::process_connectionTransaction::process_uriTransaction::process_request_headersTransaction::process_request_body
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub fn process_response_headers<T>(
&mut self,
res: &HttpResponse<T>,
) -> Result<(), Error>
pub fn process_response_headers<T>( &mut self, res: &HttpResponse<T>, ) -> Result<(), Error>
Processes rules in the response headers phase for this transaction.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub async fn process_response_body(
&mut self,
body: BoxBody,
) -> Result<BoxBody, Error>
pub async fn process_response_body( &mut self, body: BoxBody, ) -> Result<BoxBody, Error>
Processes rules in the response body phase for this transaction.
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub async fn process_response(
&mut self,
res: HttpResponse,
) -> Result<HttpResponse, Error>
pub async fn process_response( &mut self, res: HttpResponse, ) -> Result<HttpResponse, Error>
Processes ALL rules in the response phase for this transaction.
This should be called at the very beginning of a request process. Use this instead of any of the following:
NOTE: Remember to check for a possible intervention using
Transaction::intervention() after calling this method.
Sourcepub fn intervention(&mut self) -> Result<Option<Intervention>, Error>
pub fn intervention(&mut self) -> Result<Option<Intervention>, Error>
Returns an intervention if one is triggered by the transaction.
An intervention is triggered when a rule is matched and the corresponding action is disruptive.