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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§