Skip to main content

Geometry

Trait Geometry 

Source
pub trait Geometry {
    type Kind;
    type Point: Point;
}
Expand description

Every modelled geometry has a kind (its tag) and a point type it is built from.

Kind matches boost::geometry::traits::tag<G>::type (boost/geometry/core/tag.hpp); Point matches boost::geometry::traits::point_type<G>::type (boost/geometry/core/point_type.hpp). For a value whose own kind is geometry_tag::PointTag, the Point projection is Self.

§Examples

Dispatch on the geometry kind via the Kind associated type:

use geometry_tag::PointTag;
use geometry_trait::Geometry;

fn is_point<G: Geometry<Kind = PointTag>>(_g: &G) {}

Required Associated Types§

Source

type Kind

One of the *Tag types from geometry_tag.

Mirrors boost::geometry::traits::tag<G>::type (boost/geometry/core/tag.hpp).

Source

type Point: Point

The point type this geometry is built from. For a value modelling Point, this is Self.

Mirrors boost::geometry::traits::point_type<G>::type (boost/geometry/core/point_type.hpp).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§