pub struct Rect {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}Expand description
A rectangle.
Fields§
§x: f64§y: f64§width: f64§height: f64Implementations§
Source§impl Rect
impl Rect
pub fn new(x: f64, y: f64, width: f64, height: f64) -> Self
pub fn from_points(x1: f64, y1: f64, x2: f64, y2: f64) -> Self
pub fn contains(&self, px: f64, py: f64) -> bool
pub fn intersects(&self, other: &Self) -> bool
pub fn union(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Option<Self>
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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