#[repr(C)]pub struct TimeVal {
pub tv_sec: i64,
pub tv_usec: i64,
}Expand description
Time value (seconds + microseconds)
Fields§
§tv_sec: i64§tv_usec: i64Implementations§
Source§impl TimeVal
impl TimeVal
Sourcepub fn to_nanos(&self) -> u64
pub fn to_nanos(&self) -> u64
Convert to nanoseconds.
Negative fields are clamped to 0 per POSIX: a negative it_value
disarms the timer, and a negative it_interval is an error.
Returning 0 for either component ensures the caller sees “disarmed”
rather than a wrapped-to-huge u64.
Sourcepub fn from_nanos(nanos: u64) -> Self
pub fn from_nanos(nanos: u64) -> Self
Create from nanoseconds
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeVal
impl RefUnwindSafe for TimeVal
impl Send for TimeVal
impl Sync for TimeVal
impl Unpin for TimeVal
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more