pub struct Rect {
pub top_left: Point,
pub bottom_right: Point,
}
Fields§
§top_left: Point
§bottom_right: Point
Implementations§
Source§impl Rect
impl Rect
pub fn centered_with_radius(p1: &Point, radius: f32) -> Rect
pub fn from_points(p1: &Point, p2: &Point) -> Rect
pub fn from_point_and_size(point: &Point, size: &Vector) -> Rect
pub fn null() -> Rect
pub fn null_at(point: &Point) -> Rect
pub fn expand(&self, left: f32, top: f32, right: f32, bottom: f32) -> Rect
pub fn width(&self) -> f32
pub fn height(&self) -> f32
pub fn top_left(&self) -> Point
pub fn bottom_right(&self) -> Point
pub fn bottom_left(&self) -> Point
pub fn top_right(&self) -> Point
pub fn expanded_by(&self, point: &Point) -> Rect
pub fn is_null(&self) -> bool
pub fn expand_to_include(&mut self, point: &Point)
pub fn union_with(&self, other: &Rect) -> Rect
pub fn contains(&self, p: &Point) -> bool
pub fn does_intersect(&self, other: &Rect) -> bool
pub fn intersect_with(&self, other: &Rect) -> Rect
pub fn midpoint(&self) -> Point
pub fn split_quad(&self) -> [Rect; 4]
pub fn close_to(&self, other: &Rect, epsilon: f32) -> bool
Trait Implementations§
Source§impl PartialOrd for Rect
impl PartialOrd for Rect
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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