Struct TimeVal

#[repr(transparent)]
pub struct TimeVal(/* private field */);

Implementations

impl TimeVal

const fn new(seconds: time_t, microseconds: suseconds_t) -> Self

Construct a new TimeVal from its components

const fn tv_sec(&self) -> time_t
const fn tv_usec(&self) -> suseconds_t

Trait Implementations

impl Add for TimeVal

type Output = TimeVal;
fn add(self, rhs: TimeVal) -> TimeVal

impl AsMut<timeval> for TimeVal

fn as_mut(&mut self) -> &mut timeval

impl AsRef<timeval> for TimeVal

fn as_ref(&self) -> &timeval

impl Clone for TimeVal

fn clone(&self) -> Self

impl Copy for TimeVal

impl Debug for TimeVal

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for TimeVal

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Div<i32> for TimeVal

type Output = TimeVal;
fn div(self, rhs: i32) -> TimeVal

impl Eq for TimeVal

impl From<timeval> for TimeVal

fn from(tv: timeval) -> Self

impl Hash for TimeVal

fn hash<__H: Hasher>(&self, state: &mut __H)

impl Mul<i32> for TimeVal

type Output = TimeVal;
fn mul(self, rhs: i32) -> TimeVal

impl Neg for TimeVal

type Output = TimeVal;
fn neg(self) -> TimeVal

impl Ord for TimeVal

fn cmp(&self, other: &TimeVal) -> Ordering

impl PartialEq for TimeVal

fn eq(&self, other: &Self) -> bool

impl PartialOrd for TimeVal

fn partial_cmp(&self, other: &TimeVal) -> Option<Ordering>

impl StructuralPartialEq for TimeVal

impl Sub for TimeVal

type Output = TimeVal;
fn sub(self, rhs: TimeVal) -> TimeVal

impl TimeValLike for TimeVal

fn seconds(seconds: i64) -> TimeVal
fn milliseconds(milliseconds: i64) -> TimeVal
fn microseconds(microseconds: i64) -> TimeVal

Makes a new TimeVal with given number of microseconds.

fn nanoseconds(nanoseconds: i64) -> TimeVal

Makes a new TimeVal with given number of nanoseconds. Some precision will be lost

fn num_seconds(&self) -> i64
fn num_milliseconds(&self) -> i64
fn num_microseconds(&self) -> i64
fn num_nanoseconds(&self) -> i64

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

impl<T> Any for TimeVal where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TimeVal where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TimeVal where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for TimeVal where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for TimeVal

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for TimeVal where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for TimeVal where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for TimeVal where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for TimeVal where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for TimeVal where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>