use std::future::Future;
use std::pin::Pin;
use std::time::{Duration, Instant};
#[cfg(any(feature = "tokio", feature = "test-util"))]
pub(crate) mod rng;
#[cfg(feature = "tokio")]
mod tokio;
#[cfg(feature = "tokio")]
pub use tokio::TokioCore;
#[cfg(feature = "test-util")]
mod test;
#[cfg(feature = "test-util")]
pub use test::{ManualClock, TestCore};
pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
pub trait Core {
fn now(&self) -> Instant;
fn sleep(&self, dur: Duration) -> BoxFuture<'_, ()>;
fn next_u64(&self) -> u64;
}
#[cfg(feature = "tokio")]
pub type DefaultCore = TokioCore;