pub struct Time { /* private fields */ }
Expand description
Represents a point in time for file system operations.
Time_type
stores time as seconds since the Unix epoch (January 1, 1970).
It’s used throughout the file system for tracking file creation, modification,
and access times. The type is designed to be efficient for storage and comparison.
§Examples
use file_system::Time_type;
// Create a time representing the Unix epoch
let epoch = Time_type::new(0);
assert_eq!(epoch.As_u64(), 0);
// Create a time for a specific moment
let time = Time_type::new(1642684800); // January 20, 2022
§Storage
Times are stored as 64-bit unsigned integers representing seconds, providing a range from 1970 to approximately year 584 billion, which is sufficient for any practical file system use.
Implementations§
Trait Implementations§
Source§impl From<Duration> for Time
Convert from a duration to a time.
impl From<Duration> for Time
Convert from a duration to a time.
This treats the duration as an absolute time since the Unix epoch.
Source§impl From<Time> for Duration
Convert from a time to a duration.
impl From<Time> for Duration
Convert from a time to a duration.
This converts the absolute time to a duration since the Unix epoch.
Source§impl Ord for Time
impl Ord for Time
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl Copy for Time
impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more