Struct zarrs::array_subset::iterators::LinearisedIndices
source · pub struct LinearisedIndices { /* private fields */ }
Expand description
An iterator over the linearised indices in an array subset.
Iterates over the last dimension fastest (i.e. C-contiguous order). For example, consider a 4x3 array with linearised element indices
0 1 2
3 4 5
6 7 8
9 10 11
An iterator with an array subset corresponding to the lower right 2x2 region will produce [7, 8, 10, 11]
.
Implementations§
source§impl LinearisedIndices
impl LinearisedIndices
sourcepub fn new(
subset: ArraySubset,
array_shape: ArrayShape
) -> Result<Self, IncompatibleArraySubsetAndShapeError>
pub fn new( subset: ArraySubset, array_shape: ArrayShape ) -> Result<Self, IncompatibleArraySubsetAndShapeError>
Create a new linearised indices iterator.
§Errors
Returns IncompatibleArraySubsetAndShapeError
if array_shape
does not encapsulate subset
.
sourcepub unsafe fn new_unchecked(
subset: ArraySubset,
array_shape: ArrayShape
) -> Self
pub unsafe fn new_unchecked( subset: ArraySubset, array_shape: ArrayShape ) -> Self
sourcepub fn iter(&self) -> LinearisedIndicesIterator<'_> ⓘ
pub fn iter(&self) -> LinearisedIndicesIterator<'_> ⓘ
Create a new serial iterator.
Trait Implementations§
source§impl<'a> IntoIterator for &'a LinearisedIndices
impl<'a> IntoIterator for &'a LinearisedIndices
Auto Trait Implementations§
impl Freeze for LinearisedIndices
impl RefUnwindSafe for LinearisedIndices
impl Send for LinearisedIndices
impl Sync for LinearisedIndices
impl Unpin for LinearisedIndices
impl UnwindSafe for LinearisedIndices
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