flams_database/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2
3#[cfg(feature = "backend")]
4mod db;
5#[cfg(feature = "backend")]
6pub use db::*;
7
8#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
9pub struct UserData {
10    pub id: i64,
11    pub name: String,
12    pub username: String,
13    pub email: String,
14    pub avatar_url: String,
15    pub is_admin: bool,
16}
17
18#[derive(
19    Debug,
20    Copy,
21    Clone,
22    serde::Serialize,
23    serde::Deserialize,
24    PartialEq,
25    Eq,
26    strum::Display,
27    strum::EnumString,
28)]
29pub enum LoginError {
30    #[strum(to_string = "Wrong username or password")]
31    WrongUsernameOrPassword,
32    #[strum(to_string = "Internal error")]
33    InternalError,
34    #[strum(to_string = "Not logged in")]
35    NotLoggedIn,
36}