diff --git a/Cargo.toml b/Cargo.toml index 9795e3e..526e939 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "vivaldi-nc" -version = "0.5.0" +version = "0.5.1" edition = "2021" authors = ["Stephen Waits "] description = "Vivaldi network coordinates for fast, distributed latency estimates in multinode networks, with a clean and simple interface." diff --git a/src/lib.rs b/src/lib.rs index 54d98f7..81db139 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 //! latency space. Nodes with low latency (ping or round trip time) between each @@ -19,7 +20,8 @@ //! //! # 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: //! //! 1. Each node in the network has its own instance of [`NetworkCoordinate`]. *See "Note on @@ -97,17 +99,5 @@ mod vector; // publish our interface pub mod network_coordinate; pub use network_coordinate::NetworkCoordinate; - -// 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>; +pub use network_coordinate::NetworkCoordinate2D; +pub use network_coordinate::NetworkCoordinate3D; diff --git a/src/network_coordinate.rs b/src/network_coordinate.rs index 10654b3..f242b4f 100644 --- a/src/network_coordinate.rs +++ b/src/network_coordinate.rs @@ -56,6 +56,20 @@ pub struct NetworkCoordinate { 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 **** //