doc iterators
This commit is contained in:
parent
d0b54666a1
commit
dc5648733e
|
@ -78,7 +78,9 @@ py_unarys_func!(iternext, PyIterNextProtocol, Self::__next__);
|
|||
///
|
||||
/// See [`PyIterProtocol`](trait.PyIterProtocol.html) for an example.
|
||||
pub enum IterNextOutput<T, U> {
|
||||
/// The value yielded by the iterator.
|
||||
Yield(T),
|
||||
/// The `StopIteration` object.
|
||||
Return(U),
|
||||
}
|
||||
|
||||
|
|
|
@ -98,11 +98,16 @@ py_unarys_func!(aiter, PyAsyncAiterProtocol, Self::__aiter__);
|
|||
py_unarys_func!(anext, PyAsyncAnextProtocol, Self::__anext__);
|
||||
|
||||
/// Output of `__anext__`.
|
||||
///
|
||||
/// <https://docs.python.org/3/reference/expressions.html#agen.__anext__>
|
||||
pub enum IterANextOutput<T, U> {
|
||||
/// An expression which the generator yielded.
|
||||
Yield(T),
|
||||
/// A `StopAsyncIteration` object.
|
||||
Return(U),
|
||||
}
|
||||
|
||||
/// An [IterANextOutput] of Python objects.
|
||||
pub type PyIterANextOutput = IterANextOutput<PyObject, PyObject>;
|
||||
|
||||
impl IntoPyCallbackOutput<*mut ffi::PyObject> for PyIterANextOutput {
|
||||
|
|
Loading…
Reference in New Issue