wasm4pm 26.6.13

High-performance process mining algorithms in WebAssembly for JavaScript/TypeScript
Documentation
// Auto-generated by CodeManufactory from wasm4pm ontology
// DO NOT EDIT — regenerate via: ostar manufacture wasm4pm

use serde::{Deserialize, Serialize};
use std::fmt;

/// Module categories from wasm4pm-core.nt.
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ModuleCategory {
    AutonomicModule,
    ConformanceModule,
    CoreModule,
    DiscoveryModule,
    OCELModule,
    POWLModule,
    PredictionModule,
    StreamingModule,
}

impl ModuleCategory {
    pub fn id(&self) -> &'static str {
        match self {
            Self::AutonomicModule => "AutonomicModule",
            Self::ConformanceModule => "ConformanceModule",
            Self::CoreModule => "CoreModule",
            Self::DiscoveryModule => "DiscoveryModule",
            Self::OCELModule => "OCELModule",
            Self::POWLModule => "POWLModule",
            Self::PredictionModule => "PredictionModule",
            Self::StreamingModule => "StreamingModule",
        }
    }

    pub fn label(&self) -> &'static str {
        match self {
            Self::AutonomicModule => "Autonomic",
            Self::ConformanceModule => "Conformance",
            Self::CoreModule => "Core",
            Self::DiscoveryModule => "Discovery",
            Self::OCELModule => "OCEL",
            Self::POWLModule => "POWL",
            Self::PredictionModule => "Prediction",
            Self::StreamingModule => "Streaming",
        }
    }

    pub fn all() -> &'static [Self] {
        &[
            Self::AutonomicModule,
            Self::ConformanceModule,
            Self::CoreModule,
            Self::DiscoveryModule,
            Self::OCELModule,
            Self::POWLModule,
            Self::PredictionModule,
            Self::StreamingModule,
        ]
    }
}

impl fmt::Display for ModuleCategory {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.label())
    }
}