diff options
Diffstat (limited to 'fondant_deps')
-rw-r--r-- | fondant_deps/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fondant_deps/src/lib.rs b/fondant_deps/src/lib.rs index 9559b11..82626b7 100644 --- a/fondant_deps/src/lib.rs +++ b/fondant_deps/src/lib.rs | |||
@@ -21,7 +21,7 @@ pub mod fondant_exports { | |||
21 | } | 21 | } |
22 | 22 | ||
23 | use serde::{de::DeserializeOwned, Serialize}; | 23 | use serde::{de::DeserializeOwned, Serialize}; |
24 | use std::path::PathBuf; | 24 | use std::path::{Path, PathBuf}; |
25 | 25 | ||
26 | #[derive(Debug)] | 26 | #[derive(Debug)] |
27 | /// Errors that `load` and `store` can result in | 27 | /// Errors that `load` and `store` can result in |
@@ -44,9 +44,8 @@ pub enum FondantError { | |||
44 | 44 | ||
45 | /// Derive this trait on a struct to mark it as a 'configuration' struct. | 45 | /// Derive this trait on a struct to mark it as a 'configuration' struct. |
46 | pub trait Configure: Serialize + DeserializeOwned + Default { | 46 | pub trait Configure: Serialize + DeserializeOwned + Default { |
47 | fn load_file(config_file: &PathBuf) -> Result<Self, FondantError>; | 47 | fn load_file<P: AsRef<Path>>(config_file: P) -> Result<Self, FondantError>; |
48 | fn load() -> Result<Self, FondantError>; | 48 | fn load() -> Result<Self, FondantError>; |
49 | fn store(&self) -> Result<(), FondantError>; | 49 | fn store(&self) -> Result<(), FondantError>; |
50 | fn store_file(&self, config_file: &PathBuf) -> Result<(), FondantError>; | 50 | fn store_file<P: AsRef<Path>>(&self, config_file: P) -> Result<(), FondantError>; |
51 | |||
52 | } | 51 | } |