DescriptionThis module handles formatting maps. It allows for trimming output to selected fields, or to nothing at all. It also adds a label to a printout. To set up a limit for a map, you need to give recon a way to tell the map you want to trim from all the other maps, so you have to provide something like a 'type definition'. It can be either another map which is compared to the arg, or a fun.
limit() = all | none | atom() | binary() | [any()]
map_label() = atom()
pattern() = map() | function()
|clear/0||remove all imported definitions, destroy the table, clean up.|
|is_active/0||quickly check if we want to do any record formatting.|
|limit/3||Limit output to selected keys of a map (can be 'none', 'all', a key or a list of keys).|
|list/0||prints out all "known" map definitions and their limit settings.|
|remove/1||remove a given map entry.|
|rename/2||rename a given map entry, which allows to to change priorities for matching.|
clear() -> any()
remove all imported definitions, destroy the table, clean up
is_active() -> boolean()
quickly check if we want to do any record formatting
Limit output to selected keys of a map (can be 'none', 'all', a key or a list of keys). Pattern selects maps to process: a "pattern" is just a map, and if all key/value pairs of a pattern are present in a map (in other words, the pattern is a subset), then we say the map matches and we process it accordingly (apply the limit).
Patterns are applied in alphabetical order, until a match is found.Instead of a pattern you can also provide a function which will take a map and return a boolean.
list() -> any()
prints out all "known" map definitions and their limit settings. Printout tells a map's name, the matching fields required, and the limit options.
remove(Label::map_label()) -> true
remove a given map entry
rename a given map entry, which allows to to change priorities for matching. The first argument is the current name, and the second argument is the new name.