uir_core/operations/
mod.rs

1use std::fmt::{Debug, Formatter};
2use crate::DialectName;
3
4
5/// A combination of an [`Operation`]'s name and its dialect.
6#[derive(Debug, Clone, Hash, PartialEq, Eq)]
7pub struct Oid {
8    /// Operation dependent dialects
9    pub dialect: DialectName,
10    /// Operation name
11    pub name: OperationName,
12}
13
14
15#[derive(Clone, Hash, PartialEq, Eq)]
16/// An [`Operation`]'s name (not including it's dialect).
17pub struct OperationName {
18    name: Box<str>
19}
20
21impl OperationName {
22    /// Create a new OperationName.
23    pub fn new(name: &str) -> OperationName {
24        OperationName {
25            name: Box::from(name),
26        }
27    }
28}
29
30impl AsRef<str> for OperationName {
31    fn as_ref(&self) -> &str {
32        self.name.as_ref()
33    }
34}
35
36impl Debug for OperationName {
37    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
38        todo!()
39    }
40}