pub struct Matrix<T> {
pub matrix: Vec<Vec<T>>,
}
Fields§
§matrix: Vec<Vec<T>>
Implementations§
Source§impl<T: Copy> Matrix<T>
impl<T: Copy> Matrix<T>
pub fn new(matrix: Vec<Vec<T>>) -> Matrix<T>
pub fn get(&self, point: MatrixPoint) -> Option<T>
Sourcepub fn go(&self, point: MatrixPoint, direction: Direction) -> Option<T>
pub fn go(&self, point: MatrixPoint, direction: Direction) -> Option<T>
Tries to move a point in the provided direction If there is no cell in that direction, None is returned Otherwise Some(NewMatrixPoint) is returned
pub fn corner( &self, point: MatrixPoint, dir1: Direction, dir2: Direction, ) -> Option<T>
Trait Implementations§
impl<T> StructuralPartialEq for Matrix<T>
Auto Trait Implementations§
impl<T> Freeze for Matrix<T>
impl<T> RefUnwindSafe for Matrix<T>where
T: RefUnwindSafe,
impl<T> Send for Matrix<T>where
T: Send,
impl<T> Sync for Matrix<T>where
T: Sync,
impl<T> Unpin for Matrix<T>where
T: Unpin,
impl<T> UnwindSafe for Matrix<T>where
T: UnwindSafe,
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