Trait rdcl_aoc_helpers::direction::CanTravel
source · pub trait CanTravel<T> {
fn travel(&self, from: &T) -> T;
fn travel_checked(&self, from: &T) -> Option<T>;
}
Expand description
Given a position, determine the next position for a given direction.
Required Methods
sourcefn travel_checked(&self, from: &T) -> Option<T>
fn travel_checked(&self, from: &T) -> Option<T>
Travel in the specified direction, and return None if this is not possible.