Simple trend detection for Rust.
Compare two ordered values and classify the result as:
Trend::Rising
Trend::Falling
Trend::Stable
use trends::TrendExt; let trend = 10.to_trend(&20); assert!(trend.is_rising()); assert_eq!(trend.direction(), 1);
Works with any T: Ord.
T: Ord