Struct cursive::XY [] [src]

pub struct XY<T> {
    pub x: T,
    pub y: T,
}

A generic structure with a value for each axis.

Fields

X-axis value

Y-axis value

Methods

impl XY<usize>
[src]

Returns a new Vec2 that is a maximum per coordinate.

Returns a new Vec2 that is no larger than any input in both dimensions.

Returns the minimum of self and other.

Returns the maximum of self and other.

Returns a vector with the X component of self, and y=0.

Returns a vector with the Y component of self, and x=0.

Alias for Vec2::new(0,0).

Returns (max(self.x,other.x), self.y+other.y)

Returns (self.x+other.x, max(self.y,other.y))

Returns true if self could fit inside other.

Shortcut for self.x <= other.x && self.y <= other.y.

Returns a new Vec2 with the axis o set to value.

Returns a new Vec2 with the axis o set to the value from other.

Sets the axis o on self to the value from other.

impl<T> XY<T>
[src]

Creates a new XY from the given values.

Creates a new XY by applying f to x and y.

Destructure self into a pair.

Return a XY with references to this one's values.

Creates an iterator that returns references to x, then y.

Returns a reference to the value on the given axis.

Returns a new XY of tuples made by zipping self and other.

Returns a new XY by calling f on self and other for each axis.

impl<T> XY<Option<T>>
[src]

Returns a new XY by calling unwrap_or on each axis.

impl XY<bool>
[src]

Returns true if any of x or y is true.

Returns true if both x and y are true.

impl<T: Copy> XY<T>
[src]

Creates a XY with both x and y set to value.

Trait Implementations

impl PartialOrd for XY<usize>
[src]

a < b <=> a.x < b.x && a.y < b.y

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl From<(i32, i32)> for XY<usize>
[src]

Performs the conversion.

impl From<(u32, u32)> for XY<usize>
[src]

Performs the conversion.

impl<T: Into<Vec2>> Add<T> for XY<usize>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<T: Into<Vec2>> Sub<T> for XY<usize>
[src]

The resulting type after applying the - operator

The method for the - operator

impl Div<usize> for XY<usize>
[src]

The resulting type after applying the / operator

The method for the / operator

impl Mul<usize> for XY<usize>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<T: Debug> Debug for XY<T>
[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for XY<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Copy> Copy for XY<T>
[src]

impl<T: PartialEq> PartialEq for XY<T>
[src]

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

This method tests for !=.

impl<T> From<(T, T)> for XY<T>
[src]

Performs the conversion.