pub struct NtpResult {
pub packet: Packet,
pub destination_timestamp: TimestampFormat,
pub offset_seconds: f64,
pub delay_seconds: f64,
}Expand description
The result of an NTP request, containing the server’s response packet along with computed timing information.
This struct implements Deref<Target = protocol::Packet>, so all packet
fields can be accessed directly (e.g., result.transmit_timestamp).
Fields§
§packet: PacketThe parsed NTP response packet from the server.
destination_timestamp: TimestampFormatThe destination timestamp (T4): local time when the response was received.
Expressed as an NTP TimestampFormat for consistency with the packet timestamps.
offset_seconds: f64Clock offset: the estimated difference between the local clock and the server clock.
Computed as ((T2 - T1) + (T3 - T4)) / 2 per RFC 5905 Section 8, where:
- T1 = origin timestamp (client transmit time)
- T2 = receive timestamp (server receive time)
- T3 = transmit timestamp (server transmit time)
- T4 = destination timestamp (client receive time)
A positive value means the local clock is behind the server. A negative value means the local clock is ahead of the server.
delay_seconds: f64Round-trip delay between the client and server.
Computed as (T4 - T1) - (T3 - T2) per RFC 5905 Section 8.