-
-
Save sanbox-irl/da63e097fa4779ee54ffe9230e8d93c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, serde::Serialize, serde::Deserialize)] | |
pub struct SerializedMetaData { | |
pub created: SystemTime, | |
pub modified: SystemTime, | |
} | |
impl SerializedMetaData { | |
/// There is a possibility of failure reading the created/modified. Unlikely | |
/// on any target platforms, but quite likely on consoles. Unfortunately, | |
/// NDAs prevent me from going into any detail there... | |
pub fn new(metadata: fs::Metadata) -> Result<SerializedMetaData, Error> { | |
Ok(SerializedMetaData { | |
created: metadata.created()?, | |
modified: metadata.modified()?, | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment