hyperion/
operator.rs

1use std::fmt;
2
3/// Mathamatical operator that can be used on parameters.
4#[derive(Debug, PartialEq, PartialOrd, Clone)]
5pub enum Operator {
6    Add,
7    Sub,
8    Mul,
9    Div,
10    Exponent
11}
12
13impl fmt::Display for Operator {
14    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15        match self {
16            Operator::Add => write!(f, "+"),
17            Operator::Sub => write!(f, "-"),
18            Operator::Mul => write!(f, "*"),
19            Operator::Div => write!(f, "/"),
20            Operator::Exponent => write!(f, "^")
21        }
22    }
23}