[][src]Struct linux::time::Time

pub struct Time {
    pub seconds: i64,
    pub nanoseconds: i64,
}

A time offset.

= Remarks

This can have various meanings such as the duration of a timeout parameter or the offset from the epoch when a file was created.

Fields

seconds: i64

The seconds part of the offset.

nanoseconds: i64

The nanoseconds part of the offset.

Methods

impl Time[src]

pub fn normalize(self) -> Time[src]

Normalizes the time.

= Remarks

That is, transforms self into an equivalent representation where nanoseconds is in [0, 1_000_000_000).

pub fn nanoseconds(n: i64) -> Time[src]

Creates a Time that represents a number of nanoseconds.

[argument, n] The number of nanoseconds.

pub fn microseconds(m: i64) -> Time[src]

Creates a Time that represents a number of microseconds.

[argument, m] The number of microseconds.

pub fn milliseconds(m: i64) -> Time[src]

Creates a Time that represents a number of milliseconds.

[argument, m] The number of milliseconds.

pub fn seconds(s: i64) -> Time[src]

Creates a Time that represents a number of seconds.

[argument, s] The number of seconds.

pub fn minutes(m: i64) -> Time[src]

Creates a Time that represents a number of minutes.

[argument, m] The number of minutes.

pub fn hours(h: i64) -> Time[src]

Creates a Time that represents a number of hours.

[argument, h] The number of hours.

pub fn days(d: i64) -> Time[src]

Creates a Time that represents a number of days.

[argument, d] The number of days.

Trait Implementations

impl Pod for Time[src]

impl Eq for Time[src]

impl Ord for Time[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialEq<Time> for Time[src]

impl Copy for Time[src]

impl Clone for Time[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialOrd<Time> for Time[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Debug for Time[src]

impl Sub<Time> for Time[src]

type Output = Time

The resulting type after applying the - operator.

impl Add<Time> for Time[src]

type Output = Time

The resulting type after applying the + operator.

Auto Trait Implementations

impl Send for Time

impl Sync for Time

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]