Skip to main content

get_field_idx_by_name

Function get_field_idx_by_name 

Source
pub fn get_field_idx_by_name(ty: Ty<'_>, name: Symbol) -> Option<usize>
Expand description

Attempts to find the field’s index by name, for unions, structs and tuples. Note: for tuples, name is just parsed as an index.