View Source recon_rec (recon v2.5.6)

This module handles formatting records for known record types. Record definitions are imported from modules by user. Definitions are distinguished by record name and its arity, if you have multiple records of the same name and size, you have to choose one of them and some of your records may be wrongly labelled. You can manipulate your definition list by using import/1 and clear/1, and check which definitions are in use by executing list/0.

Link to this section Summary

Functions

remove all imported definitions, destroy the table, clean up
remove definitions imported from a module.
returns a list of active record definitions
import record definitions from a module. If a record definition of the same name and arity has already been imported from another module then the new definition is ignored (returned info tells you from which module the existing definition was imported). You have to choose one and possibly remove the old one using clear/1. Supports importing multiple modules at once (by giving a list of atoms as an argument).
quickly check if we want to do any record formatting
Limit output to selected fields of a record (can be 'none', 'all', a field or a list of fields). Limit set to 'none' means there is no limit, and all fields are displayed; limit 'all' means that all fields are squashed and only record name will be shown.
prints out all "known" (imported) record definitions and their limit settings. Printout tells module a record originates from, its name and a list of field names, plus the record's arity (may be handy if handling big records) and a list of field it limits its output to, if set.

Link to this section Types

-type field() :: atom().
-type import_result() ::
    {imported, module(), record_name(), arity()} |
    {overwritten, module(), record_name(), arity()} |
    {ignored, module(), record_name(), arity(), module()}.
-type limit() :: all | none | field() | [field()].
-type listentry() :: {module(), record_name(), [field()], limit()}.
-type record_name() :: atom().
compound

Link to this section Functions

remove all imported definitions, destroy the table, clean up
remove definitions imported from a module.
-spec get_list() -> [listentry()].
returns a list of active record definitions
-spec import(module() | [module()]) -> import_result() | [import_result()].
import record definitions from a module. If a record definition of the same name and arity has already been imported from another module then the new definition is ignored (returned info tells you from which module the existing definition was imported). You have to choose one and possibly remove the old one using clear/1. Supports importing multiple modules at once (by giving a list of atoms as an argument).
-spec is_active() -> boolean().
quickly check if we want to do any record formatting
Link to this function

limit(Name, Arity, Limit)

View Source
-spec limit(record_name(), arity(), limit()) -> ok | {error, any()}.
Limit output to selected fields of a record (can be 'none', 'all', a field or a list of fields). Limit set to 'none' means there is no limit, and all fields are displayed; limit 'all' means that all fields are squashed and only record name will be shown.
prints out all "known" (imported) record definitions and their limit settings. Printout tells module a record originates from, its name and a list of field names, plus the record's arity (may be handy if handling big records) and a list of field it limits its output to, if set.