pub struct Rect<T> {
pub point: Point<T>,
pub size: Size<T>,
}
Fields§
§point: Point<T>
§size: Size<T>
Implementations§
Source§impl<T> Rect<T>
impl<T> Rect<T>
pub fn new(x: T, y: T, width: T, height: T) -> Self
pub fn from_bounds(left: T, top: T, right: T, bottom: T) -> Self
pub fn standardize(&self)
pub fn is_empty(&self) -> bool
pub fn is_null(&self) -> bool
pub fn offset(&self, dx: T, dy: T) -> Rect<T>
pub fn inflate(&self, dx: T, dy: T) -> Rect<T>
pub fn deflate(&self, dx: T, dy: T) -> Rect<T>
pub fn contains_point(&self, point: Point<T>) -> bool
pub fn contains_rect(&self, rect: Rect<T>) -> bool
pub fn intersects(&self, rect: Rect<T>) -> bool
pub fn union(&self, rect: Rect<T>) -> Option<Rect<T>>
pub fn intersection(&self, rect: Rect<T>) -> Option<Rect<T>>
Trait Implementations§
impl<T: Copy> Copy for Rect<T>
impl<T> StructuralPartialEq for Rect<T>
Auto Trait Implementations§
impl<T> Freeze for Rect<T>where
T: Freeze,
impl<T> RefUnwindSafe for Rect<T>where
T: RefUnwindSafe,
impl<T> Send for Rect<T>where
T: Send,
impl<T> Sync for Rect<T>where
T: Sync,
impl<T> Unpin for Rect<T>where
T: Unpin,
impl<T> UnwindSafe for Rect<T>where
T: UnwindSafe,
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