Skip to main content

decode_shape

Function decode_shape 

Source
pub fn decode_shape(blob: &[u8]) -> Result<ShapeExpr, ShapeExprError>
Expand description

Decode one whole-shape ShapeExpr blob, rejecting a malformed one with a typed decline (§6.20-0006). Reads SameAs (core) plus the registered experimental extension constructors WithDim/Dims (§6.20-0009/-0010); the still-reserved Reduce (0x09) and the DimExpr-only tags decline typed. A well-formed blob round-trips: decode_shape(&s.encode()) == Ok(s). Distinct from decode_dim, which reads the single-dimension grammar (a Dim is never a whole shape, so a whole-shape tag declines there, and vice-versa).