pub(crate) trait FetchResponseListener: Send + 'static {
// Required methods
fn process_request_body(&mut self, request_id: RequestId);
fn process_request_eof(&mut self, request_id: RequestId);
fn process_response(
&mut self,
request_id: RequestId,
metadata: Result<FetchMetadata, NetworkError>,
);
fn process_response_chunk(&mut self, request_id: RequestId, chunk: Vec<u8>);
fn process_response_eof(
self,
request_id: RequestId,
response: Result<ResourceFetchTiming, NetworkError>,
);
fn process_csp_violations(
&mut self,
request_id: RequestId,
violations: Vec<Violation>,
);
// Provided method
fn should_invoke(&self) -> bool { ... }
}Required Methods§
fn process_request_body(&mut self, request_id: RequestId)
fn process_request_eof(&mut self, request_id: RequestId)
fn process_response( &mut self, request_id: RequestId, metadata: Result<FetchMetadata, NetworkError>, )
fn process_response_chunk(&mut self, request_id: RequestId, chunk: Vec<u8>)
fn process_response_eof( self, request_id: RequestId, response: Result<ResourceFetchTiming, NetworkError>, )
fn process_csp_violations( &mut self, request_id: RequestId, violations: Vec<Violation>, )
Provided Methods§
Sourcefn should_invoke(&self) -> bool
fn should_invoke(&self) -> bool
A gating mechanism that runs before invoking the listener methods on the target
thread. If the should_invoke method returns false, the listener does not receive
the notification.