aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: 6c0351054990b7ba5365724e3a55048da44b9063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pub use directories::ProjectDirs;
pub use serde::{de::DeserializeOwned, Serialize};
pub use serde_json;
pub use serde_yaml;
pub use toml;

#[derive(Debug)]
pub enum FondantError {
    InvalidHomeDir,
    ConfigParseError,
    DirCreateErr(std::io::Error),
    LoadError,
    FileWriteError,
    FileReadError,
    FileOpenError,
}

pub trait Configure: Serialize + DeserializeOwned + Default {
    fn load() -> Result<Self, FondantError>;
    fn store(&self) -> Result<(), FondantError>;
}