An HTTP web framework and server for Rust supporting HTTP/1.1, HTTP/2, and HTTP/3. No third-party HTTP dependencies — parsing, routing, middleware, auth, WebSocket, SSE, caching, tracing, and MCP server are all built in.
usestd::time::{SystemTime,UNIX_EPOCH};#[cfg(test)]modtests;pubstructDateTimeExt;implDateTimeExt{pubfn_now_unix_epoch_nanos()->u128{let now =SystemTime::now();let nanos =DateTimeExt::_system_time_to_unix_nanos(now);
nanos
}pubfn_system_time_to_unix_nanos(system_time: SystemTime)->u128{let boxed_duration = system_time.duration_since(UNIX_EPOCH);if boxed_duration.is_err(){eprintln!("unable to get duration from system time {}", boxed_duration.err().unwrap());let nanos =0asu128;return nanos
}let nanos = boxed_duration.unwrap().as_nanos();
nanos
}}