cruct 1.0.0

A procedural macro for loading configuration files into Rust structs with compile‑time validation and type safety.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use assay::assay;
use cruct::cruct;

#[assay(
    include = ["tests/fixtures/integration/basic.toml"],
)]
fn simple_derive_generates_loader() {
    #[cruct(load_config(path = "tests/fixtures/integration/basic.toml"))]
    #[derive(Debug)]
    #[allow(dead_code)]
    struct S {
        a: String,
    }

    let _ = S::loader();
}