pub trait FdTimerRead:
AsFd
+ AsRawFd
+ Display
+ AsRef<str>
+ PartialEq<str>
+ PartialEq<RawFd> {
// Required method
fn read(&self) -> TimerPortResult<TimerReadRes<u64>>;
}Expand description
Required Methods§
Sourcefn read(&self) -> TimerPortResult<TimerReadRes<u64>>
fn read(&self) -> TimerPortResult<TimerReadRes<u64>>
Attempts to read the timer. The realization is different on different OS. The main purpose is to check if timer is ready (ended).
§Returns
-
If FD is configured as non-blocking then returns TimerReadRes::WouldBlock otherwise would block.
-
If daytime modification happened the TimerReadRes::Cancelled will be returned, however it depends if the TimerSetTimeFlags::TFD_TIMER_CANCEL_ON_SET is set with TimerSetTimeFlags::TFD_TIMER_ABSTIME. Does not work on KQueue implementation.
-
If read was successfull the amount of the overflows before read will be returned i.e TimerReadRes::Ok. Normally is is
1. If0is returned then probably the time or day was modified. -
The Result::Err is returned if other error occured.