macro_rules! define_derived_property {
(
$derived_property:ident,
$value:ty,
[$($dependency:ident),*],
[$($global_dependency:ident),*],
|$($param:ident),+| $derive_fn:expr
) => { ... };
(
$derived_property:ident,
$value:ty,
[$($dependency:ident),*],
|$($param:ident),+| $derive_fn:expr
) => { ... };
}Expand description
Defines a derived person property with the following parameters:
$person_property: A name for the identifier type of the property$value: The type of the property’s value[$($dependency),+]: A list of person properties the derived property depends on[$($dependency),*]: A list of global properties the derived property depends on (optional)- $calculate: A closure that takes the values of each dependency and returns the derived value