Skip to main content

Crate rusty_time_core

Crate rusty_time_core 

Source
Expand description

rusty_time-core — portable NTP protocol and clock-discipline algorithms.

This crate knows bytes, timestamps, and estimates. It performs no I/O, reads no OS clock, and holds no product types: a developer who has never heard of the rest of the workspace can drive it. All platform work lives behind the seams in rusty_time-clock; all wire transport lives in the deliverables.

Sign convention used everywhere: an offset is the number of seconds to ADD to the local clock to match the source (RFC 5905 θ). Positive offset = local is behind.

Re-exports§

pub use discipline::ClockCommand;
pub use discipline::Discipline;
pub use discipline::DisciplineConfig;
pub use discipline::Plan;
pub use filter::RegressEstimate;
pub use filter::Sample;
pub use filter::SampleRegister;
pub use ntp::LeapIndicator;
pub use ntp::Mode;
pub use ntp::NtpPacket;
pub use ntp::NtpShort;
pub use ntp::NtpTimestamp;
pub use ntp::ParseError;
pub use select::Selection;
pub use select::SourceEstimate;
pub use server::ClientHandle;
pub use server::ClientRecord;
pub use server::ClientTable;
pub use server::Disposition;
pub use server::RateLimitConfig;
pub use server::ResponseMode;
pub use server::ServerStats;
pub use vclock::VirtualClock;

Modules§

client
The client-side synchronisation controller.
config
chrony.conf-compatible configuration (the documented subset).
discipline
The clock-discipline loop: turn estimates into clock commands.
filter
Per-source sample history and regression estimation.
ntp
NTPv4 packet codec (RFC 5905) with extension-field iteration (RFC 7822).
refclock
Reference-clock samples: what a GPS, a PPS edge or a PTP hardware clock hands us, and what must be true before any of it is believed.
select
Source selection: falseticker rejection by interval intersection (RFC 5905 §11.2.1) and weighted combining.
server
Server-side policy: client tracking, rate limiting, and interleaved mode.
vclock
The virtual clock: a disciplined view of time for hosts where the OS clock cannot be adjusted (wasm, unprivileged processes) — and the holdover model everywhere else.