Skip to main content

Fetch

Trait Fetch 

Source
pub trait Fetch: Send + Sync {
    // Required method
    fn get(&self, url: &str) -> Result<Vec<u8>, NetError>;

    // Provided method
    fn get_capped(&self, url: &str, max: u64) -> Result<Vec<u8>, NetError> { ... }
}
Expand description

Something that can GET a URL.

Required Methods§

Source

fn get(&self, url: &str) -> Result<Vec<u8>, NetError>

Provided Methods§

Source

fn get_capped(&self, url: &str, max: u64) -> Result<Vec<u8>, NetError>

get, refusing a body past max bytes. A fetcher with no limit of its own may take the default.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§