Struct filetime::FileTime [] [src]

pub struct FileTime { /* fields omitted */ }

A helper structure to represent a timestamp for a file.

The actual value contined within is platform-specific and does not have the same meaning across platforms, but comparisons and stringification can be significant among the same platform.

Methods

impl FileTime
[src]

Creates a new timestamp representing a 0 time.

Useful for creating the base of a cmp::max chain of times.

Creates a new instance of FileTime with a number of seconds and nanoseconds relative to January 1, 1970.

Note that this is typically the relative point that Unix time stamps are from, but on Windows the native time stamp is relative to January 1, 1601 so the return value of seconds from the returned FileTime instance may not be the same as that passed in.

Creates a new timestamp from the last modification time listed in the specified metadata.

The returned value corresponds to the mtime field of stat on Unix platforms and the ftLastWriteTime field on Windows platforms.

Creates a new timestamp from the last access time listed in the specified metadata.

The returned value corresponds to the atime field of stat on Unix platforms and the ftLastAccessTime field on Windows platforms.

Creates a new timestamp from the creation time listed in the specified metadata.

The returned value corresponds to the birthtime field of stat on Unix platforms and the ftCreationTime field on Windows platforms. Note that not all Unix platforms have this field available and may return None in some circumstances.

Returns the whole number of seconds represented by this timestamp.

Note that this value's meaning is platform specific. On Unix platform time stamps are typically relative to January 1, 1970, but on Windows platforms time stamps are relative to January 1, 1601.

Returns the whole number of seconds represented by this timestamp, relative to the Unix epoch start of January 1, 1970.

Note that this does not return the same value as seconds for Windows platforms as seconds are relative to a different date there.

Returns the nanosecond precision of this timestamp.

The returned value is always less than one billion and represents a portion of a second forward from the seconds returned by the seconds method.

Trait Implementations

impl Eq for FileTime
[src]

impl PartialEq for FileTime
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for FileTime
[src]

This method returns an Ordering between self and other. Read more

impl PartialOrd for FileTime
[src]

This method returns an ordering between self and other values if one exists. Read more

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

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

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

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

impl Debug for FileTime
[src]

Formats the value using the given formatter.

impl Copy for FileTime
[src]

impl Clone for FileTime
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for FileTime
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for FileTime
[src]

Formats the value using the given formatter. Read more