zng::layout

Trait LineFromTuplesBuilder

source
pub trait LineFromTuplesBuilder {
    // Required method
    fn to<X2, Y2>(self, x2: X2, y2: Y2) -> Line
       where X2: Into<Length>,
             Y2: Into<Length>;
}
Expand description

Build a Line using the syntax (x1, y1).to(x2, y2).

§Examples

let line = (10, 20).to(100, 120);
assert_eq!(Line::new(Point::new(10, 20), Point::new(100, 120)), line);

Required Methods§

source

fn to<X2, Y2>(self, x2: X2, y2: Y2) -> Line
where X2: Into<Length>, Y2: Into<Length>,

New Line from self as a start point to x2, y2 end point.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<X1, Y1> LineFromTuplesBuilder for (X1, Y1)
where X1: Into<Length>, Y1: Into<Length>,

source§

fn to<X2, Y2>(self, x2: X2, y2: Y2) -> Line
where X2: Into<Length>, Y2: Into<Length>,

Implementors§