Transaction

Struct Transaction 

Source
pub struct Transaction<'a> { /* private fields */ }
Expand description

Actix-Web compatible wrapper on Tranaction

Implementations§

Source§

impl<'a> Transaction<'a>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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:

NOTE: Remember to check for a possible intervention using Transaction::intervention() after calling this method.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for Transaction<'a>

§

impl<'a> !RefUnwindSafe for Transaction<'a>

§

impl<'a> Send for Transaction<'a>

§

impl<'a> Sync for Transaction<'a>

§

impl<'a> Unpin for Transaction<'a>

§

impl<'a> !UnwindSafe for Transaction<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,