Struct tapestry::rect::Rect[][src]

pub struct Rect {
    pub top: i32,
    pub bottom: i32,
    pub left: i32,
    pub right: i32,
}

Fields

top: i32bottom: i32left: i32right: i32

Implementations

impl Rect[src]

pub fn new<C: Into<Coord>>(dimensions: C) -> Self[src]

Constructs a Rect at (0, 0).

pub fn with_corners<C1, C2>(corner1: C1, corner2: C2) -> Self where
    C1: Into<Coord>,
    C2: Into<Coord>, 
[src]

Constructs a Rect, given any two corners.

It is advisable to use this over creating a RectBounds literal, because this will prevent invalid states, such as left being less than right.

pub fn dimensions(&self) -> Coord[src]

pub fn offset(&self) -> Coord[src]

pub fn area(&self) -> i32[src]

pub fn width(&self) -> i32[src]

pub fn height(&self) -> i32[src]

pub fn partition_vertical(&self, partition: i32) -> (Self, Self)[src]

pub fn partition_horizontal(&self, partition: i32) -> (Self, Self)[src]

pub fn bsp(
    &self,
    orientation: Orientation,
    splitter: &dyn Fn(Rect, Orientation) -> Option<(i32, Orientation)>
) -> BspTree
[src]

Executes a binary space partition with the given splitter algorithm.

pub fn translate<C: Into<Coord>>(&self, coord: C) -> Self[src]

pub fn contains<C: Into<Coord>>(&self, coord: C) -> bool[src]

pub fn x_range(&self) -> Range<i32>[src]

pub fn y_range(&self) -> Range<i32>[src]

pub fn iter(&self) -> impl Iterator<Item = Coord>[src]

Trait Implementations

impl Clone for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

Auto Trait Implementations

impl RefUnwindSafe for Rect

impl Send for Rect

impl Sync for Rect

impl Unpin for Rect

impl UnwindSafe for Rect

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,