Struct time::Timespec [-] [+] [src]

pub struct Timespec {
    pub sec: i64,
    pub nsec: i32,
}

A record specifying a time value in seconds and nanoseconds, where nanoseconds represent the offset from the given second.

For example a timespec of 1.2 seconds after the beginning of the epoch would be represented as {sec: 1, nsec: 200000000}.

Fields

sec
nsec

Methods

impl Timespec

fn new(sec: i64, nsec: i32) -> Timespec

Trait Implementations

impl Add<Duration> for Timespec

type Output = Timespec

fn add(self, other: Duration) -> Timespec

impl Sub<Duration> for Timespec

type Output = Timespec

fn sub(self, other: Duration) -> Timespec

impl Sub<Timespec> for Timespec

type Output = Duration

fn sub(self, other: Timespec) -> Duration

Derived Implementations

impl Hash for Timespec

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

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Debug for Timespec

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Ord for Timespec

fn cmp(&self, __arg_0: &Timespec) -> Ordering

impl PartialOrd for Timespec

fn partial_cmp(&self, __arg_0: &Timespec) -> Option<Ordering>

fn lt(&self, __arg_0: &Timespec) -> bool

fn le(&self, __arg_0: &Timespec) -> bool

fn gt(&self, __arg_0: &Timespec) -> bool

fn ge(&self, __arg_0: &Timespec) -> bool

impl Eq for Timespec

impl PartialEq for Timespec

fn eq(&self, __arg_0: &Timespec) -> bool

fn ne(&self, __arg_0: &Timespec) -> bool

impl Clone for Timespec

fn clone(&self) -> Timespec

fn clone_from(&mut self, source: &Self)

impl Copy for Timespec