pub struct VMClock { /* private fields */ }Expand description
VMClock provides the following capabilities:
- Error-bounded timestamps obtained from ClockBound daemon.
- Clock disruption signaling via the VMClock.
Implementations§
Source§impl VMClock
impl VMClock
Sourcepub fn new(
clockbound_shm_path: &str,
vmclock_shm_path: &str,
) -> Result<VMClock, ShmError>
pub fn new( clockbound_shm_path: &str, vmclock_shm_path: &str, ) -> Result<VMClock, ShmError>
Open the VMClock shared memory segment and the ClockBound shared memory segment for reading.
On error, returns an appropriate Errno. If the content of the segment
is uninitialized, unparseable, or otherwise malformed, EPROTO will be
returned.
Sourcepub fn now(&mut self) -> Result<(TimeSpec, TimeSpec, ClockStatus), ShmError>
pub fn now(&mut self) -> Result<(TimeSpec, TimeSpec, ClockStatus), ShmError>
The VMClock equivalent of clock_gettime(), but with bound on accuracy.
Returns a pair of (earliest, latest) timespec between which current time exists. The interval width is twice the clock error bound (ceb) such that: (earliest, latest) = ((now - ceb), (now + ceb)) The function also returns a clock status to assert that the clock is being synchronized, or free-running, or …
Auto Trait Implementations§
impl Freeze for VMClock
impl RefUnwindSafe for VMClock
impl !Send for VMClock
impl !Sync for VMClock
impl Unpin for VMClock
impl UnwindSafe for VMClock
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