pub struct Phc { /* private fields */ }Expand description
An open PTP hardware clock.
Implementations§
Source§impl Phc
impl Phc
pub fn index(&self) -> u32
Sourcepub fn read_s(&self) -> Result<f64, ClockError>
pub fn read_s(&self) -> Result<f64, ClockError>
Read the PHC’s current time, in Unix seconds.
Sourcepub fn sample(&self) -> Result<RefclockSample, ClockError>
pub fn sample(&self) -> Result<RefclockSample, ClockError>
Sample the PHC against the system clock.
Reads system, PHC, system and takes the midpoint of the two system
readings, so the unavoidable read latency is split rather than
charged entirely to one side. PTP_SYS_OFFSET_PRECISE does better
where hardware supports it; this works everywhere.
Auto Trait Implementations§
impl Freeze for Phc
impl RefUnwindSafe for Phc
impl Send for Phc
impl Sync for Phc
impl Unpin for Phc
impl UnsafeUnpin for Phc
impl UnwindSafe for Phc
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