Struct petgraph::MinScored [−] [src]

pub struct MinScored<K, T>(pub K, pub T);

MinScored<K, T> holds a score K and a scored object T in a pair for use with a BinaryHeap.

MinScored compares in reverse order by the score, so that we can use BinaryHeap as a min-heap to extract the score-value pair with the least score.

Note: MinScored implements a total order (Ord), so that it is possible to use float types as scores.

Trait Implementations

impl<K: PartialOrd, T> PartialEq for MinScored<K, T>

fn eq(&self, other: &MinScored<K, T>) -> bool

fn ne(&self, other: &Rhs) -> bool

impl<K: PartialOrd, T> Eq for MinScored<K, T>

impl<K: PartialOrd, T> PartialOrd for MinScored<K, T>

fn partial_cmp(&self, other: &MinScored<K, T>) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl<K: PartialOrd, T> Ord for MinScored<K, T>

fn cmp(&self, other: &MinScored<K, T>) -> Ordering

Derived Implementations

impl<K: Debug, T: Debug> Debug for MinScored<K, T> where K: Debug, T: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<K: Clone, T: Clone> Clone for MinScored<K, T> where K: Clone, T: Clone

fn clone(&self) -> MinScored<K, T>

fn clone_from(&mut self, source: &Self)

impl<K: Copy, T: Copy> Copy for MinScored<K, T> where K: Copy, T: Copy