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

Function string_field

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

Source from the content-addressed store, hash-verified

591}
592
593fn string_field(obj: &Map<String, Value>, key: &str) -> Result<String> {
594 obj.get(key)
595 .and_then(Value::as_str)
596 .map(str::to_string)
597 .ok_or_else(|| CanonicalError::Proof(format!("document is missing '{key}'")))
598}
599
600fn timestamp_field(obj: &Map<String, Value>, key: &str) -> Result<DateTime<Utc>> {
601 let raw = string_field(obj, key)?;

Callers 4

parseFunction · 0.85
verify_requestFunction · 0.85
verify_revocationFunction · 0.85
timestamp_fieldFunction · 0.85

Calls 2

ProofClass · 0.85
getMethod · 0.65

Tested by

no test coverage detected