Skip to main content

HasPosition

Trait HasPosition 

Source
pub trait HasPosition {
    type Scalar: SpadeNum;

    // Required method
    fn position(&self) -> Point2<Self::Scalar>;
}
Expand description

An object with a position.

Vertices need to implement this trait to allow being inserted into triangulations.

Required Associated Types§

Source

type Scalar: SpadeNum

The number type used by this coordinate type.

Required Methods§

Source

fn position(&self) -> Point2<Self::Scalar>

Returns the position of this object.

Note: It is assumed that the position doesn’t change once it has been inserted into a triangulation. Failing this requirement can lead to crashes, invalid results or endless loops.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§