pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
Source§impl Rect
impl Rect
pub const ZERO: Self
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub const fn from_origin_size(origin: Point, size: Size) -> Self
pub fn from_points(min: Point, max: Point) -> Self
pub const fn x(self) -> f32
pub const fn y(self) -> f32
pub const fn width(self) -> f32
pub const fn height(self) -> f32
pub fn max_x(self) -> f32
pub fn max_y(self) -> f32
pub fn is_empty(self) -> bool
pub fn contains(self, point: Point) -> bool
pub fn translate(self, delta: Vector) -> Self
pub fn inflate(self, x: f32, y: f32) -> Self
pub fn intersection(self, other: Rect) -> Option<Self>
pub fn union(self, other: Rect) -> Self
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Forget for Rect
impl Freeze for Rect
impl Move 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