pub trait LengthStrategy<G: Geometry> {
type Out: CoordinateScalar;
// Required method
fn length(&self, g: &G) -> Self::Out;
}Expand description
A strategy for computing the length of a sequence of points.
Mirrors the per-CS length-strategy concept declared in
boost/geometry/strategies/length/services.hpp and refined per
coordinate system in strategies/length/{cartesian,spherical, geographic}.hpp. The Boost concept exposes a distance(p1, p2)
helper that hands the algorithm a point-to-point distance kernel;
the Rust analogue collapses the two layers (strategy + algorithm
walk) into a single method LengthStrategy::length keyed on the
geometry type, because the walk shape is identical for every CS —
only the inner distance kernel changes.
§Associated items
Self::Out— the scalar the length comes back as. Equivalent to Boost’sdefault_length_result<Geometry>::type(strategies/default_length_result.hpp); typically the coordinate scalar ofG’s point type.
Required Associated Types§
Sourcetype Out: CoordinateScalar
type Out: CoordinateScalar
The output scalar type. Typically the geometry’s coordinate
scalar. Mirrors default_length_result<G>::type from
strategies/default_length_result.hpp.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".