zng::layout

Trait RectFromTuplesBuilder

source
pub trait RectFromTuplesBuilder {
    // Required method
    fn at<X, Y>(self, x: X, y: Y) -> Rect
       where X: Into<Length>,
             Y: Into<Length>;
}
Expand description

Build a Rect using the syntax (width, height).at(x, y).

§Examples

let rect = (800, 600).at(10, 20);
assert_eq!(Rect::new(Point::new(10, 20), Size::new(800, 600)), rect);

Required Methods§

source

fn at<X, Y>(self, x: X, y: Y) -> Rect
where X: Into<Length>, Y: Into<Length>,

New Rect from self as the size placed at the x, y origin.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<W, H> RectFromTuplesBuilder for (W, H)
where W: Into<Length>, H: Into<Length>,

source§

fn at<X, Y>(self, x: X, y: Y) -> Rect
where X: Into<Length>, Y: Into<Length>,

Implementors§