pub struct RankedNodes<'a, T: Eq + Hash + Clone> { /* private fields */ }Expand description
Holds the result of a ranking algorithm that was run on a Graph.
Implementations§
Source§impl<'a, T: Eq + Hash + Clone> RankedNodes<'a, T>
impl<'a, T: Eq + Hash + Clone> RankedNodes<'a, T>
Sourcepub fn hash_map(&self) -> HashMap<T, f32>
pub fn hash_map(&self) -> HashMap<T, f32>
Returns a hash map that maps node data to the resulting score
Sourcepub fn unsorted_iter(&'a self) -> UnsortedRankedNodesIter<'a, T> ⓘ
pub fn unsorted_iter(&'a self) -> UnsortedRankedNodesIter<'a, T> ⓘ
Returns an unsorted iterator over all nodes and their scores (&data, score).
This is useful for building maps and filtering by data aspects before sorting.
Sourcepub fn sorted_iter(&'a self) -> SortedRankedNodesIter<'a, T> ⓘ
pub fn sorted_iter(&'a self) -> SortedRankedNodesIter<'a, T> ⓘ
Returns a sorted iterator over all nodes and their scores (&data, score).
The highest scores are sorted first.
This is useful for getting the top n results of the ranking.
Sourcepub fn get_score_for(&self, data: &T) -> Option<f32>
pub fn get_score_for(&self, data: &T) -> Option<f32>
Convenience function to look the score of a single data point
This is useful if one only needs the scores for a few specific data points.
Auto Trait Implementations§
impl<'a, T> Freeze for RankedNodes<'a, T>
impl<'a, T> RefUnwindSafe for RankedNodes<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for RankedNodes<'a, T>where
T: Sync,
impl<'a, T> Sync for RankedNodes<'a, T>where
T: Sync,
impl<'a, T> Unpin for RankedNodes<'a, T>
impl<'a, T> UnwindSafe for RankedNodes<'a, T>where
T: RefUnwindSafe,
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