Trait zng_layout::unit::RectFromTuplesBuilder

source ·
pub trait RectFromTuplesBuilder {
    // Required method
    fn at<X: Into<Length>, Y: Into<Length>>(self, x: X, y: Y) -> Rect;
}
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: Into<Length>, Y: Into<Length>>(self, x: X, y: Y) -> Rect

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: Into<Length>, H: Into<Length>> RectFromTuplesBuilder for (W, H)

source§

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

Implementors§