Trait CustomDownloadInstance

Source
pub trait CustomDownloadInstance: Sized {
    // Required methods
    fn from_core(core: Ref<DownloadInstance>) -> Self;
    fn handle(&self) -> Ref<DownloadInstance>;
    fn perform_custom_request<I>(
        &self,
        method: &str,
        url: &str,
        headers: I,
    ) -> Result<DownloadResponse, String>
       where I: IntoIterator<Item = (String, String)>;

    // Provided methods
    fn new_with_provider(
        provider: DownloadProvider,
    ) -> Result<Ref<DownloadInstance>, ()> { ... }
    fn perform_request(&self, url: &str) -> Result<(), String> { ... }
}

Required Methods§

Source

fn from_core(core: Ref<DownloadInstance>) -> Self

Construct the object now that the core object has been created.

Source

fn handle(&self) -> Ref<DownloadInstance>

Get the core object, typically the handle is stored directly on the object.

Source

fn perform_custom_request<I>( &self, method: &str, url: &str, headers: I, ) -> Result<DownloadResponse, String>
where I: IntoIterator<Item = (String, String)>,

Send an HTTP request on behalf of the caller.

The caller will expect you to inform them of progress via the following:

Provided Methods§

Source

fn new_with_provider( provider: DownloadProvider, ) -> Result<Ref<DownloadInstance>, ()>

Source

fn perform_request(&self, url: &str) -> Result<(), String>

Send an HTTP request on behalf of the caller.

The caller will expect you to inform them of progress via the following:

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§