use std::cmp::Ordering;12/// A pair which is ordered exclusively by the first element.3#[derive(Copy, Clone, Debug)]4pub struct Priority<P, T>(pub P, pub T);56impl<P: Ord + Eq, T> Ord for Priority<P, T> {7fn cmp(&self, other: &Self) -> Ordering {8self.0.cmp(&other.0)9}10}1112impl<P: Ord + Eq, T> PartialOrd for Priority<P, T> {13fn partial_cmp(&self, other: &Self) -> Option<Ordering> {14Some(self.cmp(other))15}16}1718impl<P: Eq, T> PartialEq for Priority<P, T> {19fn eq(&self, other: &Self) -> bool {20self.0 == other.021}22}2324impl<P: Eq, T> Eq for Priority<P, T> {}252627