[][src]Struct conrod::position::rect::Rect

pub struct Rect {
    pub x: Range,
    pub y: Range,
}

Defines a Rectangle's bounds across the x and y axes.

This is a conrod-specific Rectangle in that it's designed to help with layout.

Fields

The start and end positions of the Rectangle on the x axis.

The start and end positions of the Rectangle on the y axis.

Methods

impl Rect
[src]

Construct a Rect from a given Point and Dimensions.

Construct a Rect from the coordinates of two points.

The Rect representing the area in which two Rects overlap.

The Rect that encompass the two given sets of Rect.

The position in the middle of the x bounds.

The position in the middle of the y bounds.

The xy position in the middle of the bounds.

The centered x and y coordinates as a tuple.

The width of the Rect.

The height of the Rect.

The total dimensions of the Rect.

The width and height of the Rect as a tuple.

Convert the Rect to a Point and Dimensions.

The Rect's centered coordinates and dimensions in a tuple.

The length of the longest side of the rectangle.

The Rect's lowest y value.

The Rect's highest y value.

The Rect's lowest x value.

The Rect's highest x value.

The top left corner Point.

The bottom left corner Point.

The top right corner Point.

The bottom right corner Point.

The edges of the Rect in a tuple (top, bottom, left, right).

The left and top edges of the Rect along with the width and height.

The left and bottom edges of the Rect along with the width and height.

Shift the Rect along the x axis.

Shift the Rect along the y axis.

Shift the Rect by the given Point.

Returns a Rect with a position relative to the given position on the x axis.

Returns a Rect with a position relative to the given position on the y axis.

Returns a Rect with a position relative to the given position.

Does the given point touch the Rectangle.

The Rect with some padding applied to the left edge.

The Rect with some padding applied to the right edge.

The rect with some padding applied to the bottom edge.

The Rect with some padding applied to the top edge.

The Rect with some padding amount applied to each edge.

The Rect with some padding applied.

Stretches the closest edge(s) to the given point if the point lies outside of the Rect area.

Align self's right edge with the left edge of the other Rect.

Align self's left edge with the right dge of the other Rect.

Align self's top edge with the bottom edge of the other Rect.

Align self's bottom edge with the top edge of the other Rect.

Align self to other along the x axis in accordance with the given Align variant.

Align self to other along the y axis in accordance with the given Align variant.

Align self's left edge with the left edge of the other Rect.

Align the middle of self with the middle of the other Rect along the x axis.

Align self's right edge with the right edge of the other Rect.

Align self's bottom edge with the bottom edge of the other Rect.

Align the middle of self with the middle of the other Rect along the y axis.

Align self's top edge with the top edge of the other Rect.

Place self along the top left edges of the other Rect.

Place self along the top right edges of the other Rect.

Place self along the bottom left edges of the other Rect.

Place self along the bottom right edges of the other Rect.

Place self in the middle of the top edge of the other Rect.

Place self in the middle of the bottom edge of the other Rect.

Place self in the middle of the left edge of the other Rect.

Place self in the middle of the right edge of the other Rect.

Place self directly in the middle of the other Rect.

Return the Corner of self that is closest to the given Point.

Trait Implementations

impl PartialEq<Rect> 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 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 Debug for Rect
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Rect

impl Sync for Rect

Blanket Implementations

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

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

Performs the conversion.

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

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Content for T where
    T: Copy
[src]

A type that holds a sized version of the content.

Prepares an output buffer, then turns this buffer into an Owned.

Returns the size of each element.

Produces a pointer to the data.

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

impl<T> Erased for T
[src]

impl<T> Downcast for T where
    T: Any
[src]

Convert Box<Trait> (where Trait: Downcast) to Box<Any>. Box<Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any's vtable from &Trait's. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any's vtable from &mut Trait's. Read more