[][src]Function futures_test::task::no_spawn_context

pub fn no_spawn_context() -> Context<'static>

Create a new task::Context where the waker will ignore any calls to wake while the spawner will panic if used.

Examples

#![feature(async_await, futures_api, pin)]
use futures::future::Future;
use futures::task::Poll;
use futures_test::task::no_spawn_context;
use pin_utils::pin_mut;

let mut future = async { 5 };
pin_mut!(future);

assert_eq!(future.poll(&mut no_spawn_context()), Poll::Ready(5));