pub trait ConfigFile:
DeserializeOwned
+ Serialize
+ JsonSchema {
// Required method
fn config_file_path() -> PathBuf;
// Provided methods
fn delete(&self) -> Result<()> { ... }
fn get_schema() -> Schema { ... }
fn try_load() -> Result<Self, LoadConfigError> { ... }
fn write(&self) -> Result<()> { ... }
fn write_schema() -> Result<()> { ... }
}Expand description
Trait defining a struct as representing a config file.
Required Methods§
Sourcefn config_file_path() -> PathBuf
fn config_file_path() -> PathBuf
The path to the config file.
Provided Methods§
Sourcefn get_schema() -> Schema
fn get_schema() -> Schema
Get the schema for the config file.
Sourcefn try_load() -> Result<Self, LoadConfigError>
fn try_load() -> Result<Self, LoadConfigError>
Try load the config file, linting it against its JSON schema.
Sourcefn write_schema() -> Result<()>
fn write_schema() -> Result<()>
Write the schema to the schema file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".