diff options
| author | Flaise <[email protected]> | 2019-08-02 16:06:04 -0500 |
|---|---|---|
| committer | Matthew Collins <[email protected]> | 2019-08-03 09:08:03 +0100 |
| commit | f36084df856b0fc3933afe3a9f376c9ccc11a98c (patch) | |
| tree | 25994cdb5a83e7e120b7e10daf11dbc2f17a1888 /src/user_stats.rs | |
| parent | Fixed build script on Linux (diff) | |
| download | steamworks-rs-f36084df856b0fc3933afe3a9f376c9ccc11a98c.tar.xz steamworks-rs-f36084df856b0fc3933afe3a9f376c9ccc11a98c.zip | |
Implemented Serialize, Deserialize and other common traits where appropriate
Diffstat (limited to 'src/user_stats.rs')
| -rw-r--r-- | src/user_stats.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/user_stats.rs b/src/user_stats.rs index f51981d..273e8d4 100644 --- a/src/user_stats.rs +++ b/src/user_stats.rs @@ -68,7 +68,8 @@ impl <Manager> UserStats<Manager> { None }) }) - }); + } + ); } } @@ -103,11 +104,11 @@ impl <Manager> UserStats<Manager> { } pub fn download_leaderboard_entries<F>( - &self, - leaderboard: &Leaderboard, - request: LeaderboardDataRequest, start: usize, end: usize, - max_details_len: usize, - mut cb: F + &self, + leaderboard: &Leaderboard, + request: LeaderboardDataRequest, start: usize, end: usize, + max_details_len: usize, + mut cb: F ) where F: FnMut(Result<Vec<LeaderboardEntry>, SteamError>) + 'static + Send + Sync { @@ -176,7 +177,7 @@ impl <Manager> UserStats<Manager> { } } -#[derive(Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct LeaderboardEntry { pub user: SteamId, pub global_rank: i32, @@ -190,7 +191,7 @@ pub enum LeaderboardDataRequest { Friends, } -#[derive(Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct LeaderboardScoreUploaded { pub score: i32, pub was_changed: bool, @@ -198,23 +199,26 @@ pub struct LeaderboardScoreUploaded { pub global_rank_previous: i32, } +#[derive(Clone, Debug, Serialize, Deserialize)] pub enum UploadScoreMethod { KeepBest, ForceUpdate, } +#[derive(Clone, Debug, Serialize, Deserialize)] pub enum LeaderboardSortMethod { Ascending, Descending, } +#[derive(Clone, Debug, Serialize, Deserialize)] pub enum LeaderboardDisplayType { Numeric, TimeSeconds, TimeMilliSeconds, } -#[derive(Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Leaderboard(u64); #[test] |