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

Function as_object

atomic-canonical/src/delegation.rs:574–578  ·  view source on GitHub ↗
(value: &Value)

Source from the content-addressed store, hash-verified

572}
573
574fn as_object(value: &Value) -> Result<&Map<String, Value>> {
575 value
576 .as_object()
577 .ok_or_else(|| CanonicalError::Proof("document is not a JSON object".into()))
578}
579
580fn expect_type(value: &Value, expected: &str) -> Result<()> {
581 let actual = as_object(value)?.get("@type").and_then(Value::as_str);

Callers 4

parseFunction · 0.85
verify_requestFunction · 0.85
verify_revocationFunction · 0.85
expect_typeFunction · 0.85

Calls 1

ProofClass · 0.85

Tested by

no test coverage detected