revolt_models/v0/
user_settings.rs

1#[cfg(feature = "rocket")]
2use rocket::FromForm;
3
4use std::collections::HashMap;
5
6/// HashMap of user settings
7/// Each key is mapped to a tuple consisting of the
8/// revision timestamp and serialised data (in JSON format)
9pub type UserSettings = HashMap<String, (i64, String)>;
10
11auto_derived!(
12    /// Options for fetching settings
13    pub struct OptionsFetchSettings {
14        /// Keys to fetch
15        pub keys: Vec<String>,
16    }
17
18    /// Additional options for inserting settings
19    #[cfg_attr(feature = "rocket", derive(FromForm))]
20    pub struct OptionsSetSettings {
21        /// Timestamp of settings change.
22        ///
23        /// Used to avoid feedback loops.
24        pub timestamp: Option<i64>,
25    }
26);