Get the current clock source and its stratum Returns a tuple of (`ClockSource`, `Stratum`) representing the current state.
(&self)
| 26 | /// |
| 27 | /// Returns a tuple of (`ClockSource`, `Stratum`) representing the current state. |
| 28 | pub fn get(&self) -> (ClockSource, Stratum) { |
| 29 | let packed = self.source_info.load(Ordering::Relaxed); |
| 30 | let refid = (packed & 0xFFFF_FFFF) as u32; |
| 31 | let stratum = |
| 32 | Stratum::try_from(((packed >> 32) & 0xFF) as u8).unwrap_or(Stratum::Unspecified); |
| 33 | |
| 34 | (Self::params_to_source(refid, stratum), stratum) |
| 35 | } |
| 36 | |
| 37 | /// Get the current clock source and the stratum of this client |
| 38 | /// |
no outgoing calls