Skip to main content

Vertex

Trait Vertex 

Source
pub trait Vertex: Copy + PartialEq {
    // Required methods
    fn position(&self) -> Coord<i32>;
    fn with_position(self, position: Coord<i32>) -> Self;
}
Expand description

A polyline vertex the slicer can clip: an integer position plus an opaque Copy + PartialEq payload that is preserved verbatim through slicing and merging.

Required Methods§

Source

fn position(&self) -> Coord<i32>

The integer (x, y) used for every clipping and tiling decision.

Source

fn with_position(self, position: Coord<i32>) -> Self

A copy of self moved to position, keeping the payload unchanged. Used to re-express a vertex in a tile-local frame (position − origin).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Vertex for Coord<i32>

Source§

fn position(&self) -> Coord<i32>

Source§

fn with_position(self, position: Coord<i32>) -> Self

Implementors§