Struct cursive::rect::Rect[][src]

pub struct Rect { /* fields omitted */ }

A non-empty rectangle on the 2D grid.

Methods

impl Rect
[src]

Creates a new Rect with the given position and size.

size must be non-zero in each axis.

Creates a new Rect from two corners.

It can be any two opposite corners.

Grow this rectangle if necessary to include other.

Returns a new rectangle that includes both self and other.

Adds the given offset to this rectangle.

Returns the size of the rectangle.

Returns the width of the rectangle.

Returns the height of the rectangle.

Returns the top-left corner.

Returns the bottom-right corner.

Returns the top-right corner.

Returns the bottom-left corner.

Returns the Y value of the top edge of the rectangle.

This is inclusive.

Returns the X value of the left edge of the rectangle.

This is inclusive.

Returns the X value of the right edge of the rectangle.

This is inclusive.

Returns the Y value of the botton edge of the rectangle.

This is inclusive.

Returns the surface (number of cells) covered by the rectangle.

Checks if a point is in self.

Trait Implementations

impl Debug for Rect
[src]

Formats the value using the given formatter. Read more

impl Clone for Rect
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Rect
[src]

impl PartialEq for Rect
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Rect
[src]

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

Performs the conversion.

impl<T> Add<T> for Rect where
    T: Into<Vec2>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

Auto Trait Implementations

impl Send for Rect

impl Sync for Rect