Skip to main content

Network

Trait Network 

Source
pub trait Network:
    Send
    + Sync
    + 'static {
    // Required method
    fn fetch(
        &self,
        request: HttpRequest,
        events: FetchEvents,
    ) -> Box<dyn FetchTask>;
}
Expand description

The platform’s HTTP stack, used by JS fetch.

Required Methods§

Source

fn fetch(&self, request: HttpRequest, events: FetchEvents) -> Box<dyn FetchTask>

Starts request: its response head, then its body in chunks as they arrive, are reported to events.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§