Skip to main content

Source

Trait Source 

Source
pub trait Source {
    // Required method
    fn fetch(&self, url: &str, output: &mut dyn Write, limit: u64) -> Result<()>;

    // Provided method
    fn fetch_from(
        &self,
        url: &str,
        output: &mut dyn Write,
        offset: u64,
        limit: u64,
    ) -> Result<Transfer> { ... }
}
Expand description

Transport boundary shared by the CLI and deterministic tests. Implementations must refuse oversized responses. Sources are required to honor the supplied URL exactly.

Required Methods§

Source

fn fetch(&self, url: &str, output: &mut dyn Write, limit: u64) -> Result<()>

Provided Methods§

Source

fn fetch_from( &self, url: &str, output: &mut dyn Write, offset: u64, limit: u64, ) -> Result<Transfer>

Append bytes beginning at offset, within the remaining byte budget. Restart must write nothing. Errors may leave a prefix; only a final whole-file hash proves it. Sources without range support safely restart that file.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§