Make platforms generic

This commit is contained in:
Philip Kristoffersen
2021-09-25 08:50:03 +02:00
parent 99079dcaff
commit 9493262076
13 changed files with 136 additions and 93 deletions
+10 -11
View File
@@ -1,13 +1,12 @@
use crate::{egs::EpicGamesLauncherSettings, legendary::LegendarySettings};
use steam_shortcuts_util::shortcut::ShortcutOwned;
pub enum Platform{
EpicGames{
settings: EpicGamesLauncherSettings,
},
Legendary{
settings: LegendarySettings
}
pub trait Platform<T, E>
where
T: Into<ShortcutOwned>,
{
fn enabled(&self) -> bool;
fn name(&self) -> &str;
fn get_shortcuts(&self) -> Result<Vec<T>, E>;
}