[][src]Trait rect_iter::FromTuple2

pub trait FromTuple2<T> {
    fn from_tuple2(tuple: (T, T)) -> Self;
}

To manipulate many Point libraries in the same way, we use tuple as entry points of API.

Example

use rect_iter::FromTuple2;
struct Point {
    x: f64,
    y: f64,
}
impl FromTuple2<f64> for Point {
    fn from_tuple2(t: (f64, f64)) -> Self {
        Point { x: t.0, y: t.1 }
    }
}

Required methods

fn from_tuple2(tuple: (T, T)) -> Self

Loading content...

Implementations on Foreign Types

impl<T: Copy, U> FromTuple2<T> for Point2D<T, U>[src]

impl<T: Clone, U> FromTuple2<T> for Vector2D<T, U>[src]

impl<T> FromTuple2<T> for (T, T)[src]

Loading content...

Implementors

Loading content...