kellnr_settings/
proxy.rs

1use serde::{Deserialize, Serialize};
2use url::Url;
3
4#[derive(Debug, Deserialize, Serialize, Eq, PartialEq, Clone)]
5#[serde(default)]
6pub struct Proxy {
7    pub enabled: bool,
8    pub num_threads: usize,
9    pub download_on_update: bool,
10    pub url: Url,
11    pub index: Url,
12}
13
14impl Default for Proxy {
15    fn default() -> Self {
16        Self {
17            enabled: false,
18            num_threads: 10,
19            download_on_update: false,
20            url: Url::parse("https://static.crates.io/crates/").unwrap(),
21            index: Url::parse("https://index.crates.io/").unwrap(),
22        }
23    }
24}