[−][src]Struct simple::Point
Immutable point type, consisting of x and y.
Methods
impl Point
[src]
impl Point
pub fn new(x: i32, y: i32) -> Point | [src] |
Creates a new point from the given coordinates.
pub fn from_ll(raw: SDL_Point) -> Point | [src] |
pub fn raw_slice(slice: &[Point]) -> *const SDL_Point | [src] |
pub fn raw(&self) -> *const SDL_Point | [src] |
pub fn offset(&self, x: i32, y: i32) -> Point | [src] |
Returns a new point by shifting this point's coordinates by the given x and y values.
pub fn scale(&self, f: i32) -> Point | [src] |
Returns a new point by multiplying this point's coordinates by the given scale factor.
pub fn x(&self) -> i32 | [src] |
Returns the x-coordinate of this point.
pub fn y(&self) -> i32 | [src] |
Returns the y-coordinate of this point.
Trait Implementations
impl Into<(i32, i32)> for Point
[src]
impl Into<(i32, i32)> for Point
impl Into<SDL_Point> for Point
[src]
impl Into<SDL_Point> for Point
impl Deref for Point
[src]
impl Deref for Point
type Target = SDL_Point
The resulting type after dereferencing.
fn deref(&self) -> &SDL_Point | [src] |
Example
use sdl2::rect::Point; let point = Point::new(2, 3); assert_eq!(2, point.x);
impl Neg for Point
[src]
impl Neg for Point
impl PartialEq<Point> for Point
[src]
impl PartialEq<Point> for Point
fn eq(&self, other: &Point) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=
.
impl DerefMut for Point
[src]
impl DerefMut for Point
fn deref_mut(&mut self) -> &mut SDL_Point | [src] |
Example
use sdl2::rect::Point; let mut point = Point::new(2, 3); point.x = 4; assert_eq!(4, point.x);
impl Hash for Point
[src]
impl Hash for Point
fn hash<H>(&self, state: &mut H) where | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl Div<i32> for Point
[src]
impl Div<i32> for Point
type Output = Point
The resulting type after applying the /
operator.
fn div(self, rhs: i32) -> Point | [src] |
impl Clone for Point
[src]
impl Clone for Point
fn clone(&self) -> Point | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Add<Point> for Point
[src]
impl Add<Point> for Point
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: Point) -> Point | [src] |
impl Eq for Point
[src]
impl Eq for Point
impl Sub<Point> for Point
[src]
impl Sub<Point> for Point
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, rhs: Point) -> Point | [src] |
impl AsMut<SDL_Point> for Point
[src]
impl AsMut<SDL_Point> for Point
impl AsRef<SDL_Point> for Point
[src]
impl AsRef<SDL_Point> for Point
impl From<SDL_Point> for Point
[src]
impl From<SDL_Point> for Point
impl From<(i32, i32)> for Point
[src]
impl From<(i32, i32)> for Point
impl Copy for Point
[src]
impl Copy for Point
impl Debug for Point
[src]
impl Debug for Point
impl Mul<i32> for Point
[src]
impl Mul<i32> for Point
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |