Trait pal_async::task::SpawnLocal
source · pub trait SpawnLocal {
// Required method
fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>;
// Provided method
fn spawn_local<T: 'static>(
&self,
name: impl Into<Arc<str>>,
fut: impl Future<Output = T> + 'static,
) -> Task<T>
where Self: Sized { ... }
}
Expand description
Trait for spawning a non-Send
task on an executor.
Required Methods§
sourcefn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>
fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>
Gets a scheduler for a new task.