#[repr(C)]pub struct _cef_download_handler_t {
pub base: cef_base_ref_counted_t,
pub can_download: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, url: *const cef_string_t, request_method: *const cef_string_t) -> c_int>,
pub on_before_download: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, download_item: *mut _cef_download_item_t, suggested_name: *const cef_string_t, callback: *mut _cef_before_download_callback_t)>,
pub on_download_updated: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, download_item: *mut _cef_download_item_t, callback: *mut _cef_download_item_callback_t)>,
}Expand description
Structure used to handle file downloads. The functions of this structure will called on the browser process UI thread.
Fields§
§base: cef_base_ref_counted_tBase structure.
can_download: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, url: *const cef_string_t, request_method: *const cef_string_t) -> c_int>Called before a download begins in response to a user-initiated action
(e.g. alt + link click or link click that returns a Content-Disposition: attachment response from the server). |url| is the target download URL
and |request_function| is the target function (GET, POST, etc). Return
true (1) to proceed with the download or false (0) to cancel the download.
on_before_download: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, download_item: *mut _cef_download_item_t, suggested_name: *const cef_string_t, callback: *mut _cef_before_download_callback_t)>Called before a download begins. |suggested_name| is the suggested name for the download file. By default the download will be canceled. Execute |callback| either asynchronously or in this function to continue the download if desired. Do not keep a reference to |download_item| outside of this function.
on_download_updated: Option<unsafe extern "C" fn(self_: *mut _cef_download_handler_t, browser: *mut _cef_browser_t, download_item: *mut _cef_download_item_t, callback: *mut _cef_download_item_callback_t)>Called when a download’s status or progress information has been updated. This may be called multiple times before and after on_before_download(). Execute |callback| either asynchronously or in this function to cancel the download if desired. Do not keep a reference to |download_item| outside of this function.
Trait Implementations§
Source§impl Clone for _cef_download_handler_t
impl Clone for _cef_download_handler_t
Source§fn clone(&self) -> _cef_download_handler_t
fn clone(&self) -> _cef_download_handler_t
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more