Skip to main content

HttpHandler

Trait HttpHandler 

Source
pub trait HttpHandler: Send + Sync {
    // Required methods
    fn get(&self, url: &str, responder: HttpResponder);
    fn get_range(
        &self,
        url: &str,
        start: u64,
        end: u64,
        responder: HttpResponder,
    );

    // Provided method
    fn capabilities(&self) -> u32 { ... }
}
Expand description

An HTTP client the library uses to fetch CDN data.

Both methods are asynchronous: reply through the HttpResponder when the request finishes, from whichever thread you like. Replying synchronously inside the method is also fine.

Required Methods§

Source

fn get(&self, url: &str, responder: HttpResponder)

Source

fn get_range(&self, url: &str, start: u64, end: u64, responder: HttpResponder)

Inclusive byte range.

Provided Methods§

Source

fn capabilities(&self) -> u32

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§