[−][src]Struct kas::geom::Coord
An (x, y)
coordinate.
Methods
impl Coord
[src]
pub const ZERO: Coord
[src]
A coord of (0, 0)
pub fn uniform(n: i32) -> Self
[src]
A Coord
with uniform value n
on both axes
pub fn min(self, other: Self) -> Self
[src]
Return the minimum, componentwise
pub fn max(self, other: Self) -> Self
[src]
Return the maximum, componentwise
pub fn clamp(self, min: Self, max: Self) -> Self
[src]
Return the value clamped to the given min
and max
In the case that min > max
, the min
value is returned.
pub fn transpose(self) -> Self
[src]
Return the transpose (swap width and height)
pub fn from_logical<X: Pixel>(
logical: LogicalPosition<X>,
dpi_factor: f64
) -> Self
[src]
logical: LogicalPosition<X>,
dpi_factor: f64
) -> Self
Convert from a logical position
Trait Implementations
impl Add<Coord> for Coord
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl Add<Coord> for Rect
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, offset: Coord) -> Self
[src]
impl Add<Size> for Coord
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Size) -> Self
[src]
impl AddAssign<Coord> for Coord
[src]
fn add_assign(&mut self, rhs: Coord)
[src]
impl AddAssign<Size> for Coord
[src]
fn add_assign(&mut self, rhs: Size)
[src]
impl Clone for Coord
[src]
impl Copy for Coord
[src]
impl Debug for Coord
[src]
impl Default for Coord
[src]
impl Eq for Coord
[src]
impl From<(i32, i32)> for Coord
[src]
impl From<Coord> for Vec2
[src]
impl From<Coord> for DVec2
[src]
impl<X: Pixel> From<Coord> for PhysicalPosition<X>
[src]
impl From<Coord> for Size
[src]
impl From<DVec2> for Coord
[src]
impl<X: Pixel> From<PhysicalPosition<X>> for Coord
[src]
impl From<Size> for Coord
[src]
impl From<Vec2> for Coord
[src]
impl PartialEq<Coord> for Coord
[src]
impl StructuralEq for Coord
[src]
impl StructuralPartialEq for Coord
[src]
impl Sub<Coord> for Coord
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self
[src]
impl Sub<Coord> for Rect
[src]
Auto Trait Implementations
impl RefUnwindSafe for Coord
impl Send for Coord
impl Sync for Coord
impl Unpin for Coord
impl UnwindSafe for Coord
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
Scheme: ApproxScheme,
[src]
Scheme: ApproxScheme,
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
[src]
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
[src]
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, Dst> ConvAsUtil<Dst> for T
[src]
fn approx(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
[src]
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
[src]
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
impl<T> ConvUtil for T
[src]
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ApproxInto<Dst, DefaultApprox>,
[src]
Self: ApproxInto<Dst, DefaultApprox>,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
[src]
Scheme: ApproxScheme,
Self: ApproxInto<Dst, Scheme>,
fn into_as<Dst>(self) -> Dst where
Self: Into<Dst>,
[src]
Self: Into<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: TryInto<Dst>,
[src]
Self: TryInto<Dst>,
fn value_as<Dst>(self) -> Result<Dst, Self::Err> where
Self: ValueInto<Dst>,
[src]
Self: ValueInto<Dst>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<Src> TryFrom<Src> for Src
[src]
type Err = NoError
The error type produced by a failed conversion.
fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<Src, Dst> TryInto<Dst> for Src where
Dst: TryFrom<Src>,
[src]
Dst: TryFrom<Src>,
type Err = <Dst as TryFrom<Src>>::Err
The error type produced by a failed conversion.
fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Src> ValueFrom<Src> for Src
[src]
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
[src]
impl<Src, Dst> ValueInto<Dst> for Src where
Dst: ValueFrom<Src>,
[src]
Dst: ValueFrom<Src>,