openehr-am 0.0.78

openEHR AM Archetype Model, generated from BMM: generations v1_4 (AM 1.4.0, ADL 1.4) and v2_4 (AM 2.4.0, ADL 2; current)
Documentation
// @generated by openehr-codegen from BMM (`EXPR_CONSTRAINT`) — DO NOT EDIT.
// SPDX-FileCopyrightText: Vernum Projecten B.V.
// SPDX-FileCopyrightText: openEHR Foundation
// SPDX-License-Identifier: Apache-2.0

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

use crate::v2_4::aom2::constraint_model::c_primitive_object::CPrimitiveObject;
use crate::v2_4::aom2::rules::expr_archetype_id_constraint::ExprArchetypeIdConstraint;

/// Expression tree leaf item representing a constraint on a primitive type, expressed in the form of a concrete subtype of C_PRIMITIVE_OBJECT.
#[doc(alias = "EXPR_CONSTRAINT")]
#[derive(Debug, Clone, PartialEq)]
pub struct ExprConstraintData {
    /// The constraint.
    pub item: CPrimitiveObject,
}

/// Polymorphic slot of `EXPR_CONSTRAINT`, dispatched on each payload's `_type`.
///
/// Expression tree leaf item representing a constraint on a primitive type, expressed in the form of a concrete subtype of C_PRIMITIVE_OBJECT.
#[doc(alias = "EXPR_CONSTRAINT")]
#[derive(Debug, Clone, PartialEq)]
pub enum ExprConstraint {
    /// The `EXPR_ARCHETYPE_ID_CONSTRAINT` subtype of `EXPR_CONSTRAINT`.
    ExprArchetypeIdConstraint(ExprArchetypeIdConstraint),
    /// An instance of `EXPR_CONSTRAINT` itself (its own, least-rich form).
    ExprConstraint(ExprConstraintData),
}