Trait pyo3_asyncio::generic::ContextExt
source · pub trait ContextExt: Runtime {
// Required methods
fn scope<F, R>(
locals: TaskLocals,
fut: F
) -> Pin<Box<dyn Future<Output = R> + Send>>
where F: Future<Output = R> + Send + 'static;
fn get_task_locals() -> Option<TaskLocals>;
}
Expand description
Exposes the utilities necessary for using task-local data in the Runtime
Required Methods§
sourcefn scope<F, R>(
locals: TaskLocals,
fut: F
) -> Pin<Box<dyn Future<Output = R> + Send>>where
F: Future<Output = R> + Send + 'static,
fn scope<F, R>( locals: TaskLocals, fut: F ) -> Pin<Box<dyn Future<Output = R> + Send>>where F: Future<Output = R> + Send + 'static,
Set the task locals for the given future
sourcefn get_task_locals() -> Option<TaskLocals>
fn get_task_locals() -> Option<TaskLocals>
Get the task locals for the current task