Trait pyo3_asyncio::generic::Runtime[][src]

pub trait Runtime {
    type JoinError: JoinError + Send;
    type JoinHandle: Future<Output = Result<(), Self::JoinError>> + Send;
    fn scope<F, R>(
        event_loop: PyObject,
        fut: F
    ) -> Pin<Box<dyn Future<Output = R> + Send>>
    where
        F: Future<Output = R> + Send + 'static
;
fn get_task_event_loop(py: Python<'_>) -> Option<&PyAny>;
fn spawn<F>(fut: F) -> Self::JoinHandle
    where
        F: Future<Output = ()> + Send + 'static
; }
Expand description

Generic Rust async/await runtime

Associated Types

The error returned by a JoinHandle after being awaited

A future that completes with the result of the spawned task

Required methods

Set the task local event loop for the given future

Get the task local event loop for the current task

Spawn a future onto this runtime’s event loop

Implementors