Commit Graph
16 Commits
Author SHA1 Message Date
swaits 609cc3e98c refactor: clean up by using cfg-if where possible
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-13 10:41:49 -07:00
swaits c3d210cf16 refactor: switch to array-init
- Use array-init for the lowest level vector operations. Makes them nicer and less bug-prone, with zero performance impact.
- Remove unnecessary/unused ::new() functions on Vector and HeightVector.
- Update README with new dependency.
- Fix typo in README.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-10 22:51:38 -05:00
swaits 79c90cbd4f test: get to 100% coverage, clean up cargo features
- eliminated `f64` feature because Cargo doesn’t understand mutually exclusive features. So, we default to `f64`, and leave the `f32` feature there if people want to change to that.
- integrated tarpaulin for coverage
- added tests to get to 100% coverage
- fixed NetworkCoordinate Div impl safety checks (now acts like Add and Sub)
- update README to explain cargo feature change
- cleanup build script with the new simpler features model

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-10 12:14:24 -07:00
swaits c07463122a perf: add benchmark, optimize
Realized about a 10x speedup.

- add benches/million-updates.rs
- optimization: use rand instead of nanorand (because of thread_rng() initialization being muchf aster)
- update README

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-09 16:36:24 -07:00
swaits c3b3ff1e4d feat: f32/f64 cargo features added
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-08 17:01:19 -07:00
swaits fce4946369 feat: improve ergonomics for serialization format
Goal: To make the serialization format more sensible instead of it being a reflection of our internal (ie private) data model.

- mostly handled with #[serde()] macros (renaming, flattening)
- renamed NetworkCoordinate::position to heightvec which is a better name, even if not seen in the published interface
- changed HeightVector from a tuple struct to a named struct so we can control serde on a field-by-field basis
- updated README, tests, and doc tests to match

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-08 15:32:27 -07:00
swaits 7f41676795 fix: exclude examples from crate
crates.io is limited to 10MB crates

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 22:09:28 -07:00
swaits 2b8fc16537 feat: add PlanetLab example
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-07 20:40:06 -07:00
swaits e2d14bcc0d doc: add link to ticket tracker
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 10:48:28 -07:00
swaits 25e0076c8d doc: add link to docs.rs in README
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 10:43:36 -07:00
swaits e9febc6faa clean up export, add module level docs
- public NetworkCoordinate so it’s easer to just `use vivaldi_nc::NetworkCoordinate`
- add module level docs and examples in lib.rs
- cleanup README

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 10:39:59 -07:00
swaits c83a4e654b update README, bump crate version
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-04 09:48:01 -07:00
swaits 2fad2e18b5 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>
2023-02-04 09:42:46 -07:00
swaits 5611618126 prep Cargo.toml for publication, add badges
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-02 22:33:15 -07:00
swaits c2399c5b8f add build badge to readme
Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-02 21:56:18 -07:00
swaits f29deb5335 initial commit
Includes an initial implementation, some tests, and some documentation.

Signed-off-by: Stephen Waits <steve@waits.net>
2023-02-02 21:19:09 -07:00