Trait tokio_rayon::AsyncThreadPool [−][src]
Extension trait that integrates Rayon’s ThreadPool
with Tokio.
Required methods
#[must_use]fn spawn_async<'life0, 'async_trait, F, R>(
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Asynchronous wrapper around Rayon’s
ThreadPool::spawn
.
Runs a function on the global Rayon thread pool with LIFO priority, produciing a future that resolves with the function’s return value.
Errors
Forwards Tokio’s RecvError
, i.e. if the channel is closed.
#[must_use]fn spawn_fifo_async<'life0, 'async_trait, F, R>(
&'life0 self,
f: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
f: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Asynchronous wrapper around Rayon’s
ThreadPool::spawn_fifo
.
Runs a function on the global Rayon thread pool with FIFO priority, produciing a future that resolves with the function’s return value.
Errors
Forwards Tokio’s RecvError
, i.e. if the channel is closed.
Implementations on Foreign Types
impl AsyncThreadPool for ThreadPool
[src]
fn spawn_async<'life0, 'async_trait, F, R>(
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn spawn_fifo_async<'life0, 'async_trait, F, R>(
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
func: F
) -> Pin<Box<dyn Future<Output = Result<R, RecvError>> + Send + 'async_trait>> where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
F: 'async_trait,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,