Struct pathfinder_geometry::vector::Vector2I

source ·
pub struct Vector2I(pub I32x2);
Expand description

2D points with 32-bit signed integer coordinates.

Tuple Fields§

§0: I32x2

Implementations§

source§

impl Vector2I

source

pub fn new(x: i32, y: i32) -> Vector2I

source

pub fn splat(value: i32) -> Vector2I

source

pub fn zero() -> Vector2I

source

pub fn x(self) -> i32

source

pub fn y(self) -> i32

source

pub fn set_x(&mut self, x: i32)

source

pub fn set_y(&mut self, y: i32)

source

pub fn min(self, other: Vector2I) -> Vector2I

source

pub fn max(self, other: Vector2I) -> Vector2I

source

pub fn to_f32(self) -> Vector2F

Trait Implementations§

source§

impl Add<i32> for Vector2I

§

type Output = Vector2I

The resulting type after applying the + operator.
source§

fn add(self, other: i32) -> Vector2I

Performs the + operation. Read more
source§

impl Add for Vector2I

§

type Output = Vector2I

The resulting type after applying the + operator.
source§

fn add(self, other: Vector2I) -> Vector2I

Performs the + operation. Read more
source§

impl AddAssign for Vector2I

source§

fn add_assign(&mut self, other: Vector2I)

Performs the += operation. Read more
source§

impl Clone for Vector2I

source§

fn clone(&self) -> Vector2I

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Vector2I

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Vector2I

source§

fn default() -> Vector2I

Returns the “default value” for a type. Read more
source§

impl Hash for Vector2I

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<i32> for Vector2I

§

type Output = Vector2I

The resulting type after applying the * operator.
source§

fn mul(self, other: i32) -> Vector2I

Performs the * operation. Read more
source§

impl Mul for Vector2I

§

type Output = Vector2I

The resulting type after applying the * operator.
source§

fn mul(self, other: Vector2I) -> Vector2I

Performs the * operation. Read more
source§

impl Neg for Vector2I

§

type Output = Vector2I

The resulting type after applying the - operator.
source§

fn neg(self) -> Vector2I

Performs the unary - operation. Read more
source§

impl PartialEq for Vector2I

source§

fn eq(&self, other: &Vector2I) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sub<i32> for Vector2I

§

type Output = Vector2I

The resulting type after applying the - operator.
source§

fn sub(self, other: i32) -> Vector2I

Performs the - operation. Read more
source§

impl Sub for Vector2I

§

type Output = Vector2I

The resulting type after applying the - operator.
source§

fn sub(self, other: Vector2I) -> Vector2I

Performs the - operation. Read more
source§

impl Copy for Vector2I

source§

impl Eq for Vector2I

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.