[][src]Function config_struct::create_struct

pub fn create_struct<SrcPath: AsRef<Path>, DstPath: AsRef<Path>>(
    filepath: SrcPath,
    destination: DstPath,
    options: &StructOptions
) -> 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

use config_struct::StructOptions;

config_struct::create_struct("config.toml", "src/config.rs", &StructOptions::default())?;