Expand description
§SecretSpec Derive Macros
This crate provides procedural macros for the SecretSpec library, enabling compile-time
generation of strongly-typed secret structs from secretspec.toml configuration files.
§Overview
The macro system reads your secretspec.toml at compile time and generates:
- A
SecretSpecstruct with all secrets as fields (union of all profiles) - A
SecretSpecProfileenum with profile-specific structs - A
Profileenum representing available profiles - Type-safe loading methods with automatic validation
§Key Features
- Compile-time validation: Invalid configurations are caught during compilation
- Type safety: Secrets are accessed as struct fields, not strings
- Profile awareness: Different types for different profiles (e.g., production vs development)
- Builder pattern: Flexible configuration with method chaining
- Environment integration: Automatic environment variable handling
Macros§
- declare_
secrets - Generates typed SecretSpec structs from your secretspec.toml file.