run_future_in_dedicated_thread

Function run_future_in_dedicated_thread 

Source
pub fn run_future_in_dedicated_thread<CreateFut, Fut, T>(
    create_future: CreateFut,
    thread_name: String,
) -> Result<impl Future<Output = Result<T, Canceled>> + Send>
where CreateFut: FnOnce() -> Fut + Send + 'static, Fut: Future<Output = T> + 'static, T: Send + 'static,
Expand description

Runs future on a dedicated thread with the specified name. Will block on drop until background thread with future is stopped, ensuring nothing is left in memory.

Some OSes (like Linux) truncate thread names at 15 characters due to kernel limits.