Skip to main content

Segment

Trait Segment 

Source
pub trait Segment: Geometry<Kind = SegmentTag> + IndexedAccess { }
Expand description

A two-point segment.

Models doc/concept/segment.qbk — equivalent in C++ to the trait specialisations on model::segment in boost/geometry/geometries/segment.hpp:119-183. Implementers provide IndexedAccess for I ∈ {0, 1}, where 0 is the start endpoint and 1 is the end endpoint. The endpoints can but need not be materialised as Point values; segment_start / segment_end reconstruct them from the indexed accessors on demand.

§Examples

use geometry_trait::Segment;
fn _accepts<S: Segment>(_s: &S) {}

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§