#[non_exhaustive]pub struct DownloadItem {Show 17 fields
pub id: DownloadId,
pub url: String,
pub filename: String,
pub state: DownloadState,
pub bytes_received: u64,
pub total_bytes: Option<u64>,
pub file_size: Option<u64>,
pub error: Option<String>,
pub start_time: String,
pub end_time: Option<String>,
pub paused: bool,
pub can_resume: bool,
pub exists: bool,
pub mime: Option<String>,
pub incognito: bool,
pub estimated_end_time: Option<String>,
pub danger: Option<String>,
}Expand description
Details about a download.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: DownloadIdBrowser-assigned download ID.
url: StringThe URL that was downloaded.
filename: StringAbsolute filesystem path where the file was saved.
state: DownloadStateCurrent state of the download.
bytes_received: u64Bytes received so far.
total_bytes: Option<u64>Total file size in bytes, or None if unknown.
file_size: Option<u64>Final file size in bytes, or None if unknown.
error: Option<String>Error reason if the download was interrupted.
start_time: StringISO 8601 timestamp when the download started.
end_time: Option<String>ISO 8601 timestamp when the download ended.
paused: boolWhether the download is paused.
can_resume: boolWhether an interrupted download can be resumed.
exists: boolWhether the downloaded file still exists on disk.
mime: Option<String>MIME type of the downloaded file.
incognito: boolWhether the download is associated with a private/incognito session.
estimated_end_time: Option<String>Predicted completion time as an ISO 8601 timestamp string.
danger: Option<String>Danger classification of the download (e.g. “safe”, “file”, “url”, “uncommon”, “malware”).
Implementations§
Source§impl DownloadItem
impl DownloadItem
Sourcepub const fn new(
id: DownloadId,
url: String,
filename: String,
state: DownloadState,
bytes_received: u64,
total_bytes: Option<u64>,
file_size: Option<u64>,
error: Option<String>,
start_time: String,
end_time: Option<String>,
paused: bool,
can_resume: bool,
exists: bool,
mime: Option<String>,
incognito: bool,
estimated_end_time: Option<String>,
danger: Option<String>,
) -> Self
pub const fn new( id: DownloadId, url: String, filename: String, state: DownloadState, bytes_received: u64, total_bytes: Option<u64>, file_size: Option<u64>, error: Option<String>, start_time: String, end_time: Option<String>, paused: bool, can_resume: bool, exists: bool, mime: Option<String>, incognito: bool, estimated_end_time: Option<String>, danger: Option<String>, ) -> Self
Create a new DownloadItem.
Trait Implementations§
Source§impl Clone for DownloadItem
impl Clone for DownloadItem
Source§fn clone(&self) -> DownloadItem
fn clone(&self) -> DownloadItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more