advent_of_code_2024::day_20

Trait CoordinateExtensions

source
trait CoordinateExtensions: Sized {
    // Required methods
    fn apply(&self, delta: &(isize, isize)) -> Option<Self>;
    fn manhattan_distance(&self, other: &Self) -> usize;
}

Required Methods§

source

fn apply(&self, delta: &(isize, isize)) -> Option<Self>

source

fn manhattan_distance(&self, other: &Self) -> usize

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CoordinateExtensions for (usize, usize)

source§

fn apply(&self, delta: &(isize, isize)) -> Option<Self>

The new coordinates after applying the given delta, None if either coordinate would end up negative

source§

fn manhattan_distance(&self, other: &Self) -> usize

Manhattan distance between two points

Implementors§