pub struct Rect<T: Copy> { /* private fields */ }Expand description
Implementations§
Source§impl<T: Copy> Rect<T>
impl<T: Copy> Rect<T>
Source§impl<T: Copy + Ord> Rect<T>
若启用perffeature,以下方法将不会进行标准化检查,以提高性能
impl<T: Copy + Ord> Rect<T>
若启用perffeature,以下方法将不会进行标准化检查,以提高性能
Sourcepub fn set_bottom(&mut self, bottom: T)
pub fn set_bottom(&mut self, bottom: T)
设置矩形的下边界坐标
Sourcepub fn set_left_top(&mut self, left: T, top: T)
pub fn set_left_top(&mut self, left: T, top: T)
设置矩形的左上角坐标
Sourcepub fn set_right_top(&mut self, right: T, top: T)
pub fn set_right_top(&mut self, right: T, top: T)
设置矩形的右上角坐标
Sourcepub fn set_left_bottom(&mut self, left: T, bottom: T)
pub fn set_left_bottom(&mut self, left: T, bottom: T)
设置矩形的左下角坐标
Sourcepub fn set_right_bottom(&mut self, right: T, bottom: T)
pub fn set_right_bottom(&mut self, right: T, bottom: T)
设置矩形的右下角坐标
Source§impl<T: Copy + Ord> Rect<T>
impl<T: Copy + Ord> Rect<T>
Sourcepub fn contains_with_bound(&self, point: Point<T>) -> bool
pub fn contains_with_bound(&self, point: Point<T>) -> bool
Sourcepub fn intersects(&self, other: &Rect<T>) -> bool
pub fn intersects(&self, other: &Rect<T>) -> bool
判断此矩形与另一个矩形是否存在交集
如果另一个矩形与此矩形存在公共区域,则返回 true
Sourcepub fn intersected(&self, other: &Self) -> Option<Self>
pub fn intersected(&self, other: &Self) -> Option<Self>
Trait Implementations§
impl<T: Copy + Copy> Copy for Rect<T>
impl<T: Eq + Copy> Eq for Rect<T>
impl<T: Copy> 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