pub trait CentroidStrategy<G: Geometry> {
type Output: PointMut + Default;
// Required method
fn centroid(&self, g: &G) -> Self::Output;
}Expand description
A strategy for computing the centroid of G.
Mirrors the per-CS centroid-strategy concept from
boost/geometry/strategies/centroid/services.hpp. The Boost concept
exposes a stateful apply(p1, p2, state) accumulator plus a
result(state) reduction (see
strategies/cartesian/centroid_bashein_detmer.hpp:173-231); the Rust
analogue collapses the two phases into a single method
CentroidStrategy::centroid keyed on the geometry type.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".