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§

source

fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>

Gets a scheduler for a new task.

Provided Methods§

source

fn spawn_local<T: 'static>( &self, name: impl Into<Arc<str>>, fut: impl Future<Output = T> + 'static, ) -> Task<T>
where Self: Sized,

Spawns a task.

Implementations on Foreign Types§

source§

impl<T: ?Sized + SpawnLocal> SpawnLocal for &T

source§

fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>

source§

impl<T: ?Sized + SpawnLocal> SpawnLocal for Box<T>

source§

fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>

source§

impl<T: ?Sized + SpawnLocal> SpawnLocal for Arc<T>

source§

fn scheduler_local(&self, metadata: &TaskMetadata) -> Arc<dyn Schedule>

Implementors§