Struct prototty::Size [] [src]

pub struct Size { /* fields omitted */ }

A size cannot be created which would contain un-addressable cells. That is, the maximum size has a width and height of one greater than the maximum i32.

Methods

impl Size
[src]

[src]

Creates a new Size. Panics if x or y is greater than ::std::i32::MAX as u32 + 1.

[src]

Returns the width.

[src]

Returns the height.

[src]

Returns an iterator over all the coordinates within a rectangle of this size.

[src]

Suppose an array is used to implement a 2D grid of this size, where traversing the array from start to end is equivalent to traversing the 2D grid top to bottom, traversing left to right within each row. If a given coordinate is valid for such a grid, this function returns the index into the array corresponding to that coordinate.

[src]

[src]

Return the number of cells in a 2D grid of this size.

Trait Implementations

impl Copy for Size
[src]

impl Hash for Size
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Clone for Size
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Size
[src]

impl<T> From<T> for Size where
    T: Into<[u32; 2]>, 
[src]

[src]

impl PartialEq<Size> for Size
[src]

[src]

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

[src]

This method tests for !=.

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

[src]

impl Add<Coord> for Size
[src]

[src]

impl<'de> Deserialize<'de> for Size
[src]

[src]

impl Debug for Size
[src]

[src]

Formats the value using the given formatter.

impl Serialize for Size
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<T> Sub<T> for Size where
    T: Into<Size>, 
[src]

[src]

impl Sub<Coord> for Size
[src]

[src]

impl Default for Size
[src]