/// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
///
/// **Disclaimer:** These system calls might change over time.
-///
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[stable(feature = "time2", since = "1.8.0")]
pub struct Instant(time::Instant);
/// The size of a `SystemTime` struct may vary depending on the target operating
/// system.
///
-/// [`Instant`]: ../../std/time/struct.Instant.html
-/// [`Result`]: ../../std/result/enum.Result.html
-/// [`Duration`]: ../../std/time/struct.Duration.html
-/// [`UNIX_EPOCH`]: ../../std/time/constant.UNIX_EPOCH.html
-///
/// Example:
///
/// ```no_run
/// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
///
/// **Disclaimer:** These system calls might change over time.
-///
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[stable(feature = "time2", since = "1.8.0")]
pub struct SystemTime(time::SystemTime);
/// This function may panic if the resulting point in time cannot be represented by the
/// underlying data structure. See [`checked_add`] for a version without panic.
///
- /// [`checked_add`]: ../../std/time/struct.Instant.html#method.checked_add
+ /// [`checked_add`]: Instant::checked_add
fn add(self, other: Duration) -> Instant {
self.checked_add(other).expect("overflow when adding duration to instant")
}
/// Returns an [`Err`] if `earlier` is later than `self`, and the error
/// contains how far from `self` the time is.
///
- /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
- /// [`Duration`]: ../../std/time/struct.Duration.html
- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
- /// [`Instant`]: ../../std/time/struct.Instant.html
- ///
/// # Examples
///
/// ```
/// Returns an [`Err`] if `self` is later than the current system time, and
/// the error contains how far from the current system time `self` is.
///
- /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
- /// [`Duration`]: ../../std/time/struct.Duration.html
- /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
- /// [`Instant`]: ../../std/time/struct.Instant.html
- ///
/// # Examples
///
/// ```no_run
/// This function may panic if the resulting point in time cannot be represented by the
/// underlying data structure. See [`checked_add`] for a version without panic.
///
- /// [`checked_add`]: ../../std/time/struct.SystemTime.html#method.checked_add
+ /// [`checked_add`]: SystemTime::checked_add
fn add(self, dur: Duration) -> SystemTime {
self.checked_add(dur).expect("overflow when adding duration to instant")
}
/// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
/// [`SystemTime`] instance to represent another fixed point in time.
///
-/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
-///
/// # Examples
///
/// ```no_run
/// methods of [`SystemTime`] whenever the second system time represents a point later
/// in time than the `self` of the method call.
///
- /// [`duration_since`]: ../../std/time/struct.SystemTime.html#method.duration_since
- /// [`elapsed`]: ../../std/time/struct.SystemTime.html#method.elapsed
- /// [`SystemTime`]: ../../std/time/struct.SystemTime.html
+ /// [`duration_since`]: SystemTime::duration_since
+ /// [`elapsed`]: SystemTime::elapsed
///
/// # Examples
///