w_inter/
traits.rs

1use std::ops::Add;
2
3/// If a type is `Interval`, it has bounds over a 1-dimensional domain.
4pub trait Interval<Time: Ord> {
5  fn start(&self) -> Time;
6  fn end(&self) -> Time;
7}
8
9/// If a type is `Weighted`, it has some number-like value associated with it.
10pub trait Weighted<Weight: Ord + Add> {
11  fn weight(&self) -> Weight;
12}