Skip to main content

constructor_parts_with_renames

Function constructor_parts_with_renames 

Source
pub fn constructor_parts_with_renames(
    fields: &[FieldDef],
    type_mapper: &dyn Fn(&TypeRef) -> String,
    field_renames: Option<&HashMap<String, String>>,
) -> (String, String, String)
Expand description

Like constructor_parts but with optional field renames for keyword escaping. field_renames maps original field name → binding field name (e.g. “class” → “class_”). Parameters keep the original name (valid in Rust), struct literal uses the renamed field.