Module

std::time

namespace Time

Records

record Duration
Members
secs: u64
nanos: u32
static fromMicros(micros: u64): Duration
static fromMillis(millis: u64): Duration
static fromNanos(nanos: u64): Duration
static fromSeconds(secs: u64): Duration
checkedAdd(&self, other: Duration): Option<Duration>
checkedSub(&self, other: Duration): Option<Duration>
compare(&self, other: &Duration): i32
wholeMicros(&self): u64
wholeMillis(&self): u64
wholeNanos(&self): u64
wholeSeconds(&self): u64
record MonotonicInstant
Members
secs: u64
nanos: u32
static now(): Result<MonotonicInstant, IoError>
checkedDurationSince(&self, other: MonotonicInstant): Option<Duration>
compare(&self, other: &MonotonicInstant): i32
elapsed(&self): Result<Duration, IoError>
record SystemTime
Members
secs: i64
nanos: u32
static now(): Result<SystemTime, IoError>
checkedAddDuration(&self, duration: Duration): Option<SystemTime>
checkedDurationSince(&self, other: SystemTime): Option<Duration>
checkedSubDuration(&self, duration: Duration): Option<SystemTime>
compare(&self, other: &SystemTime): i32
durationSinceUnixEpoch(&self): Result<Duration, TimeError>
record TimeError
Members
kind: TimeErrorKind
io: Option<IoError>
static beforeEpoch(): TimeError
static negativeDifference(): TimeError
static overflow(): TimeError
errorKind(&self): TimeErrorKind
ioError(&self): Option<IoError>

Enums

enum TimeErrorKind
Members
OVERFLOW
NEGATIVE_DIFFERENCE
BEFORE_EPOCH

Functions

function checkedAddI64U64(base: i64, delta: u64): Option<i64>
function checkedSubI64U64(base: i64, delta: u64): Option<i64>
function checkedUnsignedDurationBetween(leftSecs: u64, leftNanos: u32, rightSecs: u64, rightNanos: u32): Option<Duration>
function compareUnsignedParts(leftSecs: u64, leftNanos: u32, rightSecs: u64, rightNanos: u32): i32
function negativeMagnitude(value: i64): u64
function readClock(clockId: i32): Result<Timespec, IoError>
function signedDifferenceToUnsigned(left: i64, right: i64): u64

Constants

const MICROS_PER_SECOND: u64
const MILLIS_PER_SECOND: u64
const NANOS_PER_MICRO: u64
const NANOS_PER_MILLI: u64
const NANOS_PER_SECOND_U32: u32
const NANOS_PER_SECOND_U64: u64