pub struct TimeVal { /* private fields */ }
Implementations§
Source§impl TimeVal
impl TimeVal
pub const fn new(sec: u64, nano: u32) -> TimeVal
pub const fn from_hours(hr: u32) -> TimeVal
pub const fn as_secs(&self) -> u64
Sourcepub const fn subsec_nanos(&self) -> u32
pub const fn subsec_nanos(&self) -> u32
Returns the fractional part of this Duration
, in nanoseconds.
This method does not return the length of the duration when represented by nanoseconds. The returned number always represents a fractional portion of a second (i.e., it is less than one billion).
§Examples
use crate::libts::TimeVal;
let duration = TimeVal::new(5, 10_000_000);
assert_eq!(duration.as_secs(), 5);
assert_eq!(duration.subsec_nanos(), 10_000_000);
pub fn as_secs_f64(&self) -> f64
pub fn as_hours(&self) -> u32
pub fn subhour_micros(&self) -> u32
pub fn to_duration(&self) -> Duration
pub fn date(&self) -> (i32, i32, i32)
pub fn days(&self) -> u32
pub fn hms(&self) -> (u32, u32, u32)
pub fn now() -> TimeVal
Trait Implementations§
Source§impl AddAssign<u64> for TimeVal
impl AddAssign<u64> for TimeVal
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moreSource§impl AddAssign for TimeVal
impl AddAssign for TimeVal
Source§fn add_assign(&mut self, rhs: TimeVal)
fn add_assign(&mut self, rhs: TimeVal)
Performs the
+=
operation. Read moreSource§impl Ord for TimeVal
impl Ord for TimeVal
Source§impl PartialOrd for TimeVal
impl PartialOrd for TimeVal
Source§impl SubAssign for TimeVal
impl SubAssign for TimeVal
Source§fn sub_assign(&mut self, rhs: TimeVal)
fn sub_assign(&mut self, rhs: TimeVal)
Performs the
-=
operation. Read moreimpl Copy for TimeVal
impl Eq for TimeVal
Auto Trait Implementations§
impl Freeze for TimeVal
impl RefUnwindSafe for TimeVal
impl Send for TimeVal
impl Sync for TimeVal
impl Unpin for TimeVal
impl UnwindSafe for TimeVal
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