Trait pyo3_async::PyFuture

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

GIL-bound Future.

Provided with a blanket implementation for Future which polls inside Python::allow_threads.

Required Methods§

source

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

GIL-bound Future::poll.

Implementors§

source§

impl<F, T, E> PyFuture for Fwhere F: Future<Output = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,