#[allow(dead_code)] #[derive(Debug)] pub struct UserToken { pub uuid: String, pub token: String, pub refresh_token: String, } pub trait UserProvider { fn authenticate(&self, user: UserToken) -> Result + Send + Sync>, String>; } pub trait User { fn token(&self) -> &'_ super::UserToken; fn is_mod(&self) -> bool; fn is_admin(&self) -> bool; fn is_dev(&self) -> bool; fn unlocked_parts(&self) -> Vec; fn selected_garage_uuid(&self) -> String; fn selected_garage_slot(&self) -> u32; fn all_slots_by_id(&self) -> UserSlots; fn slot_by_id(&self, id: i32) -> Result, i16>; fn save_slot(&self, vehicle: VehicleData) -> Result<(), i16>; fn signup_date(&self) -> i64; fn singleplayer_robots(&self) -> Result, i16>; } pub struct UserSlots { pub slot_info: polariton::operation::Typed, pub slot_order: polariton::operation::Typed, } pub struct UserSlotData { pub data: polariton::operation::Typed, pub colour_data: polariton::operation::Typed, pub cube_count: polariton::operation::Typed, pub weapon_order: polariton::operation::Typed, pub movement_categories: polariton::operation::Typed, pub control_type: polariton::operation::Typed, pub control_options: polariton::operation::Typed, pub mastery_level: polariton::operation::Typed, pub robot_rank: polariton::operation::Typed, pub cpu: polariton::operation::Typed, pub cosmetic_cpu: polariton::operation::Typed, pub uuid: polariton::operation::Typed, } pub struct VehicleData { pub id: i32, pub robot_data: Vec, pub colour_data: Vec, pub weapon_order: Vec, }