AeroRust / nmea

NMEA 0183 - for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GNSS receivers and many other types of instruments. Defined and controlled by the National Marine Electronics Association (NMEA)
https://crates.io/crates/nmea
Other
56 stars 41 forks source link

Add serde support #102

Closed 0xf4lc0n closed 1 year ago

0xf4lc0n commented 1 year ago

This PR adds support for serialization and deserialization via serde as requested in #100.

Because SatsPack uses Deque which doesn't derive Serialize and Deserialize traits, a custom serialization/deserialization functions were created.

elpiel commented 1 year ago

Thank you for the PR @0xf4lc0n! I will take a look in the coming days. @wiktorwieclaw also thank you for provided feedback. I already see that your comments have been tackled

elpiel commented 1 year ago
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.86 :warning:

Comparison is base (4b9b652) 79.46% compared to head (e5f9bc9) 78.60%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #102 +/- ## ========================================== - Coverage 79.46% 78.60% -0.86% ========================================== Files 33 33 Lines 1193 1206 +13 ========================================== Hits 948 948 - Misses 245 258 +13 ``` | [Impacted Files](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust) | Coverage Δ | | |---|---|---| | [src/lib.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL2xpYi5ycw==) | `0.00% <ø> (ø)` | | | [src/parse.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3BhcnNlLnJz) | `73.62% <ø> (ø)` | | | [src/parser.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3BhcnNlci5ycw==) | `75.09% <0.00%> (-3.82%)` | :arrow_down: | | [src/sentences/aam.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9hYW0ucnM=) | `96.29% <ø> (ø)` | | | [src/sentences/alm.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9hbG0ucnM=) | `87.50% <ø> (ø)` | | | [src/sentences/bod.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9ib2QucnM=) | `77.27% <ø> (ø)` | | | [src/sentences/bwc.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9id2MucnM=) | `90.62% <ø> (ø)` | | | [src/sentences/bww.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9id3cucnM=) | `100.00% <ø> (ø)` | | | [src/sentences/dbk.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9kYmsucnM=) | `89.47% <ø> (ø)` | | | [src/sentences/faa\_mode.rs](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust#diff-c3JjL3NlbnRlbmNlcy9mYWFfbW9kZS5ycw==) | `60.86% <ø> (ø)` | | | ... and [20 more](https://app.codecov.io/gh/AeroRust/nmea/pull/102?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AeroRust) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

elpiel commented 1 year ago

I've opened this PR to bump the MSRV and update the std features:

https://github.com/grupacosmo/nmea/pull/1