Skip to main content

Module shapes

Module shapes 

Source
Expand description

Shape authoring helpers: documented and value-backed shape wrappers plus shape registration and checking utilities.

Structs§

DocumentedShape
Shape wrapper that overrides only the documentation of an inner shape, delegating all matching and binding behavior unchanged.

Constants§

CORE_SHAPE_CLASS
Name of the core class under which shapes are registered.

Functions§

check_shape_expr
Checks an expression against the shape behind a shape reference.
check_shape_value
Checks a value against the shape behind a shape reference.
shape_id
Registers shape under symbol and returns its assigned shape id.
shape_ref_arc
Wraps a shape reference in a reusable Arc<dyn Shape> handle.
shape_ref_as_shape
Borrows the shape behind a shape reference, or errors if it is not a shape.
shape_ref_id
Returns the shape id behind a shape reference, or ShapeId(0) if none.
shape_value
Wrap a shape as a kernel value: an opaque ShapeObject that carries the given symbol as the shape’s name and exposes it as a callable matcher.
shape_value_with_encoding
Like shape_value but also records the constructor encoding so the resulting value can be re-encoded back to its constructor expression.
value_as_shape
Borrows the shape backing a value, or errors if it is not a shape.