rama_utils/include_dir/
metadata.rs1use std::time::{Duration, SystemTime};
2
3#[derive(Debug, Copy, Clone, PartialEq, Eq)]
5pub struct Metadata {
6 accessed: Duration,
7 created: Duration,
8 modified: Duration,
9}
10
11impl Metadata {
12 #[must_use]
15 pub const fn new(accessed: Duration, created: Duration, modified: Duration) -> Self {
16 Self {
17 accessed,
18 created,
19 modified,
20 }
21 }
22
23 #[must_use]
27 pub fn accessed(&self) -> SystemTime {
28 SystemTime::UNIX_EPOCH + self.accessed
29 }
30
31 #[must_use]
35 pub fn created(&self) -> SystemTime {
36 SystemTime::UNIX_EPOCH + self.created
37 }
38
39 #[must_use]
43 pub fn modified(&self) -> SystemTime {
44 SystemTime::UNIX_EPOCH + self.modified
45 }
46}