Skip to main content

FetchTaskTarget

Trait FetchTaskTarget 

Source
pub trait FetchTaskTarget {
    // Required methods
    fn process_request_body(&mut self, request: &Request);
    fn process_response(&mut self, request: &Request, response: &Response);
    fn process_response_chunk(&mut self, request: &Request, chunk: Vec<u8>);
    fn process_response_eof(&mut self, request: &Request, response: &Response);
    fn process_csp_violations(
        &mut self,
        request: &Request,
        violations: Vec<Violation>,
    );
    fn process_response_length_hint(
        &mut self,
        request_id: &Request,
        length: usize,
    );
}

Required Methods§

Source

fn process_request_body(&mut self, request: &Request)

https://fetch.spec.whatwg.org/#process-request-body

Fired when a chunk of the request body is transmitted

Source

fn process_response(&mut self, request: &Request, response: &Response)

https://fetch.spec.whatwg.org/#process-response

Fired when headers are received

Source

fn process_response_chunk(&mut self, request: &Request, chunk: Vec<u8>)

Fired when a chunk of response content is received

Source

fn process_response_eof(&mut self, request: &Request, response: &Response)

https://fetch.spec.whatwg.org/#process-response-end-of-file

Fired when the response is fully fetched

Source

fn process_csp_violations( &mut self, request: &Request, violations: Vec<Violation>, )

Source

fn process_response_length_hint(&mut self, request_id: &Request, length: usize)

Tell the listener that have a hint of how long the content is. This will be sent at most once.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FetchTaskTarget for GenericCallback<FetchResponseMsg>

Source§

fn process_request_body(&mut self, request: &Request)

Source§

fn process_response(&mut self, request: &Request, response: &Response)

Source§

fn process_response_chunk(&mut self, request: &Request, chunk: Vec<u8>)

Source§

fn process_response_eof(&mut self, request: &Request, response: &Response)

Source§

fn process_csp_violations( &mut self, request: &Request, violations: Vec<Violation>, )

Source§

fn process_response_length_hint(&mut self, request: &Request, length: usize)

Source§

impl FetchTaskTarget for IpcSender<WebSocketNetworkEvent>

Implementors§