refactor(quark): port get/set_settings, get_unreads

#283
This commit is contained in:
Paul Makles
2024-04-07 18:10:11 +01:00
parent f6a565385e
commit 2de7598f8d
11 changed files with 69 additions and 68 deletions

View File

@@ -1,6 +1,26 @@
#[cfg(feature = "rocket")]
use rocket::FromForm;
use std::collections::HashMap;
/// HashMap of user settings
/// Each key is mapped to a tuple consisting of the
/// revision timestamp and serialised data (in JSON format)
pub type UserSettings = HashMap<String, (i64, String)>;
auto_derived!(
/// Options for fetching settings
pub struct OptionsFetchSettings {
/// Keys to fetch
pub keys: Vec<String>,
}
/// Additional options for inserting settings
#[cfg_attr(feature = "rocket", derive(FromForm))]
pub struct OptionsSetSettings {
/// Timestamp of settings change.
///
/// Used to avoid feedback loops.
pub timestamp: Option<i64>,
}
);