pub struct RelativeTime { /* private fields */ }
Expand description
A relative
time i.e time which is not binded to the system’s clock.
Implementations§
Source§impl RelativeTime
impl RelativeTime
Sourcepub fn new_time(time_sec: i64, time_nsec: i64) -> Self
pub fn new_time(time_sec: i64, time_nsec: i64) -> Self
Creates new instance for relative time accepting the user input.
Automatically corrects the time_nsec
value if it is larger than
999_999_999ns.
§Arguments
time_sec
- i64 a seconds in relative notation.
time_nsec
- i64 nanoseconds of relative seconds value. Should not be
larger than 999_999_999 which is defined by const Self::MAX_NS. In
case if it is larger, the nsec
will be rounded and an extra secons
will be added.
Trait Implementations§
Source§impl Add<RelativeTime> for AbsoluteTime
impl Add<RelativeTime> for AbsoluteTime
Source§type Output = AbsoluteTime
type Output = AbsoluteTime
The resulting type after applying the
+
operator.Source§impl Add<RelativeTime> for TimerExpMode<AbsoluteTime>
impl Add<RelativeTime> for TimerExpMode<AbsoluteTime>
Source§type Output = TimerExpMode<AbsoluteTime>
type Output = TimerExpMode<AbsoluteTime>
The resulting type after applying the
+
operator.Source§impl AddAssign<RelativeTime> for AbsoluteTime
impl AddAssign<RelativeTime> for AbsoluteTime
Source§fn add_assign(&mut self, rhs: RelativeTime)
fn add_assign(&mut self, rhs: RelativeTime)
Performs the
+=
operation. Read moreSource§impl AddAssign<RelativeTime> for TimerExpMode<AbsoluteTime>
impl AddAssign<RelativeTime> for TimerExpMode<AbsoluteTime>
Source§fn add_assign(&mut self, rhs: RelativeTime)
fn add_assign(&mut self, rhs: RelativeTime)
Performs the
+=
operation. Read moreSource§impl Clone for RelativeTime
impl Clone for RelativeTime
Source§fn clone(&self) -> RelativeTime
fn clone(&self) -> RelativeTime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RelativeTime
impl Debug for RelativeTime
Source§impl Display for RelativeTime
impl Display for RelativeTime
Source§impl From<Duration> for RelativeTime
Converts the Duration to RelativeTime taking the subsec_nanos
for the time_nsec
.
impl From<Duration> for RelativeTime
Converts the Duration to RelativeTime taking the subsec_nanos
for the time_nsec
.
Source§impl ModeTimeType for RelativeTime
impl ModeTimeType for RelativeTime
Source§fn new(time_spec: timespec) -> RelativeTime
fn new(time_spec: timespec) -> RelativeTime
Creates new instance from the two components: seconds and subnanoseconds of the seconds. Read more
Source§fn get_nsec(&self) -> i64
fn get_nsec(&self) -> i64
Returns the nanoseconds fraction from seconds, not a full time in nanoseconds.
Source§fn is_value_valid(&self) -> bool
fn is_value_valid(&self) -> bool
Verifies that the timer is not set to zero. For the RelativeTime it always returns true.
Source§fn get_flags() -> TimerSetTimeFlags
fn get_flags() -> TimerSetTimeFlags
Returns the TimerSetTimeFlags which are autoinitialized for both types. This flags
should be passed to timer.
Source§impl Ord for RelativeTime
impl Ord for RelativeTime
Source§impl PartialEq for RelativeTime
impl PartialEq for RelativeTime
Source§impl PartialOrd for RelativeTime
impl PartialOrd for RelativeTime
Source§impl Sub<RelativeTime> for AbsoluteTime
impl Sub<RelativeTime> for AbsoluteTime
Source§type Output = AbsoluteTime
type Output = AbsoluteTime
The resulting type after applying the
-
operator.Source§impl SubAssign<RelativeTime> for AbsoluteTime
impl SubAssign<RelativeTime> for AbsoluteTime
Source§fn sub_assign(&mut self, rhs: RelativeTime)
fn sub_assign(&mut self, rhs: RelativeTime)
Performs the
-=
operation. Read moreimpl Copy for RelativeTime
impl Eq for RelativeTime
impl StructuralPartialEq for RelativeTime
Auto Trait Implementations§
impl Freeze for RelativeTime
impl RefUnwindSafe for RelativeTime
impl Send for RelativeTime
impl Sync for RelativeTime
impl Unpin for RelativeTime
impl UnwindSafe for RelativeTime
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