roughtime 0.1.0

A no_std-capable Roughtime secure time-sync client with pluggable crypto backends
Documentation
//! Queries the well-known public Roughtime servers with **no manual IP resolution**: server
//! hostnames are resolved over `DNSCrypt` (authenticated, encrypted DNS) instead of the OS's
//! plaintext, unauthenticated resolver, closing the one remaining unauthenticated hop before
//! Roughtime's own Ed25519-verified response takes over.
//!
//! Compare with `query_tokio.rs`, which resolves hostnames via the plain OS resolver
//! (`std::net::ToSocketAddrs`) and requires the caller to build the resolved-server list by hand.
//!
//! Run with: `cargo run --example query_dnscrypt` (the `dnscrypt` feature is in `default`).

use roughtime::client::{RoughtimeClientConfig, TokioClient};

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let client = TokioClient::new(RoughtimeClientConfig::default());

    match client.query_well_known().await {
        Ok(result) => {
            println!(
                "Verified Unix time: {}s (radius {}us)",
                result.time.as_unix_seconds(),
                result.time.radius_micros
            );
            if let Some(spread) = result.spread_warning {
                println!("Warning: server spread was {spread:?}");
            }
        }
        Err(err) => eprintln!("Query failed: {err}"),
    }
}