A position, defined by a tuple of x and y coordinates.
The x coordinate of this position.
The y coordinate of this position.
pub fn translated_by_offset(&self, x: i32, y: i32) -> Position[src]
Translate this position by an offset.
x- the x offset.
y- the y offset.
pub fn translated_by_direction(&self, direction: &Direction) -> Position[src]
Translates this position by the given direction.
direction- the direction to translate this position by.
The distance between this position and another one.
Note that this is going to be the Manhattan distance between the two positions.
position- the position to calculate the distance against.
impl PartialOrd<Position> for Position[src]
fn partial_cmp(&self, other: &Position) -> Option<Ordering>[src]
impl StructuralEq for Position[src]
impl StructuralPartialEq for Position[src]
impl RefUnwindSafe for Position
impl UnwindSafe for Position
type Error = Infallible
The type returned in the event of a conversion error.