Struct boostvoronoi::Point[][src]

pub struct Point<T> where
    T: InputType
{ pub x: T, pub y: T, }
Expand description

A really simple 2d coordinate container type - integer only

Fields

x: Ty: T

Implementations

Create a new Point

Got “conflicting implementations of trait std::convert::From...” So i picked the name as_f64 for this conversion

Cast a Point<T> to ´Point¨

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to boostvoronoi::geometry::Point from &\[T;2\]

let c = [1,2];
let p:Point<i32> = Point::from(&c);
assert_eq!(p.x,c[0]);
assert_eq!(p.y,c[1]);

A copy conversion from &boostvoronoi::geometry::Point to boostvoronoi::geometry::Point This makes it possible to accept an Iter<Into<Point>> and Iter<&Point> in the same method.

let c = [1,2];
let p1:Point<i32> = Point::from(c);
let p2:Point<i32> = Point::from(&p1);

assert_eq!(p2.x,c[0]);
assert_eq!(p2.y,c[1]);

Converts to boostvoronoi::geometry::Point from [T;2]

let c = [1,2];
let p:Point<i32> = Point::from(c);
assert_eq!(p.x,c[0]);
assert_eq!(p.y,c[1]);

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

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

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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.