Skip to main content

enum_tag

Function enum_tag 

Source
pub unsafe fn enum_tag(value: *const c_void, metadata: *const c_void) -> u32
Expand description

Which case a multi-payload enum holds.

The inverse of inject_enum_tag, reading the getEnumTag witness rather than the destructiveInjectEnumTag one. Distinct from read_optional_tag, which is for the single-payload case and takes the payload’s witness rather than the enum’s.

§Safety

value must address an initialised value of metadata’s type, and that type must be an enum.