From bfe9285b432855aabc21de6bcdec3c2ec6dc0850 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Mon, 17 Feb 2025 19:36:55 +0100 Subject: [PATCH] Adds some more info on the scenario --- weaponry/src/interfaces.rs | 5 +++++ weaponry/src/weaponry_structs/equipement_scenario.rs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/weaponry/src/interfaces.rs b/weaponry/src/interfaces.rs index c02bbf2..0de0c51 100644 --- a/weaponry/src/interfaces.rs +++ b/weaponry/src/interfaces.rs @@ -156,6 +156,11 @@ pub trait DbSerializable { /// A generic database+connection, handling all the deserialization of the inner types pub trait RecipeDatabase { + /// Create the database from a file + fn new(origin: &str) -> Result + where + Self: std::marker::Sized; + /// Serialize a vector of objects of the given type in the specified table of the underlying database fn serialize_vec_from_table(table: &str) -> std::result::Result, EquipementError>; diff --git a/weaponry/src/weaponry_structs/equipement_scenario.rs b/weaponry/src/weaponry_structs/equipement_scenario.rs index 3f107fd..06b6f55 100644 --- a/weaponry/src/weaponry_structs/equipement_scenario.rs +++ b/weaponry/src/weaponry_structs/equipement_scenario.rs @@ -31,6 +31,14 @@ impl RecipeDatabase for DatabaseMock { let _ = query; todo!() } + + fn new(origin: &str) -> Result + where + Self: std::marker::Sized, + { + let _ = origin; + todo!() + } } /// Mock config pub struct ConfigMock {}