pub struct TimerFdInternal { /* private fields */ }Expand description
A synchronious timer instance based on the Linux’s timerfd_create.
A EPoll or select can be used to monitor the instance. Also the
instance implements Future which can be polled from async code. Or
used with tokio’s AsyncFd or any other equivalent.
It can be used with provided poll.rs event notification system wrapper.
Trait Implementations§
Source§impl AsFd for TimerFdInternal
impl AsFd for TimerFdInternal
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl AsRawFd for TimerFdInternal
impl AsRawFd for TimerFdInternal
Source§impl AsRef<str> for TimerFdInternal
impl AsRef<str> for TimerFdInternal
Source§impl Debug for TimerFdInternal
impl Debug for TimerFdInternal
Source§impl Display for TimerFdInternal
impl Display for TimerFdInternal
Source§impl FdTimerCom for TimerFdInternal
impl FdTimerCom for TimerFdInternal
Source§fn new(
label: Cow<'static, str>,
timer_type: TimerType,
timer_flags: TimerFlags,
) -> TimerPortResult<Self>
fn new( label: Cow<'static, str>, timer_type: TimerType, timer_flags: TimerFlags, ) -> TimerPortResult<Self>
Creates new isntance of the timer. Read more
Source§fn set_time<TIMERTYPE: ModeTimeType>(
&self,
timer_exp: TimerExpMode<TIMERTYPE>,
) -> TimerPortResult<()>
fn set_time<TIMERTYPE: ModeTimeType>( &self, timer_exp: TimerExpMode<TIMERTYPE>, ) -> TimerPortResult<()>
Sets the timer. The timer starts immidiatly and working depending on the
timer_exp mode. Read moreSource§fn unset_time(&self) -> TimerPortResult<()>
fn unset_time(&self) -> TimerPortResult<()>
Unsets the timer. The timer stops immidiatly.
Source§fn set_nonblocking(&self, flag: bool) -> TimerPortResult<()>
fn set_nonblocking(&self, flag: bool) -> TimerPortResult<()>
Sets the timer to non-blocking (on case if
flag is true).
If the timer was inited with
TimerFlags::TFD_NONBLOCK, then this will not do anything.Source§fn is_nonblocking(&self) -> TimerPortResult<bool>
fn is_nonblocking(&self) -> TimerPortResult<bool>
Reads the FD’s flags and check if Fd is in non-blocking mode.
May return error. Read more
Source§impl FdTimerRead for TimerFdInternal
impl FdTimerRead for TimerFdInternal
Source§fn 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). Read more
Source§impl Future for &TimerFdInternal
impl Future for &TimerFdInternal
Source§type Output = Result<TimerReadRes<u64>, TimerPortableErr>
type Output = Result<TimerReadRes<u64>, TimerPortableErr>
The type of value produced on completion.
Source§impl Future for TimerFdInternal
impl Future for TimerFdInternal
Source§type Output = Result<TimerReadRes<u64>, TimerPortableErr>
type Output = Result<TimerReadRes<u64>, TimerPortableErr>
The type of value produced on completion.
Source§impl Ord for TimerFdInternal
impl Ord for TimerFdInternal
Source§impl PartialEq<i32> for TimerFdInternal
impl PartialEq<i32> for TimerFdInternal
Source§impl PartialEq<str> for TimerFdInternal
impl PartialEq<str> for TimerFdInternal
Source§impl PartialEq for TimerFdInternal
impl PartialEq for TimerFdInternal
Source§impl PartialOrd for TimerFdInternal
impl PartialOrd for TimerFdInternal
impl Eq for TimerFdInternal
Auto Trait Implementations§
impl Freeze for TimerFdInternal
impl RefUnwindSafe for TimerFdInternal
impl Send for TimerFdInternal
impl Sync for TimerFdInternal
impl Unpin for TimerFdInternal
impl UnwindSafe for TimerFdInternal
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more