Module utils

Source

Structsยง

FieldInfo ๐Ÿ”’
IdentListAttribute ๐Ÿ”’
ReprInfo
ZeroVecAttrs

Functionsยง

extract_attributes_common
Removes all known zerovec:: attributes from struct attrs and validates them
extract_field_attributes
Extract attributes from field, and return them
extract_parenthetical_zerovec_attrs
Extracts all zerovec::name(..) attribute
extract_zerovec_attributes
Removes all attributes with zerovec in the name and places them in a separate vector
generate_per_field_offsets ๐Ÿ”’
Given an iterator over ULE or AsULE struct fields, returns code that calculates field sizes and generates a line of code per field based on the per_field_code function (whose parameters are the field, the identifier of the const for the previous offset, the identifier for the const for the next offset, and the field index)
repr_for
Returns the repr attribute to be applied to the resultant ULE or VarULE type
semi_for
Return a semicolon token if necessary after the struct definition
suffixed_ident ๐Ÿ”’
wrap_field_inits
Given a set of entries for struct field definitions to go inside a struct {} definition, wrap in a () or {} based on the type of field