pub struct Point<T> where
T: InputType, {
pub x: T,
pub y: T,
}
Expand description
A really simple 2d coordinate container type - integer only
Got “conflicting implementations of trait std::convert::From...
”
So i picked the name as_f64
for this conversion
Cast a Point<T>
to ´Point¨
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]);
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
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
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
#41263)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.