Attribute Macro native_model::native_model
source · #[native_model]Expand description
Macro to generate a native_model implementation for a struct.
Macro which add identity and version to your rust type.
Attributes:
id = u32: The unique identifier of the model.version = u32: The version of the model.from = type: Optional, the previous version of the model.type: The previous version of the model that you use for the From implementation.
try_from = (type, error): Optional, the previous version of the model with error handling.type: The previous version of the model that you use for the TryFrom implementation.error: The error type that you use for the TryFrom implementation.
See examples:
- Setup your data model.
- other examples