Crates.io | mparsed |
lib.rs | mparsed |
version | 0.2.0 |
source | src |
created_at | 2020-07-23 19:54:00.380402 |
updated_at | 2020-07-24 13:02:11.278326 |
description | Structs and logic to deserialize mpd (music player daemon) responses with serde |
homepage | |
repository | https://git.kageru.moe/kageru/mparsed |
max_upload_size | |
id | 268755 |
size | 27,209 |
A serde parser for MPD responses. Includes mpd structs.
Because there are lots of mpd client libraries for Rust, but most (maybe all?) of them write the same awful deserialization code that more or less looks like this:
let mut track = Track::default();
match key {
"title" => track.title = value,
"artist" => track.artist = value,
"album" => track.album = value,
...
And I figured just having a small crate that has all the types and does the serde magic for you would be nice for other people as well.
Oh, and it’s a good learning opportunity for me. Serde seemed like a library I should learn more about.
MyFavoriteStruct
!Feel free to submit a PR for it. This is still very much work in progress, but I think we should have most necessary helper functions so that you can just write the struct definition with some serde attributes and be done with it.