MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / parse

Method parse

claw-code/rust/crates/runtime/src/json.rs:63–72  ·  view source on GitHub ↗
(source: &str)

Source from the content-addressed store, hash-verified

61 }
62
63 pub fn parse(source: &str) -> Result<Self, JsonError> {
64 let mut parser = Parser::new(source);
65 let value = parser.parse_value()?;
66 parser.skip_whitespace();
67 if parser.is_eof() {
68 Ok(value)
69 } else {
70 Err(JsonError::new("unexpected trailing content"))
71 }
72 }
73
74 #[must_use]
75 pub fn as_object(&self) -> Option<&BTreeMap<String, JsonValue>> {

Callers

nothing calls this directly

Calls 3

parse_valueMethod · 0.80
skip_whitespaceMethod · 0.80
is_eofMethod · 0.80

Tested by

no test coverage detected