Struct sdl2::rect::Point[][src]

pub struct Point { /* fields omitted */ }

Immutable point type, consisting of x and y.

Methods

impl Point
[src]

Creates a new point from the given coordinates.

Returns a new point by shifting this point's coordinates by the given x and y values.

Returns a new point by multiplying this point's coordinates by the given scale factor.

Returns the x-coordinate of this point.

Returns the y-coordinate of this point.

Trait Implementations

impl Copy for Point
[src]

impl Clone for Point
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Point
[src]

Formats the value using the given formatter. Read more

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

impl Hash for Point
[src]

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

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

impl Deref for Point
[src]

The resulting type after dereferencing.

Example

use sdl2::rect::Point;
let point = Point::new(2, 3);
assert_eq!(2, point.x);

impl DerefMut for Point
[src]

Example

use sdl2::rect::Point;
let mut point = Point::new(2, 3);
point.x = 4;
assert_eq!(4, point.x);

impl AsRef<SDL_Point> for Point
[src]

Performs the conversion.

impl AsMut<SDL_Point> for Point
[src]

Performs the conversion.

impl From<SDL_Point> for Point
[src]

Performs the conversion.

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

Performs the conversion.

impl Into<SDL_Point> for Point
[src]

Performs the conversion.

impl Into<(i32, i32)> for Point
[src]

Performs the conversion.

impl Add for Point
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Neg for Point
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl Sub for Point
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Mul<i32> for Point
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<i32> for Point
[src]

The resulting type after applying the / operator.

Performs the / operation.

Auto Trait Implementations

impl Send for Point

impl Sync for Point