Skip to main content

RectFromTuplesBuilder

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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§