pub struct DisplayRect {
pub x: i32,
pub y: i32,
pub width: i32,
pub height: i32,
}Expand description
Physical-pixel rectangle in virtual-desktop coordinates.
x/y are the rectangle’s top-left corner; width/height are always
non-negative for real displays (the constructor does not enforce it so
tests and fixtures can model hostile data).
Fields§
§x: i32Left edge in virtual-desktop pixels.
y: i32Top edge in virtual-desktop pixels.
width: i32Width in pixels.
height: i32Height in pixels.
Implementations§
Source§impl DisplayRect
impl DisplayRect
Sourcepub const fn new(x: i32, y: i32, width: i32, height: i32) -> Self
pub const fn new(x: i32, y: i32, width: i32, height: i32) -> Self
Creates a rectangle from its top-left corner and size.
Sourcepub fn contains(&self, x: i32, y: i32) -> bool
pub fn contains(&self, x: i32, y: i32) -> bool
Returns true when (x, y) lies inside the half-open rectangle.
Sourcepub fn contains_rect(&self, other: &DisplayRect) -> bool
pub fn contains_rect(&self, other: &DisplayRect) -> bool
Returns true when other lies entirely inside self.
Trait Implementations§
Source§impl Clone for DisplayRect
impl Clone for DisplayRect
impl Copy for DisplayRect
Source§impl Debug for DisplayRect
impl Debug for DisplayRect
Source§impl Default for DisplayRect
impl Default for DisplayRect
Source§impl Display for DisplayRect
Available on crate feature displays only.
impl Display for DisplayRect
Available on crate feature
displays only.impl Eq for DisplayRect
Source§impl PartialEq for DisplayRect
impl PartialEq for DisplayRect
impl StructuralPartialEq for DisplayRect
Auto Trait Implementations§
impl Forget for DisplayRect
impl Freeze for DisplayRect
impl Move for DisplayRect
impl RefUnwindSafe for DisplayRect
impl Send for DisplayRect
impl Sync for DisplayRect
impl Unpin for DisplayRect
impl UnsafeUnpin for DisplayRect
impl UnwindSafe for DisplayRect
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