pub struct HeapEntry<K: Ord, R> {
pub key: K,
pub index: usize,
pub record: R,
}Expand description
One candidate in a bounded top-K stream. key carries every tie-break the equivalent
full-materialize-then-sort_by code would apply; index is always the final tiebreak
layer, reproducing sort_by’s stability – which a heap has no notion of on its own, since
two records can otherwise agree on every field key compares. record is left generic (R)
rather than fixed to any one domain’s row type, so this heap is reusable outside shogiesa.
Fields§
§key: K§index: usize§record: RTrait Implementations§
impl<K: Ord, R> Eq for HeapEntry<K, R>
Source§impl<K: Ord, R> Ord for HeapEntry<K, R>
impl<K: Ord, R> Ord for HeapEntry<K, R>
1.21.0 (const: unstable) · 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<K: Ord, R> PartialOrd for HeapEntry<K, R>
impl<K: Ord, R> PartialOrd for HeapEntry<K, R>
Auto Trait Implementations§
impl<K, R> Freeze for HeapEntry<K, R>
impl<K, R> RefUnwindSafe for HeapEntry<K, R>where
K: RefUnwindSafe,
R: RefUnwindSafe,
impl<K, R> Send for HeapEntry<K, R>
impl<K, R> Sync for HeapEntry<K, R>
impl<K, R> Unpin for HeapEntry<K, R>
impl<K, R> UnsafeUnpin for HeapEntry<K, R>where
K: UnsafeUnpin,
R: UnsafeUnpin,
impl<K, R> UnwindSafe for HeapEntry<K, R>where
K: UnwindSafe,
R: 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