Skip to main content

geometry_trait/
lib.rs

1//! Geometry concepts as Rust traits. One trait per `doc/concept/*.qbk`.
2//!
3//! Mirrors `boost/geometry/core/{access,tag,coordinate_type,
4//! coordinate_dimension,coordinate_system}.hpp` and the
5//! `boost/geometry/geometries/concepts/*_concept.hpp` headers.
6//!
7//! v1 surface — only the [`Geometry`] super-trait and the [`Point`]
8//! concept land here. Subsequent tasks add `Box`, `Segment`,
9//! `Linestring`, `Ring`, `Polygon`, and the multi / collection
10//! concepts as siblings of [`Point`].
11
12#![cfg_attr(not(feature = "std"), no_std)]
13#![forbid(unsafe_code)]
14
15mod boxg;
16mod check;
17mod closure;
18mod collection;
19mod geometry;
20mod indexed_access;
21mod linestring;
22mod multi;
23mod point;
24mod point_order;
25mod polygon;
26mod polyhedral;
27mod ring;
28mod segment;
29
30pub use boxg::{Box, box_max, box_min};
31pub use check::{
32    check_box, check_geometry_collection, check_indexed_access, check_linestring,
33    check_multi_linestring, check_multi_point, check_multi_polygon, check_point, check_polygon,
34    check_polyhedral_surface, check_ring, check_segment,
35};
36pub use closure::Closure;
37pub use collection::GeometryCollection;
38pub use geometry::Geometry;
39pub use indexed_access::{IndexedAccess, corner};
40pub use linestring::Linestring;
41pub use multi::{MultiLinestring, MultiPoint, MultiPolygon};
42pub use point::{Point, PointMut, fold_dims};
43pub use point_order::PointOrder;
44pub use polygon::Polygon;
45pub use polyhedral::PolyhedralSurface;
46pub use ring::Ring;
47pub use segment::{Segment, segment_end, segment_start};
48
49// Re-export tags and tag-hierarchy markers so a downstream `impl Point`
50// (or any other concept impl) has a single import path.
51pub use geometry_tag::{
52    Areal, BoxTag, GeometryCollectionTag, Linear, LinestringTag, Multi, MultiLinestringTag,
53    MultiPointTag, MultiPolygonTag, PointTag, Pointlike, PolygonTag, Polygonal,
54    PolyhedralSurfaceTag, Polylinear, RingTag, SameAs, SegmentTag, Single, Volumetric,
55};