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

Function timestamp_field

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

Source from the content-addressed store, hash-verified

598}
599
600fn timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<DateTime<Utc>> {
601 let raw = string_field(obj, key)?;
602 DateTime::parse_from_rfc3339(&raw)
603 .map(|dt| dt.with_timezone(&Utc))
604 .map_err(|e| CanonicalError::Proof(format!("'{key}' is not a valid RFC 3339 time: {e}")))
605}
606
607fn optional_timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<Option<DateTime<Utc>>> {
608 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