Function config_struct::create_config[][src]

pub fn create_config<SrcPath: AsRef<Path>, DstPath: AsRef<Path>>(
    filepath: SrcPath,
    destination: DstPath,
    options: &Options
) -> Result<(), Error>

Generate a Rust module containing struct definitions based on a given config file.

The format of the config is auto-detected from its filename extension.

Examples

This example is not tested
config_struct::create_config("config.toml", "src/config.rs", &Default::default())?;