Struct cogs_gamedev::grids::rectangles::IRect [−][src]
Expand description
A rectangle with integer values.
Fields
left: isizetop: isizewidth: usizeheight: usizeImplementations
impl IRect[src]
impl IRect[src]pub fn new(left: isize, top: isize, width: usize, height: usize) -> Self[src]
pub fn centered(center: ICoord, width: usize, height: usize) -> Self[src]
pub fn centered(center: ICoord, width: usize, height: usize) -> Self[src]Return a new rectangle centered at the given position with the given w/h
pub fn contains(&self, pos: ICoord) -> bool[src]
pub fn contains(&self, pos: ICoord) -> bool[src]Does this rect contain the pos?
Points on the boundary count.
pub fn area(&self) -> usize[src]
pub fn contained_coords(&self) -> RectIterⓘ[src]
pub fn contained_coords(&self) -> RectIterⓘ[src]Iterator through all the positions in the rect. It goes in reading order: left-to-right, top-to-bottom.
(Sorry hebrew speakers)
pub fn right(&self) -> isize[src]
pub fn bottom(&self) -> isize[src]
pub fn shifted(self, by: ICoord) -> IRect[src]
Trait Implementations
impl Copy for IRect[src]
impl Eq for IRect[src]
impl StructuralEq for IRect[src]
impl StructuralPartialEq for IRect[src]
Auto Trait Implementations
impl RefUnwindSafe for IRect
impl Send for IRect
impl Sync for IRect
impl Unpin for IRect
impl UnwindSafe for IRect
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,