macro_rules! define_global_property {
($global_property:ident, $value:ty, $validate: expr) => { ... };
($global_property: ident, $value: ty) => { ... };
}Expand description
Defines a global property with the following parameters:
$global_property: Name for the identifier type of the global property$value: The type of the property’s value$validate: A function (or closure) that checks the validity of the property and returnsResult<(), Box<dyn std::error::Error + 'static>>(optional)
Validator code is client code, so it should create and box its own error values.
Ixa wraps any returned error in
IxaError::IllegalGlobalPropertyValue
when the property is set or loaded.