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

Method parse

atomic-canonical/src/review_decision.rs:601–609  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

599 }
600
601 pub fn parse(bytes: &[u8]) -> Result<Self, String> {
602 if bytes.len() > MAX_BYTES {
603 return Err("Review decision exceeds the explicit 256 MiB artifact byte budget; no findings were truncated".into());
604 }
605 let value = crate::jcs::admit_document(bytes).map_err(|error| error.to_string())?;
606 let decision: Self = serde_json::from_value(value).map_err(|error| error.to_string())?;
607 decision.validate()?;
608 Ok(decision)
609 }
610}
611
612#[cfg(test)]

Callers

nothing calls this directly

Calls 3

admit_documentFunction · 0.85
lenMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected