HttpFilterInstance

Trait HttpFilterInstance 

Source
pub trait HttpFilterInstance {
    // Provided methods
    fn request_headers(
        &mut self,
        _request_headers: &RequestHeaders,
        _end_of_stream: bool,
    ) -> RequestHeadersStatus { ... }
    fn request_body(
        &mut self,
        _request_body_frame: &RequestBodyBuffer,
        _end_of_stream: bool,
    ) -> RequestBodyStatus { ... }
    fn response_headers(
        &mut self,
        _response_headers: &ResponseHeaders,
        _end_of_stream: bool,
    ) -> ResponseHeadersStatus { ... }
    fn response_body(
        &mut self,
        _response_body_frame: &ResponseBodyBuffer,
        _end_of_stream: bool,
    ) -> ResponseBodyStatus { ... }
    fn destroy(&mut self) { ... }
}
Expand description

HttpFilterInstance is a trait that represents each HTTP request.

This is created for each new HTTP request and is destroyed when the request is completed.

Provided Methods§

Source

fn request_headers( &mut self, _request_headers: &RequestHeaders, _end_of_stream: bool, ) -> RequestHeadersStatus

This is called when request headers are received. The function should return the status of the operation.

  • request_headers is the reference to the request headers map.
  • end_of_stream is a boolean that indicates if this is the headers-only request.
Source

fn request_body( &mut self, _request_body_frame: &RequestBodyBuffer, _end_of_stream: bool, ) -> RequestBodyStatus

This is called when request body data is received. The function should return the status of the operation.

  • _request_body_frame is the reference to the newly arrived request body frame.
  • end_of_stream is a boolean that indicates if this is the last data frame.
Source

fn response_headers( &mut self, _response_headers: &ResponseHeaders, _end_of_stream: bool, ) -> ResponseHeadersStatus

This is called when response headers are received. The function should return the status of the operation.

  • response_headers is the reference to the response headers map.
  • end_of_stream is a boolean that indicates if this is the headers-only response.
Source

fn response_body( &mut self, _response_body_frame: &ResponseBodyBuffer, _end_of_stream: bool, ) -> ResponseBodyStatus

This is called when response body data is received. The function should return the status of the operation.

  • _response_body_frame is the reference to the newly arrived response body frame.
  • end_of_stream is a boolean that indicates if this is the last data frame.
Source

fn destroy(&mut self)

This is called when the stream is completed or when the stream is reset.

After this returns, this object is destructed.

Implementors§