crate_activity/
usage.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
crate::ix!();

#[derive(Clone,Debug,Serialize,Deserialize)]
pub enum DownloadTrend {
    Increasing,
    Decreasing,
    Stable,
}

#[derive(Builder,Getters,Setters,Debug,Serialize,Deserialize)]
#[builder(setter(into))]
pub struct CrateUsageSummary {
    #[getset(get = "pub", set = "pub")] crate_name:              String,
    #[getset(get = "pub", set = "pub")] total_downloads:         u64,
    #[getset(get = "pub", set = "pub")] average_daily_downloads: f64,
    #[getset(get = "pub", set = "pub")] peak_daily_downloads:    u64,
    #[getset(get = "pub", set = "pub")] download_trend:          Option<DownloadTrend>,
    #[getset(get = "pub", set = "pub")] version_downloads:       Vec<VersionDownload>, // Add this
}