#[non_exhaustive]pub struct Anchor {
pub mono_us: u64,
pub utc_us: i64,
pub source: ClockSource,
pub uncertainty_us: u64,
}Expand description
One anchor: at monotonic mono_us UTC was utc_us.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mono_us: u64Monotonic microseconds.
utc_us: i64Unix microseconds.
source: ClockSourceWhere it came from.
uncertainty_us: u64Half-width of the error bar.
Implementations§
Source§impl Anchor
impl Anchor
Sourcepub fn from_sample(sample: UtcSample, source: ClockSource) -> Self
pub fn from_sample(sample: UtcSample, source: ClockSource) -> Self
Anchor from a measured sample.
Sourcepub fn mono_for_utc(&self, utc_us: i64) -> u64
pub fn mono_for_utc(&self, utc_us: i64) -> u64
The monotonic instant at which UTC reaches utc_us, saturating at
0..=u64::MAX.
Trait Implementations§
impl Copy for Anchor
impl Eq for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl Forget for Anchor
impl Freeze for Anchor
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnsafeUnpin for Anchor
impl UnwindSafe for Anchor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more