From 25ac4549a08ac2a0b56c74b1030a7f88b65d69e2 Mon Sep 17 00:00:00 2001 From: Richard Dodd Date: Sat, 5 Jan 2019 14:37:39 +0000 Subject: [PATCH] Docs --- crates/futures/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/futures/src/lib.rs b/crates/futures/src/lib.rs index 3711a666..ca35b0ab 100644 --- a/crates/futures/src/lib.rs +++ b/crates/futures/src/lib.rs @@ -378,7 +378,14 @@ fn _future_to_promise(future: Box>) -> P } } -/// Spawns a future. +/// Converts a Rust `Future` on a local task queue. +/// +/// The `future` provided must adhere to `'static` because it'll be scheduled +/// to run in the background and cannot contain any stack references. +/// +/// # Panics +/// +/// This function has the same panic behavior as `future_to_promise`. pub fn spawn_local(future: F) where F: Future + 'static,