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 {}