#[repr(C)]pub struct Rect {
pub min: Point,
pub max: Point,
}Expand description
Defined by minimum and maximum corner points.
Fields§
§min: Point§max: PointImplementations§
Source§impl Rect
impl Rect
pub const fn new(min: Point, max: Point) -> Self
pub const fn from_coords(min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> Self
pub fn center(self) -> Point
Sourcepub fn expand_point(self, point: Point) -> Rect
pub fn expand_point(self, point: Point) -> Rect
Expands to include point.
pub fn intersects_rect(self, other: Rect) -> bool
pub fn intersects_point(self, point: Point) -> bool
pub fn width(self) -> f64
pub fn height(self) -> f64
pub fn area(self) -> f64
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 UnwindSafe for Rect
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)