Enum texel_types::Bounds
source · pub enum Bounds {
Binding(Position2D, Dimension),
Free(Position2D, Dimension),
}
Expand description
Two dimensional boundary consisting of Position2D
and Dimension
Bounds can be either free standing or binding
Variants§
Binding(Position2D, Dimension)
Binding bounds constrain movement to their area
Free(Position2D, Dimension)
Free standing bounds specify an area but do not constrain
Implementations§
source§impl Bounds
impl Bounds
sourcepub fn point(pos: Position2D) -> Self
pub fn point(pos: Position2D) -> Self
Single point bounds constructor with unit size for given position
sourcepub fn position(&self) -> &Position2D
pub fn position(&self) -> &Position2D
Position component accessor
sourcepub fn contains(&self, other: Position2D) -> bool
pub fn contains(&self, other: Position2D) -> bool
Checks if given coordinates are inside this bounded area
sourcepub fn intersects(&self, pos: Position2D, dim: Dimension) -> bool
pub fn intersects(&self, pos: Position2D, dim: Dimension) -> bool
Calculates rectangular intersection
Trait Implementations§
source§impl IntoIterator for Bounds
impl IntoIterator for Bounds
source§impl PartialEq for Bounds
impl PartialEq for Bounds
source§impl Sub<Position2D> for Bounds
impl Sub<Position2D> for Bounds
impl Copy for Bounds
impl Eq for Bounds
impl StructuralPartialEq for Bounds
Auto Trait Implementations§
impl RefUnwindSafe for Bounds
impl Send for Bounds
impl Sync for Bounds
impl Unpin for Bounds
impl UnwindSafe for Bounds
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