pub trait Fetcher: Send + Sync {
// Required method
fn fetch(&self, url: &str, dest: &Path) -> Result<(), String>;
}Expand description
Downloads a URL to a file.
Behind a trait for the same reason the build service’s toolchain is (PM.5): the interesting behaviour around it — where the bytes land, what manifest gets synthesised, what happens when the download fails — should be testable without reaching the network, which is neither fast nor available in CI sandboxes.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".