docs: minor updates re: type aliases, crate to 0.5.1Signed-off-by: Stephen Waits <steve@waits.net>

This commit is contained in:
swaits committed 2023-02-08 15:59:15 -07:00
1 parent f0dedff879
commit 1bfdce1c21
3 files changed
+21 -17

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "vivaldi-nc" name = "vivaldi-nc"
version = "0.5.0" version = "0.5.1"
edition = "2021" edition = "2021"
authors = ["Stephen Waits <steve@waits.net>"] authors = ["Stephen Waits <steve@waits.net>"]
description = "Vivaldi network coordinates for fast, distributed latency estimates in multinode networks, with a clean and simple interface." description = "Vivaldi network coordinates for fast, distributed latency estimates in multinode networks, with a clean and simple interface."
+6 -16
View File
@@ -1,4 +1,5 @@
//! Vivaldi Network Coordinates with a simple interface //! Vivaldi network coordinates for fast, distributed latency estimates in multinode networks, with
//! a clean and simple interface.
//! //!
//! Network Coordinates (NC) are a way to represent a node's position in a network's //! Network Coordinates (NC) are a way to represent a node's position in a network's
//! latency space. Nodes with low latency (ping or round trip time) between each //! latency space. Nodes with low latency (ping or round trip time) between each
@@ -19,7 +20,8 @@
//! //!
//! # Usage //! # Usage
//! //!
//! This crate exports a single struct, [`NetworkCoordinate`]. Typical use of Vivaldi NCs for a //! This crate exports a single struct, [`NetworkCoordinate`] and two type aliases
//! ([`NetworkCoordinate2D`] and [`NetworkCoordinate3D`]). Typical use of Vivaldi NCs for a
//! distributed network works like this: //! distributed network works like this:
//! //!
//! 1. Each node in the network has its own instance of [`NetworkCoordinate`]. *See "Note on //! 1. Each node in the network has its own instance of [`NetworkCoordinate`]. *See "Note on
@@ -97,17 +99,5 @@ mod vector;
// publish our interface // publish our interface
pub mod network_coordinate; pub mod network_coordinate;
pub use network_coordinate::NetworkCoordinate; pub use network_coordinate::NetworkCoordinate;
pub use network_coordinate::NetworkCoordinate2D;
// type aliases for convenience pub use network_coordinate::NetworkCoordinate3D;
/// A 2D [`NetworkCoordinate`]. Includes a 2D Euclidean position and a height.
///
/// This type alias is just for convenience. It's functionally equivalent to
/// `NetworkCoordinate<2>`.
pub type NetworkCoordinate2D = NetworkCoordinate<2>;
/// A 3D [`NetworkCoordinate`]. Includes a 3D Euclidean position and a height.
///
/// This type alias is just for convenience. It's functionally equivalent to
/// `NetworkCoordinate<3>`.
pub type NetworkCoordinate3D = NetworkCoordinate<3>;
+14
View File
@@ -56,6 +56,20 @@ pub struct NetworkCoordinate<const N: usize> {
error: f32, error: f32,
} }
// type aliases for convenience
/// A 2D [`NetworkCoordinate`]. Includes a 2D Euclidean position and a height.
///
/// This type alias is just for convenience. It's functionally equivalent to
/// `NetworkCoordinate<2>`.
pub type NetworkCoordinate2D = NetworkCoordinate<2>;
/// A 3D [`NetworkCoordinate`]. Includes a 3D Euclidean position and a height.
///
/// This type alias is just for convenience. It's functionally equivalent to
/// `NetworkCoordinate<3>`.
pub type NetworkCoordinate3D = NetworkCoordinate<3>;
// //
// **** Implementations **** // **** Implementations ****
// //