|
2 | 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | 3 | // file, You can obtain one at https://mozilla.org/MPL/2.0/. |
4 | 4 |
|
5 | | -use std::net::IpAddr; |
| 5 | +//! Common types for the NTP Admin API. |
| 6 | +//! |
| 7 | +//! This crate re-exports the latest versions of all types from the |
| 8 | +//! `ntp-admin-types-versions` crate. These are floating identifiers that should |
| 9 | +//! be used by business logic that doesn't need to care about API versioning. |
| 10 | +//! |
| 11 | +//! The API crate (`ntp-admin-api`) uses fixed identifiers from the versions |
| 12 | +//! crate directly. |
6 | 13 |
|
7 | | -use schemars::JsonSchema; |
8 | | -use serde::{Deserialize, Serialize}; |
9 | | - |
10 | | -#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)] |
11 | | -pub struct TimeSync { |
12 | | - /// The synchronization state of the sled, true when the system clock |
13 | | - /// and the NTP clock are in sync (to within a small window). |
14 | | - pub sync: bool, |
15 | | - /// The NTP reference ID. |
16 | | - pub ref_id: u32, |
17 | | - /// The NTP reference IP address. |
18 | | - pub ip_addr: IpAddr, |
19 | | - /// The NTP stratum (our upstream's stratum plus one). |
20 | | - pub stratum: u8, |
21 | | - /// The NTP reference time (i.e. what chrony thinks the current time is, not |
22 | | - /// necessarily the current system time). |
23 | | - pub ref_time: f64, |
24 | | - // This could be f32, but there is a problem with progenitor/typify |
25 | | - // where, although the f32 correctly becomes "float" (and not "double") in |
26 | | - // the API spec, that "float" gets converted back to f64 when generating |
27 | | - // the client. |
28 | | - /// The current offset between the NTP clock and system clock. |
29 | | - pub correction: f64, |
30 | | -} |
| 14 | +pub mod timesync; |
0 commit comments