[−][src]Struct rustpython_vm::pyobject::PyIterable
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]
T: TryFromObject,
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self>
[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,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromArgs for T where
T: TryFromObject,
[src]
T: TryFromObject,
fn arity() -> RangeInclusive<usize>
[src]
fn from_args(&VirtualMachine, &mut PyFuncArgs) -> Result<T, ArgumentError>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,