MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / timestamp_field

Function timestamp_field

atomic-canonical/src/delegation.rs:635–640  ·  view source on GitHub ↗
(obj: &Map<String, Value>, key: &str)

Source from the content-addressed store, hash-verified

633}
634
635fn timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<DateTime<Utc>> {
636 let raw = string_field(obj, key)?;
637 DateTime::parse_from_rfc3339(&raw)
638 .map(|dt| dt.with_timezone(&Utc))
639 .map_err(|e| CanonicalError::Proof(format!("'{key}' is not a valid RFC 3339 time: {e}")))
640}
641
642fn optional_timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<Option<DateTime<Utc>>> {
643 match obj.get(key) {

Callers 4

parseFunction · 0.85
verify_requestFunction · 0.85
verify_revocationFunction · 0.85
optional_timestamp_fieldFunction · 0.85

Calls 2

string_fieldFunction · 0.85
ProofClass · 0.85

Tested by

no test coverage detected