What do you use to parse config files in #rust ? #asknostr

Reply to this note

Please Login to reply.

Discussion

DeSerialize toml into hashmap

But I'm a noob don't listen

I'm a rust noob coming from c++. I know nothing from this ecosystem. Just struggling to stay relevant 🤣

Serde deserialize for the win, either as a hashmap as nostr:npub1utx00neqgqln72j22kej3ux7803c2k986henvvha4thuwfkper4s7r50e8 said or into a struct is possible.

the config crate is the go-to for robust multilayered application configuration. supports all the different file formats you might want along with defaults, config merging, and environment variables configuration as well.

https://crates.io/crates/config

depending on what you're building, you may also wanna check this out for multiplatform config directory location handling. https://crates.io/crates/dirs

Is that XDG-like support?

yeah plus it supposed to support standard locations on windows and mac too. not sure what it is on windows but something like "Application Support" on mac

Cool thanks! I need you on my speed dial 😅

anytime. send me a message or a note here and i can help where i can.

serde