pub struct ScoredItem<N, T> {
pub cost: N,
pub item: T,
}Expand description
Generic struct used to select an item based on a minimum score. Use with std::collections::BinaryHeap for problems requiring Djikstra’s Algorithm or A*
Fields§
§cost: N§item: TTrait Implementations§
Source§impl<N: Clone, T: Clone> Clone for ScoredItem<N, T>
impl<N: Clone, T: Clone> Clone for ScoredItem<N, T>
Source§fn clone(&self) -> ScoredItem<N, T>
fn clone(&self) -> ScoredItem<N, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<N: Ord + PartialOrd, T: Ord + PartialOrd> Ord for ScoredItem<N, T>
impl<N: Ord + PartialOrd, T: Ord + PartialOrd> Ord for ScoredItem<N, T>
Source§fn cmp(&self, other: &ScoredItem<N, T>) -> Ordering
fn cmp(&self, other: &ScoredItem<N, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<N: Ord + PartialOrd, T: Ord + PartialOrd> PartialOrd for ScoredItem<N, T>
impl<N: Ord + PartialOrd, T: Ord + PartialOrd> PartialOrd for ScoredItem<N, T>
impl<N: Copy, T: Copy> Copy for ScoredItem<N, T>
impl<N: Eq, T: Eq> Eq for ScoredItem<N, T>
impl<N, T> StructuralPartialEq for ScoredItem<N, T>
Auto Trait Implementations§
impl<N, T> Freeze for ScoredItem<N, T>
impl<N, T> RefUnwindSafe for ScoredItem<N, T>where
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<N, T> Send for ScoredItem<N, T>
impl<N, T> Sync for ScoredItem<N, T>
impl<N, T> Unpin for ScoredItem<N, T>
impl<N, T> UnwindSafe for ScoredItem<N, T>where
N: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.