8 releases (4 breaking)

Uses old Rust 2015

0.5.0 Jun 29, 2018
0.4.0 Oct 26, 2017
0.3.1 Oct 21, 2017
0.3.0 Jul 12, 2017
0.1.1 Feb 23, 2017

#33 in #time-parser

Download history 198/week @ 2024-03-24 224/week @ 2024-03-31 164/week @ 2024-04-07 134/week @ 2024-04-14 164/week @ 2024-04-21 115/week @ 2024-04-28 175/week @ 2024-05-05 262/week @ 2024-05-12 225/week @ 2024-05-19 172/week @ 2024-05-26 301/week @ 2024-06-02 214/week @ 2024-06-09 258/week @ 2024-06-16 282/week @ 2024-06-23 101/week @ 2024-06-30 216/week @ 2024-07-07

881 downloads per month
Used in 3 crates

MIT/Apache

22KB
497 lines

Ntplib

An ntp packet parsing library written in Rust.

Usage

Add this to your Cargo.toml:

[dependencies]
ntp = "0.5"

and this to your crate root:

extern crate ntp;

Todo

  • no-std
  • io independent parsing
  • async support
  • setting clocks
  • ntp server functionality

Contributions

Pull Requests and Issues welcome!

License

ntp is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.


lib.rs:

Example

fn main() {
let address = "0.pool.ntp.org:123";
let response: ntp::packet::Packet = ntp::request(address).unwrap();
let ntp_time = response.transmit_time;
println!("{}", ntp_time);
}

Dependencies

~1–2MB
~33K SLoC