feat: add serde

Adds serialization/deserialization support via serde and serde_with.

Also:

- remove `license-file` in Cargo.toml (superfluous)
- update README with Getting Started section
- add `serde` and `serde_with` dependencies to README
- add tests to `HeightVector`
- tweak assertion in `NetworkCoordinate`
- refactor `Vector` to be a struct witn an `inner` instead of a tuple struct so that we can use `serde_as` (from `serde_with`) to help us derive SerDe implementations for the const generic sized array
- moved trait requirements (which are getting long) into where clauses

Signed-off-by: Stephen Waits <steve@waits.net>
This commit is contained in:
swaits committed 2023-02-04 09:42:46 -07:00
1 parent 9265b5fa28
commit b3147dfad7
5 files changed
+213 -34

No files matched your search

+3 -1
View File
@@ -11,11 +11,13 @@ documentation = "https://docs.rs/vivaldi-nc/"
readme = "README.md"
homepage = "https://sr.ht/~swaits/vivaldi-nc/"
repository = "https://git.sr.ht/~swaits/vivaldi-nc"
license-file = "LICENSE.txt"
[dev-dependencies]
assert_approx_eq = "1.1.0"
serde_json = "1.0.91"
[dependencies]
nanorand = {version = "0.7.0", features = ["wyrand", "getrandom"]}
num-traits = "0.2.15"
serde = {version = "1.0.152", features = ["serde_derive"]}
serde_with = "2.2.0"