Struct pingora_core::modules::http::HttpModuleCtx
source · pub struct HttpModuleCtx { /* private fields */ }
Expand description
The Contexts of multiple modules
This is the object that will apply all the included modules to a certain HTTP request.
The modules are ordered according to their order()
.
Implementations§
source§impl HttpModuleCtx
impl HttpModuleCtx
sourcepub fn empty() -> Self
pub fn empty() -> Self
Create a placeholder empty HttpModuleCtx.
HttpModules should be used to create nonempty HttpModuleCtx.
sourcepub fn get<T: 'static>(&self) -> Option<&T>
pub fn get<T: 'static>(&self) -> Option<&T>
Get a ref to HttpModule if any.
sourcepub fn get_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn get_mut<T: 'static>(&mut self) -> Option<&mut T>
Get a mut ref to HttpModule if any.
sourcepub fn request_header_filter(&mut self, req: &mut RequestHeader) -> Result<()>
pub fn request_header_filter(&mut self, req: &mut RequestHeader) -> Result<()>
Run the request_header_filter
for all the modules according to their orders.
sourcepub fn request_body_filter(
&mut self,
body: Option<Bytes>
) -> Result<Option<Bytes>>
pub fn request_body_filter( &mut self, body: Option<Bytes> ) -> Result<Option<Bytes>>
Run the request_body_filter
for all the modules according to their orders.
sourcepub fn response_filter(&mut self, t: &mut HttpTask) -> Result<()>
pub fn response_filter(&mut self, t: &mut HttpTask) -> Result<()>
Run the response_filter
for all the modules according to their orders.
Auto Trait Implementations§
impl Freeze for HttpModuleCtx
impl !RefUnwindSafe for HttpModuleCtx
impl Send for HttpModuleCtx
impl Sync for HttpModuleCtx
impl Unpin for HttpModuleCtx
impl !UnwindSafe for HttpModuleCtx
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more