pub struct InterceptBuilder<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> InterceptBuilder<'a>
impl<'a> InterceptBuilder<'a>
Sourcepub fn url_patterns(self, patterns: Vec<String>) -> Self
pub fn url_patterns(self, patterns: Vec<String>) -> Self
Sets URL patterns to filter intercepted requests/responses.
Patterns support glob-style wildcards (*).
Sourcepub fn resource_types(self, types: Vec<String>) -> Self
pub fn resource_types(self, types: Vec<String>) -> Self
Sets resource types to filter intercepted requests/responses.
Valid types: “document”, “script”, “stylesheet”, “image”, “media”, “font”, “xhr”, “fetch”, “websocket”, “other”.
Sourcepub async fn requests<F>(self, callback: F) -> Result<InterceptId>
pub async fn requests<F>(self, callback: F) -> Result<InterceptId>
Intercepts requests with the configured filters.
§Returns
An InterceptId that can be used to stop this intercept.
Sourcepub async fn request_headers<F>(self, callback: F) -> Result<InterceptId>
pub async fn request_headers<F>(self, callback: F) -> Result<InterceptId>
Intercepts request headers with the configured filters.
Sourcepub async fn request_body<F>(self, callback: F) -> Result<InterceptId>
pub async fn request_body<F>(self, callback: F) -> Result<InterceptId>
Intercepts request body with the configured filters (read-only).
Sourcepub async fn responses<F>(self, callback: F) -> Result<InterceptId>
pub async fn responses<F>(self, callback: F) -> Result<InterceptId>
Intercepts response headers with the configured filters.
Sourcepub async fn response_body<F>(self, callback: F) -> Result<InterceptId>
pub async fn response_body<F>(self, callback: F) -> Result<InterceptId>
Intercepts response body with the configured filters.
Auto Trait Implementations§
impl<'a> Freeze for InterceptBuilder<'a>
impl<'a> !RefUnwindSafe for InterceptBuilder<'a>
impl<'a> Send for InterceptBuilder<'a>
impl<'a> Sync for InterceptBuilder<'a>
impl<'a> Unpin for InterceptBuilder<'a>
impl<'a> UnsafeUnpin for InterceptBuilder<'a>
impl<'a> !UnwindSafe for InterceptBuilder<'a>
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