tez 0.0.3

A lightweight, ergonomic, and fast high-level HTTP client for Rust
Documentation
use super::{Executor, Runtime, Timer};

/// Builds runtime capabilities backed by Smol.
#[derive(Clone, Copy, Debug, Default)]
pub struct Smol;

impl Smol {
    /// Creates a complete Smol runtime integration for a Tez client.
    #[must_use]
    pub fn runtime() -> Runtime {
        Runtime::builder()
            .executor(Executor::new(|future| {
                smol::spawn(future).detach();
            }))
            .timer(Timer::new(|deadline| async move {
                let _ = async_io::Timer::at(deadline).await;
            }))
            .build()
    }
}