Trait 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. GIL is maintained during polling operation. To release the GIL, see AllowThreads.

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 F
where F: Future<Output = Result<T, E>> + Send, T: IntoPy<PyObject> + Send, E: Send, PyErr: From<E>,