pub enum ContainsResult {
No,
OnBounds,
WithinBounds,
}
Expand description
This is a result type for containment checks.
No
Not inside.OnBounds
Lies on the boundaries.WithinBounds
Fully inside.
Variants§
No
Does not contain the point.
OnBounds
Contains the point but on the borders/end-points.
WithinBounds
Fully contains the point.
Implementations§
Source§impl ContainsResult
impl ContainsResult
Sourcepub fn is_within_bounds(&self) -> bool
pub fn is_within_bounds(&self) -> bool
Tells if the point is contained but does not lie on the bounds.
Sourcepub fn inclusive_bounds(&self) -> bool
pub fn inclusive_bounds(&self) -> bool
Tells if the point is contained or lies on the bounds.
Sourcepub fn on_bounds(&self) -> bool
pub fn on_bounds(&self) -> bool
Check if the point neither is on the bounds nor within the bounds.
Sourcepub fn max(self, other: ContainsResult) -> ContainsResult
pub fn max(self, other: ContainsResult) -> ContainsResult
Returns the stronger result of the both.
Ordering from weak to strong is No
, OnBounds
, WithinBounds
Sourcepub fn min(self, other: ContainsResult) -> ContainsResult
pub fn min(self, other: ContainsResult) -> ContainsResult
Returns the weaker result of the both.
Ordering from weak to strong is No
, OnBounds
, WithinBounds
Trait Implementations§
Source§impl Clone for ContainsResult
impl Clone for ContainsResult
Source§fn clone(&self) -> ContainsResult
fn clone(&self) -> ContainsResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContainsResult
impl Debug for ContainsResult
Source§impl PartialEq for ContainsResult
impl PartialEq for ContainsResult
impl Copy for ContainsResult
impl Eq for ContainsResult
impl StructuralPartialEq for ContainsResult
Auto Trait Implementations§
impl Freeze for ContainsResult
impl RefUnwindSafe for ContainsResult
impl Send for ContainsResult
impl Sync for ContainsResult
impl Unpin for ContainsResult
impl UnwindSafe for ContainsResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more