pub struct InterceptorHandler { /* private fields */ }Expand description
Combined interceptor handler for both HTTP and TCP traffic Manages automatic correlation between requests and responses via session IDs
Implementations§
Source§impl InterceptorHandler
impl InterceptorHandler
Sourcepub fn with_timeout(self, timeout_secs: u64) -> Self
pub fn with_timeout(self, timeout_secs: u64) -> Self
Create a new interceptor handler with a configurable per-interceptor timeout
Sourcepub fn add_interceptor(&mut self, interceptor: Arc<dyn Interceptor>)
pub fn add_interceptor(&mut self, interceptor: Arc<dyn Interceptor>)
Add a unified interceptor that handles both requests and responses This is the recommended way to add interceptors as it provides automatic session correlation between requests and responses
Sourcepub async fn process_request(
&self,
request: MitmRequest,
) -> Result<Option<MitmRequest>>
pub async fn process_request( &self, request: MitmRequest, ) -> Result<Option<MitmRequest>>
Process a request through all interceptors
Sourcepub async fn process_response(
&self,
response: MitmResponse,
) -> Result<Option<MitmResponse>>
pub async fn process_response( &self, response: MitmResponse, ) -> Result<Option<MitmResponse>>
Process a response through all interceptors
Sourcepub fn has_interceptors(&self) -> bool
pub fn has_interceptors(&self) -> bool
Check if any interceptors are registered
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterceptorHandler
impl !RefUnwindSafe for InterceptorHandler
impl Send for InterceptorHandler
impl Sync for InterceptorHandler
impl Unpin for InterceptorHandler
impl UnsafeUnpin for InterceptorHandler
impl !UnwindSafe for InterceptorHandler
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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