[][src]Struct rustpython_vm::pyobject::PyIterable

pub struct PyIterable<T = PyObjectRef> { /* fields omitted */ }

An iterable Python object.

PyIterable implements FromArgs so that a built-in function can accept an object that is required to conform to the Python iterator protocol.

PyIterable can optionally perform type checking and conversions on iterated objects using a generic type parameter that implements TryFromObject.

Methods

impl<T> PyIterable<T>[src]

pub fn iter<'a>(&self, vm: &'a VirtualMachine) -> PyResult<PyIterator<'a, T>>[src]

Returns an iterator over this sequence of objects.

This operation may fail if an exception is raised while invoking the __iter__ method of the iterable object.

Trait Implementations

impl<T> TryFromObject for PyIterable<T> where
    T: TryFromObject
[src]

Auto Trait Implementations

impl<T = Rc<PyObject<dyn PyObjectPayload + 'static>>> !RefUnwindSafe for PyIterable<T>

impl<T = Rc<PyObject<dyn PyObjectPayload + 'static>>> !Send for PyIterable<T>

impl<T = Rc<PyObject<dyn PyObjectPayload + 'static>>> !Sync for PyIterable<T>

impl<T> Unpin for PyIterable<T> where
    T: Unpin

impl<T = Rc<PyObject<dyn PyObjectPayload + 'static>>> !UnwindSafe for PyIterable<T>

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> FromArgs for T where
    T: TryFromObject
[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,