use crate::schema::config; use crate::schema::strava_tokens; use crate::schema::users; use chrono::DateTime; use chrono::Utc; use std::fmt; #[derive(Insertable, Queryable)] #[table_name = "config"] pub struct Config { pub strava_client_secret: String, pub strava_client_id: String, pub rocket_secret_key: String, pub singleton: bool, } #[derive(Insertable)] #[table_name = "users"] pub struct NewUser<'a> { pub username: &'a str, pub password: &'a str, } #[derive(Queryable, Clone)] pub struct User { pub username: String, pub password: String, } impl fmt::Debug for User { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "User {{ username: {}, password: }}", self.username ) } } #[derive(Insertable, Queryable)] #[table_name = "strava_tokens"] pub struct StravaToken { pub username: String, pub refresh_token: String, pub access_token: String, pub expires_at: DateTime, }