crow/enum-util.crow (source)

not-in-enum record exception variant-member

Attempted to convert a symbol/string to an enum, but it's not a valid enum member.

show string(a not-in-enum)

enum-like[t] spec t equal

values[t] t array() t enum-like

to[t] symbol(a t) t enum-like

to[t] string(a t) t enum-like

to[t] json(a t) t enum-like

to[t] t?(a symbol) t enum-like

Converts a symbol to the enum value that was declared with that name.

Returns an empty option if a is not the name of an enum member.

to[t] t(a symbol) t enum-like

to[t] t?(a string) t enum-like

to[t] t(a string) t enum-like