Trait graph::Coords

source ·
pub trait Coords {
    // Required methods
    fn get_x(&self) -> f32;
    fn get_y(&self) -> f32;
}
Expand description

A trait to extract the coordinates of a node.

Required Methods§

source

fn get_x(&self) -> f32

Get the x coordinate of the node

source

fn get_y(&self) -> f32

Get the y coordinate of the node

Implementations on Foreign Types§

source§

impl Coords for ()

Implement the Coords trait for the unit type.

Since there’s no data 0. is returned

source§

fn get_x(&self) -> f32

source§

fn get_y(&self) -> f32

source§

impl Coords for (f32, f32)

Implement the Coords trait for all tuples (f32, f32).

When a Graph has the generic N type bound to (f32, f32) we can call the various distance methods on the nodes.

source§

fn get_x(&self) -> f32

source§

fn get_y(&self) -> f32

Implementors§