pub struct AbsoluteTime { /* private fields */ }
Expand description
An absolute
time which are binded to the system’s clock
and never be zero except when timer is reset.
Implementations§
Source§impl AbsoluteTime
impl AbsoluteTime
pub fn new_time(time_sec: i64, time_nsec: i64) -> Option<Self>
Sourcepub unsafe fn new_time_unchecked(time_sec: i64, time_nsec: i64) -> Self
pub unsafe fn new_time_unchecked(time_sec: i64, time_nsec: i64) -> Self
Creates new instance for absolute 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 absolute notation.
time_nsec
- i64 nanoseconds of absolute 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.
§Returns
An instance is returned. May panic on overflow.
Sourcepub fn seconds_cmp(&self, other: &Self) -> Ordering
pub fn seconds_cmp(&self, other: &Self) -> Ordering
Compares only full seconds without nanoseconds fraction (subnano).
pub fn add_sec(self, seconds: i64) -> Self
pub fn reset_nsec(self) -> Self
Trait Implementations§
Source§impl Add<RelativeTime> for AbsoluteTime
impl Add<RelativeTime> for AbsoluteTime
Source§type Output = AbsoluteTime
type Output = AbsoluteTime
+
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)
+=
operation. Read moreSource§impl Clone for AbsoluteTime
impl Clone for AbsoluteTime
Source§fn clone(&self) -> AbsoluteTime
fn clone(&self) -> AbsoluteTime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AbsoluteTime
impl Debug for AbsoluteTime
Source§impl Display for AbsoluteTime
impl Display for AbsoluteTime
Source§impl<TZ: TimeZone> From<DateTime<TZ>> for AbsoluteTime
Convers the chrono
DateTime into the AbsoluteTime using
the TZ
TimeZone taking the ns
fraction of a second (subsec_nano)
using timestamp_subsec_nanos
function.
impl<TZ: TimeZone> From<DateTime<TZ>> for AbsoluteTime
Convers the chrono
DateTimeTZ
TimeZone taking the ns
fraction of a second (subsec_nano)
using timestamp_subsec_nanos
function.
Source§impl From<Duration> for AbsoluteTime
Converts the Duration to RelativeTime taking the subsec_nanos
for the time_nsec
.
impl From<Duration> for AbsoluteTime
Converts the Duration to RelativeTime taking the subsec_nanos
for the time_nsec
.
Source§impl ModeTimeType for AbsoluteTime
impl ModeTimeType for AbsoluteTime
Source§fn new(time_spec: timespec) -> Selfwhere
Self: Sized,
fn new(time_spec: timespec) -> Selfwhere
Self: Sized,
Source§fn get_nsec(&self) -> i64
fn get_nsec(&self) -> i64
Source§fn is_value_valid(&self) -> bool
fn is_value_valid(&self) -> bool
Source§fn get_flags() -> TimerSetTimeFlags
fn get_flags() -> TimerSetTimeFlags
Source§impl Ord for AbsoluteTime
impl Ord for AbsoluteTime
Source§impl PartialEq for AbsoluteTime
impl PartialEq for AbsoluteTime
Source§impl PartialOrd for AbsoluteTime
impl PartialOrd for AbsoluteTime
Source§impl Sub<RelativeTime> for AbsoluteTime
impl Sub<RelativeTime> for AbsoluteTime
Source§type Output = AbsoluteTime
type Output = AbsoluteTime
-
operator.Source§impl Sub for AbsoluteTime
impl Sub for AbsoluteTime
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)
-=
operation. Read moreSource§impl SubAssign for AbsoluteTime
impl SubAssign for AbsoluteTime
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more