BinFormat.FieldType.Util
Implementations of the AST generator functions for builtin types with the BinFormat.FieldType.BuiltIn struct replaced by the relevant variables.
These functions are useful for other types and are provided to reduce duplication.
Summary
Functions
Add an implementation of field to the packet structure
Builds a binary pattern for an Elixir built in binary type
Builds a struct definition for a simple field
Builds a struct pattern for a simple field
Functions
Add an implementation of field to the packet structure
Adds an field to the end of the current packet structure. The field should be an implementation of the BinFormat.Field protocol.
Builds a binary pattern for an Elixir built in binary type.
Returns the equivalent of << … full_name :: type-option1-option2-size(s), … >> where option1 and option2 are members of the list options and s is the value of size.
This can be used for both building and matching patterns.
Builds a struct definition for a simple field.
Returns the equivalent of defstruct ... name: default, ...
in a struct definition.