Trait PyStream

Source
pub trait PyStream: Send {
    // Required method
    fn poll_next_py(
        self: Pin<&mut Self>,
        py: Python<'_>,
        cx: &mut Context<'_>,
    ) -> Poll<Option<PyResult<PyObject>>>;
}
Expand description

GIL-bound Stream.

Provided with a blanket implementation for Stream. GIL is maintained during polling operation. To release the GIL, see AllowThreads.

Required Methods§

Source

fn poll_next_py( self: Pin<&mut Self>, py: Python<'_>, cx: &mut Context<'_>, ) -> Poll<Option<PyResult<PyObject>>>

GIL-bound Stream::poll_next.

Implementors§

Source§

impl<S, T, E> PyStream for S
where S: Stream<Item = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,