Struct zarrs::array_subset::iterators::Indices
source · pub struct Indices { /* private fields */ }
Expand description
An iterator over the indices in an array subset.
Iterates over the last dimension fastest (i.e. C-contiguous order). For example, consider a 4x3 array with element indices
(0, 0) (0, 1) (0, 2)
(1, 0) (1, 1) (1, 2)
(2, 0) (2, 1) (2, 2)
(3, 0) (3, 1) (3, 2)
An iterator with an array subset corresponding to the lower right 2x2 region will produce [(2, 1), (2, 2), (3, 1), (3, 2)]
.
Implementations§
source§impl Indices
impl Indices
sourcepub fn new(subset: ArraySubset) -> Self
pub fn new(subset: ArraySubset) -> Self
Create a new indices struct.
sourcepub fn new_with_start_end(
subset: ArraySubset,
index_front: u64,
index_back: u64
) -> Self
pub fn new_with_start_end( subset: ArraySubset, index_front: u64, index_back: u64 ) -> Self
Create a new indices struct spanning an explicit index range.
§Panics
Panics if index_back
< index_front
sourcepub fn iter(&self) -> IndicesIterator<'_> ⓘ
pub fn iter(&self) -> IndicesIterator<'_> ⓘ
Create a new serial iterator.
Trait Implementations§
source§impl<'a> IntoIterator for &'a Indices
impl<'a> IntoIterator for &'a Indices
source§impl<'a> IntoParallelIterator for &'a Indices
impl<'a> IntoParallelIterator for &'a Indices
Auto Trait Implementations§
impl Freeze for Indices
impl RefUnwindSafe for Indices
impl Send for Indices
impl Sync for Indices
impl Unpin for Indices
impl UnwindSafe for Indices
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<'data, I> IntoParallelRefIterator<'data> for I
impl<'data, I> IntoParallelRefIterator<'data> for I
§type Iter = <&'data I as IntoParallelIterator>::Iter
type Iter = <&'data I as IntoParallelIterator>::Iter
The type of the parallel iterator that will be returned.
§type Item = <&'data I as IntoParallelIterator>::Item
type Item = <&'data I as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
This will typically be an
&'data T
reference type.