pub trait HasGeometry {
// Required methods
fn id(&self) -> usize;
fn geometry(&self) -> &Geometry<Float>;
// Provided method
fn reorder(items: ConcreteVec<Self>) -> ConcreteVec<Self>
where Self: Sized + 'static { ... }
}Expand description
A trait for types that have a Geometry.
Helps abstract away this property so the helper methods can be generalized.
Required Methods§
Sourcefn id(&self) -> usize
fn id(&self) -> usize
Get the id of the HasGeometry.
Provided Methods§
Sourcefn reorder(items: ConcreteVec<Self>) -> ConcreteVec<Self>where
Self: Sized + 'static,
fn reorder(items: ConcreteVec<Self>) -> ConcreteVec<Self>where
Self: Sized + 'static,
Impose a canonical order on the items at build time. Defaults to leaving source order alone; override to make lookup results come back in a meaningful order.
A lookup returns candidates in the order their ids appear in the lookup cache, and the
cache is built by walking the items in order — so item order is result order, and it
costs nothing at runtime. An implementation that reorders must rewrite each item’s
id to its new index, because id is the item’s position in this collection.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".