Trait aoclib::geometry::point::PointTrait
source · pub trait PointTrait: Copy + Eq {
type N;
// Required methods
fn manhattan(self) -> Self::N;
fn decr(self) -> Self;
fn incr(self) -> Self;
fn inclusive_range(min: Self, max: Self) -> Box<dyn Iterator<Item = Self>>;
fn boundary_min(self, other: Self) -> Self;
fn boundary_max(self, other: Self) -> Self;
fn volume<T>(self) -> T
where T: From<Self::N> + Mul<Output = T>;
// Provided method
fn adjacent(self) -> Box<dyn Iterator<Item = Self>>
where Self: 'static { ... }
}
Required Associated Types§
Required Methods§
sourcefn inclusive_range(min: Self, max: Self) -> Box<dyn Iterator<Item = Self>>
fn inclusive_range(min: Self, max: Self) -> Box<dyn Iterator<Item = Self>>
Generate all points inclusively bounded by min
and max
.
sourcefn boundary_min(self, other: Self) -> Self
fn boundary_min(self, other: Self) -> Self
Return the boundary minimum between self
and other
.
This is defined as a new point with each component defined by self.component.min(other.component)
.
sourcefn boundary_max(self, other: Self) -> Self
fn boundary_max(self, other: Self) -> Self
Return the boundary maximum between self
and other
.
This is defined as a new point with each component defined by self.component.max(other.component)
.
Provided Methods§
sourcefn adjacent(self) -> Box<dyn Iterator<Item = Self>>where
Self: 'static,
fn adjacent(self) -> Box<dyn Iterator<Item = Self>>where Self: 'static,
Iterate over points adjacent to this point.
This includes diagonals, and excludes the center.
The implementation should always return a constant number of items, even if
for simplicity it does not implement ExactSizeIterator
.