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§
sourcefn from_core(core: Ref<DownloadInstance>) -> Self
fn from_core(core: Ref<DownloadInstance>) -> Self
Construct the object now that the core object has been created.
sourcefn handle(&self) -> Ref<DownloadInstance>
fn handle(&self) -> Ref<DownloadInstance>
Get the core object, typically the handle is stored directly on the object.
sourcefn perform_custom_request<I>(
&self,
method: &str,
url: &str,
headers: I,
) -> Result<DownloadResponse, String>
fn perform_custom_request<I>( &self, method: &str, url: &str, headers: I, ) -> Result<DownloadResponse, 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§
fn new_with_provider( provider: DownloadProvider, ) -> Result<Ref<DownloadInstance>, ()>
Object Safety§
This trait is not object safe.