[][src]Struct embedded_graphics::unsignedcoord::UnsignedCoord

pub struct UnsignedCoord(pub u32, pub u32);

2D unsigned coordinate in screen space

As opposed to Coord, this coordinate is unsigned. It is intended for use with Drawable iterators to output valid display pixel coordinates, i.e. coordinates that are always positive.

use embedded_graphics::{unsignedcoord::UnsignedCoord, ucoord};

// Create a coord using the `new` constructor method
let c1 = UnsignedCoord::new(10, 20);

// Create a coord using the handy `ucoord` macro
let c2 = ucoord!(10, 20);

assert_eq!(c1, c2);

Note that enabling the nalgebra feature will alias Nalgebra's Vector2<u32> type to UnsignedCoord instead of this builtin implementation.

Methods

impl UnsignedCoord[src]

pub fn new(x: u32, y: u32) -> Self[src]

Create a new coordinate with X and Y values

Trait Implementations

impl Add<UnsignedCoord> for UnsignedCoord[src]

type Output = UnsignedCoord

The resulting type after applying the + operator.

impl AddAssign<UnsignedCoord> for UnsignedCoord[src]

impl Clone for UnsignedCoord[src]

impl Copy for UnsignedCoord[src]

impl Debug for UnsignedCoord[src]

impl Eq for UnsignedCoord[src]

impl<'_> From<&'_ [u32; 2]> for UnsignedCoord[src]

impl<'_> From<&'_ UnsignedCoord> for (u32, u32)[src]

impl From<[u32; 2]> for UnsignedCoord[src]

impl From<(u32, u32)> for UnsignedCoord[src]

impl From<UnsignedCoord> for (u32, u32)[src]

impl Index<usize> for UnsignedCoord[src]

type Output = u32

The returned type after indexing.

impl Neg for UnsignedCoord[src]

type Output = Coord

The resulting type after applying the - operator.

impl PartialEq<UnsignedCoord> for UnsignedCoord[src]

impl StructuralEq for UnsignedCoord[src]

impl StructuralPartialEq for UnsignedCoord[src]

impl Sub<UnsignedCoord> for UnsignedCoord[src]

type Output = UnsignedCoord

The resulting type after applying the - operator.

impl SubAssign<UnsignedCoord> for UnsignedCoord[src]

impl ToSigned for UnsignedCoord[src]

Auto Trait Implementations

impl Send for UnsignedCoord

impl Sync for UnsignedCoord

impl Unpin for UnsignedCoord

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.