Skip to main content

deep_normalize

Function deep_normalize 

Source
pub fn deep_normalize(v: &PerlValue) -> PerlValue
Expand description

Recursively convert any ClassInstance / StructInstance / EnumInstance reachable inside v into plain hashrefs (using the field name as the key). Hashrefs and arrayrefs are walked in place; every other value (numbers, strings, undef, code refs, blessed non-hash refs, …) round-trips unchanged.

The intent is “make this value JSON-serializable end-to-end” — call it once at the top of every serializer that doesn’t already know about stryke-native OO instances.