Struct matrixable::strategies::FlipH
source · pub struct FlipH;
Expand description
Performs a horizontal flip of a matrix.
§Example
use matrixable::MatrixExt;
use matrixable::strategies::{ TransformStrategy, FlipH };
let m = [
[ 0, 1, 2 ],
[ 3, 4, 5 ],
[ 6, 7, 8 ]
];
// `m` is borrowed.
let access = m.access(FlipH);
let expected = [
[ 2, 1, 0 ],
[ 5, 4, 3 ],
[ 8, 7, 6 ]
];
assert!(expected.iter().eq(access.iter()));
// `m` is consumed.
let t = FlipH.out_of(m);
assert_eq!(expected, t);
Trait Implementations§
source§impl<M: MatrixExt> AccessStrategy<M> for FlipH
impl<M: MatrixExt> AccessStrategy<M> for FlipH
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 FlipH
impl Ord for FlipH
source§impl PartialEq for FlipH
impl PartialEq for FlipH
source§impl PartialOrd for FlipH
impl PartialOrd for FlipH
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: MatrixMutExt> TransformStrategy<M> for FlipH
impl<M: MatrixMutExt> TransformStrategy<M> for FlipH
impl Copy for FlipH
impl Eq for FlipH
impl StructuralPartialEq for FlipH
Auto Trait Implementations§
impl RefUnwindSafe for FlipH
impl Send for FlipH
impl Sync for FlipH
impl Unpin for FlipH
impl UnwindSafe for FlipH
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