[][src]Struct numpy::npyiter::NpyMultiIter

pub struct NpyMultiIter<'py, T, S: MultiIterModeWithManyArrays> { /* fields omitted */ }

An iterator over multiple arrays, construced by NpyMultiIterBuilder. You can add NpyMultiIterBuilder::add_readwrite for adding a mutable component to the iterator, and NpyMultiIterBuilder::add_readonly for adding a immutable one.

Example

use numpy::NpyMultiIterBuilder;
pyo3::Python::with_gil(|py| {
    let array1 = numpy::PyArray::arange(py, 0, 10, 1);
    let array2 = numpy::PyArray::arange(py, 10, 20, 1);
    let array3 = numpy::PyArray::arange(py, 10, 30, 2);
    let iter = NpyMultiIterBuilder::new()
        .add_readonly(array1.readonly())
        .add_readwrite(array2)
        .add_readonly(array3.readonly())
        .build()
         .unwrap();
    for (i, j, k) in iter {
        assert_eq!(*i + *j, *k);
        *j += *i + *k;  // The third element is only mutable.
    }
});

Trait Implementations

impl<'py, T, S: MultiIterModeWithManyArrays> Drop for NpyMultiIter<'py, T, S>[src]

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RO<()>>>[src]

type Item = (&'py T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RW<()>>>[src]

type Item = (&'py mut T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RW<RO<()>>>>[src]

type Item = (&'py T, &'py mut T, &'py mut T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RW<RW<()>>>>[src]

type Item = (&'py mut T, &'py mut T, &'py mut T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RO<()>>>[src]

type Item = (&'py T, &'py mut T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RW<()>>>[src]

type Item = (&'py mut T, &'py mut T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RO<RO<()>>>>[src]

type Item = (&'py T, &'py T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RO<RW<()>>>>[src]

type Item = (&'py mut T, &'py T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RW<RO<()>>>>[src]

type Item = (&'py T, &'py mut T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RO<RO<()>>>>[src]

type Item = (&'py T, &'py T, &'py mut T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RO<RW<RW<()>>>>[src]

type Item = (&'py mut T, &'py mut T, &'py T)

The type of the elements being iterated over.

impl<'py, T: 'py> Iterator for NpyMultiIter<'py, T, RW<RO<RW<()>>>>[src]

type Item = (&'py mut T, &'py T, &'py mut T)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'py, T, S> !RefUnwindSafe for NpyMultiIter<'py, T, S>[src]

impl<'py, T, S> !Send for NpyMultiIter<'py, T, S>[src]

impl<'py, T, S> !Sync for NpyMultiIter<'py, T, S>[src]

impl<'py, T, S> Unpin for NpyMultiIter<'py, T, S> where
    S: Unpin,
    T: Unpin
[src]

impl<'py, T, S> !UnwindSafe for NpyMultiIter<'py, T, S>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, I> IntoPyDict for I where
    T: PyDictItem,
    I: IntoIterator<Item = T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.