Skip to main content

parse_blob

Function parse_blob 

Source
fn parse_blob(map: &Map<String, Value>, path: &str) -> Result<Value, DataError>
Expand description

Parses {"$type": "blob", "ref": ..., "mimeType": ..., "size": ...}.

A blob is a plain map once it is checked — there is no Value::Blob, because a blob encodes exactly as the map it looks like. What this refuses is a malformed one, and the reason to refuse it here rather than during lexicon validation is that a blob reference is the protocol’s own shape: every lexicon that declares a blob means this one, and a stored blob whose size is the string "10000" is unusable to every reader regardless of which lexicon declared it.