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

#53 in #time-parser

Download history 157/week @ 2024-07-21 213/week @ 2024-07-28 263/week @ 2024-08-04 246/week @ 2024-08-11 249/week @ 2024-08-18 287/week @ 2024-08-25 331/week @ 2024-09-01 320/week @ 2024-09-08 238/week @ 2024-09-15 321/week @ 2024-09-22 293/week @ 2024-09-29 293/week @ 2024-10-06 349/week @ 2024-10-13 303/week @ 2024-10-20 254/week @ 2024-10-27 300/week @ 2024-11-03

1,232 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–6MB
~32K SLoC