#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum Operation {
Add,
Subtract,
Multiply,
Divide,
Modulo,
DivInt,
Negate,
Equals,
NotEquals,
GreaterThan,
GreaterEqual,
LessThan,
LessEqual,
Like,
And,
Or,
Not,
Sum,
Avg,
Count,
Min,
Max,
First,
Last,
Median,
Deviation,
Stddev,
PearsonCorr,
Row,
Xbar,
Ceil,
Floor,
Round,
Rand,
In,
Distinct,
Reverse,
Group,
Take,
Top,
Bot,
Remove,
Filter,
Find,
Within,
Sect,
Except,
Union,
Raze,
Select,
Update,
Insert,
Upsert,
Where,
InnerJoin,
LeftJoin,
AsofJoin,
WindowJoin,
WindowJoin1,
Asc,
Desc,
Xasc,
Xdesc,
Iasc,
Idesc,
Rank,
Xrank,
At,
Key,
Value,
Get,
Map,
MapLeft,
MapRight,
Pmap,
Fold,
Scan,
Apply,
Til,
Enlist,
List,
Type,
As,
Guid,
NilQ,
Date,
Time,
Timestamp,
Ser,
De,
Parse,
Eval,
Quote,
Load,
Do,
If,
Try,
Return,
Raise,
Set,
Let,
Env,
Dict,
Table,
Concat,
Meta,
Rc,
}
impl Operation {
pub fn as_str(self) -> &'static str {
use Operation::*;
match self {
Add => "+",
Subtract => "-",
Multiply => "*",
Divide => "/",
Modulo => "%",
DivInt => "div",
Negate => "neg",
Equals => "==",
NotEquals => "!=",
GreaterThan => ">",
GreaterEqual => ">=",
LessThan => "<",
LessEqual => "<=",
Like => "like",
And => "and",
Or => "or",
Not => "not",
Sum => "sum",
Avg => "avg",
Count => "count",
Min => "min",
Max => "max",
First => "first",
Last => "last",
Median => "med",
Deviation => "dev",
Stddev => "stddev",
PearsonCorr => "pearson_corr",
Row => "row",
Xbar => "xbar",
Ceil => "ceil",
Floor => "floor",
Round => "round",
Rand => "rand",
In => "in",
Distinct => "distinct",
Reverse => "reverse",
Group => "group",
Take => "take",
Top => "top",
Bot => "bot",
Remove => "remove",
Filter => "filter",
Find => "find",
Within => "within",
Sect => "sect",
Except => "except",
Union => "union",
Raze => "raze",
Select => "select",
Update => "update",
Insert => "insert",
Upsert => "upsert",
Where => "where",
InnerJoin => "inner-join",
LeftJoin => "left-join",
AsofJoin => "asof-join",
WindowJoin => "window-join",
WindowJoin1 => "window-join1",
Asc => "asc",
Desc => "desc",
Xasc => "xasc",
Xdesc => "xdesc",
Iasc => "iasc",
Idesc => "idesc",
Rank => "rank",
Xrank => "xrank",
At => "at",
Key => "key",
Value => "value",
Get => "get",
Map => "map",
MapLeft => "map-left",
MapRight => "map-right",
Pmap => "pmap",
Fold => "fold",
Scan => "scan",
Apply => "apply",
Til => "til",
Enlist => "enlist",
List => "list",
Type => "type",
As => "as",
Guid => "guid",
NilQ => "nil?",
Date => "date",
Time => "time",
Timestamp => "timestamp",
Ser => "ser",
De => "de",
Parse => "parse",
Eval => "eval",
Quote => "quote",
Load => "load",
Do => "do",
If => "if",
Try => "try",
Return => "return",
Raise => "raise",
Set => "set",
Let => "let",
Env => "env",
Dict => "dict",
Table => "table",
Concat => "concat",
Meta => "meta",
Rc => "rc",
}
}
}
impl std::fmt::Display for Operation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}