use crate::Result;
use crate::double::Double;
use crate::time::DateTime;
mod null;
#[cfg(feature = "repl")]
pub mod repl;
#[cfg(feature = "std")]
mod std;
pub use null::NullHost;
#[cfg(feature = "std")]
pub use std::StdHost;
pub trait Io {
fn key(&mut self) -> Result<Option<u8>>;
fn emit(&mut self, u: u8) -> Result<()>;
fn refill(&mut self, buf: &mut [u8]) -> Result<Option<usize>>;
}
pub trait Clock {
fn utime(&self) -> Double;
fn time_and_date(&self) -> DateTime;
fn sleep_ms(&self, ms: usize);
}
#[cfg(not(feature = "std"))]
pub trait MaybeClock {}
#[cfg(not(feature = "std"))]
impl<T> MaybeClock for T {}
#[cfg(feature = "std")]
pub trait MaybeClock: Clock {}
#[cfg(feature = "std")]
impl<T: Clock> MaybeClock for T {}