Skip to main content

ScriptFetcher

Trait ScriptFetcher 

Source
pub trait ScriptFetcher: 'static {
    // Required method
    fn fetch(&self, url: &Url) -> Result<String, FetchError>;
}
Expand description

Trait for synchronously fetching external script sources.

Scripts are fetched synchronously because the HTML spec requires classic scripts to execute in document order, blocking parsing.

Required Methods§

Source

fn fetch(&self, url: &Url) -> Result<String, FetchError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§