pub struct NetworkWatcher { /* private fields */ }Expand description
Watches network events and provides a stream of captured requests
Implementations§
Source§impl NetworkWatcher
impl NetworkWatcher
Sourcepub async fn process_event(&self, event: &CdpMessage) -> bool
pub async fn process_event(&self, event: &CdpMessage) -> bool
Process a CDP event Returns true if the event was a network event that was processed
Sourcepub async fn recv(&self) -> Option<NetworkEvent>
pub async fn recv(&self) -> Option<NetworkEvent>
Receive the next network event
Sourcepub async fn try_recv(&self) -> Option<NetworkEvent>
pub async fn try_recv(&self) -> Option<NetworkEvent>
Try to receive a network event without blocking
Sourcepub async fn get_request(&self, request_id: &str) -> Option<CapturedRequest>
pub async fn get_request(&self, request_id: &str) -> Option<CapturedRequest>
Get a captured request by ID
Sourcepub async fn get_all_requests(&self) -> Vec<CapturedRequest>
pub async fn get_all_requests(&self) -> Vec<CapturedRequest>
Get all captured requests
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NetworkWatcher
impl !RefUnwindSafe for NetworkWatcher
impl Send for NetworkWatcher
impl Sync for NetworkWatcher
impl Unpin for NetworkWatcher
impl !UnwindSafe for NetworkWatcher
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