#[repr(C)]pub struct Timestamps {
pub created: u64,
pub modified: u64,
pub accessed: u64,
}Expand description
Generic timestamps using Unix epoch (seconds since 1970-01-01 00:00:00 UTC).
This representation is no-std compatible and can be converted to platform-specific types when needed.
Fields§
§created: u64Creation time (seconds since Unix epoch).
modified: u64Last modification time (seconds since Unix epoch).
accessed: u64Last access time (seconds since Unix epoch).
Implementations§
Source§impl Timestamps
impl Timestamps
Sourcepub const fn new(time: u64) -> Self
pub const fn new(time: u64) -> Self
Creates new timestamps with all fields set to the same value.
Sourcepub const fn with_times(created: u64, modified: u64, accessed: u64) -> Self
pub const fn with_times(created: u64, modified: u64, accessed: u64) -> Self
Creates timestamps with explicit values for each field.
Sourcepub const fn most_recent(&self) -> u64
pub const fn most_recent(&self) -> u64
Returns the most recent timestamp.
Trait Implementations§
Source§impl Clone for Timestamps
impl Clone for Timestamps
Source§fn clone(&self) -> Timestamps
fn clone(&self) -> Timestamps
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Timestamps
Source§impl Debug for Timestamps
impl Debug for Timestamps
Source§impl Default for Timestamps
impl Default for Timestamps
Source§fn default() -> Timestamps
fn default() -> Timestamps
Returns the “default value” for a type. Read more
impl Eq for Timestamps
Source§impl Hash for Timestamps
impl Hash for Timestamps
Source§impl PartialEq for Timestamps
impl PartialEq for Timestamps
impl Pod for Timestamps
impl StructuralPartialEq for Timestamps
Auto Trait Implementations§
impl Freeze for Timestamps
impl RefUnwindSafe for Timestamps
impl Send for Timestamps
impl Sync for Timestamps
impl Unpin for Timestamps
impl UnsafeUnpin for Timestamps
impl UnwindSafe for Timestamps
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.