Skip to main content

holds_enum

Function holds_enum 

Source
pub fn holds_enum(value: &Value) -> bool
Expand description

Whether a host Value is an enum, or carries one inside it.

An enum crosses the boundary outward only: a script hands one back, and no parameter accepts one on the way in. Asking the value rather than the declared type is what covers the positions a type check cannot refuse on its own: an any parameter, and an array or map whose element type was never pinned.