teo_parser/ast/arity.rs
1#[derive(Debug, PartialEq, Copy, Clone)]
2pub enum Arity {
3 Scalar,
4 Array,
5 Dictionary,
6}
7
8impl Arity {
9
10 pub fn is_scalar(&self) -> bool {
11 use Arity::*;
12 match self {
13 Scalar => true,
14 _ => false,
15 }
16 }
17
18 pub fn is_array(&self) -> bool {
19 use Arity::*;
20 match self {
21 Array => true,
22 _ => false,
23 }
24 }
25
26 pub fn is_dictionary(&self) -> bool {
27 use Arity::*;
28 match self {
29 Dictionary => true,
30 _ => false,
31 }
32 }
33}