pub struct Rect {
pub x: u16,
pub y: u16,
pub width: u16,
pub height: u16,
}Fields§
§x: u16§y: u16§width: u16§height: u16Implementations§
Source§impl Rect
impl Rect
pub const fn new(x: u16, y: u16, width: u16, height: u16) -> Self
pub const fn right(self) -> u16
pub const fn bottom(self) -> u16
pub const fn is_empty(self) -> bool
pub const fn intersects(self, other: Self) -> bool
pub fn intersection(self, other: Self) -> Option<Self>
pub const fn contains(self, other: Self) -> bool
pub const fn can_merge_rect(self, other: Self) -> bool
pub fn union(self, other: Self) -> Self
pub fn shrink(self, amount: u16) -> Self
pub fn inset(self, padding: Padding) -> Self
Trait Implementations§
impl Copy for Rect
impl Eq 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