Skip to main content

FetchTask

Trait FetchTask 

Source
pub trait FetchTask: Send {
    // Required methods
    fn send(&mut self, chunk: Vec<u8>);
    fn finish(&mut self);
    fn pause(&mut self, paused: bool);
    fn cancel(self: Box<Self>);
}
Expand description

A request in flight, driven from the engine thread.

Required Methods§

Source

fn send(&mut self, chunk: Vec<u8>)

The next chunk of a streamed body (HttpBody::Stream), after FetchEvent::BodyWanted.

Source

fn finish(&mut self)

A streamed body is complete.

Source

fn pause(&mut self, paused: bool)

Stops (true) or resumes (false) reading the response body: JS does not read what arrived (back pressure). Bytes already on their way may still arrive.

Source

fn cancel(self: Box<Self>)

Aborts the request.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§