[][src]Struct pathtracer::Coordinate

pub struct Coordinate {
    pub x: i16,
    pub y: i16,
}

Fields

x: i16y: i16

Methods

impl Coordinate[src]

pub fn new(x: i16, y: i16) -> Self[src]

Constructs a Coordinate struct.

Examples

Coordinate::new(10, 10);

Invocation can be done used the macro coordinate!

coordinate!(10);

These are equal.

let a = coordinate!(10);
let b = Coordinate::new(10, 10);
assert_eq!(a, b);

pub fn lt(self, lt: i16) -> bool[src]

Returns true if either x or y is less than the input.

Examples

let c = Coordinate::new(10, 10);
assert!(c.lt(11));

pub fn abs(self) -> Coordinate[src]

Returns the absolute coordinate equivilent.

Examples

let c = Coordinate::new(-10, 10);
assert_eq!(c.abs(), Coordinate::new(10, 10));

pub fn from_list(list: &[(i16, i16)]) -> Vec<Coordinate>[src]

Creates a list of coordinates from a list of tuples with x and y positions.

Trait Implementations

impl Add<Coordinate> for Coordinate[src]

type Output = Coordinate

The resulting type after applying the + operator.

impl AddAssign<Coordinate> for Coordinate[src]

impl Clone for Coordinate[src]

impl Copy for Coordinate[src]

impl Debug for Coordinate[src]

impl Default for Coordinate[src]

impl Display for Coordinate[src]

impl Eq for Coordinate[src]

impl From<Coordinate> for Node[src]

impl From<Coordinate> for Group[src]

impl From<Group> for Coordinate[src]

impl From<Node> for Coordinate[src]

impl Location for Coordinate[src]

impl Mul<Coordinate> for Coordinate[src]

type Output = Self

The resulting type after applying the * operator.

impl Ord for Coordinate[src]

impl PartialEq<Coordinate> for Coordinate[src]

impl PartialOrd<Coordinate> for Coordinate[src]

impl StructuralEq for Coordinate[src]

impl Sub<Coordinate> for Coordinate[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Coordinate> for Coordinate[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.