use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DownloadWillBeginEvent {
pub frame_id: String,
pub guid: String,
pub url: String,
pub suggested_filename: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum DownloadProgressState {
InProgress,
Completed,
Canceled,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DownloadProgressEvent {
pub guid: String,
pub total_bytes: f64,
pub received_bytes: f64,
pub state: DownloadProgressState,
}
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetDownloadBehaviorParams {
pub behavior: DownloadBehavior,
#[serde(skip_serializing_if = "Option::is_none")]
pub download_path: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum DownloadBehavior {
Deny,
Allow,
Default,
}