pub trait BinaryHeapCtx<Element> {
    // Required method
    fn lt(&mut self, x: &Element, y: &Element) -> bool;

    // Provided method
    fn on_move(&mut self, e: &mut Element, new_index: usize) { ... }
}
Expand description

Context type for BinaryHeap’s operations.

Required Methods§

source

fn lt(&mut self, x: &Element, y: &Element) -> bool

Return true iff x < y.

Provided Methods§

source

fn on_move(&mut self, e: &mut Element, new_index: usize)

Called when the element e is moved to the new position new_index.

Implementations on Foreign Types§

source§

impl<T: Ord + PartialOrd> BinaryHeapCtx<T> for ()

source§

const fn lt(&mut self, x: &T, y: &T) -> bool

Implementors§