#[repr(C)]pub struct Point_<T> {
pub x: T,
pub y: T,
}Expand description
Fields
x: Ty: TImplementations
sourceimpl<T> Point_<T>
impl<T> Point_<T>
pub fn new(x: T, y: T) -> Self
pub fn from_vec2(vec: VecN<T, 2>) -> Self
pub fn from_size(sz: Size_<T>) -> Self
pub fn cross(self, pt: Point_<T>) -> f64where
f64: From<T>,
pub fn dot(self, pt: Point_<T>) -> Twhere
T: NumOps,
pub fn ddot(self, pt: Point_<T>) -> f64where
f64: From<T>,
pub fn inside(self, rect: Rect_<T>) -> boolwhere
T: PartialOrd + Add<Output = T> + Copy,
pub fn norm(self) -> f64where
f64: From<T>,
pub fn to<D: NumCast>(self) -> Option<Point_<D>>where
T: ToPrimitive,
pub fn to_vec2(self) -> VecN<T, 2>
Trait Implementations
sourceimpl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
impl<P, R: AddAssign<P>> AddAssign<Point_<P>> for Rect_<R>
sourcefn add_assign(&mut self, rhs: Point_<P>)
fn add_assign(&mut self, rhs: Point_<P>)
Performs the
+= operation. Read moresourceimpl<T: AddAssign> AddAssign<Point_<T>> for Point_<T>
impl<T: AddAssign> AddAssign<Point_<T>> for Point_<T>
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresourceimpl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
impl<T: DivAssign + Copy> DivAssign<T> for Point_<T>
sourcefn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moresourceimpl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
impl<T: MulAssign + Copy> MulAssign<T> for Point_<T>
sourcefn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moresourceimpl<T: PartialEq> PartialEq<Point_<T>> for Point_<T>
impl<T: PartialEq> PartialEq<Point_<T>> for Point_<T>
sourceimpl<T: PartialOrd> PartialOrd<Point_<T>> for Point_<T>
impl<T: PartialOrd> PartialOrd<Point_<T>> for Point_<T>
sourcefn partial_cmp(&self, other: &Point_<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Point_<T>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresourceimpl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
impl<P, R: SubAssign<P>> SubAssign<Point_<P>> for Rect_<R>
sourcefn sub_assign(&mut self, rhs: Point_<P>)
fn sub_assign(&mut self, rhs: Point_<P>)
Performs the
-= operation. Read moresourceimpl<T: SubAssign> SubAssign<Point_<T>> for Point_<T>
impl<T: SubAssign> SubAssign<Point_<T>> for Point_<T>
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Point_<T>
impl<T: Eq> Eq for Point_<T>
impl<T> StructuralEq for Point_<T>
impl<T> StructuralPartialEq for Point_<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Point_<T>where
T: RefUnwindSafe,
impl<T> Send for Point_<T>where
T: Send,
impl<T> Sync for Point_<T>where
T: Sync,
impl<T> Unpin for Point_<T>where
T: Unpin,
impl<T> UnwindSafe for Point_<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more