pub struct Index {
pub row: usize,
pub col: usize,
}
Expand description
A structure representing the index of an element in a Matrix<T>
.
Refer to SingleElementIndex
for more information.
Fields§
§row: usize
The row index of the element.
col: usize
The column index of the element.
Implementations§
Trait Implementations§
Source§impl SingleElementIndex for Index
impl SingleElementIndex for Index
impl Copy for Index
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, I> MatrixIndex<T> for Iwhere
I: SingleElementIndex,
impl<T, I> MatrixIndex<T> for Iwhere
I: SingleElementIndex,
Source§fn is_out_of_bounds(&self, matrix: &Matrix<T>) -> bool
fn is_out_of_bounds(&self, matrix: &Matrix<T>) -> bool
Returns
true
if the index is out of bounds for the given matrix.Source§fn get(
self,
matrix: &Matrix<T>,
) -> Result<&<I as MatrixIndex<T>>::Output, Error>
fn get( self, matrix: &Matrix<T>, ) -> Result<&<I as MatrixIndex<T>>::Output, Error>
Returns a shared reference to the output at this location, if in
bounds. Read more
Source§fn get_mut(
self,
matrix: &mut Matrix<T>,
) -> Result<&mut <I as MatrixIndex<T>>::Output, Error>
fn get_mut( self, matrix: &mut Matrix<T>, ) -> Result<&mut <I as MatrixIndex<T>>::Output, Error>
Returns a mutable reference to the output at this location, if in
bounds. Read more
Source§unsafe fn get_unchecked(
self,
matrix: *const Matrix<T>,
) -> *const <I as MatrixIndex<T>>::Output
unsafe fn get_unchecked( self, matrix: *const Matrix<T>, ) -> *const <I as MatrixIndex<T>>::Output
Returns a pointer to the output at this location, without
performing any bounds checking. Read more
Source§unsafe fn get_unchecked_mut(
self,
matrix: *mut Matrix<T>,
) -> *mut <I as MatrixIndex<T>>::Output
unsafe fn get_unchecked_mut( self, matrix: *mut Matrix<T>, ) -> *mut <I as MatrixIndex<T>>::Output
Returns a mutable pointer to the output at this location, without
performing any bounds checking. Read more
Source§fn ensure_in_bounds(&self, matrix: &Matrix<T>) -> Result<&Self>
fn ensure_in_bounds(&self, matrix: &Matrix<T>) -> Result<&Self>
Ensures the index is in bounds for the given matrix. Read more