disposition_input_ir_model 0.2.0

`disposition` diagram generator input to IR mapping data types.
Documentation
use disposition_ir_model::IrDiagram;

use crate::issue::ModelToIrIssue;

/// An input diagram and any issues encountered during mapping from the input
/// model.
#[cfg_attr(
    all(feature = "schemars", not(feature = "test")),
    derive(schemars::JsonSchema)
)]
#[derive(Clone, Debug)]
pub struct IrDiagramAndIssues<'id> {
    /// The mapped intermediate representation diagram.
    pub diagram: IrDiagram<'id>,
    /// Issues encountered during mapping.
    pub issues: Vec<ModelToIrIssue>,
}

impl<'id> IrDiagramAndIssues<'id> {
    /// Returns a reference to the intermediate representation diagram.
    pub fn diagram(&self) -> &IrDiagram<'id> {
        &self.diagram
    }

    /// Returns a reference to the issues encountered during mapping.
    pub fn issues(&self) -> &[ModelToIrIssue] {
        &self.issues
    }

    /// Converts this `IrDiagramAndIssues` into one with a `'static` lifetime.
    ///
    /// If any inner `Cow` is borrowed, this will clone the string to create
    /// an owned version.
    pub fn into_static(self) -> IrDiagramAndIssues<'static> {
        IrDiagramAndIssues {
            diagram: self.diagram.into_static(),
            issues: self.issues,
        }
    }
}