[][src]Struct pathfinder::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 Location for Coordinate[src]

fn eq<L: Location>(&self, other: &L) -> bool[src]

Returns if the positions are equal or not.

fn x(&self) -> i16[src]

Retrieves the X coordinate.

fn y(&self) -> i16[src]

Retrieves the Y coordinate.

fn sum(&self) -> i16[src]

Returns the sum of the x and y value.

impl Ord for Coordinate[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Clone for Coordinate[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for Coordinate[src]

impl From<Coordinate> for Node[src]

impl From<Coordinate> for Group[src]

impl From<Node> for Coordinate[src]

impl From<Group> for Coordinate[src]

impl Default for Coordinate[src]

impl PartialEq<Coordinate> for Coordinate[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Eq for Coordinate[src]

impl PartialOrd<Coordinate> for Coordinate[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for Coordinate[src]

impl Display for Coordinate[src]

impl Add<Coordinate> for Coordinate[src]

type Output = Coordinate

The resulting type after applying the + operator.

impl Sub<Coordinate> for Coordinate[src]

type Output = Self

The resulting type after applying the - operator.

impl Mul<Coordinate> for Coordinate[src]

type Output = Self

The resulting type after applying the * operator.

impl AddAssign<Coordinate> for Coordinate[src]

impl SubAssign<Coordinate> for Coordinate[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.