pub struct Rect<C> {
pub top_left: CoordPair<C>,
pub size: CoordPair<C>,
}
Fields§
§top_left: CoordPair<C>
§size: CoordPair<C>
Implementations§
Source§impl<C> Rect<C>
impl<C> Rect<C>
pub fn as_ref(&self) -> Rect<&C>
pub fn as_mut(&mut self) -> Rect<&mut C>
pub fn map<F, C0>(self, mapper: F) -> Rect<C0>where
F: FnMut(C) -> C0,
pub fn try_map<F, C0, E>(self, mapper: F) -> Result<Rect<C0>, E>
pub fn bottom_right<D>(self) -> CoordPair<D>where
C: Add<Output = D>,
pub fn checked_bottom_right(&self) -> Option<CoordPair<C>>where
C: CheckedAdd,
pub fn contains_point(self, point: CoordPair<C>) -> boolwhere
C: Sub<Output = C> + PartialOrd,
pub fn checked_horz_area_down_to( self, point: CoordPair<C>, ) -> Result<C, HorzAreaError<C>>
pub fn horz_area_down_to(self, point: CoordPair<C>) -> C
pub fn checked_bot_right_of_horz_area( &self, area: &C, ) -> Result<CoordPair<C>, InvalidArea<C>>
pub fn bot_right_of_horz_area(self, area: C) -> CoordPair<C>
pub fn total_area<D>(self) -> Dwhere
C: Mul<Output = D>,
pub fn checked_total_area(&self) -> Option<C>where
C: CheckedMul,
pub fn checked_move_point_unit(
self,
point: CoordPair<C>,
direction: Direction,
) -> Result<CoordPair<C>, InvalidPoint<C>>where
C: Add<Output = C> + Sub<Output = C> + CheckedAdd + CheckedSub + One + Clone + PartialOrd + Display,
pub fn checked_move_point_by(
self,
point: CoordPair<C>,
vector: DirectionVec<&C>,
) -> Result<CoordPair<C>, InvalidPoint<C>>where
C: Add<Output = C> + Sub<Output = C> + CheckedAdd + CheckedSub + Clone + PartialOrd + Display,
Trait Implementations§
Source§impl<'de, C> Deserialize<'de> for Rect<C>where
C: Deserialize<'de>,
impl<'de, C> Deserialize<'de> for Rect<C>where
C: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C: Ord> Ord for Rect<C>
impl<C: Ord> Ord for Rect<C>
Source§impl<C: PartialOrd> PartialOrd for Rect<C>
impl<C: PartialOrd> PartialOrd for Rect<C>
impl<C: Copy> Copy for Rect<C>
impl<C: Eq> Eq for Rect<C>
impl<C> StructuralPartialEq for Rect<C>
Auto Trait Implementations§
impl<C> Freeze for Rect<C>where
C: Freeze,
impl<C> RefUnwindSafe for Rect<C>where
C: RefUnwindSafe,
impl<C> Send for Rect<C>where
C: Send,
impl<C> Sync for Rect<C>where
C: Sync,
impl<C> Unpin for Rect<C>where
C: Unpin,
impl<C> UnwindSafe for Rect<C>where
C: UnwindSafe,
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