pub trait FetchProvider:
Send
+ Sync
+ 'static {
// Required method
fn fetch(&self, request: FetchRequest, handler: Box<dyn FetchHandler>);
}Expand description
A type that performs fetch-style requests on behalf of a guest.
Asynchronous by construction: fetch hands the
request over and returns immediately, and the answer arrives through the
handler on whatever thread the implementation chooses. Callers must not
assume the handler runs later, or on another thread: an implementation
serving a data: URL may answer before fetch returns.
Required Methods§
fn fetch(&self, request: FetchRequest, handler: Box<dyn FetchHandler>)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".