Struct Rect
pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
§impl Rect
impl Rect
pub const ZERO: Rect
pub const fn new(x: f64, y: f64, width: f64, height: f64) -> Rect
pub fn from_size(size: Size) -> Rect
pub fn min_x(&self) -> f64
pub fn min_y(&self) -> f64
pub fn max_x(&self) -> f64
pub fn max_y(&self) -> f64
pub fn center(&self) -> Point
pub fn inset(&self, d: f64) -> Rect
pub fn inset_by(&self, i: Insets) -> Rect
pub fn intersects(&self, other: &Rect) -> bool
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 UnsafeUnpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more