pub trait Indexable {
// Required method
fn bounds(&self) -> Bounds;
}Expand description
A value the Rtree can index — one that exposes an
axis-aligned bounding box.
Mirrors boost::geometry::index::indexable<Value>
(index/indexable.hpp). Implemented for the kernel’s point type and
for Bounds itself; wrap any other payload in a (Bounds, T)
pair, which is also Indexable, to index it by a precomputed box.
§Examples
use geometry_cs::Cartesian;
use geometry_model::Point2D;
use geometry_rtree::indexable::Indexable;
let p = Point2D::<f64, Cartesian>::new(3.0, 4.0);
let b = p.bounds();
assert_eq!(b.min, [3.0, 4.0]);
assert_eq!(b.max, [3.0, 4.0]);Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T> Indexable for (Bounds, T)
Index an arbitrary payload T by a precomputed box. The tree stores
the pair and reads the box from .0.
impl<T> Indexable for (Bounds, T)
Index an arbitrary payload T by a precomputed box. The tree stores
the pair and reads the box from .0.