Trait config_file2::StoreConfigFile
source · pub trait StoreConfigFile {
// Required method
fn store_with_specific_format(
self,
path: impl AsRef<Path>,
config_type: ConfigFormat,
) -> Result<()>;
// Provided methods
fn store(self, path: impl AsRef<Path>) -> Result<()>
where Self: Sized { ... }
fn store_without_overwrite(self, path: impl AsRef<Path>) -> Result<()>
where Self: Sized { ... }
}Expand description
Trait for storing a struct into a configuration file.
This trait is automatically implemented when serde::Serialize is.
Required Methods§
sourcefn store_with_specific_format(
self,
path: impl AsRef<Path>,
config_type: ConfigFormat,
) -> Result<()>
fn store_with_specific_format( self, path: impl AsRef<Path>, config_type: ConfigFormat, ) -> Result<()>
Store config file to path with specific format, do not use extension to determine.
Provided Methods§
Object Safety§
This trait is not object safe.