Skip to main content

shape_value

Function shape_value 

Source
pub fn shape_value(symbol: Symbol, shape: Arc<dyn Shape>) -> Value
Expand description

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.

§Examples

let value = shape_value(Symbol::new("any"), Arc::new(AnyShape));
assert!(value.object().as_shape().is_some());