Tuple Fields
0: Point<N>
1: Size<N>
Implementations
sourceimpl<N: Num> Rect<N>
impl<N: Num> Rect<N>
pub fn new_zero_value() -> Self
pub fn new_from_raw(
bottom_left_x: N,
bottom_left_y: N,
width: N,
height: N
) -> Self
pub fn new(bottom_left: Point<N>, size: Size<N>) -> Self
pub fn new_from_centre(centre: Point<N>, size: Size<N>) -> Self
pub fn new_from_top_left(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_top_right(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_bottom_right(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_bottom_left(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_bottom_centre(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_left_centre(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_top_centre(position: Point<N>, size: Size<N>) -> Self
pub fn new_from_right_centre(position: Point<N>, size: Size<N>) -> Self
pub fn move_xy(&mut self, xy: Point<N>)
pub fn move_x(&mut self, x: N)
pub fn move_y(&mut self, y: N)
pub fn width(&self) -> N
pub fn height(&self) -> N
pub fn area(&self) -> N
pub fn size(&self) -> Size<N>
pub fn bottom_left(&self) -> Point<N>
pub fn bottom_right(&self) -> Point<N>
pub fn top_left(&self) -> Point<N>
pub fn top_right(&self) -> Point<N>
pub fn bottom_centre(&self) -> Point<N>
pub fn top_centre(&self) -> Point<N>
pub fn left_centre(&self) -> Point<N>
pub fn right_centre(&self) -> Point<N>
pub fn top_y(&self) -> N
pub fn bottom_y(&self) -> N
pub fn left_x(&self) -> N
pub fn right_x(&self) -> N
pub fn centre(&self) -> Point<N>
pub fn set_bottom_left(&mut self, xy: Point<N>)
pub fn set_centre(&mut self, xy: Point<N>)
pub fn set_size(&mut self, size: Size<N>)
pub fn overlaps(&self, other: Self) -> bool
pub fn contains_point(&self, point: Point<N>) -> bool
pub fn line_position(&self, other: Line<N>) -> LinePosition
pub fn point_position(&self, other: Point<N>) -> PointPosition
pub fn point_horizontal_position(&self, other: Point<N>) -> HorizontalPosition
pub fn point_vertical_position(&self, other: Point<N>) -> VerticalPosition
pub fn intersect_rect(&self, other: Self) -> Option<Self>
pub fn combine(&self, other: Self) -> Self
pub fn get_scale_diff(&self, other: Self) -> Size<N>
pub fn to<T: Num + From<N>>(&self) -> Rect<T>
pub fn min(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
pub fn centre_to(self, other: Rect<N>) -> Line<N>
pub fn left_edge(self) -> Line<N>
pub fn right_edge(self) -> Line<N>
pub fn top_edge(self) -> Line<N>
pub fn bottom_edge(self) -> Line<N>
pub fn interpolate_to(self, other: Rect<N>, n: N) -> Rect<N>
pub fn round_to_max_size(self) -> Rect<N>
Trait Implementations
sourceimpl<N: Num> AddAssign<Point<N>> for Rect<N>
impl<N: Num> AddAssign<Point<N>> for Rect<N>
sourcefn add_assign(&mut self, other: Point<N>)
fn add_assign(&mut self, other: Point<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> AddAssign<Size<N>> for Rect<N>
impl<N: Num> AddAssign<Size<N>> for Rect<N>
sourcefn add_assign(&mut self, other: Size<N>)
fn add_assign(&mut self, other: Size<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> IntoIterator for Rect<N>
impl<N: Num> IntoIterator for Rect<N>
sourceimpl<N: INum> ShlAssign<N> for Rect<N>
impl<N: INum> ShlAssign<N> for Rect<N>
sourcefn shl_assign(&mut self, other: N)
fn shl_assign(&mut self, other: N)
Performs the <<=
operation. Read more
sourceimpl<N: INum> ShrAssign<N> for Rect<N>
impl<N: INum> ShrAssign<N> for Rect<N>
sourcefn shr_assign(&mut self, other: N)
fn shr_assign(&mut self, other: N)
Performs the >>=
operation. Read more
sourceimpl<N: Num> SubAssign<Point<N>> for Rect<N>
impl<N: Num> SubAssign<Point<N>> for Rect<N>
sourcefn sub_assign(&mut self, other: Point<N>)
fn sub_assign(&mut self, other: Point<N>)
Performs the -=
operation. Read more
sourceimpl<N: Num> SubAssign<Size<N>> for Rect<N>
impl<N: Num> SubAssign<Size<N>> for Rect<N>
sourcefn sub_assign(&mut self, other: Size<N>)
fn sub_assign(&mut self, other: Size<N>)
Performs the -=
operation. Read more
sourceimpl<O: Num, N: Num + ToRounded<O>> ToRounded<Rect<O>> for Rect<N>
impl<O: Num, N: Num + ToRounded<O>> ToRounded<Rect<O>> for Rect<N>
sourcefn to_rounded(self) -> Rect<O>
fn to_rounded(self) -> Rect<O>
Returns the value in the new type, but clamped.
impl<N: Copy + Num> Copy for Rect<N>
impl<N: Num> StructuralPartialEq for Rect<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Rect<N> where
N: RefUnwindSafe,
impl<N> Send for Rect<N> where
N: Send,
impl<N> Sync for Rect<N> where
N: Sync,
impl<N> Unpin for Rect<N> where
N: Unpin,
impl<N> UnwindSafe for Rect<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more