ic-backup 0.15.0

Host-side snapshot backup and same-release recovery for Internet Computer canisters
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Poll immediate fixture providers without nesting a runtime around blocking Testkit.

use std::{
    future::Future,
    pin::pin,
    task::{Context, Poll, Waker},
};

/// Immediate fixtures must finish on their first poll; this is not an async executor.
pub fn ready<F: Future>(future: F) -> F::Output {
    match pin!(future).poll(&mut Context::from_waker(Waker::noop())) {
        Poll::Ready(value) => value,
        Poll::Pending => panic!("fixture unexpectedly requires an async executor"),
    }
}