pub trait Contains<T> {
// Required method
fn contains(&self, other: &T) -> Containment;
// Provided methods
fn encloses(&self, other: &T) -> bool { ... }
fn partially_intersects(&self, other: &T) -> bool { ... }
}Expand description
Provides information on whether a shape contains another shape.
Required Methods§
Sourcefn contains(&self, other: &T) -> Containment
fn contains(&self, other: &T) -> Containment
Returns a Containment indicating how other is enclosed within this shape.
- If
otheris entirely contained, returnsContainment::Full. - If
otheris only partially contained, returnsContainment::Partial. - If no part of
otherlies within this shape, returnsContainment::None.
Provided Methods§
Sourcefn partially_intersects(&self, other: &T) -> bool
fn partially_intersects(&self, other: &T) -> bool
Returns true if other is fully or partially enclosed in this shape.