futures_test::task

Function noop_context

Source
pub fn noop_context() -> Context<'static>
Expand description

Create a new Context where the waker will ignore any uses.

ยงExamples

use futures::future::Future;
use futures::task::Poll;
use futures_test::task::noop_context;
use futures::pin_mut;

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

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