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.

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<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§