pub struct Point<T, Unit> {
pub x: T,
pub y: T,
/* private fields */
}
Expand description
A location represented by an x and y value.
Fields
x: T
y: T
Implementations
impl<T, Unit> Point<T, Unit> where
T: Copy,
impl<T, Unit> Point<T, Unit> where
T: Copy,
pub fn from_figures(x: Figure<T, Unit>, y: Figure<T, Unit>) -> Point<T, Unit>
pub fn from_figures(x: Figure<T, Unit>, y: Figure<T, Unit>) -> Point<T, Unit>
Returns a new Point
.
impl<T, Unit> Point<T, Unit> where
T: NumCast + Copy,
impl<T, Unit> Point<T, Unit> where
T: NumCast + Copy,
Trait Implementations
impl<T, Unit> AbsDiffEq<Point<T, Unit>> for Point<T, Unit> where
T: AbsDiffEq<T, Epsilon = T> + Copy,
impl<T, Unit> AbsDiffEq<Point<T, Unit>> for Point<T, Unit> where
T: AbsDiffEq<T, Epsilon = T> + Copy,
fn default_epsilon() -> <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
fn default_epsilon() -> <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn abs_diff_eq(
&self,
other: &Point<T, Unit>,
epsilon: <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
) -> bool
fn abs_diff_eq(
&self,
other: &Point<T, Unit>,
epsilon: <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
) -> bool
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(
&self,
other: &Point<T, Unit>,
epsilon: <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
) -> bool
fn abs_diff_ne(
&self,
other: &Point<T, Unit>,
epsilon: <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
) -> bool
The inverse of AbsDiffEq::abs_diff_eq
.
impl<T, Unit> AddAssign<Point<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
impl<T, Unit> AddAssign<Point<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
fn add_assign(&mut self, rhs: Point<T, Unit>)
fn add_assign(&mut self, rhs: Point<T, Unit>)
Performs the +=
operation. Read more
impl<T, Unit> AddAssign<Size<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
impl<T, Unit> AddAssign<Size<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
fn add_assign(&mut self, rhs: Size<T, Unit>)
fn add_assign(&mut self, rhs: Size<T, Unit>)
Performs the +=
operation. Read more
impl<T, Unit> AddAssign<Vector<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
impl<T, Unit> AddAssign<Vector<T, Unit>> for Point<T, Unit> where
T: AddAssign<T> + Copy,
fn add_assign(&mut self, rhs: Vector<T, Unit>)
fn add_assign(&mut self, rhs: Vector<T, Unit>)
Performs the +=
operation. Read more
impl<T, Unit> Approx<T> for Point<T, Unit> where
T: AbsDiffEq<T> + Copy,
impl<T, Unit> Approx<T> for Point<T, Unit> where
T: AbsDiffEq<T> + Copy,
impl<T> Displayable<T> for Point<T, Points> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
impl<T> Displayable<T> for Point<T, Points> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
fn to_pixels(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Pixels
fn to_pixels(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Pixels
Returns this value after applying scale
, if needed.
fn to_points(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Points
fn to_points(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Points
Returns this value after applying scale
, if needed.
fn to_scaled(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Scaled
fn to_scaled(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Points> as Displayable<T>>::Scaled
Returns this value after applying scale
, if needed.
impl<T> Displayable<T> for Point<T, Scaled> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
impl<T> Displayable<T> for Point<T, Scaled> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
fn to_pixels(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Pixels
fn to_pixels(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Pixels
Returns this value after applying scale
, if needed.
fn to_points(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Points
fn to_points(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Points
Returns this value after applying scale
, if needed.
fn to_scaled(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Scaled
fn to_scaled(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Scaled> as Displayable<T>>::Scaled
Returns this value after applying scale
, if needed.
impl<T> Displayable<T> for Point<T, Pixels> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
impl<T> Displayable<T> for Point<T, Pixels> where
T: Mul<T, Output = T> + Copy + Div<T, Output = T>,
fn to_pixels(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Pixels
fn to_pixels(
&self,
_scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Pixels
Returns this value after applying scale
, if needed.
fn to_points(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Points
fn to_points(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Points
Returns this value after applying scale
, if needed.
fn to_scaled(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Scaled
fn to_scaled(
&self,
scale: &DisplayScale<T>
) -> <Point<T, Pixels> as Displayable<T>>::Scaled
Returns this value after applying scale
, if needed.
impl<T, UnitA, UnitB> Div<Scale<T, UnitA, UnitB>> for Point<T, UnitB> where
T: Div<T, Output = T> + Copy,
impl<T, UnitA, UnitB> Div<Scale<T, UnitA, UnitB>> for Point<T, UnitB> where
T: Div<T, Output = T> + Copy,
impl<T, UnitA, UnitB> Mul<Scale<T, UnitA, UnitB>> for Point<T, UnitA> where
T: Mul<T, Output = T> + Copy,
impl<T, UnitA, UnitB> Mul<Scale<T, UnitA, UnitB>> for Point<T, UnitA> where
T: Mul<T, Output = T> + Copy,
impl<T, Unit> RelativeEq<Point<T, Unit>> for Point<T, Unit> where
T: RelativeEq<T, Epsilon = T> + Copy,
impl<T, Unit> RelativeEq<Point<T, Unit>> for Point<T, Unit> where
T: RelativeEq<T, Epsilon = T> + Copy,
fn default_max_relative(
) -> <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
fn default_max_relative(
) -> <Point<T, Unit> as AbsDiffEq<Point<T, Unit>>>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
impl<T, Unit> SubAssign<Point<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
impl<T, Unit> SubAssign<Point<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
fn sub_assign(&mut self, rhs: Point<T, Unit>)
fn sub_assign(&mut self, rhs: Point<T, Unit>)
Performs the -=
operation. Read more
impl<T, Unit> SubAssign<Size<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
impl<T, Unit> SubAssign<Size<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
fn sub_assign(&mut self, rhs: Size<T, Unit>)
fn sub_assign(&mut self, rhs: Size<T, Unit>)
Performs the -=
operation. Read more
impl<T, Unit> SubAssign<Vector<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
impl<T, Unit> SubAssign<Vector<T, Unit>> for Point<T, Unit> where
T: SubAssign<T> + Copy,
fn sub_assign(&mut self, rhs: Vector<T, Unit>)
fn sub_assign(&mut self, rhs: Vector<T, Unit>)
Performs the -=
operation. Read more
impl<T, Unit> UlpsEq<Point<T, Unit>> for Point<T, Unit> where
T: UlpsEq<T, Epsilon = T> + Copy,
impl<T, Unit> UlpsEq<Point<T, Unit>> for Point<T, Unit> where
T: UlpsEq<T, Epsilon = T> + Copy,
fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
impl<T, Unit> Vectorlike<T, Unit> for Point<T, Unit> where
T: Copy,
impl<T, Unit> Vectorlike<T, Unit> for Point<T, Unit> where
T: Copy,
impl<T, Unit> Copy for Point<T, Unit> where
T: Copy,
impl<T, Unit> Eq for Point<T, Unit> where
T: Eq,
Auto Trait Implementations
impl<T, Unit> RefUnwindSafe for Point<T, Unit> where
T: RefUnwindSafe,
Unit: RefUnwindSafe,
impl<T, Unit> Send for Point<T, Unit> where
T: Send,
Unit: Send,
impl<T, Unit> Sync for Point<T, Unit> where
T: Sync,
Unit: Sync,
impl<T, Unit> Unpin for Point<T, Unit> where
T: Unpin,
Unit: Unpin,
impl<T, Unit> UnwindSafe for Point<T, Unit> where
T: UnwindSafe,
Unit: UnwindSafe,
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more