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
other
is entirely contained, returnsContainment::Full
. - If
other
is only partially contained, returnsContainment::Partial
. - If no part of
other
lies 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.