ndgrid/traits/
geometry.rs1use crate::types::Scalar;
3
4pub trait Point {
6 type T: Scalar;
8
9 fn index(&self) -> usize;
11
12 fn dim(&self) -> usize;
14
15 fn coords(&self, data: &mut [Self::T]);
17}
18
19pub trait Geometry {
23 type T: Scalar;
25
26 type Point<'a>: Point<T = Self::T>
28 where
29 Self: 'a;
30
31 type PointIter<'a>: Iterator<Item = Self::Point<'a>>
33 where
34 Self: 'a;
35
36 fn points(&self) -> Self::PointIter<'_>;
38
39 fn point_count(&self) -> usize;
41
42 fn degree(&self) -> usize;
44}