openehr-lang 0.0.2

openEHR LANG 1.0.0: BMM/P_BMM object model (generated from BMM) plus a hand-written ODIN instance parser (the `odin` module — deliberately off the codegen path).
Documentation
// @generated by openehr-codegen from BMM (`BMM_PACKAGE_CONTAINER`) — DO NOT EDIT.

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

use crate::bmm::core::bmm_model::BmmModel;
use crate::bmm::core::bmm_package::BmmPackage;

/// Abstraction of a BMM model component that contains packages and classes.
#[doc(alias = "BMM_PACKAGE_CONTAINER")]
#[derive(Debug, Clone, PartialEq)]
pub struct BmmPackageContainerData {
    // inherited: BMM_MODEL_ELEMENT
    /// Optional documentation of this element.
    pub documentation: Option<String>,
    /// Child packages; keys all in upper case for guaranteed matching.
    pub packages: Option<std::collections::BTreeMap<String, BmmPackage>>,
}

/// Polymorphic slot of `BMM_PACKAGE_CONTAINER`, dispatched on each payload's `_type`.
///
/// Abstraction of a BMM model component that contains packages and classes.
#[doc(alias = "BMM_PACKAGE_CONTAINER")]
#[derive(Debug, Clone, PartialEq)]
pub enum BmmPackageContainer {
    /// The `BMM_MODEL` subtype of `BMM_PACKAGE_CONTAINER`.
    BmmModel(BmmModel),
    /// The `BMM_PACKAGE` subtype of `BMM_PACKAGE_CONTAINER`.
    BmmPackage(BmmPackage),
    /// An instance of `BMM_PACKAGE_CONTAINER` itself (its own, least-rich form).
    BmmPackageContainer(BmmPackageContainerData),
}