Skip to content

Commit ec3ac11

Browse files
committed
Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer
1 parent 0b9f19d commit ec3ac11

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

src/libstd/os/linux/fs.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub trait MetadataExt {
191191
/// ```
192192
#[stable(feature = "metadata_ext2", since = "1.8.0")]
193193
fn st_size(&self) -> u64;
194-
/// Returns the last access time.
194+
/// Returns the last access time of the file, in seconds since Unix Epoch.
195195
///
196196
/// # Examples
197197
///
@@ -208,7 +208,9 @@ pub trait MetadataExt {
208208
/// ```
209209
#[stable(feature = "metadata_ext2", since = "1.8.0")]
210210
fn st_atime(&self) -> i64;
211-
/// Returns the last access time, nano seconds part.
211+
/// Returns the last access time of the file, in nanoseconds since [`st_atime`].
212+
///
213+
/// [`st_atime`]: #tymethod.st_atime
212214
///
213215
/// # Examples
214216
///
@@ -225,7 +227,7 @@ pub trait MetadataExt {
225227
/// ```
226228
#[stable(feature = "metadata_ext2", since = "1.8.0")]
227229
fn st_atime_nsec(&self) -> i64;
228-
/// Returns the last modification time.
230+
/// Returns the last modification time of the file, in seconds since Unix Epoch.
229231
///
230232
/// # Examples
231233
///
@@ -242,7 +244,9 @@ pub trait MetadataExt {
242244
/// ```
243245
#[stable(feature = "metadata_ext2", since = "1.8.0")]
244246
fn st_mtime(&self) -> i64;
245-
/// Returns the last modification time, nano seconds part.
247+
/// Returns the last modification time of the file, in nanoseconds since [`st_mtime`].
248+
///
249+
/// [`st_mtime`]: #tymethod.st_mtime
246250
///
247251
/// # Examples
248252
///
@@ -259,7 +263,7 @@ pub trait MetadataExt {
259263
/// ```
260264
#[stable(feature = "metadata_ext2", since = "1.8.0")]
261265
fn st_mtime_nsec(&self) -> i64;
262-
/// Returns the last status change time.
266+
/// Returns the last status change time of the file, in seconds since Unix Epoch.
263267
///
264268
/// # Examples
265269
///
@@ -276,7 +280,9 @@ pub trait MetadataExt {
276280
/// ```
277281
#[stable(feature = "metadata_ext2", since = "1.8.0")]
278282
fn st_ctime(&self) -> i64;
279-
/// Returns the last status change time, nano seconds part.
283+
/// Returns the last status change time of the file, in nanoseconds since [`st_ctime`].
284+
///
285+
/// [`st_ctime`]: #tymethod.st_ctime
280286
///
281287
/// # Examples
282288
///

src/libstd/sys/unix/ext/fs.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ pub trait MetadataExt {
522522
/// ```
523523
#[stable(feature = "metadata_ext", since = "1.1.0")]
524524
fn size(&self) -> u64;
525-
/// Returns the time of the last access to the file.
525+
/// Returns the last access time of the file, in seconds since Unix Epoch.
526526
///
527527
/// # Examples
528528
///
@@ -539,7 +539,9 @@ pub trait MetadataExt {
539539
/// ```
540540
#[stable(feature = "metadata_ext", since = "1.1.0")]
541541
fn atime(&self) -> i64;
542-
/// Returns the time of the last access to the file in nanoseconds.
542+
/// Returns the last access time of the file, in nanoseconds since [`atime`].
543+
///
544+
/// [`atime`]: #tymethod.atime
543545
///
544546
/// # Examples
545547
///
@@ -556,7 +558,7 @@ pub trait MetadataExt {
556558
/// ```
557559
#[stable(feature = "metadata_ext", since = "1.1.0")]
558560
fn atime_nsec(&self) -> i64;
559-
/// Returns the time of the last modification of the file.
561+
/// Returns the last modification time of the file, in seconds since Unix Epoch.
560562
///
561563
/// # Examples
562564
///
@@ -573,7 +575,9 @@ pub trait MetadataExt {
573575
/// ```
574576
#[stable(feature = "metadata_ext", since = "1.1.0")]
575577
fn mtime(&self) -> i64;
576-
/// Returns the time of the last modification of the file in nanoseconds.
578+
/// Returns the last modification time of the file, in nanoseconds since [`mtime`].
579+
///
580+
/// [`mtime`]: #tymethod.mtime
577581
///
578582
/// # Examples
579583
///
@@ -590,7 +594,7 @@ pub trait MetadataExt {
590594
/// ```
591595
#[stable(feature = "metadata_ext", since = "1.1.0")]
592596
fn mtime_nsec(&self) -> i64;
593-
/// Returns the time of the last status change of the file.
597+
/// Returns the last status change time of the file, in seconds since Unix Epoch.
594598
///
595599
/// # Examples
596600
///
@@ -607,7 +611,9 @@ pub trait MetadataExt {
607611
/// ```
608612
#[stable(feature = "metadata_ext", since = "1.1.0")]
609613
fn ctime(&self) -> i64;
610-
/// Returns the time of the last status change of the file in nanoseconds.
614+
/// Returns the last status change time of the file, in nanoseconds since [`ctime`].
615+
///
616+
/// [`ctime`]: #tymethod.ctime
611617
///
612618
/// # Examples
613619
///

0 commit comments

Comments
 (0)