pub struct ClockBoundClient { /* private fields */ }Expand description
The ClockBoundClient
Use it to return current time, the clock error bound and clock status associated with it.
Implementations§
Source§impl ClockBoundClient
impl ClockBoundClient
Sourcepub fn new() -> Result<ClockBoundClient, ClockBoundError>
pub fn new() -> Result<ClockBoundClient, ClockBoundError>
Creates and returns a new ClockBoundClient.
The client accesses two shared memory segments. One written to by the ClockBound daemon. The second one by the VMClock device (if available).
Use default paths to the two shared memory segments.
§Errors
Returns ClockBoundError if the shared memory segments cannot be open or accessed.
Sourcepub fn new_with_path(
clockbound_shm_path: &str,
) -> Result<ClockBoundClient, ClockBoundError>
pub fn new_with_path( clockbound_shm_path: &str, ) -> Result<ClockBoundClient, ClockBoundError>
Creates and returns a new ClockBoundClient.
The client accesses two shared memory segments. One written to by the ClockBound daemon. The second one by the VMClock device (if available).
Specify the path to the shared memory segment written to by the VMClock device. Use the default paths to the ClockBound daemon shared memory segment.
§Errors
Returns ClockBoundError if the shared memory segments cannot be open or accessed.
Sourcepub fn new_with_paths(
clockbound_shm_path: &str,
vmclock_shm_path: &str,
) -> Result<ClockBoundClient, ClockBoundError>
pub fn new_with_paths( clockbound_shm_path: &str, vmclock_shm_path: &str, ) -> Result<ClockBoundClient, ClockBoundError>
Creates and returns a new ClockBoundClient.
The client accesses two shared memory segments. One written to by the ClockBound daemon. The second one by the VMClock device (if available).
Explicitly specifies the paths to the two shared memory segments.
§Errors
Returns ClockBoundError if the shared memory segments cannot be open or accessed.
Sourcepub fn now(&mut self) -> Result<ClockBoundNowResult, ClockBoundError>
pub fn now(&mut self) -> Result<ClockBoundNowResult, ClockBoundError>
Read the current time, but with a bound on accuracy and a status.
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 …
§Errors
Returns ClockBoundError if the shared memory segments cannot be open or accessed.