use serde::{Deserialize, Serialize};
use std::fmt;
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ManufacturingOperator {
op_breed_ontology,
op_project_artifact,
op_rust_benchmark,
op_rust_compile,
op_rust_test,
op_seed_ontology,
op_validate_ontology,
}
impl ManufacturingOperator {
pub fn id(&self) -> &'static str {
match self {
Self::op_breed_ontology => "op-breed-ontology",
Self::op_project_artifact => "op-project-artifact",
Self::op_rust_benchmark => "op-rust-benchmark",
Self::op_rust_compile => "op-rust-compile",
Self::op_rust_test => "op-rust-test",
Self::op_seed_ontology => "op-seed-ontology",
Self::op_validate_ontology => "op-validate-ontology",
}
}
pub fn label(&self) -> &'static str {
match self {
Self::op_breed_ontology => "Breed Ontology",
Self::op_project_artifact => "Project Artifact",
Self::op_rust_benchmark => "Rust Benchmark",
Self::op_rust_compile => "Rust Compile",
Self::op_rust_test => "Rust Test",
Self::op_seed_ontology => "Seed Ontology",
Self::op_validate_ontology => "Validate Ontology",
}
}
pub fn pipeline_order() -> &'static [Self] {
&[
Self::op_breed_ontology,
Self::op_project_artifact,
Self::op_rust_benchmark,
Self::op_rust_compile,
Self::op_rust_test,
Self::op_seed_ontology,
Self::op_validate_ontology,
]
}
}
impl fmt::Display for ManufacturingOperator {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.label())
}
}