pub trait Geometry {
// Required methods
fn bbox(&self) -> Option<Rect>;
fn is_areal(&self) -> bool;
fn visit_segments(&self, f: &mut dyn FnMut(Point, Point));
fn locate(&self, p: Point) -> Location;
fn any_point(&self) -> Option<Point>;
// Provided methods
fn component_points(&self, f: &mut dyn FnMut(Point)) { ... }
fn first_not_outside(&self, pts: &[Point]) -> Option<Point> { ... }
}Expand description
Required Methods§
Sourcefn is_areal(&self) -> bool
fn is_areal(&self) -> bool
true for regions (rings, polygons), false for points and linear geometries.
Sourcefn visit_segments(&self, f: &mut dyn FnMut(Point, Point))
fn visit_segments(&self, f: &mut dyn FnMut(Point, Point))
Calls f for every boundary segment (areal) or every segment (linear). A point
geometry yields one degenerate segment (p, p); so does a single-vertex path.
Provided Methods§
Sourcefn component_points(&self, f: &mut dyn FnMut(Point))
fn component_points(&self, f: &mut dyn FnMut(Point))
Calls f with one vertex of every connected component (every polygon of a set,
every outer ring of a tree). Single-component geometries use any_point.
Sourcefn first_not_outside(&self, pts: &[Point]) -> Option<Point>
fn first_not_outside(&self, pts: &[Point]) -> Option<Point>
The first of pts that is not outside this geometry, if any. Geometries made of many
parts override this with a spatial index.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".