[][src]Function safina::spawn_unpin

pub fn spawn_unpin(fut: impl Send + Unpin + Future<Output = ()> + 'static)

Creates a new task to execute fut and schedules it for immediate execution.

Panics if the caller is not running on an Executor.

Returns immediately.

Note that fut must be Unpin. You can use std::boxed::Box::pin to make it Unpin. The spawn function does this for you. Or use pin_utils::pin_mut to do it with unsafe code that does not allocate memory.