Struct matrixable::strategies::Identity
source · pub struct Identity;
Expand description
This Strategy does nothing…
§Example
use matrixable::MatrixExt;
use matrixable::strategies::{ TransformStrategy, Identity };
let m = [
[ 0, 1, 2 ],
[ 3, 4, 5 ],
[ 6, 7, 8 ],
];
// `m` is borrowed
let access = m.access(Identity);
assert!(m.iter().eq(access.iter()));
// `m` is consumed.
let t = Identity.out_of(m.clone());
assert_eq!(m, t);
Trait Implementations§
source§impl<M: MatrixExt> AccessStrategy<M> for Identity
impl<M: MatrixExt> AccessStrategy<M> for Identity
source§fn access(&self, _m: &M, i: usize, j: usize) -> Option<(usize, usize)>
fn access(&self, _m: &M, i: usize, j: usize) -> Option<(usize, usize)>
Gives the location (if it exists) of the element in a matrix that
should match the indexes (subscripts) provided according to the access strategy. Read more
source§impl Ord for Identity
impl Ord for Identity
source§impl PartialEq for Identity
impl PartialEq for Identity
source§impl PartialOrd for Identity
impl PartialOrd for Identity
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<M: MatrixExt> TransformStrategy<M> for Identity
impl<M: MatrixExt> TransformStrategy<M> for Identity
impl Copy for Identity
impl Eq for Identity
impl StructuralPartialEq for Identity
Auto Trait Implementations§
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
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