PriorityQueueElement

Trait PriorityQueueElement 

Source
pub trait PriorityQueueElement:
    Ord
    + Copy
    + Sized {
    type Point;
    type Dist: Add<Output = Self::Dist>;

    // Required methods
    fn init(_: Self::Point, _: Self::Dist) -> Self;
    fn point(&self) -> Self::Point;
    fn dist(&self) -> Self::Dist;
}
Expand description

Element of a priority queue.

Required Associated Types§

Source

type Point

“Point”, “node”, or “vertex” type.

Source

type Dist: Add<Output = Self::Dist>

Type for the distance or “value” of the point.

Required Methods§

Source

fn init(_: Self::Point, _: Self::Dist) -> Self

Source

fn point(&self) -> Self::Point

Source

fn dist(&self) -> Self::Dist

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Point, Value> PriorityQueueElement for PqElement<Point, Value>
where Point: Copy, Value: Copy + Add<Output = Value> + Ord,

Source§

type Point = Point

Source§

type Dist = Value