[−][src]Struct cogs_gamedev::int_coords::Coord
Unsigned-int coordinates
Fields
x: usize
y: usize
Implementations
impl Coord
[src]
pub fn new(x: usize, y: usize) -> Self
[src]
Make a new coord.
pub fn to_2d_idx(self, width: usize) -> usize
[src]
Get this as an index into an array representing a 2d array.
(AKA, y * width + x
.)
Trait Implementations
impl Add<Coord> for Coord
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, rhs: Self) -> Self::Output
[src]
impl AddAssign<Coord> for Coord
[src]
pub fn add_assign(&mut self, rhs: Self)
[src]
impl Clone for Coord
[src]
impl Copy for Coord
[src]
impl Debug for Coord
[src]
impl Eq for Coord
[src]
impl From<Coord> for ICoord
[src]
impl PartialEq<Coord> for Coord
[src]
impl StructuralEq for Coord
[src]
impl StructuralPartialEq for Coord
[src]
impl TryFrom<ICoord> for Coord
[src]
Try to convert an ICoord to a Coord. Will return Error if the ICoord has any negatives in it.
Auto Trait Implementations
impl RefUnwindSafe for Coord
impl Send for Coord
impl Sync for Coord
impl Unpin for Coord
impl UnwindSafe for Coord
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,