Mapper::MapperRuntimeKeyInfo Struct Reference

Describes a runtime mapper field key. More...

## Public Attributes

*hash< string, bool > | conflicting_keys
| Hash of conflicting keys, if any.
string | desc
| A description of the key.
*code | handler
| The code to handle the key at runtime. More...
bool | requires_field_type = False
| If the type of the value for the key must be the same as the field type.
*softlist< string > | requires_roles
| If the key can only be used if one or more other keys supplying the given roles are also present.
*string | returns_type
| If the key provides a value that returns a specific type.
*softlist< string > | unique_roles
| If the key provides some unique functionality. More...
string | value_type = "string"
| The type of value that must be assigned to this key.

## Detailed Description

Describes a runtime mapper field key.

## Member Data Documentation

## handler

*code Mapper::MapperRuntimeKeyInfo::handler

The code to handle the key at runtime.

the signature of this closure or call reference depends on requires_roles:

- requires_roles contains value: `auto sub (auto arg, auto val, hash<auto> ctx, *reference<bool> missing_input) {}`
  - parameters:
    - `arg:` the argument to the runtime key in the mapping
    - `val:` the current value of the mapping, if any
    - `ctx:` mapper context info; will contain at least the following fields:
      - `output-key`: (string) provides the name of the output field currently being mapped
      - `input:` (hash) the current input record
    - `missing_input:` an output variable; set to True if the handler could not resolve the value because input was missing
- requires_roles does not contain value: `auto sub (auto arg, hash<auto> ctx, *reference<bool> missing_input) {}`
  - parameters:
    - `arg:` the argument to the runtime key in the mapping
    - `ctx:` mapper context info; will contain at least the following fields:
      - `output-key`: (string) provides the name of the output field currently being mapped
      - `input:` (hash) the current input record
    - `missing_input:` an output variable; set to True if the handler could not resolve the value because input was missing

In both cases the return value is the value to use for the field

## unique_roles

*softlist<string> Mapper::MapperRuntimeKeyInfo::unique_roles

If the key provides some unique functionality.

only one key providing the given functionality can be included in an output field; this is a list so that keys can provide more than one unique function