geometry/intersect.rs
1//! Intersections of geometric objects.
2
3/// Trait for calculating the intersection with another geometric object.
4pub trait Intersect<T: ?Sized> {
5 /// The type of the output shape representing the intersection.
6 type Output;
7 /// Calculates the intersection of this shape with `other`.
8 ///
9 /// If no part of this shape lies within `other`,
10 /// returns [`None`].
11 fn intersect(&self, other: &T) -> Option<Self::Output>;
12}