Trait pyo3_async::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 GilUnbound.

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 GilUnbound<S>where S: Stream<Item = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,

source§

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