pub struct Direction {
pub name: &'static str,
pub dx: i64,
pub dy: i64,
}Expand description
One direction of a neighbourhood record: the field’s name and the (dx, dy)
step it names.
Name and offset are one tuple on purpose. Two parallel lists — field names here, offsets in the wrapper — is exactly the shape that lets slot i hold the neighbour of direction j, which no test of either list alone would catch.
Fields§
§name: &'static strThe record field’s name, and therefore the schema’s slot at this index.
dx: i64Column step. y grows downward, so down is +1.
dy: i64Row step.
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnsafeUnpin for Direction
impl UnwindSafe for Direction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more