openehr-lang 0.0.128

openEHR LANG BMM/P_BMM object model, generated from BMM: generations v1_0 (LANG 1.0.0) and v1_1 (LANG 1.1.0, current; the stable BMM v2.x unit beside the paused BMM3 unit), plus hand-written ODIN/BEL/EL readers
Documentation
// @generated by openehr-codegen from BMM (`BMM_PROPERTY`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Cadasto B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0
// Hand-written spec functions/invariants live in the sibling `*_impl.rs`.

//! The openEHR `BMM_PROPERTY` spec class, generated from the vendored BMM
//! meta-model.

use crate::v1_1::bmm::core::bmm_container_property::BmmContainerProperty;

/// Model of a property definition within a class definition of an object model. Generic parameter takes care of variants.
#[doc(alias = "BMM_PROPERTY")]
#[derive(Debug, Clone, PartialEq)]
pub struct BmmPropertyData<T> {
    // inherited: BMM_MODEL_ELEMENT
    /// Optional documentation of this element.
    pub documentation: Option<String>,
    /// Name of this property in the model.
    pub name: String,
    /// True if this property is mandatory in its class.
    pub is_mandatory: Option<bool>,
    /// True if this property is computed rather than stored in objects of this class.
    pub is_computed: Option<bool>,
    /// Formal type of this property.
    pub r#type: T,
    /// True if this property is marked with info model `_im_runtime_` property.
    pub is_im_runtime: Option<bool>,
    /// True if this property was marked with info model `_im_infrastructure_` flag.
    pub is_im_infrastructure: Option<bool>,
}

/// Polymorphic slot of `BMM_PROPERTY`, dispatched on each payload's `_type`.
///
/// Model of a property definition within a class definition of an object model. Generic parameter takes care of variants.
#[doc(alias = "BMM_PROPERTY")]
#[derive(Debug, Clone, PartialEq)]
pub enum BmmProperty<T> {
    /// The `BMM_CONTAINER_PROPERTY` subtype of `BMM_PROPERTY`.
    BmmContainerProperty(BmmContainerProperty),
    /// An instance of `BMM_PROPERTY` itself (its own, least-rich form).
    BmmProperty(BmmPropertyData<T>),
}