zonyitoo / rust-ini

INI file parser in Rust
MIT License
299 stars 77 forks source link

Serde Support #40

Open Michael-F-Bryan opened 6 years ago

Michael-F-Bryan commented 6 years ago

What are your thoughts on adding serde support so you can serialize to/deserialize from an INI file? Along the same lines as serde_json, toml, or serde_xml.

zonyitoo commented 6 years ago

Well, INI file format is a flat format, which is a pure and simple key-value structure. So I don't think it is necessary to be used with serde. Ini is just a two level HashMap.

hellow554 commented 5 years ago

I think it's nice to have! It's much cleaner and simpler to let serde parse the values into the correct types, instead of doing that by hand.

So I would think this is worth supporting.

zonyitoo commented 5 years ago

PR is welcomed. Because I don't have time recently :(

kirawi commented 3 years ago

I'll try to do this, though I can't guarantee I'll have the time either.

Zerowalker commented 2 years ago

I would also like this. I am trying my hands at it but proc_macro stuff is not something i have worked with before. made some progress, i can deserialize to basic String and Option, but not sections.

My goal is to support sections and allow duplicate ones to make a Vec<...> out of it.

@kirawi have you made any progress?

Other than that, great crate, it's the only one that supported the ini files i am trying to parse that i could find, and quite straight forward:)

EDIT: Forgot to mention that it's not using serde right now, just doing it "manually" so to speak.

kirawi commented 2 years ago

Honestly, I'll admit I completely forgot 😅 you can go ahead.

Zerowalker commented 2 years ago

Haha xd Well will do my best, but don't expect much;)