fromJSON

Extract an enumerated type from a json value.

Examples

Convert a json string into an enum value.

enum Category { one, two }
assert(JSONValue("one").fromJSON!Category == Category.one);

Meta