Function mun_memory::mapping::field_mapping[][src]

pub unsafe fn field_mapping<T: Clone + TypeDesc + TypeFields<T> + TypeMemory>(
    old_ty: T,
    new_ty: T,
    diff: &[FieldDiff]
) -> Conversion<T>

Given a set of old_fields of type T and their corresponding diff, calculates the mapping new_index -> Option<FieldMappingDesc> for each new field.

The indices of the returned Vec’s elements should be used as indices for the new fields.

Safety

Expects the diff to be based on old_ty and new_ty. If not, it causes undefined behavior.