ntp-client 0.1.0

The ntp-client is a Rust library designed for interacting with NTP (Network Time Protocol) servers. It enables developers to easily obtain accurate time information from NTP servers. This can be applied in scenarios such as calibrating system time and performing time synchronization. The library offers a simple and user - friendly API, and also features good performance and stability.
Documentation
/*!
### Example: Get time from an NTP server and sync systemtime
```rust
fn main() -> e_utils::AnyResult<()> {
    let target = "0.pool.ntp.org:123";
    let res = ntp_client::Client::new()
        .target(target)?
        .format(Some("%Y/%m/%d %H:%M:%S"))
        .request()?;
    let res_str = res.get_datetime_str().ok_or("error")?;
    println!("UTC str -> {res_str}");
    let datetime = res.get_datetime_utc().ok_or("get datetime utc")?;
    ntp_client::sync_systemtime(datetime)?;
    Ok(())
}
```
*/

#![doc = include_str!("../readme.md")]
#![allow(
  clippy::cognitive_complexity,
  clippy::large_enum_variant,
  clippy::module_inception,
  clippy::needless_doctest_main
)]
#![deny(unused_must_use)]
#![doc(test(no_crate_inject, attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))))]
// #![warn(missing_debug_implementations, missing_docs, rust_2018_idioms, unreachable_pub)]


pub mod formats;
pub mod packet;
pub use packet::Packet;
pub mod client;
pub use client::Client;
#[cfg(feature = "sync-system")]
mod sync_systemtime;
#[cfg(feature = "sync-system")]
pub use sync_systemtime::sync_systemtime;