Skip to content

Add config serialization#50

Open
jgrund wants to merge 1 commit intoLukasKalbertodt:mainfrom
jgrund:jgrund/serialize
Open

Add config serialization#50
jgrund wants to merge 1 commit intoLukasKalbertodt:mainfrom
jgrund:jgrund/serialize

Conversation

@jgrund
Copy link

@jgrund jgrund commented Feb 7, 2026

Add the ability to serialize an instantiated Config struct back to a configuration file with documentation comments preserved.

When a field's value equals its default, it is commented out (disabled) just like in template output - this means serializing a default config produces output identical to template().

New serialize fns (requires serialize feature):

  • toml::serialize
  • yaml::serialize
  • json5::serialize (also requires serde_json feature)

Add the ability to serialize an instantiated Config struct back to a
configuration file with documentation comments preserved.

When a field's value equals its default, it is commented out (disabled) just like in
template output - this means serializing a default config produces
output identical to template().

New serialize fns (requires `serialize` feature):

- `toml::serialize`
- `yaml::serialize`
- `json5::serialize` (also requires `serde_json` feature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant