[][src]Struct pathfinder::Coordinate

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

Holds a Coordinate on a x and y plane. It's implemented in Nodes, Groups, HL and the Location trait to enable differennt structures to be drawn.

Fields

x: i16y: i16

Methods

impl Coordinate
[src]

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

Constructs a Coordinate struct.

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

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

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

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

Returns the absolute/positive equivilent.

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 PartialEq<Coordinate> for Coordinate
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.0.0
[src]

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

impl Ord for Coordinate
[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. 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 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 Copy for Coordinate
[src]

impl AddAssign<Coordinate> for Coordinate
[src]

impl Display for Coordinate
[src]

impl Debug 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 = Coordinate

The resulting type after applying the - operator.

impl SubAssign<Coordinate> for Coordinate
[src]

Auto Trait Implementations

impl Send for Coordinate

impl Sync for Coordinate

Blanket Implementations

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

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

type Owned = T

impl<T> From for T
[src]

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

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?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.