Crate barentp

Crate barentp 

Source
Expand description

An NTP client library for use with and without the standard library.

This library providers both block and non-blocking (async) interfaces for getting the current time from an NTP server.

The async feature must be enabled to use the async interface found in nonblocking.

The std feature can be enabled for an implementation of NtpTransport and NtpTransportAsync that uses the standard library’s std::net::UdpSocket.

The chrono feature can be enabled for an implementation of From<Timestamp> to the chrono crate’s NaiveDateTime and DateTime<Utc> types.

In order to use the library you will first need an implementation of the NtpTransport or NtpTransportAsync trait.

Then you can use one of sntp_get_transmit_timestamp or sntp_get_transmit_timestamp to get the current time from an NTP server. DNS lookup functionality is not provided by this library.

Modules§

error
nonblocking

Structs§

Timestamp

Traits§

NtpTransport

Functions§

sntp_get_transmit_timestamp