Skip to main content

RemoteFetcher

Trait RemoteFetcher 

Source
pub trait RemoteFetcher: Send + Sync {
    // Required method
    fn fetch(&self, url: &str) -> Result<Vec<u8>, ConfigError>;
}
Expand description

Fetches a fragment or file’s raw bytes from a URL. Injected through resolve_extends/load_caproni_config so tests can substitute a wiremock-backed double for the real UreqFetcher; see this module’s doc comment for the full design rationale.

Required Methods§

Source

fn fetch(&self, url: &str) -> Result<Vec<u8>, ConfigError>

Fetches url’s body, enforcing the MAX_FRAGMENT_BYTES size limit and a 200 OK status. Port of fetchRemoteFile.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§